org.elasticsearch.cluster.routing
Class RoutingNodes

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

@NotThreadSafe
public class RoutingNodes
extends java.lang.Object
implements java.lang.Iterable<RoutingNode>


Constructor Summary
RoutingNodes(MetaData metaData, ClusterBlocks blocks, RoutingTable routingTable)
           
 
Method Summary
 ClusterBlocks blocks()
           
 MutableShardRouting findPrimaryForReplica(ShardRouting shard)
           
 ClusterBlocks getBlocks()
           
 MetaData getMetaData()
           
 java.util.Map<java.lang.String,RoutingNode> getNodesToShards()
           
 RoutingTable getRoutingTable()
           
 java.util.List<MutableShardRouting> getUnassigned()
           
 boolean hasUnassigned()
           
 java.util.List<MutableShardRouting> ignoredUnassigned()
           
 java.util.Iterator<RoutingNode> iterator()
           
 MetaData metaData()
           
 RoutingNode node(java.lang.String nodeId)
           
 java.util.Map<java.lang.String,RoutingNode> nodesToShards()
           
 java.util.List<RoutingNode> nodesToShardsSorted(java.util.Comparator<RoutingNode> comparator)
           
 int numberOfShardsOfType(ShardRoutingState state)
           
 java.lang.String prettyPrint()
           
 int requiredAverageNumberOfShardsPerNode()
           
 RoutingTable routingTable()
           
 java.util.List<MutableShardRouting> shardsRoutingFor(ShardRouting shardRouting)
           
 java.util.List<MutableShardRouting> shardsRoutingFor(java.lang.String index, int shardId)
           
 java.util.List<MutableShardRouting> shardsWithState(ShardRoutingState... state)
           
 java.util.List<MutableShardRouting> shardsWithState(java.lang.String index, ShardRoutingState... state)
           
 java.util.List<RoutingNode> sortedNodesLeastToHigh()
           
 java.util.List<MutableShardRouting> unassigned()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoutingNodes

public RoutingNodes(MetaData metaData,
                    ClusterBlocks blocks,
                    RoutingTable routingTable)
Method Detail

iterator

public java.util.Iterator<RoutingNode> iterator()
Specified by:
iterator in interface java.lang.Iterable<RoutingNode>

routingTable

public RoutingTable routingTable()

getRoutingTable

public RoutingTable getRoutingTable()

metaData

public MetaData metaData()

getMetaData

public MetaData getMetaData()

blocks

public ClusterBlocks blocks()

getBlocks

public ClusterBlocks getBlocks()

requiredAverageNumberOfShardsPerNode

public int requiredAverageNumberOfShardsPerNode()

hasUnassigned

public boolean hasUnassigned()

ignoredUnassigned

public java.util.List<MutableShardRouting> ignoredUnassigned()

unassigned

public java.util.List<MutableShardRouting> unassigned()

getUnassigned

public java.util.List<MutableShardRouting> getUnassigned()

nodesToShards

public java.util.Map<java.lang.String,RoutingNode> nodesToShards()

getNodesToShards

public java.util.Map<java.lang.String,RoutingNode> getNodesToShards()

node

public RoutingNode node(java.lang.String nodeId)

findPrimaryForReplica

public MutableShardRouting findPrimaryForReplica(ShardRouting shard)

shardsRoutingFor

public java.util.List<MutableShardRouting> shardsRoutingFor(ShardRouting shardRouting)

shardsRoutingFor

public java.util.List<MutableShardRouting> shardsRoutingFor(java.lang.String index,
                                                            int shardId)

numberOfShardsOfType

public int numberOfShardsOfType(ShardRoutingState state)

shardsWithState

public java.util.List<MutableShardRouting> shardsWithState(ShardRoutingState... state)

shardsWithState

public java.util.List<MutableShardRouting> shardsWithState(java.lang.String index,
                                                           ShardRoutingState... state)

sortedNodesLeastToHigh

public java.util.List<RoutingNode> sortedNodesLeastToHigh()

nodesToShardsSorted

public java.util.List<RoutingNode> nodesToShardsSorted(java.util.Comparator<RoutingNode> comparator)

prettyPrint

public java.lang.String prettyPrint()