public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
GridComponent.DiscoveryDataExchangeType| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_DISCOVERY_HISTORY_SIZE |
static String |
DISCO_METRICS
Name of the discovery metrics registry.
|
static String |
NODES_SYS_VIEW |
static String |
NODES_SYS_VIEW_DESC |
ctx, log| Constructor and Description |
|---|
GridDiscoveryManager(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
ackTopology(long topVer,
int evtType,
ClusterNode evtNode)
Prints the latest topology info into log taking into account logging/verbosity settings.
|
void |
addCacheGroup(CacheGroupDescriptor grpDesc,
IgnitePredicate<ClusterNode> filter,
CacheMode cacheMode) |
boolean |
addClientNode(String cacheName,
UUID clientNodeId,
boolean nearEnabled)
Adds near node ID to cache filter.
|
void |
addLocalNodeInitializedEventListener(IgniteInClosure<ClusterNode> lsnr)
Adds a listener for local node initialized event.
|
boolean |
alive(ClusterNode node) |
boolean |
alive(UUID nodeId) |
boolean |
aliveAll(@Nullable Collection<UUID> nodeIds) |
Collection<ClusterNode> |
aliveServerNodes() |
Collection<ClusterNode> |
allNodes() |
@Nullable List<? extends BaselineNode> |
baselineNodes(AffinityTopologyVersion topVer) |
boolean |
cacheAffinityNode(ClusterNode node,
String cacheName)
Checks if node is a data node for the given cache.
|
boolean |
cacheClientNode(ClusterNode node,
String cacheName) |
boolean |
cacheGroupAffinityNode(ClusterNode node,
int grpId)
Checks if node is a data node for the given cache group.
|
Collection<ClusterNode> |
cacheGroupAffinityNodes(int grpId,
AffinityTopologyVersion topVer)
Gets cache nodes for cache with given ID that participate in affinity calculation.
|
boolean |
cacheNearNode(ClusterNode node,
String cacheName) |
boolean |
cacheNode(ClusterNode node,
String cacheName) |
List<ClusterNode> |
cacheNodes(@Nullable String cacheName,
AffinityTopologyVersion topVer)
Gets cache nodes for cache with given name.
|
void |
cleanCachesAndGroups() |
void |
clientCacheStartEvent(UUID reqId,
@Nullable Map<String,DynamicCacheChangeRequest> startReqs,
@Nullable Set<String> cachesToClose) |
Map<String,Map<UUID,Boolean>> |
clientNodesMap()
Called from discovery thread.
|
boolean |
communicationErrorResolveSupported() |
Serializable |
consistentId()
Deprecated.
Use
ClusterNode.consistentId() of local node to get actual consistent ID. |
Map<UUID,Short> |
consistentId(AffinityTopologyVersion topVer)
Gets consistentId from history for given topology version.
|
void |
consistentId(Serializable consistentId)
Sets TCP local node consistent ID.
|
DiscoCache |
createDiscoCacheOnCacheChange(AffinityTopologyVersion topVer,
DiscoCache discoCache)
Creates discovery cache after
DynamicCacheChangeBatch received. |
DiscoveryMetricsProvider |
createMetricsProvider() |
Collection<ClusterNode> |
daemonNodes() |
DiscoCache |
discoCache()
Gets discovery collection cache from SPI safely guarding against "floating" collections.
|
DiscoCache |
discoCache(AffinityTopologyVersion topVer)
Gets discovery collection cache from SPI safely guarding against "floating" collections.
|
void |
failNode(UUID nodeId,
@Nullable String warning) |
@Nullable ClusterNode |
getAlive(UUID nodeId) |
DiscoverySpi |
getInjectedDiscoverySpi()
Performs injection of discovery SPI if needed, then provides DiscoverySpi SPI.
|
long |
gridStartTime()
Gets first grid node start time, see
DiscoverySpi.getGridStartTime(). |
ClusterNode |
historicalNode(UUID nodeId)
Resolves by ID cluster node which is alive or has recently left the cluster.
|
static void |
initCommunicationErrorResolveConfiguration(IgniteConfiguration cfg) |
DiscoveryLocalJoinData |
localJoin() |
DiscoveryEvent |
localJoinEvent() |
GridFutureAdapter<DiscoveryLocalJoinData> |
localJoinFuture() |
ClusterNode |
localNode() |
void |
metricsUpdateEvent(DiscoCache discoCache,
ClusterNode node)
Adds metrics update event to discovery worker queue.
|
boolean |
mutableCustomMessages() |
ClusterNode |
node(AffinityTopologyVersion topVer,
UUID id)
Gets node from history for given topology version.
|
@Nullable ClusterNode |
node(UUID nodeId) |
Map<Short,UUID> |
nodeIdMap(AffinityTopologyVersion topVer)
Gets consistentId from history for given topology version.
|
Map<String,CacheConfiguration> |
nodePublicCaches(ClusterNode node) |
Collection<ClusterNode> |
nodes(AffinityTopologyVersion topVer)
Gets all nodes for given topology version.
|
Collection<ClusterNode> |
nodes(@Nullable Collection<UUID> ids,
IgnitePredicate<UUID>... p)
Gets collection of node for given node IDs and predicates.
|
Collection<ClusterNode> |
nodes(long topVer)
Gets all nodes for given topology version.
|
@Nullable ClusterNode |
oldestAliveServerNode(AffinityTopologyVersion topVer) |
void |
onBeforeSpiStart()
This method executed before manager will start SPI.
|
boolean |
onClientCacheClose(String cacheName,
UUID clientNodeId)
Called from discovery thread.
|
protected void |
onKernalStart0() |
void |
onKernalStop0(boolean cancel) |
boolean |
pingNode(UUID nodeId) |
boolean |
pingNodeNoError(UUID nodeId) |
void |
reconnect()
Leave cluster and try to join again.
|
boolean |
reconnectSupported() |
Collection<ClusterNode> |
remoteAliveNodesWithCaches(AffinityTopologyVersion topVer)
Gets cache remote nodes for cache with given name.
|
Collection<ClusterNode> |
remoteNodes() |
void |
removeCacheFilter(String cacheName)
Called from discovery thread.
|
void |
removeCacheGroup(CacheGroupDescriptor grpDesc) |
void |
resolveCommunicationError(ClusterNode node,
Exception err) |
void |
sendCustomEvent(DiscoveryCustomMessage msg) |
List<ClusterNode> |
serverNodes(AffinityTopologyVersion topVer) |
Collection<ClusterNode> |
serverTopologyNodes(long topVer)
Gets server nodes topology by specified version from snapshots history storage.
|
void |
setCacheFilter(int cacheId,
int grpId,
String cacheName,
boolean nearEnabled)
Called from discovery thread.
|
<T extends DiscoveryCustomMessage> |
setCustomEventListener(Class<T> msgCls,
CustomEventListener<T> lsnr) |
int |
size() |
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
@Nullable Collection<ClusterNode> |
topology(long topVer)
Gets topology by specified version from history storage.
|
IgniteInternalFuture<Long> |
topologyFuture(long awaitVer)
Gets future that will be completed when current topology version becomes greater or equal to argument passed.
|
long |
topologyVersion() |
AffinityTopologyVersion |
topologyVersionEx() |
boolean |
tryFailNode(UUID nodeId,
@Nullable String warning) |
assertParameter, collectGridNodeData, collectJoiningNodeData, discoveryDataType, enabled, getSpi, getSpi, getSpis, inject, onAfterSpiStart, onDisconnected, onGridDataReceived, onJoiningNodeDataReceived, onKernalStart, onKernalStop, onReconnected, printMemoryStats, startInfo, startSpi, stopInfo, stopSpi, toString, validateNode, validateNodepublic static final String NODES_SYS_VIEW
public static final String NODES_SYS_VIEW_DESC
public static final int DFLT_DISCOVERY_HISTORY_SIZE
public static final String DISCO_METRICS
public GridDiscoveryManager(GridKernalContext ctx)
ctx - Context.public void onBeforeSpiStart()
onBeforeSpiStart in interface GridManageronBeforeSpiStart in class GridManagerAdapter<DiscoverySpi>public void cleanCachesAndGroups()
public void addCacheGroup(CacheGroupDescriptor grpDesc, IgnitePredicate<ClusterNode> filter, CacheMode cacheMode)
grpDesc - Cache group descriptor.filter - Node filter.cacheMode - Cache mode.public void removeCacheGroup(CacheGroupDescriptor grpDesc)
grpDesc - Cache group descriptor.public void setCacheFilter(int cacheId,
int grpId,
String cacheName,
boolean nearEnabled)
cacheId - Cache ID.grpId - Cache group ID.cacheName - Cache name.nearEnabled - Near enabled flag.public void removeCacheFilter(String cacheName)
cacheName - Cache name.public boolean addClientNode(String cacheName, UUID clientNodeId, boolean nearEnabled)
cacheName - Cache name.clientNodeId - Near node ID.nearEnabled - Near enabled flag.True if new node ID was added.public boolean onClientCacheClose(String cacheName, UUID clientNodeId)
cacheName - Cache name.clientNodeId - Near node ID.True if existing node ID was removed.public Map<String,Map<UUID,Boolean>> clientNodesMap()
protected void onKernalStart0()
throws IgniteCheckedException
onKernalStart0 in class GridManagerAdapter<DiscoverySpi>IgniteCheckedException - If failed.public void start()
throws IgniteCheckedException
IgniteCheckedException - Throws in case of any errors.public <T extends DiscoveryCustomMessage> void setCustomEventListener(Class<T> msgCls, CustomEventListener<T> lsnr)
msgCls - Message class.lsnr - Custom event listener.public void addLocalNodeInitializedEventListener(IgniteInClosure<ClusterNode> lsnr)
lsnr - Listener to add.public DiscoveryMetricsProvider createMetricsProvider()
public void ackTopology(long topVer,
int evtType,
ClusterNode evtNode)
topVer - Topology version.evtType - Event type.evtNode - Event node.public void onKernalStop0(boolean cancel)
onKernalStop0 in class GridManagerAdapter<DiscoverySpi>cancel - Cancel flag.public void stop(boolean cancel)
throws IgniteCheckedException
cancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.IgniteCheckedException - Thrown in case of any errors.public boolean aliveAll(@Nullable
@Nullable Collection<UUID> nodeIds)
nodeIds - Node IDs to check.True if at least one ID belongs to an alive node.public boolean alive(UUID nodeId)
nodeId - Node ID.True if node for given ID is alive.@Nullable public @Nullable ClusterNode getAlive(UUID nodeId)
nodeId - Node ID.public boolean alive(ClusterNode node)
node - Node.True if node is alive.public boolean pingNode(UUID nodeId) throws IgniteClientDisconnectedCheckedException
nodeId - ID of the node.True if ping succeeded.IgniteClientDisconnectedCheckedException - If ping failed.public boolean pingNodeNoError(UUID nodeId)
nodeId - ID of the node.True if ping succeeded.@Nullable public @Nullable ClusterNode node(UUID nodeId)
nodeId - ID of the node.public Collection<ClusterNode> nodes(@Nullable @Nullable Collection<UUID> ids, IgnitePredicate<UUID>... p)
ids - Ids to include.p - Filter for IDs.public IgniteInternalFuture<Long> topologyFuture(long awaitVer)
awaitVer - Topology version to await.public DiscoCache discoCache()
public DiscoCache discoCache(AffinityTopologyVersion topVer)
public Collection<ClusterNode> remoteNodes()
public Collection<ClusterNode> allNodes()
public Collection<ClusterNode> aliveServerNodes()
public int size()
public Collection<ClusterNode> nodes(long topVer)
topVer - Topology version.public Collection<ClusterNode> nodes(AffinityTopologyVersion topVer)
topVer - Topology version.public List<ClusterNode> serverNodes(AffinityTopologyVersion topVer)
topVer - Topology version.@Nullable public @Nullable List<? extends BaselineNode> baselineNodes(AffinityTopologyVersion topVer)
topVer - Topology version.null if baseline was not set for the
given topology version.public ClusterNode node(AffinityTopologyVersion topVer, UUID id)
topVer - Topology version.id - Node ID.public Map<UUID,Short> consistentId(AffinityTopologyVersion topVer)
topVer - Topology version.public Map<Short,UUID> nodeIdMap(AffinityTopologyVersion topVer)
topVer - Topology version.public List<ClusterNode> cacheNodes(@Nullable @Nullable String cacheName, AffinityTopologyVersion topVer)
cacheName - Cache name.topVer - Topology version.public Collection<ClusterNode> remoteAliveNodesWithCaches(AffinityTopologyVersion topVer)
topVer - Topology version.@Nullable public @Nullable ClusterNode oldestAliveServerNode(AffinityTopologyVersion topVer)
topVer - Topology version (maximum allowed node order).public Collection<ClusterNode> cacheGroupAffinityNodes(int grpId, AffinityTopologyVersion topVer)
grpId - Cache group ID.topVer - Topology version.public boolean cacheAffinityNode(ClusterNode node, String cacheName)
node - Node to check.cacheName - Cache name.True if node is a cache data node.public boolean cacheGroupAffinityNode(ClusterNode node, int grpId)
node - Node to check.grpId - Cache group ID.True if node is a cache data node.public boolean cacheNearNode(ClusterNode node, String cacheName)
node - Node to check.cacheName - Cache name.True if node has near cache enabled.public boolean cacheClientNode(ClusterNode node, String cacheName)
node - Node to check.cacheName - Cache name.True if node has client cache (without near cache).public boolean cacheNode(ClusterNode node, String cacheName)
node - Node to check.cacheName - Cache name.public Map<String,CacheConfiguration> nodePublicCaches(ClusterNode node)
node - Node to check.@Nullable public @Nullable Collection<ClusterNode> topology(long topVer)
topVer - Topology version.null if there are no nodes for passed in version.public Collection<ClusterNode> serverTopologyNodes(long topVer)
topVer - Topology version.public Collection<ClusterNode> daemonNodes()
public ClusterNode localNode()
@Deprecated public Serializable consistentId()
ClusterNode.consistentId() of local node to get actual consistent ID.public DiscoverySpi getInjectedDiscoverySpi()
public void consistentId(Serializable consistentId)
consistentId - New value of consistent ID to be used in local node initializationpublic long topologyVersion()
public AffinityTopologyVersion topologyVersionEx()
public DiscoveryEvent localJoinEvent()
public DiscoveryLocalJoinData localJoin()
public GridFutureAdapter<DiscoveryLocalJoinData> localJoinFuture()
public void sendCustomEvent(DiscoveryCustomMessage msg) throws IgniteCheckedException
msg - Custom message.IgniteCheckedException - If failed.public void clientCacheStartEvent(UUID reqId, @Nullable @Nullable Map<String,DynamicCacheChangeRequest> startReqs, @Nullable @Nullable Set<String> cachesToClose)
reqId - Start request ID.startReqs - Cache start requests.cachesToClose - Cache to close.public void metricsUpdateEvent(DiscoCache discoCache, ClusterNode node)
discoCache - Discovery cache.node - Event node.public long gridStartTime()
DiscoverySpi.getGridStartTime().public boolean tryFailNode(UUID nodeId, @Nullable @Nullable String warning)
nodeId - Node ID.warning - Warning message to be shown on all nodes.public void failNode(UUID nodeId, @Nullable @Nullable String warning)
nodeId - Node ID to fail.warning - Warning message to be shown on all nodes.public boolean reconnectSupported()
True if local node client and discovery SPI supports reconnect.public void reconnect()
IgniteSpiException - If failed.public static void initCommunicationErrorResolveConfiguration(IgniteConfiguration cfg) throws IgniteCheckedException
cfg - Configuration.IgniteCheckedException - If configuration is not valid.public boolean communicationErrorResolveSupported()
True if communication error resolve is supported.public boolean mutableCustomMessages()
True if configured DiscoverySpi supports mutable custom messages.public void resolveCommunicationError(ClusterNode node, Exception err)
node - Problem node.err - Error.public ClusterNode historicalNode(UUID nodeId)
nodeId - Node id.null if node not found.public DiscoCache createDiscoCacheOnCacheChange(AffinityTopologyVersion topVer, DiscoCache discoCache)
DynamicCacheChangeBatch received.topVer - Topology version.discoCache - Current disco cache.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021