public abstract class GridProcessorAdapter extends Object implements GridProcessor
GridComponent.DiscoveryDataExchangeType
Modifier and Type | Field and Description |
---|---|
protected GridKernalContext |
ctx
Kernal context.
|
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. |
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 activeOnStart)
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(boolean activeOnStart)
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
String |
toString() |
IgniteNodeValidationResult |
validateNode(ClusterNode node)
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
protected GridProcessorAdapter(GridKernalContext ctx)
ctx
- Kernal context.public void onKernalStart(boolean activeOnStart) throws IgniteCheckedException
onKernalStart
in interface GridComponent
IgniteCheckedException
- Thrown in case of any errors.public void onKernalStop(boolean cancel)
onKernalStop
in interface GridComponent
cancel
- Flag indicating whether jobs should be canceled.public void onDisconnected(IgniteFuture<?> reconnectFut) throws IgniteCheckedException
onDisconnected
in interface GridComponent
reconnectFut
- Reconnect future.IgniteCheckedException
- If failed.public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted) throws IgniteCheckedException
onReconnected
in interface GridComponent
clusterRestarted
- Cluster restarted flag.IgniteCheckedException
- If failed.@Nullable public GridComponent.DiscoveryDataExchangeType discoveryDataType()
GridComponent.collectJoiningNodeData(DiscoveryDataBag)
or GridComponent.collectGridNodeData(DiscoveryDataBag)
.discoveryDataType
in interface GridComponent
public void collectJoiningNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryJoinRequestMessage
request.collectJoiningNodeData
in interface GridComponent
dataBag
- container object to store discovery data in.public void collectGridNodeData(DiscoveryDataBag dataBag)
TcpDiscoveryNodeAddedMessage
.collectGridNodeData
in interface GridComponent
dataBag
- container object to store discovery data in.public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)
onGridDataReceived
in interface GridComponent
data
- 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 GridComponent
data
- DiscoveryDataBag.JoiningNodeDiscoveryData
interface to retrieve discovery data of joining node.public void start(boolean activeOnStart) throws IgniteCheckedException
start
in interface GridComponent
IgniteCheckedException
- Throws in case of any errors.public void stop(boolean cancel) throws IgniteCheckedException
stop
in interface GridComponent
cancel
- 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 false
public void printMemoryStats()
printMemoryStats
in interface GridComponent
@Nullable public IgniteNodeValidationResult validateNode(ClusterNode node)
validateNode
in interface GridComponent
node
- Joining node.null
in case of success.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.0.0 Release Date : April 30 2017