org.elasticsearch.cluster.routing
Class IndexShardRoutingTable

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

public class IndexShardRoutingTable
extends Object
implements Iterable<ShardRouting>


Nested Class Summary
static class IndexShardRoutingTable.Builder
           
 
Method Summary
 com.google.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.
 com.google.common.collect.ImmutableList<ShardRouting> assignedShards()
           
 ShardIterator assignedShardsIt()
           
 ShardIterator assignedShardsIt(int index)
           
 ShardIterator assignedShardsRandomIt()
           
 int countWithState(ShardRoutingState state)
           
 com.google.common.collect.ImmutableList<ShardRouting> getActiveShards()
           
 com.google.common.collect.ImmutableList<ShardRouting> getAssignedShards()
           
 ShardId getShardId()
           
 com.google.common.collect.ImmutableList<ShardRouting> getShards()
           
 int getSize()
           
 com.google.common.collect.UnmodifiableIterator<ShardRouting> iterator()
           
 IndexShardRoutingTable normalizeVersions()
          Normalizes all shard routings to the same version.
 ShardIterator onlyNodeActiveShardsIt(String nodeId)
           
 ShardIterator preferAttributesActiveShardsIt(String[] attributes, DiscoveryNodes nodes)
           
 ShardIterator preferAttributesActiveShardsIt(String[] attributes, DiscoveryNodes nodes, int index)
           
 ShardIterator preferNodeActiveShardsIt(String nodeId)
          Prefers execution on the provided node if applicable.
 ShardIterator preferNodeAssignedShardsIt(String nodeId)
          Prefers execution on the provided node if applicable.
 ShardIterator preferNodeShardsIt(String nodeId)
          Prefers execution on the provided node if applicable.
 ShardIterator primaryFirstActiveShardsIt()
           
 ShardRouting primaryShard()
           
 ShardIterator primaryShardIt()
          Returns an iterator only on the primary shard.
 List<ShardRouting> replicaShards()
           
 ShardId shardId()
           
 com.google.common.collect.ImmutableList<ShardRouting> shards()
           
 ShardIterator shardsIt()
           
 ShardIterator shardsIt(int index)
           
 ShardIterator shardsRandomIt()
           
 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 com.google.common.collect.UnmodifiableIterator<ShardRouting> iterator()
Specified by:
iterator in interface Iterable<ShardRouting>

size

public int size()

getSize

public int getSize()

shards

public com.google.common.collect.ImmutableList<ShardRouting> shards()

getShards

public com.google.common.collect.ImmutableList<ShardRouting> getShards()

activeShards

public com.google.common.collect.ImmutableList<ShardRouting> activeShards()

getActiveShards

public com.google.common.collect.ImmutableList<ShardRouting> getActiveShards()

assignedShards

public com.google.common.collect.ImmutableList<ShardRouting> assignedShards()

getAssignedShards

public com.google.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.


primaryFirstActiveShardsIt

public ShardIterator primaryFirstActiveShardsIt()

preferNodeShardsIt

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


onlyNodeActiveShardsIt

public ShardIterator onlyNodeActiveShardsIt(String nodeId)

preferNodeActiveShardsIt

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


preferNodeAssignedShardsIt

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


preferAttributesActiveShardsIt

public ShardIterator preferAttributesActiveShardsIt(String[] attributes,
                                                    DiscoveryNodes nodes)

preferAttributesActiveShardsIt

public ShardIterator preferAttributesActiveShardsIt(String[] attributes,
                                                    DiscoveryNodes nodes,
                                                    int index)

primaryShard

public ShardRouting primaryShard()

replicaShards

public List<ShardRouting> replicaShards()

shardsWithState

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


Copyright © 2009-2012. All Rights Reserved.