public abstract class GridProcessorAdapter extends Object implements GridProcessor
GridComponent.DiscoveryDataExchangeType| Modifier and Type | Field and Description |
|---|---|
protected GridKernalContext |
ctx
Kernal context.
|
protected IgniteLogger |
diagnosticLog
Diagnostic logger.
|
protected IgniteLogger |
log
Grid logger.
|
| Modifier | Constructor and Description |
|---|---|
protected |
GridProcessorAdapter(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertParameter(boolean cond,
String condDesc)
Throws exception with uniform error message if given parameter's assertion condition
is
false. |
void |
collectGridNodeData(DiscoveryDataBag dataBag)
Collects discovery data on nodes already in grid on receiving
TcpDiscoveryNodeAddedMessage. |
void |
collectJoiningNodeData(DiscoveryDataBag dataBag)
Collects discovery data on joining node before sending
TcpDiscoveryJoinRequestMessage request. |
@Nullable GridComponent.DiscoveryDataExchangeType |
discoveryDataType()
Gets unique component type to distinguish components providing discovery data.
|
void |
onDisconnected(IgniteFuture<?> reconnectFut)
Client disconnected callback.
|
void |
onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
Receives discovery data object from remote nodes (called
on new node during discovery process).
|
void |
onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)
Method is called on nodes that are already in grid (not on joining node).
|
void |
onKernalStart(boolean active)
Callback that notifies that kernal has successfully started,
including all managers and processors.
|
void |
onKernalStop(boolean cancel)
Callback to notify that kernal is about to stop.
|
IgniteInternalFuture<?> |
onReconnected(boolean clusterRestarted)
Client reconnected callback.
|
void |
printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.).
|
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
String |
toString() |
@Nullable IgniteNodeValidationResult |
validateNode(ClusterNode node)
Validates that new node can join grid topology, this method is called on coordinator
node before new node joins topology.
|
@Nullable IgniteNodeValidationResult |
validateNode(ClusterNode node,
DiscoveryDataBag.JoiningNodeDiscoveryData discoData)
Validates that new node can join grid topology, this method is called on coordinator
node before new node joins topology.
|
@GridToStringExclude protected final GridKernalContext ctx
@GridToStringExclude protected final IgniteLogger log
@GridToStringExclude protected final IgniteLogger diagnosticLog
protected GridProcessorAdapter(GridKernalContext ctx)
ctx - Kernal context.public void onKernalStart(boolean active)
throws IgniteCheckedException
onKernalStart in interface GridComponentactive - Cluster active flag (note: should be used carefully since state can
change concurrently).IgniteCheckedException - Thrown in case of any errors.public void onKernalStop(boolean cancel)
onKernalStop in interface GridComponentcancel - Flag indicating whether jobs should be canceled.public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException
onDisconnected in interface GridComponentreconnectFut - Reconnect future.IgniteCheckedException - If failed.public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted) throws IgniteCheckedException
onReconnected in interface GridComponentclusterRestarted - Cluster restarted flag.IgniteCheckedException - If failed.@Nullable public @Nullable GridComponent.DiscoveryDataExchangeType discoveryDataType()
GridComponent.collectJoiningNodeData(DiscoveryDataBag)
or GridComponent.collectGridNodeData(DiscoveryDataBag).discoveryDataType in interface GridComponentpublic void collectJoiningNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryJoinRequestMessage request.collectJoiningNodeData in interface GridComponentdataBag - container object to store discovery data in.public void collectGridNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryNodeAddedMessage.collectGridNodeData in interface GridComponentdataBag - container object to store discovery data in.public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
onGridDataReceived in interface GridComponentdata - DiscoveryDataBag.GridDiscoveryData interface to retrieve discovery data collected on remote nodes
(data common for all nodes in grid and specific for each node).public void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)
onJoiningNodeDataReceived in interface GridComponentdata - DiscoveryDataBag.JoiningNodeDiscoveryData interface to retrieve discovery data of joining node.public void start()
throws IgniteCheckedException
start in interface GridComponentIgniteCheckedException - Throws in case of any errors.public void stop(boolean cancel)
throws IgniteCheckedException
stop in interface GridComponentcancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.IgniteCheckedException - Thrown in case of any errors.protected final void assertParameter(boolean cond,
String condDesc)
throws IgniteCheckedException
false.cond - Assertion condition to check.condDesc - Description of failed condition. Note that this description should include
JavaBean name of the property (not a variable name) as well condition in
Java syntax like, for example:
...
assertParameter(dirPath != null, "dirPath != null");
...
Note that in case when variable name is the same as JavaBean property you
can just copy Java condition expression into description as a string.IgniteCheckedException - Thrown if given condition is falsepublic void printMemoryStats()
printMemoryStats in interface GridComponent@Nullable public @Nullable IgniteNodeValidationResult validateNode(ClusterNode node)
validateNode in interface GridComponentnode - Joining node.null in case of success.@Nullable public @Nullable IgniteNodeValidationResult validateNode(ClusterNode node, DiscoveryDataBag.JoiningNodeDiscoveryData discoData)
validateNode in interface GridComponentnode - Joining node.discoData - Joining node discovery data.null in case of success.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021