public class RoutingNode extends Object implements 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(String nodeId,
DiscoveryNode node) |
RoutingNode(String nodeId,
DiscoveryNode node,
List<ShardRouting> shards) |
Modifier and Type | Method and Description |
---|---|
Collection<ShardRouting> |
copyShards() |
ShardRouting |
get(int i) |
boolean |
isEmpty() |
Iterator<ShardRouting> |
iterator() |
DiscoveryNode |
node()
Returns the nodes
DiscoveryNode . |
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
|
String |
prettyPrint() |
List<ShardRouting> |
shardsWithState(ShardRoutingState... states)
Determine the shards with a specific state
|
List<ShardRouting> |
shardsWithState(String index,
ShardRoutingState... states)
Determine the shards of an index with a specific state
|
int |
size() |
String |
toString() |
public RoutingNode(String nodeId, DiscoveryNode node)
public RoutingNode(String nodeId, DiscoveryNode node, List<ShardRouting> shards)
public Iterator<ShardRouting> iterator()
iterator
in interface Iterable<ShardRouting>
public DiscoveryNode node()
DiscoveryNode
.public String nodeId()
public int size()
public int numberOfShardsWithState(ShardRoutingState... states)
states
- set of states which should be countedpublic List<ShardRouting> shardsWithState(ShardRoutingState... states)
states
- set of states which should be listedpublic List<ShardRouting> shardsWithState(String index, ShardRoutingState... states)
index
- id of the indexstates
- set of states which should be listedpublic int numberOfOwningShards()
public String prettyPrint()
public ShardRouting get(int i)
public Collection<ShardRouting> copyShards()
public boolean isEmpty()
Copyright © 2009–2016. All rights reserved.