org.elasticsearch.cluster.routing
Class IndexRoutingTable

java.lang.Object
  extended by org.elasticsearch.cluster.routing.IndexRoutingTable
All Implemented Interfaces:
java.lang.Iterable<IndexShardRoutingTable>

@Immutable
public class IndexRoutingTable
extends java.lang.Object
implements java.lang.Iterable<IndexShardRoutingTable>


Nested Class Summary
static class IndexRoutingTable.Builder
           
 
Method Summary
 boolean allPrimaryShardsActive()
           
 boolean allPrimaryShardsUnassigned()
           
 java.lang.String getIndex()
           
 org.elasticsearch.common.collect.ImmutableMap<java.lang.Integer,IndexShardRoutingTable> getShards()
           
 GroupShardsIterator groupByAllIt()
          A groups shards iterator where each groups is a single ShardRouting and a group is created for each shard routing.
 GroupShardsIterator groupByShardsIt()
          A group shards iterator where each group (ShardsIterator is an iterator across shard replication group.
 java.lang.String index()
           
 org.elasticsearch.common.collect.UnmodifiableIterator<IndexShardRoutingTable> iterator()
           
 java.lang.String prettyPrint()
           
 int primaryShardsActive()
           
 int primaryShardsUnassigned()
           
 IndexShardRoutingTable shard(int shardId)
           
 org.elasticsearch.common.collect.ImmutableMap<java.lang.Integer,IndexShardRoutingTable> shards()
           
 java.util.List<ShardRouting> shardsWithState(ShardRoutingState... states)
           
 void validate()
           
 void validate(RoutingTableValidation validation, MetaData metaData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

index

public java.lang.String index()

getIndex

public java.lang.String getIndex()

validate

public void validate(RoutingTableValidation validation,
                     MetaData metaData)

iterator

public org.elasticsearch.common.collect.UnmodifiableIterator<IndexShardRoutingTable> iterator()
Specified by:
iterator in interface java.lang.Iterable<IndexShardRoutingTable>

shards

public org.elasticsearch.common.collect.ImmutableMap<java.lang.Integer,IndexShardRoutingTable> shards()

getShards

public org.elasticsearch.common.collect.ImmutableMap<java.lang.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 java.util.List<ShardRouting> shardsWithState(ShardRoutingState... states)

groupByShardsIt

public GroupShardsIterator groupByShardsIt()
A group shards iterator where each group (ShardsIterator 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 java.lang.String prettyPrint()