public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
GridComponent.DiscoveryDataExchangeType| Modifier and Type | Field and Description |
|---|---|
protected static int |
DISCOVERY_HISTORY_SIZE
Discovery cached history size.
|
ctx, log| Constructor and Description |
|---|
GridDiscoveryManager(GridKernalContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
ackTopology()
Prints the latest topology info into log taking into account logging/verbosity settings.
|
boolean |
addClientNode(String cacheName,
UUID clientNodeId,
boolean nearEnabled)
Adds near node ID to cache filter.
|
boolean |
alive(ClusterNode node) |
boolean |
alive(UUID nodeId) |
boolean |
aliveAll(Collection<UUID> nodeIds) |
Collection<ClusterNode> |
aliveCacheNodes(String cacheName,
AffinityTopologyVersion topVer)
Gets cache nodes for cache with given name.
|
Collection<ClusterNode> |
aliveNodesWithCaches(AffinityTopologyVersion topVer)
Gets alive nodes with at least one cache configured.
|
Collection<ClusterNode> |
aliveRemoteCacheNodes(String cacheName,
AffinityTopologyVersion topVer)
Gets cache remote nodes for cache with given name.
|
Collection<ClusterNode> |
aliveRemoteServerNodesWithCaches(AffinityTopologyVersion topVer)
Gets alive remote server nodes with at least one cache configured.
|
Collection<ClusterNode> |
aliveServerNodesWithCaches(AffinityTopologyVersion topVer)
Gets alive server nodes with at least one cache configured.
|
Collection<ClusterNode> |
allNodes() |
boolean |
cacheAffinityNode(ClusterNode node,
String cacheName)
Checks if node is a data node for the given cache.
|
Collection<ClusterNode> |
cacheAffinityNodes(String cacheName,
AffinityTopologyVersion topVer)
Gets cache nodes for cache with given name that participate in affinity calculation.
|
boolean |
cacheClientNode(ClusterNode node,
String cacheName) |
boolean |
cacheNearNode(ClusterNode node,
String cacheName) |
boolean |
cacheNode(ClusterNode node,
String cacheName) |
Collection<ClusterNode> |
cacheNodes(AffinityTopologyVersion topVer)
Gets all nodes with at least one cache configured.
|
Collection<ClusterNode> |
cacheNodes(String cacheName,
AffinityTopologyVersion topVer)
Gets cache nodes for cache with given name.
|
Map<String,Map<UUID,Boolean>> |
clientNodesMap() |
Collection<ClusterNode> |
daemonNodes() |
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.DiscoCache |
discoCache()
Gets discovery collection cache from SPI safely guarding against "floating" collections.
|
org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.DiscoCache |
discoCache(AffinityTopologyVersion topVer)
Gets discovery collection cache from SPI safely guarding against "floating" collections.
|
void |
failNode(UUID nodeId,
String warning) |
ClusterNode |
getAlive(UUID nodeId) |
long |
gridStartTime()
Gets first grid node start time, see
DiscoverySpi.getGridStartTime(). |
boolean |
hasNearCache(String cacheName,
AffinityTopologyVersion topVer)
Checks if cache with given name has at least one node with near cache enabled.
|
DiscoveryEvent |
localJoinEvent() |
ClusterNode |
localNode() |
GridLocalMetrics |
metrics() |
ClusterNode |
node(UUID nodeId) |
Collection<ClusterNode> |
nodes(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.
|
void |
onBeforeSpiStart()
This method executed before manager will start SPI.
|
boolean |
onClientCacheClose(String cacheName,
UUID clientNodeId)
Removes near node ID from cache filter.
|
protected void |
onKernalStart0() |
void |
onKernalStop0(boolean cancel) |
boolean |
pingNode(UUID nodeId) |
boolean |
pingNodeNoError(UUID nodeId) |
Collection<ClusterNode> |
remoteCacheNodes(AffinityTopologyVersion topVer)
Gets cache remote nodes for cache with given name.
|
Collection<ClusterNode> |
remoteCacheNodes(String cacheName,
AffinityTopologyVersion topVer)
Gets cache remote nodes for cache with given name.
|
Collection<ClusterNode> |
remoteNodes() |
void |
removeCacheFilter(String cacheName)
Removes dynamic cache filter.
|
void |
sendCustomEvent(DiscoveryCustomMessage msg) |
void |
setCacheFilter(String cacheName,
IgnitePredicate<ClusterNode> filter,
boolean nearEnabled,
boolean loc)
Adds dynamic cache filter.
|
<T extends DiscoveryCustomMessage> |
setCustomEventListener(Class<T> msgCls,
CustomEventListener<T> lsnr) |
int |
size() |
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
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 |
topologyHash(Iterable<? extends ClusterNode> nodes)
Gets topology hash for given set of nodes.
|
long |
topologyVersion() |
AffinityTopologyVersion |
topologyVersionEx() |
NavigableMap<IgniteProductVersion,Collection<ClusterNode>> |
topologyVersionMap()
Gets topology grouped by node versions.
|
boolean |
tryFailNode(UUID nodeId,
String warning) |
assertParameter, collectDiscoveryData, discoveryDataType, enabled, getSpi, getSpi, getSpis, onAfterSpiStart, onDisconnected, onDiscoveryDataReceived, onKernalStart, onKernalStop, onReconnected, printMemoryStats, startInfo, startSpi, stopInfo, stopSpi, toString, validateNodeprotected static final int DISCOVERY_HISTORY_SIZE
public GridDiscoveryManager(GridKernalContext ctx)
ctx - Context.public void onBeforeSpiStart()
onBeforeSpiStart in interface GridManageronBeforeSpiStart in class GridManagerAdapter<DiscoverySpi>public void setCacheFilter(String cacheName, IgnitePredicate<ClusterNode> filter, boolean nearEnabled, boolean loc)
cacheName - Cache name.filter - Cache filter.nearEnabled - Near enabled flag.loc - True if cache is local.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.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 GridLocalMetrics metrics()
public void ackTopology()
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 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 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 ClusterNode node(UUID nodeId)
nodeId - ID of the node.public Collection<ClusterNode> nodes(@Nullable Collection<UUID> ids, IgnitePredicate<UUID>... p)
ids - Ids to include.p - Filter for IDs.public long topologyHash(Iterable<? extends ClusterNode> nodes)
nodes - Subset of grid nodes for hashing.public IgniteInternalFuture<Long> topologyFuture(long awaitVer)
awaitVer - Topology version to await.public org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.DiscoCache discoCache()
public org.apache.ignite.internal.managers.discovery.GridDiscoveryManager.DiscoCache discoCache(AffinityTopologyVersion topVer)
public Collection<ClusterNode> remoteNodes()
public Collection<ClusterNode> allNodes()
public NavigableMap<IgniteProductVersion,Collection<ClusterNode>> topologyVersionMap()
public int size()
public Collection<ClusterNode> nodes(long topVer)
topVer - Topology version.public Collection<ClusterNode> cacheNodes(@Nullable String cacheName, AffinityTopologyVersion topVer)
cacheName - Cache name.topVer - Topology version.public Collection<ClusterNode> cacheNodes(AffinityTopologyVersion topVer)
topVer - Topology version.public Collection<ClusterNode> remoteCacheNodes(@Nullable String cacheName, AffinityTopologyVersion topVer)
cacheName - Cache name.topVer - Topology version.public Collection<ClusterNode> remoteCacheNodes(AffinityTopologyVersion topVer)
topVer - Topology version.public Collection<ClusterNode> aliveCacheNodes(@Nullable String cacheName, AffinityTopologyVersion topVer)
cacheName - Cache name.topVer - Topology version.public Collection<ClusterNode> aliveRemoteCacheNodes(@Nullable String cacheName, AffinityTopologyVersion topVer)
cacheName - Cache name.topVer - Topology version.public Collection<ClusterNode> aliveRemoteServerNodesWithCaches(AffinityTopologyVersion topVer)
topVer - Topology version (maximum allowed node order).public Collection<ClusterNode> aliveServerNodesWithCaches(AffinityTopologyVersion topVer)
topVer - Topology version (maximum allowed node order).public Collection<ClusterNode> aliveNodesWithCaches(AffinityTopologyVersion topVer)
topVer - Topology version (maximum allowed node order).public Collection<ClusterNode> cacheAffinityNodes(@Nullable String cacheName, AffinityTopologyVersion topVer)
cacheName - Cache name.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 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 boolean hasNearCache(@Nullable String cacheName, AffinityTopologyVersion topVer)
cacheName - Cache name.topVer - Topology version.True if cache with given name has at least one node with near cache enabled.@Nullable public Collection<ClusterNode> topology(long topVer)
topVer - Topology version.null if there are no nodes for passed in version.public Collection<ClusterNode> daemonNodes()
public ClusterNode localNode()
public long topologyVersion()
public AffinityTopologyVersion topologyVersionEx()
public DiscoveryEvent localJoinEvent()
public void sendCustomEvent(DiscoveryCustomMessage msg) throws IgniteCheckedException
msg - Custom message.IgniteCheckedException - If failed.public long gridStartTime()
DiscoverySpi.getGridStartTime().public boolean tryFailNode(UUID nodeId, @Nullable String warning)
nodeId - Node ID.warning - Warning message to be shown on all nodes.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.4.0 Release Date : September 24 2015