org.apache.ignite.internal.processors.platform.callback

## Class PlatformCallbackGateway

- java.lang.Object
- - org.apache.ignite.internal.processors.platform.callback.PlatformCallbackGateway

    public class PlatformCallbackGateway
    extends Object

Gateway to all platform-dependent callbacks. Implementers might extend this class and provide additional callbacks.

### Field Summary

Fields
`protected long` `envPtr` Environment pointer.

### Constructor Summary

Constructors
Constructor and Description
`PlatformCallbackGateway(long envPtr)` Native gateway.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `affinityFunctionAssignPartitions(long memPtr)` Assigns the affinity partitions.
`void` `affinityFunctionDestroy(long ptr)` Destroys the affinity function.
`long` `affinityFunctionInit(long memPtr, PlatformTargetProxy baseFunc)` Initializes affinity function.
`int` `affinityFunctionPartition(long memPtr)` Gets the partition from affinity function.
`void` `affinityFunctionRemoveNode(long memPtr)` Removes the node from affinity function.
`protected void` `block()` Block gateway.
`int` `cacheEntryFilterApply(long memPtr)`
`long` `cacheEntryFilterCreate(long memPtr)` Creates cache entry filter and returns a pointer.
`void` `cacheEntryFilterDestroy(long ptr)`
`void` `cacheInvoke(long memPtr)` Invoke cache entry processor.
`long` `cacheStoreCreate(long memPtr)` Create cache store.
`void` `cacheStoreDestroy(long objPtr)`
`int` `cacheStoreInvoke(long memPtr)`
`long` `cacheStoreSessionCreate()` Creates cache store session.
`int` `clusterNodeFilterApply(long memPtr)` Invokes cluster node filter.
`void` `computeActionExecute(long memPtr)` Read compute action from stream, execute, and write results back to the same stream.
`void` `computeJobCancel(long jobPtr)` Cancel the job.
`long` `computeJobCreate(long memPtr)` Create job in native platform.
`void` `computeJobDestroy(long ptr)` Destroy the job.
`void` `computeJobExecute(long memPtr)` Execute native job on a node other than where it was created.
`void` `computeJobExecuteLocal(long jobPtr, long cancel)` Execute native job on a node other than where it was created.
`int` `computeJobSerialize(long jobPtr, long memPtr)` Serialize native job.
`void` `computeOutFuncExecute(long memPtr)` Read compute func from stream, execute, and write results back to the same stream.
`void` `computeTaskComplete(long taskPtr, long memPtr)` Complete task with native error.
`int` `computeTaskJobResult(long memPtr)` Perform native task job result notification.
`int` `computeTaskLocalJobResult(long taskPtr, long jobPtr)` Perform native task job result notification.
`void` `computeTaskMap(long memPtr)` Perform native task map.
`void` `computeTaskReduce(long taskPtr)` Perform native task reduce.
`static void` `consoleWrite(String str, boolean isErr)` Redirects the console output to platform.
`long` `continuousQueryFilterApply(long memPtr)` Invoke remote filter.
`long` `continuousQueryFilterCreate(long memPtr)` Create filter in native platform.
`void` `continuousQueryFilterRelease(long filterPtr)` Release remote filter.
`void` `continuousQueryListenerApply(long memPtr)` Invoke local callback.
`void` `dataStreamerStreamReceiverInvoke(long ptr, PlatformTargetProxy cache, long memPtr, boolean keepBinary)` Invoke stream receiver.
`void` `dataStreamerTopologyUpdate(long ptr, long topVer, int topSize)` Notify native data streamer about topology update.
`protected void` `enter()` Enter gateway.
`long` `environmentPointer()` Get environment pointer.
`int` `eventFilterApply(long ptr, long memPtr)`
`long` `eventFilterCreate(long memPtr)` Creates event filter and returns a pointer.
`void` `eventFilterDestroy(long ptr)`
`long` `eventLocalListenerApply(long memPtr)`
`long` `extensionCallbackInLongLongOutLong(int typ, long arg1, long arg2)` Extension callback accepting two long arguments and returning long result.
`long` `extensionCallbackInLongOutLong(int typ, long arg1)` Extension callback accepting single long argument and returning long result.
`void` `futureBoolResult(long futPtr, long res)` Notify future with boolean result.
`void` `futureByteResult(long futPtr, long res)` Notify future with byte result.
`void` `futureCharResult(long futPtr, long res)` Notify future with byte result.
`void` `futureDoubleResult(long futPtr, long res)` Notify future with double result.
`void` `futureError(long futPtr, long memPtr)` Notify future with error.
`void` `futureFloatResult(long futPtr, long res)` Notify future with float result.
`void` `futureIntResult(long futPtr, long res)` Notify future with int result.
`void` `futureLongResult(long futPtr, long res)` Notify future with long result.
`void` `futureNullResult(long futPtr)` Notify future with null result.
`void` `futureObjectResult(long futPtr, long memPtr)` Notify future with object result.
`void` `futureShortResult(long futPtr, long res)` Notify future with short result.
`protected void` `leave()` Leave gateway.
`void` `lifecycleEvent(long ptr, int evt)` Lifecycle event callback.
`boolean` `loggerIsLevelEnabled(int level)` Gets a value indicating whether native logger has specified level enabled.
`void` `loggerLog(int level, String message, String category, String errorInfo, long memPtr)` Logs to the platform.
`void` `memoryReallocate(long memPtr, int cap)` Re-allocate external memory chunk.
`int` `messagingFilterApply(long ptr, long memPtr)`
`long` `messagingFilterCreate(long memPtr)` Creates message filter and returns a pointer.
`void` `messagingFilterDestroy(long ptr)`
`void` `nodeInfo(long memPtr)` Sends node info to native target.
`void` `onAffinityTopologyVersionChanged(AffinityTopologyVersion version)` Notifies about topology version update.
`void` `onCacheStopped(int cacheId)` Notifies about cache stop.
`void` `onClientDisconnected()` Notifies platform about client disconnect.
`void` `onClientReconnected(boolean clusterRestarted)` Notifies platform about client reconnect.
`void` `onStart(Object proc, long memPtr)` Kernal start callback.
`void` `onStop()` Kernal stop callback.
`void` `platformCacheUpdate(long memPtr)` Updates platform cache data.
`void` `platformCacheUpdateFromThreadLocal(long cacheIdAndPartition, long verMajor, long verMinor)` Updates platform cache data.
`long` `pluginCallback(long callbackId, PlatformMemory outMem, PlatformMemory inMem)` Invoke plugin callback by id.
`void` `pluginProcessorIgniteStop(boolean cancel)` Notifies plugin processor about Ignite stop.
`void` `pluginProcessorStop(boolean cancel)` Stops plugin processor.
`void` `serviceCancel(long memPtr)` Cancels native service.
`void` `serviceExecute(long memPtr)` Executes native service.
`long` `serviceInit(long memPtr)` Initializes native service.
`void` `serviceInvokeMethod(long memPtr)` Invokes service method.

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

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

