public class RoutingTable extends Object implements Iterable<IndexRoutingTable>
IndexRoutingTable
Modifier and Type | Class and Description |
---|---|
static class |
RoutingTable.Builder |
Modifier and Type | Field and Description |
---|---|
static RoutingTable |
EMPTY_ROUTING_TABLE |
Modifier and Type | Method and Description |
---|---|
GroupShardsIterator |
activePrimaryShardsGrouped(String[] indices,
boolean includeEmpty)
All the *active* primary shards for the provided indices grouped (each group is a single element, consisting
of the primary shard).
|
GroupShardsIterator |
allActiveShardsGrouped(String[] indices,
boolean includeEmpty) |
GroupShardsIterator |
allActiveShardsGrouped(String[] indices,
boolean includeEmpty,
boolean includeRelocationTargets)
Return GroupShardsIterator where each active shard routing has it's own shard iterator.
|
GroupShardsIterator |
allAssignedShardsGrouped(String[] indices,
boolean includeEmpty) |
GroupShardsIterator |
allAssignedShardsGrouped(String[] indices,
boolean includeEmpty,
boolean includeRelocationTargets)
Return GroupShardsIterator where each assigned shard routing has it's own shard iterator.
|
List<ShardRouting> |
allShards(String... indices)
All the shards (replicas) for the provided indices.
|
GroupShardsIterator |
allShardsGrouped(String... indices)
All the shards (primary + replicas) for the provided indices grouped (each group is a single element, consisting
of the shard).
|
static RoutingTable.Builder |
builder() |
static RoutingTable.Builder |
builder(RoutingTable routingTable) |
Map<String,IndexRoutingTable> |
getIndicesRouting() |
boolean |
hasIndex(String index) |
IndexRoutingTable |
index(String index) |
Map<String,IndexRoutingTable> |
indicesRouting() |
com.google.common.collect.UnmodifiableIterator<IndexRoutingTable> |
iterator() |
String |
prettyPrint() |
RoutingNodes |
routingNodes(ClusterState state) |
List<ShardRouting> |
shardsWithState(ShardRoutingState state) |
RoutingTableValidation |
validate(MetaData metaData) |
RoutingTable |
validateRaiseException(MetaData metaData) |
long |
version()
Returns the version of the
RoutingTable . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final RoutingTable EMPTY_ROUTING_TABLE
public long version()
RoutingTable
.RoutingTable
public com.google.common.collect.UnmodifiableIterator<IndexRoutingTable> iterator()
iterator
in interface Iterable<IndexRoutingTable>
public boolean hasIndex(String index)
public IndexRoutingTable index(String index)
public Map<String,IndexRoutingTable> indicesRouting()
public Map<String,IndexRoutingTable> getIndicesRouting()
public RoutingNodes routingNodes(ClusterState state)
public RoutingTable validateRaiseException(MetaData metaData) throws RoutingValidationException
RoutingValidationException
public RoutingTableValidation validate(MetaData metaData)
public List<ShardRouting> shardsWithState(ShardRoutingState state)
public List<ShardRouting> allShards(String... indices) throws IndexMissingException
indices
- The indices to return all the shards (replicas), can be null or empty array to indicate all indicesIndexMissingException
- If an index passed does not existspublic GroupShardsIterator allShardsGrouped(String... indices) throws IndexMissingException
indices
- The indices to return all the shards (replicas), can be null or empty array to indicate all indicesIndexMissingException
- If an index passed does not existsIndexRoutingTable.groupByAllIt()
public GroupShardsIterator allActiveShardsGrouped(String[] indices, boolean includeEmpty) throws IndexMissingException
IndexMissingException
public GroupShardsIterator allActiveShardsGrouped(String[] indices, boolean includeEmpty, boolean includeRelocationTargets) throws IndexMissingException
includeEmpty
- if true, a shard iterator will be added for non-assigned shards as wellincludeRelocationTargets
- if true, an extra shard iterator will be added for relocating shards. The extra
iterator contains a single ShardRouting pointing at the relocating targetIndexMissingException
public GroupShardsIterator allAssignedShardsGrouped(String[] indices, boolean includeEmpty) throws IndexMissingException
IndexMissingException
public GroupShardsIterator allAssignedShardsGrouped(String[] indices, boolean includeEmpty, boolean includeRelocationTargets) throws IndexMissingException
includeEmpty
- if true, a shard iterator will be added for non-assigned shards as wellincludeRelocationTargets
- if true, an extra shard iterator will be added for relocating shards. The extra
iterator contains a single ShardRouting pointing at the relocating targetIndexMissingException
public GroupShardsIterator activePrimaryShardsGrouped(String[] indices, boolean includeEmpty) throws IndexMissingException
indices
- The indices to return all the shards (replicas), can be null or empty array to indicate all indicesIndexMissingException
- If an index passed does not existsIndexRoutingTable.groupByAllIt()
public static RoutingTable.Builder builder()
public static RoutingTable.Builder builder(RoutingTable routingTable)
public String prettyPrint()
Copyright © 2009–2015. All rights reserved.