org.elasticsearch.cluster.routing
Class IndexShardRoutingTable

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

public class IndexShardRoutingTable
extends java.lang.Object
implements java.lang.Iterable<ShardRouting>


Nested Class Summary
static class IndexShardRoutingTable.Builder
           
 
Method Summary
 boolean allocatedPostApi()
          Has this shard group primary shard been allocated post API creation.
 int countWithState(ShardRoutingState state)
           
 ShardId getShardId()
           
 org.elasticsearch.common.collect.ImmutableList<ShardRouting> getShards()
           
 int getSize()
           
 org.elasticsearch.common.collect.UnmodifiableIterator<ShardRouting> iterator()
           
 IndexShardRoutingTable normalizeVersions()
          Normalizes all shard routings to the same version.
 ShardIterator preferLocalShardsIt(java.lang.String nodeId)
          Prefers execution on the local node if applicable.
 ShardRouting primaryShard()
           
 ShardIterator primaryShardIt()
          Returns an iterator only on the primary shard.
 java.util.List<ShardRouting> replicaShards()
           
 ShardId shardId()
           
 org.elasticsearch.common.collect.ImmutableList<ShardRouting> shards()
           
 ShardIterator shardsIt()
          Returns a regular shard iterator.
 ShardIterator shardsIt(int index)
           
 ShardIterator shardsRandomIt()
          Returns a random shards iterator.
 java.util.List<ShardRouting> shardsWithState(ShardRoutingState... states)
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalizeVersions

public IndexShardRoutingTable normalizeVersions()
Normalizes all shard routings to the same version.


allocatedPostApi

public boolean allocatedPostApi()
Has this shard group primary shard been allocated post API creation. Will be set to true if it was created because of recovery action.


shardId

public ShardId shardId()

getShardId

public ShardId getShardId()

iterator

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

size

public int size()

getSize

public int getSize()

shards

public org.elasticsearch.common.collect.ImmutableList<ShardRouting> shards()

getShards

public org.elasticsearch.common.collect.ImmutableList<ShardRouting> getShards()

countWithState

public int countWithState(ShardRoutingState state)

shardsIt

public ShardIterator shardsIt()
Returns a regular shard iterator.


shardsIt

public ShardIterator shardsIt(int index)

primaryShardIt

public ShardIterator primaryShardIt()
Returns an iterator only on the primary shard.


preferLocalShardsIt

public ShardIterator preferLocalShardsIt(java.lang.String nodeId)
Prefers execution on the local node if applicable.


shardsRandomIt

public ShardIterator shardsRandomIt()
Returns a random shards iterator.


primaryShard

public ShardRouting primaryShard()

replicaShards

public java.util.List<ShardRouting> replicaShards()

shardsWithState

public java.util.List<ShardRouting> shardsWithState(ShardRoutingState... states)