Class PlatformProcessorImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.GridProcessorAdapter
-
- org.apache.ignite.internal.processors.platform.PlatformProcessorImpl
-
- All Implemented Interfaces:
GridComponent,GridProcessor,PlatformProcessor,PlatformTarget
public class PlatformProcessorImpl extends GridProcessorAdapter implements PlatformProcessor, PlatformTarget
Platform processor.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent
GridComponent.DiscoveryDataExchangeType
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter
ctx, diagnosticLog
-
-
Constructor Summary
Constructors Constructor Description PlatformProcessorImpl(GridKernalContext ctx)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawaitStart()Await until platform processor is safe to use (i.e.PlatformCacheManagercacheManager()Gets the cache manager.PlatformContextcontext()Gets platform context.ExceptionconvertException(Exception e)Convert caught exception.longenvironmentPointer()Get environment pointer associated with this processor.booleanhasContext()Returns a value indicating whetherPlatformProcessor.context()is available.Igniteignite()Gets owning Ignite instance.voidonDisconnected(IgniteFuture<?> reconnectFut)Client disconnected callback.voidonKernalStop(boolean cancel)Callback to notify that kernal is about to stop.IgniteInternalFuture<?>onReconnected(boolean clusterRestarted)Client reconnected callback.longprocessInLongOutLong(int type, long val)Process IN operation.PlatformTargetprocessInObjectStreamOutObjectStream(int type, @Nullable PlatformTarget arg, BinaryRawReaderEx reader, BinaryRawWriterEx writer)Process IN-OUT operation.PlatformAsyncResultprocessInStreamAsync(int type, BinaryRawReaderEx reader)Process asynchronous operation.longprocessInStreamOutLong(int type, BinaryRawReaderEx reader)Process IN operation.longprocessInStreamOutLong(int type, BinaryRawReaderEx reader, PlatformMemory mem)Process IN operation.PlatformTargetprocessInStreamOutObject(int type, BinaryRawReaderEx reader)Process IN-OUT operation.voidprocessInStreamOutStream(int type, BinaryRawReaderEx reader, BinaryRawWriterEx writer)Process IN-OUT operation.PlatformTargetprocessOutObject(int type)Process OUT operation.voidprocessOutStream(int type, BinaryRawWriterEx writer)Process OUT operation.voidregisterStore(PlatformCacheStore store, boolean convertBinary)Register cache store.voidreleaseStart()Notify processor that it is safe to use.voidsetThreadLocal(Object value)Sets thread local value for platform.voidstart()Starts grid component.voidstop(boolean cancel)Stops grid component.-
Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, printMemoryStats, toString, validateNode, validateNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.GridComponent
collectGridNodeData, collectJoiningNodeData, discoveryDataType, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, printMemoryStats, validateNode, validateNode
-
-
-
-
Constructor Detail
-
PlatformProcessorImpl
public PlatformProcessorImpl(GridKernalContext ctx)
Constructor.- Parameters:
ctx- Kernal context.
-
-
Method Detail
-
start
public void start() throws IgniteCheckedExceptionStarts grid component.- Specified by:
startin interfaceGridComponent- Overrides:
startin classGridProcessorAdapter- Throws:
IgniteCheckedException- Throws in case of any errors.
-
onKernalStop
public void onKernalStop(boolean cancel)
Callback to notify that kernal is about to stop.- Specified by:
onKernalStopin interfaceGridComponent- Overrides:
onKernalStopin classGridProcessorAdapter- Parameters:
cancel- Flag indicating whether jobs should be canceled.
-
stop
public void stop(boolean cancel) throws IgniteCheckedExceptionStops grid component.- Specified by:
stopin interfaceGridComponent- Overrides:
stopin classGridProcessorAdapter- Parameters:
cancel- Iftrue, then all ongoing tasks or jobs for relevant components need to be cancelled.- Throws:
IgniteCheckedException- Thrown in case of any errors.
-
ignite
public Ignite ignite()
Gets owning Ignite instance.- Specified by:
ignitein interfacePlatformProcessor- Returns:
- Ignite instance.
-
environmentPointer
public long environmentPointer()
Get environment pointer associated with this processor.- Specified by:
environmentPointerin interfacePlatformProcessor- Returns:
- Environment pointer.
-
releaseStart
public void releaseStart()
Notify processor that it is safe to use.- Specified by:
releaseStartin interfacePlatformProcessor
-
awaitStart
public void awaitStart() throws IgniteCheckedExceptionAwait until platform processor is safe to use (i.e.has been called.- Specified by:
awaitStartin interfacePlatformProcessor- Throws:
IgniteCheckedException- If failed.
-
context
public PlatformContext context()
Gets platform context.- Specified by:
contextin interfacePlatformProcessor- Returns:
- Platform context.
-
hasContext
public boolean hasContext()
Returns a value indicating whetherPlatformProcessor.context()is available.- Specified by:
hasContextin interfacePlatformProcessor- Returns:
- value indicating whether
PlatformProcessor.context()is available.
-
registerStore
public void registerStore(PlatformCacheStore store, boolean convertBinary) throws IgniteCheckedException
Register cache store.- Specified by:
registerStorein interfacePlatformProcessor- Parameters:
store- Store.convertBinary- Convert binary flag.- Throws:
IgniteCheckedException- If failed.
-
cacheManager
public PlatformCacheManager cacheManager()
Gets the cache manager.- Specified by:
cacheManagerin interfacePlatformProcessor- Returns:
- Cache manager.
-
onDisconnected
public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException
Client disconnected callback.- Specified by:
onDisconnectedin interfaceGridComponent- Overrides:
onDisconnectedin classGridProcessorAdapter- Parameters:
reconnectFut- Reconnect future.- Throws:
IgniteCheckedException- If failed.
-
onReconnected
public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted) throws IgniteCheckedException
Client reconnected callback.- Specified by:
onReconnectedin interfaceGridComponent- Overrides:
onReconnectedin classGridProcessorAdapter- Parameters:
clusterRestarted- Cluster restarted flag.- Returns:
- Future to wait before completing reconnect future.
- Throws:
IgniteCheckedException- If failed.
-
processInLongOutLong
public long processInLongOutLong(int type, long val) throws IgniteCheckedExceptionProcess IN operation.- Specified by:
processInLongOutLongin interfacePlatformTarget- Parameters:
type- Type.val- Value.- Returns:
- Result.
- Throws:
IgniteCheckedException- In case of exception.
-
processInStreamOutLong
public long processInStreamOutLong(int type, BinaryRawReaderEx reader) throws IgniteCheckedExceptionProcess IN operation.- Specified by:
processInStreamOutLongin interfacePlatformTarget- Parameters:
type- Type.reader- Binary reader.- Returns:
- Result.
- Throws:
IgniteCheckedException- In case of exception.
-
processInStreamOutLong
public long processInStreamOutLong(int type, BinaryRawReaderEx reader, PlatformMemory mem) throws IgniteCheckedExceptionProcess IN operation.- Specified by:
processInStreamOutLongin interfacePlatformTarget- Parameters:
type- Type.reader- Binary reader.- Returns:
- Result.
- Throws:
IgniteCheckedException- In case of exception.
-
processInStreamOutStream
public void processInStreamOutStream(int type, BinaryRawReaderEx reader, BinaryRawWriterEx writer) throws IgniteCheckedExceptionProcess IN-OUT operation.- Specified by:
processInStreamOutStreamin interfacePlatformTarget- Parameters:
type- Type.reader- Binary reader.writer- Binary writer.- Throws:
IgniteCheckedException- In case of exception.
-
processInStreamOutObject
public PlatformTarget processInStreamOutObject(int type, BinaryRawReaderEx reader) throws IgniteCheckedException
Process IN-OUT operation.- Specified by:
processInStreamOutObjectin interfacePlatformTarget- Parameters:
type- Type.reader- Binary reader.- Throws:
IgniteCheckedException- In case of exception.
-
processInObjectStreamOutObjectStream
public PlatformTarget processInObjectStreamOutObjectStream(int type, @Nullable @Nullable PlatformTarget arg, BinaryRawReaderEx reader, BinaryRawWriterEx writer) throws IgniteCheckedException
Process IN-OUT operation.- Specified by:
processInObjectStreamOutObjectStreamin interfacePlatformTarget- Parameters:
type- Type.arg- Argument.reader- Binary reader.writer- Binary writer.- Throws:
IgniteCheckedException- In case of exception.
-
processOutStream
public void processOutStream(int type, BinaryRawWriterEx writer) throws IgniteCheckedExceptionProcess OUT operation.- Specified by:
processOutStreamin interfacePlatformTarget- 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- Parameters:
type- Type.- Throws:
IgniteCheckedException- In case of exception.
-
processInStreamAsync
public PlatformAsyncResult processInStreamAsync(int type, BinaryRawReaderEx reader) throws IgniteCheckedException
Process asynchronous operation.- Specified by:
processInStreamAsyncin interfacePlatformTarget- Parameters:
type- Type.reader- Binary reader.- Returns:
- Async result (should not be null).
- Throws:
IgniteCheckedException- In case of exception.
-
convertException
public Exception convertException(Exception e)
Convert caught exception.- Specified by:
convertExceptionin interfacePlatformTarget- Parameters:
e- Exception to convert.- Returns:
- Converted exception.
-
setThreadLocal
public void setThreadLocal(Object value)
Sets thread local value for platform.- Specified by:
setThreadLocalin interfacePlatformProcessor- Parameters:
value- Value.
-
-