Class PlatformCache
- java.lang.Object
-
- org.apache.ignite.internal.processors.platform.PlatformAbstractTarget
-
- org.apache.ignite.internal.processors.platform.cache.PlatformCache
-
- All Implemented Interfaces:
PlatformTarget
public class PlatformCache extends PlatformAbstractTarget
Native cache wrapper implementation.
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.platform.PlatformAbstractTarget
ERROR, FALSE, log, platformCtx, TRUE
-
-
Constructor Summary
Constructors Constructor Description PlatformCache(PlatformContext platformCtx, IgniteCache cache, boolean keepBinary)Constructor.PlatformCache(PlatformContext platformCtx, IgniteCache cache, boolean keepBinary, PlatformCacheExtension[] exts)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExceptionconvertException(Exception e)Convert caught exception.longprocessInLongOutLong(int type, long val)Process IN operation.longprocessInStreamOutLong(int type, BinaryRawReaderEx reader, PlatformMemory mem)Process IN operation.PlatformTargetprocessInStreamOutObject(int type, BinaryRawReaderEx reader)Process IN-OUT operation.PlatformTargetprocessOutObject(int type)Process OUT operation.voidprocessOutStream(int type, BinaryRawWriterEx writer)Process OUT operation.IgniteCacherawCache()static @Nullable Object[]readQueryArgs(BinaryRawReaderEx reader)Read arguments for SQL query.static voidwriteCacheMetrics(BinaryRawWriter writer, CacheMetrics metrics)Writes cache metrics.static voidwriteQueryMetrics(BinaryRawWriter writer, QueryMetrics metrics)Writes query metrics.longwriteResult(PlatformMemory mem, Object obj)Writes the result to reused stream, if any.longwriteResult(PlatformMemory mem, Object obj, PlatformWriterClosure clo)Writes the result to reused stream, if any.-
Methods inherited from class org.apache.ignite.internal.processors.platform.PlatformAbstractTarget
platformContext, processInObjectStreamOutObjectStream, processInStreamAsync, processInStreamOutLong, processInStreamOutStream, readAndListenFuture, readAndListenFuture, readAndListenFuture, throwUnsupported, wrapListenable
-
-
-
-
Field Detail
-
OP_CLEAR
public static final int OP_CLEAR
- See Also:
- Constant Field Values
-
OP_CLEAR_ALL
public static final int OP_CLEAR_ALL
- See Also:
- Constant Field Values
-
OP_CONTAINS_KEY
public static final int OP_CONTAINS_KEY
- See Also:
- Constant Field Values
-
OP_CONTAINS_KEYS
public static final int OP_CONTAINS_KEYS
- See Also:
- Constant Field Values
-
OP_GET
public static final int OP_GET
- See Also:
- Constant Field Values
-
OP_GET_ALL
public static final int OP_GET_ALL
- See Also:
- Constant Field Values
-
OP_GET_AND_PUT
public static final int OP_GET_AND_PUT
- See Also:
- Constant Field Values
-
OP_GET_AND_PUT_IF_ABSENT
public static final int OP_GET_AND_PUT_IF_ABSENT
- See Also:
- Constant Field Values
-
OP_GET_AND_REMOVE
public static final int OP_GET_AND_REMOVE
- See Also:
- Constant Field Values
-
OP_GET_AND_REPLACE
public static final int OP_GET_AND_REPLACE
- See Also:
- Constant Field Values
-
OP_GET_NAME
public static final int OP_GET_NAME
- See Also:
- Constant Field Values
-
OP_INVOKE
public static final int OP_INVOKE
- See Also:
- Constant Field Values
-
OP_INVOKE_ALL
public static final int OP_INVOKE_ALL
- See Also:
- Constant Field Values
-
OP_IS_LOCAL_LOCKED
public static final int OP_IS_LOCAL_LOCKED
- See Also:
- Constant Field Values
-
OP_LOAD_CACHE
public static final int OP_LOAD_CACHE
- See Also:
- Constant Field Values
-
OP_LOC_EVICT
public static final int OP_LOC_EVICT
- See Also:
- Constant Field Values
-
OP_LOC_LOAD_CACHE
public static final int OP_LOC_LOAD_CACHE
- See Also:
- Constant Field Values
-
OP_LOCAL_CLEAR
public static final int OP_LOCAL_CLEAR
- See Also:
- Constant Field Values
-
OP_LOCAL_CLEAR_ALL
public static final int OP_LOCAL_CLEAR_ALL
- See Also:
- Constant Field Values
-
OP_LOCK
public static final int OP_LOCK
- See Also:
- Constant Field Values
-
OP_LOCK_ALL
public static final int OP_LOCK_ALL
- See Also:
- Constant Field Values
-
OP_LOCAL_METRICS
public static final int OP_LOCAL_METRICS
- See Also:
- Constant Field Values
-
OP_PUT_IF_ABSENT
public static final int OP_PUT_IF_ABSENT
- See Also:
- Constant Field Values
-
OP_QRY_CONTINUOUS
public static final int OP_QRY_CONTINUOUS
- See Also:
- Constant Field Values
-
OP_QRY_SCAN
public static final int OP_QRY_SCAN
- See Also:
- Constant Field Values
-
OP_QRY_SQL
public static final int OP_QRY_SQL
- See Also:
- Constant Field Values
-
OP_QRY_SQL_FIELDS
public static final int OP_QRY_SQL_FIELDS
- See Also:
- Constant Field Values
-
OP_QRY_TXT
public static final int OP_QRY_TXT
- See Also:
- Constant Field Values
-
OP_REMOVE_ALL
public static final int OP_REMOVE_ALL
- See Also:
- Constant Field Values
-
OP_REMOVE_BOOL
public static final int OP_REMOVE_BOOL
- See Also:
- Constant Field Values
-
OP_REMOVE_OBJ
public static final int OP_REMOVE_OBJ
- See Also:
- Constant Field Values
-
OP_REPLACE_2
public static final int OP_REPLACE_2
- See Also:
- Constant Field Values
-
OP_REPLACE_3
public static final int OP_REPLACE_3
- See Also:
- Constant Field Values
-
OP_GET_CONFIG
public static final int OP_GET_CONFIG
- See Also:
- Constant Field Values
-
OP_LOAD_ALL
public static final int OP_LOAD_ALL
- See Also:
- Constant Field Values
-
OP_CLEAR_CACHE
public static final int OP_CLEAR_CACHE
- See Also:
- Constant Field Values
-
OP_WITH_PARTITION_RECOVER
public static final int OP_WITH_PARTITION_RECOVER
- See Also:
- Constant Field Values
-
OP_REMOVE_ALL2
public static final int OP_REMOVE_ALL2
- See Also:
- Constant Field Values
-
OP_WITH_KEEP_BINARY
public static final int OP_WITH_KEEP_BINARY
- See Also:
- Constant Field Values
-
OP_WITH_EXPIRY_POLICY
public static final int OP_WITH_EXPIRY_POLICY
- See Also:
- Constant Field Values
-
OP_WITH_NO_RETRIES
public static final int OP_WITH_NO_RETRIES
- See Also:
- Constant Field Values
-
OP_WITH_SKIP_STORE
public static final int OP_WITH_SKIP_STORE
- See Also:
- Constant Field Values
-
OP_SIZE
public static final int OP_SIZE
- See Also:
- Constant Field Values
-
OP_ITERATOR
public static final int OP_ITERATOR
- See Also:
- Constant Field Values
-
OP_LOC_ITERATOR
public static final int OP_LOC_ITERATOR
- See Also:
- Constant Field Values
-
OP_ENTER_LOCK
public static final int OP_ENTER_LOCK
- See Also:
- Constant Field Values
-
OP_EXIT_LOCK
public static final int OP_EXIT_LOCK
- See Also:
- Constant Field Values
-
OP_TRY_ENTER_LOCK
public static final int OP_TRY_ENTER_LOCK
- See Also:
- Constant Field Values
-
OP_CLOSE_LOCK
public static final int OP_CLOSE_LOCK
- See Also:
- Constant Field Values
-
OP_REBALANCE
public static final int OP_REBALANCE
- See Also:
- Constant Field Values
-
OP_SIZE_LOC
public static final int OP_SIZE_LOC
- See Also:
- Constant Field Values
-
OP_PUT_ASYNC
public static final int OP_PUT_ASYNC
- See Also:
- Constant Field Values
-
OP_CLEAR_CACHE_ASYNC
public static final int OP_CLEAR_CACHE_ASYNC
- See Also:
- Constant Field Values
-
OP_CLEAR_ALL_ASYNC
public static final int OP_CLEAR_ALL_ASYNC
- See Also:
- Constant Field Values
-
OP_REMOVE_ALL2_ASYNC
public static final int OP_REMOVE_ALL2_ASYNC
- See Also:
- Constant Field Values
-
OP_SIZE_ASYNC
public static final int OP_SIZE_ASYNC
- See Also:
- Constant Field Values
-
OP_CLEAR_ASYNC
public static final int OP_CLEAR_ASYNC
- See Also:
- Constant Field Values
-
OP_LOAD_CACHE_ASYNC
public static final int OP_LOAD_CACHE_ASYNC
- See Also:
- Constant Field Values
-
OP_LOC_LOAD_CACHE_ASYNC
public static final int OP_LOC_LOAD_CACHE_ASYNC
- See Also:
- Constant Field Values
-
OP_PUT_ALL_ASYNC
public static final int OP_PUT_ALL_ASYNC
- See Also:
- Constant Field Values
-
OP_REMOVE_ALL_ASYNC
public static final int OP_REMOVE_ALL_ASYNC
- See Also:
- Constant Field Values
-
OP_GET_ASYNC
public static final int OP_GET_ASYNC
- See Also:
- Constant Field Values
-
OP_CONTAINS_KEY_ASYNC
public static final int OP_CONTAINS_KEY_ASYNC
- See Also:
- Constant Field Values
-
OP_CONTAINS_KEYS_ASYNC
public static final int OP_CONTAINS_KEYS_ASYNC
- See Also:
- Constant Field Values
-
OP_REMOVE_BOOL_ASYNC
public static final int OP_REMOVE_BOOL_ASYNC
- See Also:
- Constant Field Values
-
OP_REMOVE_OBJ_ASYNC
public static final int OP_REMOVE_OBJ_ASYNC
- See Also:
- Constant Field Values
-
OP_GET_ALL_ASYNC
public static final int OP_GET_ALL_ASYNC
- See Also:
- Constant Field Values
-
OP_GET_AND_PUT_ASYNC
public static final int OP_GET_AND_PUT_ASYNC
- See Also:
- Constant Field Values
-
OP_GET_AND_PUT_IF_ABSENT_ASYNC
public static final int OP_GET_AND_PUT_IF_ABSENT_ASYNC
- See Also:
- Constant Field Values
-
OP_GET_AND_REMOVE_ASYNC
public static final int OP_GET_AND_REMOVE_ASYNC
- See Also:
- Constant Field Values
-
OP_GET_AND_REPLACE_ASYNC
public static final int OP_GET_AND_REPLACE_ASYNC
- See Also:
- Constant Field Values
-
OP_REPLACE_2_ASYNC
public static final int OP_REPLACE_2_ASYNC
- See Also:
- Constant Field Values
-
OP_REPLACE_3_ASYNC
public static final int OP_REPLACE_3_ASYNC
- See Also:
- Constant Field Values
-
OP_INVOKE_ASYNC
public static final int OP_INVOKE_ASYNC
- See Also:
- Constant Field Values
-
OP_INVOKE_ALL_ASYNC
public static final int OP_INVOKE_ALL_ASYNC
- See Also:
- Constant Field Values
-
OP_PUT_IF_ABSENT_ASYNC
public static final int OP_PUT_IF_ABSENT_ASYNC
- See Also:
- Constant Field Values
-
OP_EXTENSION
public static final int OP_EXTENSION
- See Also:
- Constant Field Values
-
OP_GLOBAL_METRICS
public static final int OP_GLOBAL_METRICS
- See Also:
- Constant Field Values
-
OP_GET_LOST_PARTITIONS
public static final int OP_GET_LOST_PARTITIONS
- See Also:
- Constant Field Values
-
OP_QUERY_METRICS
public static final int OP_QUERY_METRICS
- See Also:
- Constant Field Values
-
OP_RESET_QUERY_METRICS
public static final int OP_RESET_QUERY_METRICS
- See Also:
- Constant Field Values
-
OP_PRELOAD_PARTITION
public static final int OP_PRELOAD_PARTITION
- See Also:
- Constant Field Values
-
OP_PRELOAD_PARTITION_ASYNC
public static final int OP_PRELOAD_PARTITION_ASYNC
- See Also:
- Constant Field Values
-
OP_LOCAL_PRELOAD_PARTITION
public static final int OP_LOCAL_PRELOAD_PARTITION
- See Also:
- Constant Field Values
-
OP_SIZE_LONG
public static final int OP_SIZE_LONG
- See Also:
- Constant Field Values
-
OP_SIZE_LONG_ASYNC
public static final int OP_SIZE_LONG_ASYNC
- See Also:
- Constant Field Values
-
OP_SIZE_LONG_LOC
public static final int OP_SIZE_LONG_LOC
- See Also:
- Constant Field Values
-
OP_ENABLE_STATISTICS
public static final int OP_ENABLE_STATISTICS
- See Also:
- Constant Field Values
-
OP_CLEAR_STATISTICS
public static final int OP_CLEAR_STATISTICS
- See Also:
- Constant Field Values
-
OP_INVOKE_JAVA
public static final int OP_INVOKE_JAVA
- See Also:
- Constant Field Values
-
OP_PERSISTENCE_ENABLED
public static final int OP_PERSISTENCE_ENABLED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PlatformCache
public PlatformCache(PlatformContext platformCtx, IgniteCache cache, boolean keepBinary)
Constructor.- Parameters:
platformCtx- Context.cache- Underlying cache.keepBinary- Keep binary flag.
-
PlatformCache
public PlatformCache(PlatformContext platformCtx, IgniteCache cache, boolean keepBinary, PlatformCacheExtension[] exts)
Constructor.- Parameters:
platformCtx- Context.cache- Underlying cache.keepBinary- Keep binary flag.exts- Extensions.
-
-
Method Detail
-
rawCache
public IgniteCache rawCache()
- Returns:
- Raw cache.
-
processInStreamOutLong
public long processInStreamOutLong(int type, BinaryRawReaderEx reader, PlatformMemory mem) throws IgniteCheckedExceptionProcess IN operation.- Specified by:
processInStreamOutLongin interfacePlatformTarget- Overrides:
processInStreamOutLongin classPlatformAbstractTarget- Parameters:
type- Type.reader- Binary reader.- Returns:
- Result.
- Throws:
IgniteCheckedException- In case of exception.
-
writeResult
public long writeResult(PlatformMemory mem, Object obj)
Writes the result to reused stream, if any.
-
writeResult
public long writeResult(PlatformMemory mem, Object obj, PlatformWriterClosure clo)
Writes the result to reused stream, if any.
-
processInStreamOutObject
public PlatformTarget processInStreamOutObject(int type, BinaryRawReaderEx reader) throws IgniteCheckedException
Process IN-OUT operation.- Specified by:
processInStreamOutObjectin interfacePlatformTarget- Overrides:
processInStreamOutObjectin classPlatformAbstractTarget- Parameters:
type- Type.reader- Binary reader.- Throws:
IgniteCheckedException- In case of exception.
-
readQueryArgs
@Nullable public static @Nullable Object[] readQueryArgs(BinaryRawReaderEx reader)
Read arguments for SQL query.- Parameters:
reader- Reader.- Returns:
- Arguments.
-
processOutStream
public void processOutStream(int type, BinaryRawWriterEx writer) throws IgniteCheckedExceptionProcess OUT operation.- Specified by:
processOutStreamin interfacePlatformTarget- Overrides:
processOutStreamin classPlatformAbstractTarget- Parameters:
type- Type.writer- Binary writer.- Throws:
IgniteCheckedException- In case of exception.
-
processOutObject
public PlatformTarget processOutObject(int type) throws IgniteCheckedException
Process OUT operation.- Specified by:
processOutObjectin interfacePlatformTarget- Overrides:
processOutObjectin classPlatformAbstractTarget- Parameters:
type- Type.- Throws:
IgniteCheckedException- In case of exception.
-
processInLongOutLong
public long processInLongOutLong(int type, long val) throws IgniteCheckedExceptionProcess IN operation.- Specified by:
processInLongOutLongin interfacePlatformTarget- Overrides:
processInLongOutLongin classPlatformAbstractTarget- Parameters:
type- Type.val- Value.- Returns:
- Result.
- Throws:
IgniteCheckedException- In case of exception.
-
convertException
public Exception convertException(Exception e)
Convert caught exception.- Specified by:
convertExceptionin interfacePlatformTarget- Overrides:
convertExceptionin classPlatformAbstractTarget- Parameters:
e- Exception to convert.- Returns:
- Converted exception.
-
writeCacheMetrics
public static void writeCacheMetrics(BinaryRawWriter writer, CacheMetrics metrics)
Writes cache metrics.- Parameters:
writer- Writer.metrics- Metrics.
-
writeQueryMetrics
public static void writeQueryMetrics(BinaryRawWriter writer, QueryMetrics metrics)
Writes query metrics.- Parameters:
writer- Writer.metrics- Metrics.
-
-