primaryShardIt
Returns an iterator only on the primary shard.
java.lang.Iterable<ShardRouting>
public class IndexShardRoutingTable extends java.lang.Object implements java.lang.Iterable<ShardRouting>
IndexShardRoutingTable
encapsulates all instances of a single shard.
Each Elasticsearch index consists of multiple shards, each shard encapsulates
a disjoint set of the index data and each shard has one or more instances
referred to as replicas of a shard. Given that, this class encapsulates all
replicas (instances) for a single index shard.Modifier and Type | Class | Description |
---|---|---|
static class |
IndexShardRoutingTable.Builder |
Modifier and Type | Method | Description |
---|---|---|
ShardIterator |
activeInitializingShardsIt(int seed) |
Returns an iterator over active and initializing shards.
|
ShardIterator |
activeInitializingShardsRandomIt() |
Returns an iterator over active and initializing shards.
|
ShardIterator |
activeInitializingShardsRankedIt(ResponseCollectorService collector,
java.util.Map<java.lang.String,java.lang.Long> nodeSearchCounts) |
Returns an iterator over active and initializing shards, ordered by the adaptive replica
selection formula.
|
java.util.List<ShardRouting> |
activeShards() |
Returns a
List of active shards |
boolean |
allShardsStarted() |
Returns
true iff all shards in the routing table are started otherwise false |
java.util.List<ShardRouting> |
assignedShards() |
Returns a
List of assigned shards, including relocation targets |
boolean |
equals(java.lang.Object o) |
|
java.util.List<ShardRouting> |
getActiveShards() |
Returns a
List of active shards |
java.util.Set<java.lang.String> |
getAllAllocationIds() |
|
java.util.List<ShardRouting> |
getAllInitializingShards() |
Returns a
List of all initializing shards, including target shards of relocations |
ShardRouting |
getByAllocationId(java.lang.String allocationId) |
|
ShardId |
getShardId() |
Returns the shards id
|
java.util.List<ShardRouting> |
getShards() |
Returns a
List of shards |
int |
getSize() |
Returns the number of this shards instances.
|
int |
hashCode() |
|
java.util.Iterator<ShardRouting> |
iterator() |
|
ShardIterator |
onlyNodeActiveInitializingShardsIt(java.lang.String nodeId) |
|
ShardIterator |
onlyNodeSelectorActiveInitializingShardsIt(java.lang.String[] nodeAttributes,
DiscoveryNodes discoveryNodes) |
Returns shards based on nodeAttributes given such as node name , node attribute, node IP
Supports node specifications in cluster API
|
ShardIterator |
onlyNodeSelectorActiveInitializingShardsIt(java.lang.String nodeAttributes,
DiscoveryNodes discoveryNodes) |
|
ShardIterator |
preferAttributesActiveInitializingShardsIt(java.util.List<java.lang.String> attributes,
DiscoveryNodes nodes) |
|
ShardIterator |
preferAttributesActiveInitializingShardsIt(java.util.List<java.lang.String> attributes,
DiscoveryNodes nodes,
int seed) |
|
ShardIterator |
preferNodeActiveInitializingShardsIt(java.util.Set<java.lang.String> nodeIds) |
|
ShardRouting |
primaryShard() |
|
ShardIterator |
primaryShardIt() |
Returns an iterator only on the primary shard.
|
java.util.List<ShardRouting> |
replicaShards() |
|
java.util.List<ShardRouting> |
replicaShardsWithState(ShardRoutingState... states) |
|
ShardId |
shardId() |
Returns the shards id
|
java.util.List<ShardRouting> |
shards() |
Returns a
List of shards |
ShardIterator |
shardsIt() |
|
ShardIterator |
shardsIt(int seed) |
|
ShardIterator |
shardsRandomIt() |
|
java.util.List<ShardRouting> |
shardsWithState(ShardRoutingState state) |
|
int |
size() |
Returns the number of this shards instances.
|
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
iterator
in interface java.lang.Iterable<ShardRouting>
List
of shardsList
of shardsList
of shardsList
of shardsList
of active shardsList
of shardsList
of all initializing shards, including target shards of relocationsList
of shardsList
of active shardsList
of shardsList
of assigned shards, including relocation targetsList
of shardsequals
in class java.lang.Object
hashCode
in class java.lang.Object
true
iff all shards in the routing table are started otherwise false
toString
in class java.lang.Object