org.elasticsearch.cluster.routing
Class RoutingTable
java.lang.Object
org.elasticsearch.cluster.routing.RoutingTable
- All Implemented Interfaces:
- java.lang.Iterable<IndexRoutingTable>
@Immutable
public class RoutingTable
- extends java.lang.Object
- implements java.lang.Iterable<IndexRoutingTable>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EMPTY_ROUTING_TABLE
public static final RoutingTable EMPTY_ROUTING_TABLE
iterator
public UnmodifiableIterator<IndexRoutingTable> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<IndexRoutingTable>
hasIndex
public boolean hasIndex(java.lang.String index)
index
public IndexRoutingTable index(java.lang.String index)
indicesRouting
public java.util.Map<java.lang.String,IndexRoutingTable> indicesRouting()
getIndicesRouting
public java.util.Map<java.lang.String,IndexRoutingTable> getIndicesRouting()
routingNodes
public RoutingNodes routingNodes(MetaData metaData)
validateRaiseException
public RoutingTable validateRaiseException(MetaData metaData)
throws RoutingValidationException
- Throws:
RoutingValidationException
validate
public RoutingTableValidation validate(MetaData metaData)
allShards
public java.util.List<ShardRouting> allShards(java.lang.String... indices)
throws IndexMissingException
- All the shards (replicas) for the provided indices.
- Parameters:
indices
- The indices to return all the shards (replicas), can be null or empty array to indicate all indices
- Returns:
- All the shards matching the specific index
- Throws:
IndexMissingException
- If an index passed does not exists
allShardsGrouped
public GroupShardsIterator allShardsGrouped(java.lang.String... indices)
throws IndexMissingException
- All the shards (replicas) for the provided indices grouped (each group is a single element, consisting
of the shard). This is handy for components that expect to get group iterators, but still want in some
cases to iterate over all the shards (and not just one shard in replication group).
- Parameters:
indices
- The indices to return all the shards (replicas), can be null or empty array to indicate all indices
- Returns:
- All the shards grouped into a single shard element group each
- Throws:
IndexMissingException
- If an index passed does not exists- See Also:
IndexRoutingTable.groupByAllIt()
newRoutingTableBuilder
public static RoutingTable.Builder newRoutingTableBuilder()
prettyPrint
public java.lang.String prettyPrint()