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. |
Serializable |
collectDiscoveryData(UUID nodeId)
Gets discovery data object that will be sent to new node
during discovery process.
|
GridComponent.DiscoveryDataExchangeType |
discoveryDataType()
Gets unique component type to distinguish components providing discovery data.
|
void |
onDiscoveryDataReceived(UUID joiningNodeId,
UUID rmtNodeId,
Serializable data)
Receives discovery data object from remote nodes (called
on new node during discovery process).
|
void |
onKernalStart()
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.
|
void |
printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.).
|
void |
start()
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()
throws IgniteCheckedException
onKernalStart in interface GridComponentIgniteCheckedException - Thrown in case of any errors.public void onKernalStop(boolean cancel)
onKernalStop in interface GridComponentcancel - Flag indicating whether jobs should be canceled.@Nullable public GridComponent.DiscoveryDataExchangeType discoveryDataType()
GridComponent.collectDiscoveryData(UUID).discoveryDataType in interface GridComponent@Nullable public Serializable collectDiscoveryData(UUID nodeId)
collectDiscoveryData in interface GridComponentnodeId - ID of new node that joins topology.null if there is nothing
to send for this component.public void onDiscoveryDataReceived(UUID joiningNodeId, UUID rmtNodeId, Serializable data)
onDiscoveryDataReceived in interface GridComponentjoiningNodeId - Joining node ID.rmtNodeId - Remote node ID for which data is provided.data - Discovery data object or null if nothing waspublic 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 IgniteNodeValidationResult validateNode(ClusterNode node)
validateNode in interface GridComponentnode - Joining node.null in case of success.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.1.0-incubating Release Date : May 20 2015