### Field Detail

#### envPtr

    protected final long envPtr

Environment pointer.

### Constructor Detail

#### PlatformCallbackGateway

    public PlatformCallbackGateway(long envPtr)

Native gateway.

Parameters:
  `envPtr` - Environment pointer.

### Method Detail

#### environmentPointer

    public long environmentPointer()

Get environment pointer.

Returns:
  Environment pointer.

#### cacheStoreCreate

    public long cacheStoreCreate(long memPtr)

Create cache store.

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Pointer.

#### cacheStoreInvoke

    public int cacheStoreInvoke(long memPtr)

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Result.

#### cacheStoreDestroy

    public void cacheStoreDestroy(long objPtr)

Parameters:
  `objPtr` - Object pointer.

#### cacheStoreSessionCreate

    public long cacheStoreSessionCreate()

Creates cache store session.

Returns:
  Session instance pointer.

#### cacheEntryFilterCreate

    public long cacheEntryFilterCreate(long memPtr)

Creates cache entry filter and returns a pointer.

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Pointer.

#### cacheEntryFilterApply

    public int cacheEntryFilterApply(long memPtr)

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Result.

#### cacheEntryFilterDestroy

    public void cacheEntryFilterDestroy(long ptr)

Parameters:
  `ptr` - Pointer.

#### cacheInvoke

    public void cacheInvoke(long memPtr)

Invoke cache entry processor.

Parameters:
  `memPtr` - Memory pointer.

#### computeTaskMap

    public void computeTaskMap(long memPtr)

Perform native task map. Do not throw exceptions, serializing them to the output stream instead.

Parameters:
  `memPtr` - Memory pointer.

