public class RoutingTable extends Object implements Iterable<IndexRoutingTable>, Diffable<RoutingTable>
IndexRoutingTable
Modifier and Type | Class and Description |
---|---|
static class |
RoutingTable.Builder |
Modifier and Type | Field and Description |
---|---|
static RoutingTable |
EMPTY_ROUTING_TABLE |
static RoutingTable |
PROTO |
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()
All the shards (replicas) for all indices in this routing table.
|
List<ShardRouting> |
allShards(String index)
All the shards (replicas) for the provided index.
|
ShardsIterator |
allShards(String[] indices) |
ShardsIterator |
allShardsIncludingRelocationTargets(String[] indices) |
static RoutingTable.Builder |
builder() |
static RoutingTable.Builder |
builder(RoutingTable routingTable) |
Diff<RoutingTable> |
diff(RoutingTable previousState)
Returns serializable object representing differences between this and previousState
|
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() |
Diff<RoutingTable> |
readDiffFrom(StreamInput in)
Reads the
Diff from StreamInput |
RoutingTable |
readFrom(StreamInput in)
Reads a copy of an object with the same type form the stream input
The caller object remains unchanged.
|
IndexShardRoutingTable |
shardRoutingTable(String index,
int shardId)
All shards for the provided index and shard id
|
List<ShardRouting> |
shardsWithState(ShardRoutingState state) |
RoutingTableValidation |
validate(MetaData metaData) |
RoutingTable |
validateRaiseException(MetaData metaData) |
long |
version()
Returns the version of the
RoutingTable . |
void |
writeTo(StreamOutput out)
Writes the current object into the output stream out
|
public static RoutingTable PROTO
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 IndexShardRoutingTable shardRoutingTable(String index, int shardId)
IndexNotFoundException
- if provided index does not existShardNotFoundException
- if provided shard id is unknownpublic RoutingTable validateRaiseException(MetaData metaData) throws RoutingValidationException
RoutingValidationException
public RoutingTableValidation validate(MetaData metaData)
public List<ShardRouting> shardsWithState(ShardRoutingState state)
public List<ShardRouting> allShards()
public List<ShardRouting> allShards(String index)
index
- The index to return all the shards (replicas).IndexNotFoundException
- If the index passed does not existspublic GroupShardsIterator allActiveShardsGrouped(String[] indices, boolean includeEmpty)
public GroupShardsIterator allActiveShardsGrouped(String[] indices, boolean includeEmpty, boolean includeRelocationTargets)
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 targetpublic GroupShardsIterator allAssignedShardsGrouped(String[] indices, boolean includeEmpty)
public GroupShardsIterator allAssignedShardsGrouped(String[] indices, boolean includeEmpty, boolean includeRelocationTargets)
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 targetpublic ShardsIterator allShards(String[] indices)
public ShardsIterator allShardsIncludingRelocationTargets(String[] indices)
public GroupShardsIterator activePrimaryShardsGrouped(String[] indices, boolean includeEmpty)
indices
- The indices to return all the shards (replicas)IndexNotFoundException
- If an index passed does not existsIndexRoutingTable.groupByAllIt()
public Diff<RoutingTable> diff(RoutingTable previousState)
Diffable
diff
in interface Diffable<RoutingTable>
public Diff<RoutingTable> readDiffFrom(StreamInput in) throws IOException
Diffable
Diff
from StreamInputreadDiffFrom
in interface Diffable<RoutingTable>
IOException
public RoutingTable readFrom(StreamInput in) throws IOException
StreamableReader
readFrom
in interface StreamableReader<RoutingTable>
IOException
public void writeTo(StreamOutput out) throws IOException
Writeable
writeTo
in interface Writeable<RoutingTable>
IOException
public static RoutingTable.Builder builder()
public static RoutingTable.Builder builder(RoutingTable routingTable)
public String prettyPrint()
Copyright © 2009–2017. All rights reserved.