public class RoutingNode extends java.lang.Object implements java.lang.Iterable<ShardRouting>
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 and Description |
---|
RoutingNode(java.lang.String nodeId,
DiscoveryNode node,
ShardRouting... shards) |
Modifier and Type | Method and Description |
---|---|
java.util.List<ShardRouting> |
copyShards() |
ShardRouting |
getByShardId(ShardId id) |
boolean |
isEmpty() |
java.util.Iterator<ShardRouting> |
iterator() |
DiscoveryNode |
node()
Returns the nodes
DiscoveryNode . |
java.lang.String |
nodeId()
Get the id of this node
|
int |
numberOfOwningShards()
The number of shards on this node that will not be eventually relocated.
|
int |
numberOfShardsWithState(ShardRoutingState... states)
Determine the number of shards with a specific state
|
java.lang.String |
prettyPrint() |
java.util.List<ShardRouting> |
shardsWithState(ShardRoutingState... states)
Determine the shards with a specific state
|
java.util.List<ShardRouting> |
shardsWithState(java.lang.String index,
ShardRoutingState... states)
Determine the shards of an index with a specific state
|
int |
size() |
java.lang.String |
toString() |
public RoutingNode(java.lang.String nodeId, DiscoveryNode node, ShardRouting... shards)
public java.util.Iterator<ShardRouting> iterator()
iterator
in interface java.lang.Iterable<ShardRouting>
public DiscoveryNode node()
DiscoveryNode
.@Nullable public ShardRouting getByShardId(ShardId id)
public java.lang.String nodeId()
public int size()
public int numberOfShardsWithState(ShardRoutingState... states)
states
- set of states which should be countedpublic java.util.List<ShardRouting> shardsWithState(ShardRoutingState... states)
states
- set of states which should be listedpublic java.util.List<ShardRouting> shardsWithState(java.lang.String index, ShardRoutingState... states)
index
- id of the indexstates
- set of states which should be listedpublic int numberOfOwningShards()
public java.lang.String prettyPrint()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List<ShardRouting> copyShards()
public boolean isEmpty()