@IgniteSpiMultipleInstancesSupport(value=true) @DiscoverySpiHistorySupport(value=true) @DiscoverySpiOrderSupport(value=true) public class IsolatedDiscoverySpi extends IgniteSpiAdapter implements org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
ignite, igniteInstanceName, log
Constructor and Description |
---|
IsolatedDiscoverySpi() |
Modifier and Type | Method and Description |
---|---|
boolean |
allNodesSupport(org.apache.ignite.internal.IgniteFeatures feature) |
void |
clientReconnect() |
boolean |
clientReconnectSupported() |
Serializable |
consistentId()
Gets consistent ID.
|
void |
disconnect()
Tells discovery SPI to disconnect from topology.
|
void |
failNode(UUID nodeId,
@Nullable String warning)
Initiates failure of provided node.
|
long |
getGridStartTime()
Gets start time of the very first node in the grid.
|
ClusterNode |
getLocalNode()
Gets local node.
|
ClusterNode |
getNode(UUID nodeId)
Gets node by ID.
|
Collection<ClusterNode> |
getRemoteNodes()
Gets collection of remote nodes in grid or empty collection if no remote nodes found.
|
protected void |
injectResources(Ignite ignite)
Inject ignite instance.
|
boolean |
isClientMode()
Whether or not discovery is started in client mode.
|
boolean |
knownNode(UUID nodeId) |
protected void |
onContextInitialized0(IgniteSpiContext spiCtx)
Method to be called in the end of onContextInitialized method.
|
boolean |
pingNode(UUID nodeId)
Pings the remote node to see if it's alive.
|
void |
resolveCommunicationFailure(ClusterNode node,
Exception err) |
void |
sendCustomEvent(DiscoverySpiCustomMessage msg)
Sends custom message across the ring.
|
void |
setAuthenticator(DiscoverySpiNodeAuthenticator auth)
Sets discovery SPI node authenticator.
|
void |
setDataExchange(DiscoverySpiDataExchange exchange)
Sets a handler for initial data exchange between Ignite nodes.
|
void |
setInternalListener(org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpiInternalListener lsnr)
For TESTING only.
|
void |
setListener(@Nullable DiscoverySpiListener lsnr)
Sets a listener for discovery events.
|
void |
setMetricsProvider(DiscoveryMetricsProvider metricsProvider)
Sets discovery metrics provider.
|
void |
setNodeAttributes(Map<String,Object> attrs,
IgniteProductVersion ver)
Sets node attributes and node version which will be distributed in grid during
join process.
|
void |
simulateNodeFailure()
For TESTING only.
|
void |
spiStart(@Nullable String igniteInstanceName)
This method is called to start SPI.
|
void |
spiStop()
This method is called to stop SPI.
|
boolean |
supportsCommunicationFailureResolve() |
addTimeoutObject, assertParameter, checkConfigurationConsistency0, clientFailureDetectionTimeout, configInfo, createSpiAttributeName, failureDetectionTimeout, failureDetectionTimeoutEnabled, failureDetectionTimeoutEnabled, getConsistentAttributeNames, getExceptionRegistry, getName, getNodeAttributes, getSpiContext, ignite, initFailureDetectionTimeout, injectables, isNodeStopping, onBeforeStart, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextDestroyed0, onContextInitialized, registerMBean, removeTimeoutObject, setName, started, startInfo, startStopwatch, stopInfo, unregisterMBean
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getNodeAttributes, onClientDisconnected, onClientReconnected, onContextDestroyed, onContextInitialized
public Serializable consistentId() throws IgniteSpiException
consistentId
in interface DiscoverySpi
null
if not applicable.IgniteSpiException
- If failed.public Collection<ClusterNode> getRemoteNodes()
getRemoteNodes
in interface DiscoverySpi
public ClusterNode getLocalNode()
getLocalNode
in interface DiscoverySpi
getLocalNode
in class IgniteSpiAdapter
public ClusterNode getNode(UUID nodeId)
getNode
in interface DiscoverySpi
nodeId
- Node ID.null
if node is not found.public boolean pingNode(UUID nodeId)
pingNode
in interface DiscoverySpi
nodeId
- Node Id.true
if node alive, false
otherwise.public void setNodeAttributes(Map<String,Object> attrs, IgniteProductVersion ver)
setNodeAttributes
in interface DiscoverySpi
attrs
- Map of node attributes.ver
- Product version.public void setListener(@Nullable @Nullable DiscoverySpiListener lsnr)
DiscoveryEvent
for a set of all possible
discovery events.
TODO: This method should be removed from public API in Apache Ignite 3.0
setListener
in interface DiscoverySpi
lsnr
- Listener to discovery events or null
to unset the listener.public void setDataExchange(DiscoverySpiDataExchange exchange)
setDataExchange
in interface DiscoverySpi
exchange
- Discovery data exchange handler.public void setMetricsProvider(DiscoveryMetricsProvider metricsProvider)
DiscoveryMetricsProvider.metrics()
method to exchange
dynamic metrics between nodes.setMetricsProvider
in interface DiscoverySpi
metricsProvider
- Provider of metrics data.public void disconnect() throws IgniteSpiException
IgniteSpi.spiStop()
with accounting that it is not a full stop,
but disconnect due to segmentation.disconnect
in interface DiscoverySpi
IgniteSpiException
- If any error occurs.public void setAuthenticator(DiscoverySpiNodeAuthenticator auth)
setAuthenticator
in interface DiscoverySpi
auth
- Discovery SPI authenticator.public long getGridStartTime()
getGridStartTime
in interface DiscoverySpi
0
if SPI implementation
does not support this method.public void sendCustomEvent(DiscoverySpiCustomMessage msg) throws IgniteException
sendCustomEvent
in interface DiscoverySpi
msg
- Custom message.IgniteException
- if failed to sent the event message.public void failNode(UUID nodeId, @Nullable @Nullable String warning)
failNode
in interface DiscoverySpi
nodeId
- Node ID.warning
- Warning to be shown on all cluster nodes.public boolean isClientMode() throws IllegalStateException
isClientMode
in interface DiscoverySpi
true
if node is in client mode.IllegalStateException
- If discovery SPI has not started.public void spiStart(@Nullable @Nullable String igniteInstanceName) throws IgniteSpiException
spiStart
in interface IgniteSpi
igniteInstanceName
- Name of Ignite instance this SPI is being started for
(null
for default Ignite instance).IgniteSpiException
- Throws in case of any error during SPI start.public void spiStop() throws IgniteSpiException
Note that this method can be called at any point including during recovery of failed start. It should make no assumptions on what state SPI will be in when this method is called.
spiStop
in interface IgniteSpi
IgniteSpiException
- Thrown in case of any error during SPI stop.protected void onContextInitialized0(IgniteSpiContext spiCtx) throws IgniteSpiException
onContextInitialized0
in class IgniteSpiAdapter
spiCtx
- SPI context.IgniteSpiException
- In case of errors.public boolean knownNode(UUID nodeId)
knownNode
in interface org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
nodeId
- Node ID.True
if node joining or already joined topology.public boolean clientReconnectSupported()
clientReconnectSupported
in interface org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
True
if SPI supports client reconnect.public void clientReconnect()
clientReconnect
in interface org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
protected void injectResources(Ignite ignite)
injectResources
in class IgniteSpiAdapter
ignite
- Ignite instance.public boolean allNodesSupport(org.apache.ignite.internal.IgniteFeatures feature)
allNodesSupport
in interface org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
feature
- Feature to check.true
if all nodes support the given feature.public void simulateNodeFailure()
simulateNodeFailure
in interface org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
public void setInternalListener(org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpiInternalListener lsnr)
setInternalListener
in interface org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
lsnr
- Listener.public boolean supportsCommunicationFailureResolve()
supportsCommunicationFailureResolve
in interface org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
True
if supports communication error resolve.public void resolveCommunicationFailure(ClusterNode node, Exception err)
resolveCommunicationFailure
in interface org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi
node
- Problem node.err
- Connection error.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023