org.apache.ignite.internal.processors.platform

## Interface PlatformContext

All Known Implementing Classes:
  PlatformContextImpl

    public interface PlatformContext

Platform context. Acts as an entry point for platform operations.

### Method Summary

All Methods Instance Methods Abstract Methods
`void` `addNode(ClusterNode node)` Sends node info to native platform, if necessary.
`PlatformCacheEntryFilter` `createCacheEntryFilter(Object filter, long ptr)` Create cache entry filter.
`PlatformCacheEntryProcessor` `createCacheEntryProcessor(Object proc, long ptr)` Create cache entry processor.
`PlatformJob` `createClosureJob(Object task, long ptr, Object job)` Create closure job.
`PlatformClusterNodeFilter` `createClusterNodeFilter(Object filter)` Create cluster node filter.
`PlatformContinuousQuery` `createContinuousQuery(long ptr, boolean hasFilter, @Nullable Object filter)`
`PlatformContinuousQueryFilter` `createContinuousQueryFilter(Object filter)` Create continuous query filter to be deployed on remote node.
`PlatformJob` `createJob(Object task, long ptr, @Nullable Object job)` Create job.
`PlatformEventFilterListener` `createLocalEventFilter(long hnd)` Create local event filter.
`PlatformNativeException` `createNativeException(Object cause)` Create native exception.
`PlatformEventFilterListener` `createRemoteEventFilter(Object pred, int... types)` Create remote event filter.
`PlatformMessageFilter` `createRemoteMessageFilter(Object filter, long ptr)` Create remote message filter.
`PlatformStreamReceiver` `createStreamReceiver(Object rcv, long ptr, boolean keepBinary)` Create stream receiver.
`void` `disableThreadLocalForPlatformCacheUpdate()` Disables thread-local optimization for platform cache update.
`void` `enableThreadLocalForPlatformCacheUpdate()` Enables thread-local optimization for platform cache update.
`PlatformCallbackGateway` `gateway()` Gets platform callback gateway.
`@Nullable BinaryMetadata` `getBinaryType(String typeName)` Gets platform binary type metadata.
`byte` `getMarshallerPlatformId()` Gets marshaller platform id (see `MarshallerPlatformIds`).
`boolean` `isEventTypeSupported(int evtTyp)` Check whether the given event type is supported.
`boolean` `isPlatformCacheSupported()` Gets a value indicating whether current platform supports native cache.
`GridKernalContext` `kernalContext()` Gets kernal context.
`PlatformMemoryManager` `memory()` Gets platform memory manager.
`String` `platform()` Gets the current platform name.
`void` `processMetadata(BinaryRawReaderEx reader)` Process metadata from the platform.
`BinaryRawReaderEx` `reader(PlatformInputStream in)` Get memory reader.
`BinaryRawReaderEx` `reader(PlatformMemory mem)` Get memory reader.
`void` `updatePlatformCache(int cacheId, byte[] keyBytes, byte[] valBytes, int part, AffinityTopologyVersion ver)` Updates the platform cache cache.
`void` `writeAllMetadata(BinaryRawWriterEx writer)` Write all available metadata.
`void` `writeClusterMetrics(BinaryRawWriterEx writer, @Nullable ClusterMetrics metrics)` Write cluster metrics.
`void` `writeEvent(BinaryRawWriterEx writer, Event evt)` Write event.
`void` `writeMetadata(BinaryRawWriterEx writer, int typeId, boolean includeSchemas)` Write metadata for the given type ID.
`void` `writeNode(BinaryRawWriterEx writer, ClusterNode node)` Writes a node id to a stream and sends node info to native platform, if necessary.
`void` `writeNodes(BinaryRawWriterEx writer, Collection<ClusterNode> nodes)` Writes multiple node ids to a stream and sends node info to native platform, if necessary.
`BinaryRawWriterEx` `writer(PlatformMemory mem)` Get memory writer.
`BinaryRawWriterEx` `writer(PlatformOutputStream out)` Get memory writer.
`void` `writeSchema(BinaryRawWriterEx writer, int typeId, int schemaId)` Write schema for the given type ID and schema ID.

