org.apache.ignite.internal.processors.platform.cache

## 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
`static int` `OP_CLEAR`
`static int` `OP_CLEAR_ALL`
`static int` `OP_CLEAR_ALL_ASYNC`
`static int` `OP_CLEAR_ASYNC`
`static int` `OP_CLEAR_CACHE`
`static int` `OP_CLEAR_CACHE_ASYNC`
`static int` `OP_CLEAR_STATISTICS`
`static int` `OP_CLOSE_LOCK`
`static int` `OP_CONTAINS_KEY`
`static int` `OP_CONTAINS_KEY_ASYNC`
`static int` `OP_CONTAINS_KEYS`
`static int` `OP_CONTAINS_KEYS_ASYNC`
`static int` `OP_ENABLE_STATISTICS`
`static int` `OP_ENTER_LOCK`
`static int` `OP_EXIT_LOCK`
`static int` `OP_EXTENSION`
`static int` `OP_GET`
`static int` `OP_GET_ALL`
`static int` `OP_GET_ALL_ASYNC`
`static int` `OP_GET_AND_PUT`
`static int` `OP_GET_AND_PUT_ASYNC`
`static int` `OP_GET_AND_PUT_IF_ABSENT`
`static int` `OP_GET_AND_PUT_IF_ABSENT_ASYNC`
`static int` `OP_GET_AND_REMOVE`
`static int` `OP_GET_AND_REMOVE_ASYNC`
`static int` `OP_GET_AND_REPLACE`
`static int` `OP_GET_AND_REPLACE_ASYNC`
`static int` `OP_GET_ASYNC`
`static int` `OP_GET_CONFIG`
`static int` `OP_GET_LOST_PARTITIONS`
`static int` `OP_GET_NAME`
`static int` `OP_GLOBAL_METRICS`
`static int` `OP_INVOKE`
`static int` `OP_INVOKE_ALL`
`static int` `OP_INVOKE_ALL_ASYNC`
`static int` `OP_INVOKE_ASYNC`
`static int` `OP_IS_LOCAL_LOCKED`
`static int` `OP_ITERATOR`
`static int` `OP_LOAD_ALL`
`static int` `OP_LOAD_CACHE`
`static int` `OP_LOAD_CACHE_ASYNC`
`static int` `OP_LOC_EVICT`
`static int` `OP_LOC_ITERATOR`
`static int` `OP_LOC_LOAD_CACHE`
`static int` `OP_LOC_LOAD_CACHE_ASYNC`
`static int` `OP_LOCAL_CLEAR`
`static int` `OP_LOCAL_CLEAR_ALL`
`static int` `OP_LOCAL_METRICS`
`static int` `OP_LOCAL_PRELOAD_PARTITION`
`static int` `OP_LOCK`
`static int` `OP_LOCK_ALL`
`static int` `OP_PRELOAD_PARTITION`
`static int` `OP_PRELOAD_PARTITION_ASYNC`
`static int` `OP_PUT_ALL_ASYNC`
`static int` `OP_PUT_ASYNC`
`static int` `OP_PUT_IF_ABSENT`
`static int` `OP_PUT_IF_ABSENT_ASYNC`
`static int` `OP_QRY_CONTINUOUS`
`static int` `OP_QRY_SCAN`
`static int` `OP_QRY_SQL`
`static int` `OP_QRY_SQL_FIELDS`
`static int` `OP_QRY_TXT`
`static int` `OP_QUERY_METRICS`
`static int` `OP_REBALANCE`
`static int` `OP_REMOVE_ALL`
`static int` `OP_REMOVE_ALL_ASYNC`
`static int` `OP_REMOVE_ALL2`
`static int` `OP_REMOVE_ALL2_ASYNC`
`static int` `OP_REMOVE_BOOL`
`static int` `OP_REMOVE_BOOL_ASYNC`
`static int` `OP_REMOVE_OBJ`
`static int` `OP_REMOVE_OBJ_ASYNC`
`static int` `OP_REPLACE_2`
`static int` `OP_REPLACE_2_ASYNC`
`static int` `OP_REPLACE_3`
`static int` `OP_REPLACE_3_ASYNC`
`static int` `OP_RESET_QUERY_METRICS`
`static int` `OP_SIZE`
`static int` `OP_SIZE_ASYNC`
`static int` `OP_SIZE_LOC`
`static int` `OP_SIZE_LONG`
`static int` `OP_SIZE_LONG_ASYNC`
`static int` `OP_SIZE_LONG_LOC`
`static int` `OP_TRY_ENTER_LOCK`
`static int` `OP_WITH_EXPIRY_POLICY`
`static int` `OP_WITH_KEEP_BINARY`
`static int` `OP_WITH_NO_RETRIES`
`static int` `OP_WITH_PARTITION_RECOVER`
`static int` `OP_WITH_SKIP_STORE`

### Fields inherited from class org.apache.ignite.internal.processors.platform.PlatformAbstractTarget

`ERROR, FALSE, log, platformCtx, TRUE`

### Constructor Summary

Constructors
Constructor and 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
`Exception` `convertException(Exception e)` Convert caught exception.
`long` `processInLongOutLong(int type, long val)` Process IN operation.
`long` `processInStreamOutLong(int type, BinaryRawReaderEx reader, PlatformMemory mem)` Process IN operation.
`PlatformTarget` `processInStreamOutObject(int type, BinaryRawReaderEx reader)` Process IN-OUT operation.
`PlatformTarget` `processOutObject(int type)` Process OUT operation.
`void` `processOutStream(int type, BinaryRawWriterEx writer)` Process OUT operation.
`IgniteCache` `rawCache()`
`static @Nullable Object[]` `readQueryArgs(BinaryRawReaderEx reader)` Read arguments for SQL query.
`static void` `writeCacheMetrics(BinaryRawWriter writer, CacheMetrics metrics)` Writes cache metrics.
`static void` `writeQueryMetrics(BinaryRawWriter writer, QueryMetrics metrics)` Writes query metrics.
`long` `writeResult(PlatformMemory mem, Object obj)` Writes the result to reused stream, if any.
`long` `writeResult(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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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

### 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 IgniteCheckedException

Process IN operation.

Specified by:
  `processInStreamOutLong` in interface `PlatformTarget`
Overrides:
  `processInStreamOutLong` in class `PlatformAbstractTarget`
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:
  `processInStreamOutObject` in interface `PlatformTarget`
Overrides:
  `processInStreamOutObject` in class `PlatformAbstractTarget`
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 IgniteCheckedException

Process OUT operation.

Specified by:
  `processOutStream` in interface `PlatformTarget`
Overrides:
  `processOutStream` in class `PlatformAbstractTarget`
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:
  `processOutObject` in interface `PlatformTarget`
Overrides:
  `processOutObject` in class `PlatformAbstractTarget`
Parameters:
  `type` - Type.
Throws:
  `IgniteCheckedException` - In case of exception.

#### processInLongOutLong

    public long processInLongOutLong(int type,
                                     long val)
                              throws IgniteCheckedException

Process IN operation.

Specified by:
  `processInLongOutLong` in interface `PlatformTarget`
Overrides:
  `processInLongOutLong` in class `PlatformAbstractTarget`
Parameters:
  `type` - Type.
  `val` - Value.
Returns:
  Result.
Throws:
  `IgniteCheckedException` - In case of exception.

#### convertException

    public Exception convertException(Exception e)

Convert caught exception.

Specified by:
  `convertException` in interface `PlatformTarget`
Overrides:
  `convertException` in class `PlatformAbstractTarget`
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.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020