#### computeTaskLocalJobResult

    public int computeTaskLocalJobResult(long taskPtr,
                                         long jobPtr)

Perform native task job result notification.

Parameters:
  `taskPtr` - Task pointer.
  `jobPtr` - Job pointer.
Returns:
  Job result enum ordinal.

#### computeTaskJobResult

    public int computeTaskJobResult(long memPtr)

Perform native task job result notification.

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Job result enum ordinal.

#### computeTaskReduce

    public void computeTaskReduce(long taskPtr)

Perform native task reduce.

Parameters:
  `taskPtr` - Task pointer.

#### computeTaskComplete

    public void computeTaskComplete(long taskPtr,
                                    long memPtr)

Complete task with native error.

Parameters:
  `taskPtr` - Task pointer.
  `memPtr` - Memory pointer with exception data or `0` in case of success.

#### computeJobSerialize

    public int computeJobSerialize(long jobPtr,
                                   long memPtr)

Serialize native job.

Parameters:
  `jobPtr` - Job pointer.
  `memPtr` - Memory pointer.
Returns:
  `True` if serialization succeeded.

#### computeJobCreate

    public long computeJobCreate(long memPtr)

Create job in native platform.

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Pointer to job.

#### computeJobExecuteLocal

    public void computeJobExecuteLocal(long jobPtr,
                                       long cancel)

Execute native job on a node other than where it was created.

Parameters:
  `jobPtr` - Job pointer.
  `cancel` - Cancel flag.

#### computeJobExecute

    public void computeJobExecute(long memPtr)

Execute native job on a node other than where it was created.

Parameters:
  `memPtr` - Memory pointer.

#### computeOutFuncExecute

    public void computeOutFuncExecute(long memPtr)

Read compute func from stream, execute, and write results back to the same stream.

Parameters:
  `memPtr` - Memory pointer.

#### computeActionExecute

    public void computeActionExecute(long memPtr)

Read compute action from stream, execute, and write results back to the same stream.

Parameters:
  `memPtr` - Memory pointer.

#### computeJobCancel

    public void computeJobCancel(long jobPtr)

Cancel the job.

Parameters:
  `jobPtr` - Job pointer.

#### computeJobDestroy

    public void computeJobDestroy(long ptr)

Destroy the job.

Parameters:
  `ptr` - Pointer.

#### continuousQueryListenerApply

    public void continuousQueryListenerApply(long memPtr)

Invoke local callback.

Parameters:
  `memPtr` - Memory pointer.

#### continuousQueryFilterCreate

    public long continuousQueryFilterCreate(long memPtr)

Create filter in native platform.

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Pointer to created filter.

#### continuousQueryFilterApply

    public long continuousQueryFilterApply(long memPtr)

Invoke remote filter.

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Result.

#### continuousQueryFilterRelease

    public void continuousQueryFilterRelease(long filterPtr)

Release remote filter.

Parameters:
  `filterPtr` - Filter pointer.

#### dataStreamerTopologyUpdate

    public void dataStreamerTopologyUpdate(long ptr,
                                           long topVer,
                                           int topSize)

Notify native data streamer about topology update.

Parameters:
  `ptr` - Data streamer native pointer.
  `topVer` - Topology version.
  `topSize` - Topology size.

#### dataStreamerStreamReceiverInvoke

    public void dataStreamerStreamReceiverInvoke(long ptr,
                                                 PlatformTargetProxy cache,
                                                 long memPtr,
                                                 boolean keepBinary)

Invoke stream receiver.

Parameters:
  `cache` - Cache object.
  `memPtr` - Stream pointer.

#### futureByteResult

    public void futureByteResult(long futPtr,
                                 long res)

Notify future with byte result.

Parameters:
  `futPtr` - Future pointer.
  `res` - Result.

#### futureBoolResult

    public void futureBoolResult(long futPtr,
                                 long res)

Notify future with boolean result.

Parameters:
  `futPtr` - Future pointer.
  `res` - Result.

#### futureShortResult

    public void futureShortResult(long futPtr,
                                  long res)

Notify future with short result.

Parameters:
  `futPtr` - Future pointer.
  `res` - Result.

#### futureCharResult

    public void futureCharResult(long futPtr,
                                 long res)

Notify future with byte result.

Parameters:
  `futPtr` - Future pointer.
  `res` - Result.

#### futureIntResult

    public void futureIntResult(long futPtr,
                                long res)

