org.elasticsearch.cluster.routing
Class IndexRoutingTable
java.lang.Object
org.elasticsearch.cluster.routing.IndexRoutingTable
- All Implemented Interfaces:
- Iterable<IndexShardRoutingTable>
public class IndexRoutingTable
- extends Object
- implements Iterable<IndexShardRoutingTable>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
index
public String index()
getIndex
public String getIndex()
normalizeVersions
public IndexRoutingTable normalizeVersions()
validate
public void validate(RoutingTableValidation validation,
MetaData metaData)
iterator
public com.google.common.collect.UnmodifiableIterator<IndexShardRoutingTable> iterator()
- Specified by:
iterator
in interface Iterable<IndexShardRoutingTable>
numberOfNodesShardsAreAllocatedOn
public int numberOfNodesShardsAreAllocatedOn(String... excludedNodes)
shards
public com.google.common.collect.ImmutableMap<Integer,IndexShardRoutingTable> shards()
getShards
public com.google.common.collect.ImmutableMap<Integer,IndexShardRoutingTable> getShards()
shard
public IndexShardRoutingTable shard(int shardId)
allPrimaryShardsActive
public boolean allPrimaryShardsActive()
primaryShardsActive
public int primaryShardsActive()
allPrimaryShardsUnassigned
public boolean allPrimaryShardsUnassigned()
primaryShardsUnassigned
public int primaryShardsUnassigned()
shardsWithState
public List<ShardRouting> shardsWithState(ShardRoutingState... states)
randomAllShardsIt
public ShardsIterator randomAllShardsIt()
- An iterator over all shards (including replicas).
randomAllActiveShardsIt
public ShardsIterator randomAllActiveShardsIt()
groupByShardsIt
public GroupShardsIterator groupByShardsIt()
- A group shards iterator where each group (
ShardIterator
is an iterator across shard replication group.
groupByAllIt
public GroupShardsIterator groupByAllIt()
- A groups shards iterator where each groups is a single
ShardRouting
and a group
is created for each shard routing.
This basically means that components that use the GroupShardsIterator
will iterate
over *all* the shards (all the replicas) within the index.
validate
public void validate()
throws RoutingValidationException
- Throws:
RoutingValidationException
prettyPrint
public String prettyPrint()
Copyright © 2009-2012. All Rights Reserved.