public class GridDiscoveryManager extends GridManagerAdapter<GridDiscoverySpi>
| 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 |
alive(GridNode node) |
boolean |
alive(UUID nodeId) |
boolean |
aliveAll(Collection<UUID> nodeIds) |
Collection<GridNode> |
aliveCacheNodes(String cacheName,
long topVer)
Gets cache nodes for cache with given name.
|
Collection<GridNode> |
aliveRemoteCacheNodes(String cacheName,
long topVer)
Gets cache remote nodes for cache with given name.
|
Collection<GridNode> |
allNodes() |
Collection<GridNode> |
cacheAffinityNodes(String cacheName,
long topVer)
Gets cache nodes for cache with given name that participate in affinity calculation.
|
Collection<GridNode> |
cacheNodes(String cacheName,
long topVer)
Gets cache nodes for cache with given name.
|
Collection<GridNode> |
daemonNodes() |
org.gridgain.grid.kernal.managers.discovery.GridDiscoveryManager.DiscoCache |
discoCache()
Gets discovery collection cache from SPI safely guarding against "floating" collections.
|
long |
gridStartTime()
Gets first grid node start time, see
GridDiscoverySpi.getGridStartTime(). |
boolean |
hasNearCache(String cacheName,
long topVer)
Checks if cache with given name has at least one node with near cache enabled.
|
GridDiscoveryEvent |
localJoinEvent() |
GridNode |
localNode() |
GridLocalMetrics |
metrics() |
GridNode |
node(UUID nodeId) |
Collection<GridNode> |
nodes(Collection<UUID> ids,
GridPredicate<UUID>... p)
Gets collection of node for given node IDs and predicates.
|
Collection<GridNode> |
nodes(long topVer)
Gets all nodes for given topology version.
|
void |
onKernalStop0(boolean cancel) |
boolean |
pingNode(UUID nodeId) |
Collection<GridNode> |
remoteCacheNodes(String cacheName,
long topVer)
Gets cache remote nodes for cache with given name.
|
Collection<GridNode> |
remoteNodes() |
void |
setNodeAttributes(Map<String,Object> attrs,
GridProductVersion ver)
Sets local node attributes into discovery SPI.
|
GridNodeShadow |
shadow(GridNode node)
Gets node shadow.
|
int |
size() |
void |
start()
Starts grid component.
|
void |
stop(boolean cancel)
Stops grid component.
|
Collection<GridNode> |
topology(long topVer)
Gets topology by specified version from history storage.
|
GridFuture<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 GridNode> nodes)
Gets topology hash for given set of nodes.
|
long |
topologyVersion() |
NavigableMap<GridProductVersion,Collection<GridNode>> |
topologyVersionMap()
Gets topology grouped by node versions.
|
addSpiAttributes, assertParameter, collectDiscoveryData, enabled, getSpi, getSpi, getSpis, onDiscoveryDataReceived, onKernalStart, onKernalStart0, onKernalStop, printMemoryStats, startInfo, startSpi, stopInfo, stopSpi, toString, validateNodeprotected static final int DISCOVERY_HISTORY_SIZE
public GridDiscoveryManager(GridKernalContext ctx)
ctx - Context.public void setNodeAttributes(Map<String,Object> attrs, GridProductVersion ver)
attrs - Attributes to set.ver - Version.public void start()
throws GridException
GridException - Throws in case of any errors.public GridLocalMetrics metrics()
public void ackTopology()
public void onKernalStop0(boolean cancel)
onKernalStop0 in class GridManagerAdapter<GridDiscoverySpi>cancel - Cancel flag.public void stop(boolean cancel)
throws GridException
cancel - If true, then all ongoing tasks or jobs for relevant
components need to be cancelled.GridException - Thrown in case of any errors.public GridNodeShadow shadow(GridNode node)
node - Node.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.public boolean alive(GridNode node)
node - Node.True if node is alive.public boolean pingNode(UUID nodeId)
nodeId - ID of the node.True if ping succeeded.@Nullable public GridNode node(UUID nodeId)
nodeId - ID of the node.public Collection<GridNode> nodes(@Nullable Collection<UUID> ids, GridPredicate<UUID>... p)
ids - Ids to include.p - Filter for IDs.public long topologyHash(Iterable<? extends GridNode> nodes)
nodes - Subset of grid nodes for hashing.public GridFuture<Long> topologyFuture(long awaitVer)
awaitVer - Topology version to await.public org.gridgain.grid.kernal.managers.discovery.GridDiscoveryManager.DiscoCache discoCache()
public Collection<GridNode> remoteNodes()
public Collection<GridNode> allNodes()
public NavigableMap<GridProductVersion,Collection<GridNode>> topologyVersionMap()
public int size()
public Collection<GridNode> nodes(long topVer)
topVer - Topology version.public Collection<GridNode> cacheNodes(@Nullable String cacheName, long topVer)
cacheName - Cache name.topVer - Topology version.public Collection<GridNode> remoteCacheNodes(@Nullable String cacheName, long topVer)
cacheName - Cache name.topVer - Topology version.public Collection<GridNode> aliveCacheNodes(@Nullable String cacheName, long topVer)
cacheName - Cache name.topVer - Topology version.public Collection<GridNode> aliveRemoteCacheNodes(@Nullable String cacheName, long topVer)
cacheName - Cache name.topVer - Topology version.public Collection<GridNode> cacheAffinityNodes(@Nullable String cacheName, long topVer)
cacheName - Cache name.topVer - Topology version.public boolean hasNearCache(@Nullable String cacheName, long 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<GridNode> topology(long topVer)
topVer - Topology version.null if there are no nodes for passed in version.public Collection<GridNode> daemonNodes()
public GridNode localNode()
public long topologyVersion()
public GridDiscoveryEvent localJoinEvent()
public long gridStartTime()
GridDiscoverySpi.getGridStartTime().Copyright © 2014. All rights reserved.