T - SPI wrapped by this manager.public abstract class GridManagerAdapter<T extends IgniteSpi> extends Object implements GridManager
GridComponent.DiscoveryDataExchangeType| Modifier and Type | Field and Description |
|---|---|
protected GridKernalContext |
ctx
Kernal context.
|
protected IgniteLogger |
log
Logger.
|
| Modifier | Constructor and Description |
|---|---|
protected |
GridManagerAdapter(GridKernalContext ctx,
T... spis) |
| 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.
|
boolean |
enabled() |
protected T |
getSpi()
Gets wrapped SPI.
|
protected T |
getSpi(@Nullable String name) |
protected T[] |
getSpis() |
protected void |
inject()
Injects resources to SPI.
|
void |
onAfterSpiStart()
This method executed after manager started SPI.
|
void |
onBeforeSpiStart()
This method executed before manager will start SPI.
|
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.
|
protected void |
onKernalStart0() |
void |
onKernalStop(boolean cancel)
Callback to notify that kernal is about to stop.
|
protected void |
onKernalStop0(boolean cancel) |
IgniteInternalFuture<?> |
onReconnected(boolean clusterRestarted)
Client reconnected callback.
|
void |
printMemoryStats()
Prints memory statistics (sizes of internal structures, etc.).
|
protected String |
startInfo() |
protected void |
startSpi()
Starts wrapped SPI.
|
protected String |
stopInfo() |
protected void |
stopSpi()
Stops wrapped SPI.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitstart, stop@GridToStringExclude protected final GridKernalContext ctx
@GridToStringExclude protected final IgniteLogger log
protected GridManagerAdapter(GridKernalContext ctx, T... spis)
ctx - Kernal context.spis - Specific SPI instance.protected final T getSpi()
protected final T getSpi(@Nullable @Nullable String name)
name - SPI namenull or empty, then 1st SPI on the list
is returned.public boolean enabled()
enabled in interface GridManagertrue if at least one SPI does not have a NO-OP implementation, false otherwise.protected final T[] getSpis()
public void onBeforeSpiStart()
onBeforeSpiStart in interface GridManagerpublic void onAfterSpiStart()
onAfterSpiStart in interface GridManagerpublic 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.protected void inject()
throws IgniteCheckedException
IgniteCheckedException - If failed.protected final void startSpi()
throws IgniteCheckedException
IgniteCheckedException - If wrapped SPI could not be started.protected final void stopSpi()
throws IgniteCheckedException
IgniteCheckedException - If underlying SPI could not be stopped.protected final String startInfo()
protected final String stopInfo()
public final 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 final void onKernalStop(boolean cancel)
onKernalStop in interface GridComponentcancel - Flag indicating whether jobs should be canceled.@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.protected void onKernalStart0()
throws IgniteCheckedException
IgniteCheckedException - If failed.protected void onKernalStop0(boolean cancel)
cancel - Cancel flag.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