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
 org.elasticsearch.common.collect.ImmutableList<ShardRouting> activeShards()
           
 ShardIterator activeShardsIt()
           
 ShardIterator activeShardsIt(int index)
           
 ShardIterator activeShardsRandomIt()
           
 boolean allocatedPostApi()
          Has this shard group primary shard been allocated post API creation.
 org.elasticsearch.common.collect.ImmutableList<ShardRouting> assignedShards()
           
 ShardIterator assignedShardsIt()
           
 ShardIterator assignedShardsIt(int index)
           
 ShardIterator assignedShardsRandomIt()
           
 int countWithState(ShardRoutingState state)
           
 org.elasticsearch.common.collect.ImmutableList<ShardRouting> getActiveShards()
           
 org.elasticsearch.common.collect.ImmutableList<ShardRouting> getAssignedShards()
           
 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 preferNodeActiveShardsIt(java.lang.String nodeId)
          Prefers execution on the provided node if applicable.
 ShardIterator preferNodeAssignedShardsIt(java.lang.String nodeId)
          Prefers execution on the provided node if applicable.
 ShardIterator preferNodeShardsIt(java.lang.String nodeId)
          Prefers execution on the provided 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()
           
 ShardIterator shardsIt(int index)
           
 ShardIterator shardsRandomIt()
           
 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()

activeShards

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

getActiveShards

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

assignedShards

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

getAssignedShards

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

countWithState

public int countWithState(ShardRoutingState state)

shardsRandomIt

public ShardIterator shardsRandomIt()

shardsIt

public ShardIterator shardsIt()

shardsIt

public ShardIterator shardsIt(int index)

activeShardsRandomIt

public ShardIterator activeShardsRandomIt()

activeShardsIt

public ShardIterator activeShardsIt()

activeShardsIt

public ShardIterator activeShardsIt(int index)

assignedShardsRandomIt

public ShardIterator assignedShardsRandomIt()

assignedShardsIt

public ShardIterator assignedShardsIt()

assignedShardsIt

public ShardIterator assignedShardsIt(int index)

primaryShardIt

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


preferNodeShardsIt

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


preferNodeActiveShardsIt

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


preferNodeAssignedShardsIt

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


primaryShard

public ShardRouting primaryShard()

replicaShards

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

shardsWithState

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