Class RoutingNode
org.elasticsearch.cluster.routing.RoutingNode
- All Implemented Interfaces:
<ShardRouting>
A
RoutingNode
represents a cluster node associated with a single DiscoveryNode
including all shards
that are hosted on that nodes. Each RoutingNode
has a unique node id that can be used to identify the node.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetByShardId(ShardId id)
boolean
isEmpty()
iterator()
node()
Returns the nodesDiscoveryNode
.nodeId()
Get the id of this nodeint
The number of shards on this node that will not be eventually relocated.int
numberOfOwningShardsForIndex(Index index)
int
numberOfShardsWithState(ShardRoutingState... states)
Determine the number of shards with a specific stateindex, ShardRoutingState... states)
Determine the shards of an index with a specific stateshardsWithState(ShardRoutingState... states)
Determine the shards with a specific stateint
size()
toString()
Methods inherited from class java.lang.
, , , , , , , , ,
Methods inherited from interface java.lang.
,
-
Constructor Details
-
RoutingNode
-
-
Method Details
-
iterator
- Specified by:
in interface
<ShardRouting>
-
node
Returns the nodesDiscoveryNode
.- Returns:
- discoveryNode of this node
-
getByShardId
-
nodeId
public nodeId()Get the id of this node- Returns:
- id of the node
-
size
public int size() -
numberOfShardsWithState
Determine the number of shards with a specific state- Parameters:
states
- set of states which should be counted- Returns:
- number of shards
-
shardsWithState
Determine the shards with a specific state- Parameters:
states
- set of states which should be listed- Returns:
- List of shards
-
shardsWithState
public < index, ShardRoutingState... states)Determine the shards of an index with a specific state- Parameters:
index
- id of the indexstates
- set of states which should be listed- Returns:
- a list of shards
-
numberOfOwningShards
public int numberOfOwningShards()The number of shards on this node that will not be eventually relocated. -
numberOfOwningShardsForIndex
-
prettyPrint
public prettyPrint() -
toString
public toString()- Overrides:
in class
-
copyShards
-
isEmpty
public boolean isEmpty()
-