### Method Detail

#### kernalContext

    GridKernalContext kernalContext()

Gets kernal context.

Returns:
  Kernal context.

#### memory

    PlatformMemoryManager memory()

Gets platform memory manager.

Returns:
  Memory manager.

#### gateway

    PlatformCallbackGateway gateway()

Gets platform callback gateway.

Returns:
  Callback gateway.

#### reader

    BinaryRawReaderEx reader(PlatformMemory mem)

Get memory reader.

Parameters:
  `mem` - Memory.
Returns:
  Reader.

#### reader

    BinaryRawReaderEx reader(PlatformInputStream in)

Get memory reader.

Parameters:
  `in` - Input.
Returns:
  Reader.

#### writer

    BinaryRawWriterEx writer(PlatformMemory mem)

Get memory writer.

Parameters:
  `mem` - Memory.
Returns:
  Writer.

#### writer

    BinaryRawWriterEx writer(PlatformOutputStream out)

Get memory writer.

Parameters:
  `out` - Output.
Returns:
  Writer.

#### addNode

    void addNode(ClusterNode node)

Sends node info to native platform, if necessary.

Parameters:
  `node` - Node.

#### writeNode

    void writeNode(BinaryRawWriterEx writer,
                   ClusterNode node)

Writes a node id to a stream and sends node info to native platform, if necessary.

Parameters:
  `writer` - Writer.
  `node` - Node.

#### writeNodes

    void writeNodes(BinaryRawWriterEx writer,
                    Collection<ClusterNode> nodes)

Writes multiple node ids to a stream and sends node info to native platform, if necessary.

Parameters:
  `writer` - Writer.
  `nodes` - Nodes.

#### processMetadata

    void processMetadata(BinaryRawReaderEx reader)

Process metadata from the platform.

Parameters:
  `reader` - Reader.

#### writeMetadata

    void writeMetadata(BinaryRawWriterEx writer,
                       int typeId,
                       boolean includeSchemas)

Write metadata for the given type ID.

Parameters:
  `writer` - Writer.
  `typeId` - Type ID.
  `includeSchemas` - Whether to include binary object schemas into the result.

#### writeAllMetadata

    void writeAllMetadata(BinaryRawWriterEx writer)

Write all available metadata.

Parameters:
  `writer` - Writer.

#### writeSchema

    void writeSchema(BinaryRawWriterEx writer,
                     int typeId,
                     int schemaId)

Write schema for the given type ID and schema ID.

Parameters:
  `writer` - Writer.
  `typeId` - Type ID.
  `schemaId` - Schema ID.

#### writeClusterMetrics

    void writeClusterMetrics(BinaryRawWriterEx writer,
                             @Nullable
                             @Nullable ClusterMetrics metrics)

Write cluster metrics.

Parameters:
  `writer` - Writer.
  `metrics` - Metrics.

#### createContinuousQuery

    PlatformContinuousQuery createContinuousQuery(long ptr,
                                                  boolean hasFilter,
                                                  @Nullable
                                                  @Nullable Object filter)

Parameters:
  `ptr` - Pointer to continuous query deployed on the platform.
  `hasFilter` - Whether filter exists.
  `filter` - Filter.
Returns:
  Platform continuous query.

#### createContinuousQueryFilter

    PlatformContinuousQueryFilter createContinuousQueryFilter(Object filter)

Create continuous query filter to be deployed on remote node.

Parameters:
  `filter` - Native filter.
Returns:
  Filter.

#### createRemoteMessageFilter

    PlatformMessageFilter createRemoteMessageFilter(Object filter,
                                                    long ptr)

Create remote message filter.

Parameters:
  `filter` - Native filter.
  `ptr` - Pointer of deployed native filter.
Returns:
  Filter.

#### isEventTypeSupported

    boolean isEventTypeSupported(int evtTyp)