Notify future with int result.

Parameters:
  `futPtr` - Future pointer.
  `res` - Result.

#### futureFloatResult

    public void futureFloatResult(long futPtr,
                                  long res)

Notify future with float result.

Parameters:
  `futPtr` - Future pointer.
  `res` - Result.

#### futureLongResult

    public void futureLongResult(long futPtr,
                                 long res)

Notify future with long result.

Parameters:
  `futPtr` - Future pointer.
  `res` - Result.

#### futureDoubleResult

    public void futureDoubleResult(long futPtr,
                                   long res)

Notify future with double result.

Parameters:
  `futPtr` - Future pointer.
  `res` - Result.

#### futureObjectResult

    public void futureObjectResult(long futPtr,
                                   long memPtr)

Notify future with object result.

Parameters:
  `futPtr` - Future pointer.
  `memPtr` - Memory pointer.

#### futureNullResult

    public void futureNullResult(long futPtr)

Notify future with null result.

Parameters:
  `futPtr` - Future pointer.

#### futureError

    public void futureError(long futPtr,
                            long memPtr)

Notify future with error.

Parameters:
  `futPtr` - Future pointer.
  `memPtr` - Pointer to memory with error information.

#### messagingFilterCreate

    public long messagingFilterCreate(long memPtr)

Creates message filter and returns a pointer.

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Pointer.

#### messagingFilterApply

    public int messagingFilterApply(long ptr,
                                    long memPtr)

Parameters:
  `ptr` - Pointer.
  `memPtr` - Memory pointer.
Returns:
  Result.

#### messagingFilterDestroy

    public void messagingFilterDestroy(long ptr)

Parameters:
  `ptr` - Pointer.

#### eventFilterCreate

    public long eventFilterCreate(long memPtr)

Creates event filter and returns a pointer.

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Pointer.

#### eventFilterApply

    public int eventFilterApply(long ptr,
                                long memPtr)

Parameters:
  `ptr` - Pointer.
  `memPtr` - Memory pointer.
Returns:
  Result.

#### eventLocalListenerApply

    public long eventLocalListenerApply(long memPtr)

Parameters:
  `memPtr` - Memory pointer.
Returns:
  Result.

#### eventFilterDestroy

    public void eventFilterDestroy(long ptr)

Parameters:
  `ptr` - Pointer.

#### nodeInfo

    public void nodeInfo(long memPtr)

Sends node info to native target.

Parameters:
  `memPtr` - Ptr to a stream with serialized node.

#### onStart

    public void onStart(Object proc,
                        long memPtr)

Kernal start callback.

Parameters:
  `proc` - Platform processor.
  `memPtr` - Memory pointer.

#### lifecycleEvent

    public void lifecycleEvent(long ptr,
                               int evt)

Lifecycle event callback.

Parameters:
  `ptr` - Holder pointer.
  `evt` - Event.

#### memoryReallocate

    public void memoryReallocate(long memPtr,
                                 int cap)

Re-allocate external memory chunk.

Parameters:
  `memPtr` - Cross-platform pointer.
  `cap` - Capacity.

#### serviceInit

    public long serviceInit(long memPtr)
                     throws IgniteCheckedException

Initializes native service.

Parameters:
  `memPtr` - Pointer.
Throws:
  `IgniteCheckedException` - In case of error.

#### serviceExecute

    public void serviceExecute(long memPtr)
                        throws IgniteCheckedException

Executes native service.

Parameters:
  `memPtr` - Stream pointer.
Throws:
  `IgniteCheckedException` - In case of error.

#### serviceCancel

    public void serviceCancel(long memPtr)
                       throws IgniteCheckedException

Cancels native service.

Parameters:
  `memPtr` - Stream pointer.
Throws:
  `IgniteCheckedException` - In case of error.

#### serviceInvokeMethod

    public void serviceInvokeMethod(long memPtr)
                             throws IgniteCheckedException

Invokes service method.

Parameters:
  `memPtr` - Memory pointer.
Throws:
  `IgniteCheckedException` - In case of error.

#### clusterNodeFilterApply

    public int clusterNodeFilterApply(long memPtr)

Invokes cluster node filter.

Parameters:
  `memPtr` - Stream pointer.

#### extensionCallbackInLongOutLong

    public long extensionCallbackInLongOutLong(int typ,
                                               long arg1)

