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 Modifier and Type Field Description protected longenvPtrEnvironment pointer.
-
Constructor Summary
Constructors Constructor Description PlatformCallbackGateway(long envPtr)Native gateway.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaffinityFunctionAssignPartitions(long memPtr)Assigns the affinity partitions.voidaffinityFunctionDestroy(long ptr)Destroys the affinity function.longaffinityFunctionInit(long memPtr, PlatformTargetProxy baseFunc)Initializes affinity function.intaffinityFunctionPartition(long memPtr)Gets the partition from affinity function.voidaffinityFunctionRemoveNode(long memPtr)Removes the node from affinity function.longbinaryTypeGet(long memPtr)Gets binary type by name.protected voidblock()Block gateway.intcacheEntryFilterApply(long memPtr)longcacheEntryFilterCreate(long memPtr)Creates cache entry filter and returns a pointer.voidcacheEntryFilterDestroy(long ptr)voidcacheInvoke(long memPtr)Invoke cache entry processor.longcacheStoreCreate(long memPtr)Create cache store.voidcacheStoreDestroy(long objPtr)intcacheStoreInvoke(long memPtr)longcacheStoreSessionCreate()Creates cache store session.intclusterNodeFilterApply(long memPtr)Invokes cluster node filter.voidcomputeActionExecute(long memPtr)Read compute action from stream, execute, and write results back to the same stream.voidcomputeJobCancel(long jobPtr)Cancel the job.longcomputeJobCreate(long memPtr)Create job in native platform.voidcomputeJobDestroy(long ptr)Destroy the job.voidcomputeJobExecute(long memPtr, PlatformTargetProxy ses)Execute native job on a node other than where it was created.voidcomputeJobExecuteLocal(long jobPtr, long cancel, PlatformTargetProxy ses)Execute native job on a node other than where it was created.intcomputeJobSerialize(long jobPtr, long memPtr)Serialize native job.voidcomputeOutFuncExecute(long memPtr)Read compute func from stream, execute, and write results back to the same stream.voidcomputeTaskComplete(long taskPtr, long memPtr)Complete task with native error.intcomputeTaskJobResult(long memPtr)Perform native task job result notification.intcomputeTaskLocalJobResult(long taskPtr, long jobPtr)Perform native task job result notification.voidcomputeTaskMap(long memPtr, PlatformTargetProxy ses)Perform native task map.voidcomputeTaskReduce(long taskPtr)Perform native task reduce.static voidconsoleWrite(String str, boolean isErr)Redirects the console output to platform.longcontinuousQueryFilterApply(long memPtr)Invoke remote filter.longcontinuousQueryFilterCreate(long memPtr)Create filter in native platform.voidcontinuousQueryFilterRelease(long filterPtr)Release remote filter.voidcontinuousQueryListenerApply(long memPtr)Invoke local callback.voiddataStreamerStreamReceiverInvoke(long ptr, PlatformTargetProxy cache, long memPtr, boolean keepBinary)Invoke stream receiver.voiddataStreamerTopologyUpdate(long ptr, long topVer, int topSize)Notify native data streamer about topology update.protected voidenter()Enter gateway.longenvironmentPointer()Get environment pointer.inteventFilterApply(long ptr, long memPtr)longeventFilterCreate(long memPtr)Creates event filter and returns a pointer.voideventFilterDestroy(long ptr)longeventLocalListenerApply(long memPtr)longextensionCallbackInLongLongOutLong(int typ, long arg1, long arg2)Extension callback accepting two long arguments and returning long result.longextensionCallbackInLongOutLong(int typ, long arg1)Extension callback accepting single long argument and returning long result.voidfutureBoolResult(long futPtr, long res)Notify future with boolean result.voidfutureByteResult(long futPtr, long res)Notify future with byte result.voidfutureCharResult(long futPtr, long res)Notify future with byte result.voidfutureDoubleResult(long futPtr, long res)Notify future with double result.voidfutureError(long futPtr, long memPtr)Notify future with error.voidfutureFloatResult(long futPtr, long res)Notify future with float result.voidfutureIntResult(long futPtr, long res)Notify future with int result.voidfutureLongResult(long futPtr, long res)Notify future with long result.voidfutureNullResult(long futPtr)Notify future with null result.voidfutureObjectResult(long futPtr, long memPtr)Notify future with object result.voidfutureShortResult(long futPtr, long res)Notify future with short result.protected voidleave()Leave gateway.voidlifecycleEvent(long ptr, int evt)Lifecycle event callback.booleanloggerIsLevelEnabled(int level)Gets a value indicating whether native logger has specified level enabled.voidloggerLog(int level, String message, String category, String errorInfo, long memPtr)Logs to the platform.voidmemoryReallocate(long memPtr, int cap)Re-allocate external memory chunk.intmessagingFilterApply(long ptr, long memPtr)longmessagingFilterCreate(long memPtr)Creates message filter and returns a pointer.voidmessagingFilterDestroy(long ptr)voidnodeInfo(long memPtr)Sends node info to native target.voidonAffinityTopologyVersionChanged(AffinityTopologyVersion version)Notifies about topology version update.voidonCacheStopped(int cacheId, boolean cancel, boolean destroy)Notifies about cache stop.voidonClientDisconnected()Notifies platform about client disconnect.voidonClientReconnected(boolean clusterRestarted)Notifies platform about client reconnect.voidonStart(Object proc, long memPtr)Kernal start callback.voidonStop()Kernal stop callback.voidplatformCacheUpdate(long memPtr)Updates platform cache data.voidplatformCacheUpdateFromThreadLocal(long cacheIdAndPartition, long verMajor, long verMinor)Updates platform cache data.longpluginCallback(long callbackId, PlatformMemory outMem, PlatformMemory inMem)Invoke plugin callback by id.voidpluginProcessorIgniteStop(boolean cancel)Notifies plugin processor about Ignite stop.voidpluginProcessorStop(boolean cancel)Stops plugin processor.voidserviceCancel(long memPtr)Cancels native service.voidserviceExecute(long memPtr)Executes native service.longserviceInit(long memPtr)Initializes native service.voidserviceInvokeMethod(long memPtr)Invokes service method.
-
-
-
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, PlatformTargetProxy ses)Perform native task map. Do not throw exceptions, serializing them to the output stream instead.- Parameters:
memPtr- Memory pointer.ses- Platform compute task session proxy.
-
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 or0in case of success.
-
computeJobSerialize
public int computeJobSerialize(long jobPtr, long memPtr)Serialize native job.- Parameters:
jobPtr- Job pointer.memPtr- Memory pointer.- Returns:
Trueif 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, PlatformTargetProxy ses)Execute native job on a node other than where it was created.- Parameters:
jobPtr- Job pointer.cancel- Cancel flag.ses- Platform compute task session proxy.
-
computeJobExecute
public void computeJobExecute(long memPtr, PlatformTargetProxy ses)Execute native job on a node other than where it was created.- Parameters:
memPtr- Memory pointer.ses- Platform compute task session proxy.
-
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 IgniteCheckedExceptionInitializes native service.- Parameters:
memPtr- Pointer.- Throws:
IgniteCheckedException- In case of error.
-
serviceExecute
public void serviceExecute(long memPtr) throws IgniteCheckedExceptionExecutes native service.- Parameters:
memPtr- Stream pointer.- Throws:
IgniteCheckedException- In case of error.
-
serviceCancel
public void serviceCancel(long memPtr) throws IgniteCheckedExceptionCancels native service.- Parameters:
memPtr- Stream pointer.- Throws:
IgniteCheckedException- In case of error.
-
serviceInvokeMethod
public void serviceInvokeMethod(long memPtr) throws IgniteCheckedExceptionInvokes 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, boolean cancel, boolean destroy)Notifies about cache stop.- Parameters:
cacheId- Cache id.cancel- Cancel flag.destroy- Cache destroy flag.
-
onAffinityTopologyVersionChanged
public void onAffinityTopologyVersionChanged(AffinityTopologyVersion version)
Notifies about topology version update.- Parameters:
version- Affinity topology version.
-
binaryTypeGet
public long binaryTypeGet(long memPtr)
Gets binary type by name.- Parameters:
memPtr- Ptr to a stream with serialized type name. Result is returned in the same stream.
-
enter
protected void enter()
Enter gateway.
-
leave
protected void leave()
Leave gateway.
-
block
protected void block()
Block gateway.
-
-