Check whether the given event type is supported.

Parameters:
  `evtTyp` - Event type.
Returns:
  `True` if supported.

#### writeEvent

    void writeEvent(BinaryRawWriterEx writer,
                    Event evt)

Write event.

Parameters:
  `writer` - Writer.
  `evt` - Event.

#### createLocalEventFilter

    PlatformEventFilterListener createLocalEventFilter(long hnd)

Create local event filter.

Parameters:
  `hnd` - Native handle.
Returns:
  Filter.

#### createRemoteEventFilter

    PlatformEventFilterListener createRemoteEventFilter(Object pred,
                                                        int... types)

Create remote event filter.

Parameters:
  `pred` - Native predicate.
  `types` - Event types.
Returns:
  Filter.

#### createNativeException

    PlatformNativeException createNativeException(Object cause)

Create native exception.

Parameters:
  `cause` - Native cause.
Returns:
  Exception.

#### createJob

    PlatformJob createJob(Object task,
                          long ptr,
                          @Nullable
                          @Nullable Object job)

Create job.

Parameters:
  `task` - Task.
  `ptr` - Pointer.
  `job` - Native job.
Returns:
  job.

#### createClosureJob

    PlatformJob createClosureJob(Object task,
                                 long ptr,
                                 Object job)

Create closure job.

Parameters:
  `task` - Native task.
  `ptr` - Pointer.
  `job` - Native job.
Returns:
  Closure job.

#### createCacheEntryProcessor

    PlatformCacheEntryProcessor createCacheEntryProcessor(Object proc,
                                                          long ptr)

Create cache entry processor.

Parameters:
  `proc` - Native processor.
  `ptr` - Pointer.
Returns:
  Entry processor.

#### createCacheEntryFilter

    PlatformCacheEntryFilter createCacheEntryFilter(Object filter,
                                                    long ptr)

Create cache entry filter.

Parameters:
  `filter` - Native filter.
  `ptr` - Pointer.
Returns:
  Entry filter.

#### createStreamReceiver

    PlatformStreamReceiver createStreamReceiver(Object rcv,
                                                long ptr,
                                                boolean keepBinary)

Create stream receiver.

Parameters:
  `rcv` - Native receiver.
  `ptr` - Pointer.
  `keepBinary` - Keep binary flag.
Returns:
  Stream receiver.

#### createClusterNodeFilter

    PlatformClusterNodeFilter createClusterNodeFilter(Object filter)

Create cluster node filter.

Parameters:
  `filter` - Native filter.
Returns:
  Cluster node filter.

#### platform

    String platform()

Gets the current platform name.

Returns:
  Current platform name.

#### isPlatformCacheSupported

    boolean isPlatformCacheSupported()

Gets a value indicating whether current platform supports native cache.

Returns:
  True when native caching is supported; false otherwise.

#### updatePlatformCache

    void updatePlatformCache(int cacheId,
                             byte[] keyBytes,
                             byte[] valBytes,
                             int part,
                             AffinityTopologyVersion ver)

Updates the platform cache cache.

Parameters:
  `cacheId` - Cache id.
  `keyBytes` - Serialized key to update.
  `valBytes` - Serialized value.
  `part` - Key partition.
  `ver` - Key version.

#### enableThreadLocalForPlatformCacheUpdate

    void enableThreadLocalForPlatformCacheUpdate()

Enables thread-local optimization for platform cache update.

#### disableThreadLocalForPlatformCacheUpdate

    void disableThreadLocalForPlatformCacheUpdate()

Disables thread-local optimization for platform cache update.

#### getBinaryType

    @Nullable
    @Nullable BinaryMetadata getBinaryType(String typeName)

Gets platform binary type metadata.

Parameters:
  `typeName` - Type name.
Returns:
  Metadata when type exists; null otherwise.

#### getMarshallerPlatformId

    byte getMarshallerPlatformId()

Gets marshaller platform id (see `MarshallerPlatformIds`).

Returns:
  Marshaller platform id.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022