Extension callback accepting single long argument and returning long result.

Parameters:
  `typ` - Operation type.
  `arg1` - Argument 1.
Returns:
  Long result.

#### extensionCallbackInLongLongOutLong

    public long extensionCallbackInLongLongOutLong(int typ,
                                                   long arg1,
                                                   long arg2)

Extension callback accepting two long arguments and returning long result.

Parameters:
  `typ` - Operation type.
  `arg1` - Argument 1.
  `arg2` - Argument 2.
Returns:
  Long result.

#### onClientDisconnected

    public void onClientDisconnected()

Notifies platform about client disconnect.

#### onClientReconnected

    public void onClientReconnected(boolean clusterRestarted)

Notifies platform about client reconnect.

Parameters:
  `clusterRestarted` - Cluster restarted flag.

#### loggerLog

    public void loggerLog(int level,
                          String message,
                          String category,
                          String errorInfo,
                          long memPtr)

Logs to the platform.

Parameters:
  `level` - Log level.
  `message` - Message.
  `category` - Category.
  `errorInfo` - Error info.
  `memPtr` - Pointer to optional payload (serialized exception).

#### loggerIsLevelEnabled

    public boolean loggerIsLevelEnabled(int level)

Gets a value indicating whether native logger has specified level enabled.

Parameters:
  `level` - Log level.

#### onStop

    public void onStop()

Kernal stop callback.

#### affinityFunctionInit

    public long affinityFunctionInit(long memPtr,
                                     PlatformTargetProxy baseFunc)

Initializes affinity function.

Parameters:
  `memPtr` - Pointer to a stream with serialized affinity function.
  `baseFunc` - Optional func for base calls.
Returns:
  Affinity function pointer.

#### affinityFunctionPartition

    public int affinityFunctionPartition(long memPtr)

Gets the partition from affinity function.

Parameters:
  `memPtr` - Pointer to a stream with data.
Returns:
  Partition number for a given key.

#### affinityFunctionAssignPartitions

    public void affinityFunctionAssignPartitions(long memPtr)

Assigns the affinity partitions.

Parameters:
  `memPtr` - Pointer to a stream.

#### affinityFunctionRemoveNode

    public void affinityFunctionRemoveNode(long memPtr)

Removes the node from affinity function.

Parameters:
  `memPtr` - Pointer to a stream.

#### affinityFunctionDestroy

    public void affinityFunctionDestroy(long ptr)

Destroys the affinity function.

Parameters:
  `ptr` - Affinity function pointer.

#### pluginProcessorStop

    public void pluginProcessorStop(boolean cancel)

Stops plugin processor.

#### pluginProcessorIgniteStop

    public void pluginProcessorIgniteStop(boolean cancel)

Notifies plugin processor about Ignite stop.

#### consoleWrite

    public static void consoleWrite(String str,
                                    boolean isErr)

Redirects the console output to platform.

Parameters:
  `str` - String to write.
  `isErr` - Whether this is stdErr or stdOut.

#### pluginCallback

    public long pluginCallback(long callbackId,
                               PlatformMemory outMem,
                               PlatformMemory inMem)

Invoke plugin callback by id.

Parameters:
  `callbackId` - Id of a callback registered in Platform.
  `outMem` - Out memory (Java writes, platform reads).
  `inMem` - In memory (platform writes, Java reads).

#### platformCacheUpdate

    public void platformCacheUpdate(long memPtr)

Updates platform cache data.

Parameters:
  `memPtr` - Ptr to a stream with serialized data.

#### platformCacheUpdateFromThreadLocal

    public void platformCacheUpdateFromThreadLocal(long cacheIdAndPartition,
                                                   long verMajor,
                                                   long verMinor)

Updates platform cache data.

Parameters:
  `cacheIdAndPartition` - Cache id and partition.
  `verMajor` - Affinity version.
  `verMinor` - Affinity version minor part.

#### onCacheStopped

    public void onCacheStopped(int cacheId)

Notifies about cache stop.

Parameters:
  `cacheId` - Cache id.

#### onAffinityTopologyVersionChanged

    public void onAffinityTopologyVersionChanged(AffinityTopologyVersion version)

Notifies about topology version update.

Parameters:
  `version` - Affinity topology version.

#### enter

    protected void enter()

Enter gateway.

#### leave

    protected void leave()

Leave gateway.

#### block

    protected void block()

Block gateway.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020