public class IndexShardRoutingTable extends Object implements 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 and Description |
---|---|
static class |
IndexShardRoutingTable.Builder |
public IndexShardRoutingTable normalizeVersions()
public ShardId shardId()
public ShardId getShardId()
public Iterator<ShardRouting> iterator()
iterator
in interface Iterable<ShardRouting>
public int size()
public int getSize()
public List<ShardRouting> shards()
List
of shardsList
of shardspublic List<ShardRouting> getShards()
List
of shardsList
of shardspublic List<ShardRouting> activeShards()
List
of active shardsList
of shardspublic List<ShardRouting> getActiveShards()
List
of active shardsList
of shardspublic List<ShardRouting> assignedShards()
List
of assigned shardsList
of shardspublic List<ShardRouting> getAssignedShards()
List
of assigned shardsList
of shardspublic ShardIterator shardsRandomIt()
public ShardIterator shardsIt()
public ShardIterator shardsIt(int seed)
public ShardIterator activeInitializingShardsRandomIt()
public ShardIterator activeInitializingShardsIt(int seed)
public ShardIterator primaryShardIt()
public ShardIterator primaryActiveInitializingShardIt()
public ShardIterator primaryFirstActiveInitializingShardsIt()
public ShardIterator replicaActiveInitializingShardIt()
public ShardIterator replicaFirstActiveInitializingShardsIt()
public ShardIterator onlyNodeActiveInitializingShardsIt(String nodeId)
public ShardIterator onlyNodeSelectorActiveInitializingShardsIt(String nodeAttributes, DiscoveryNodes discoveryNodes)
public ShardIterator onlyNodeSelectorActiveInitializingShardsIt(String[] nodeAttributes, DiscoveryNodes discoveryNodes)
public ShardIterator preferNodeActiveInitializingShardsIt(String nodeId)
public boolean allShardsStarted()
true
iff all shards in the routing table are started otherwise false
public ShardIterator preferAttributesActiveInitializingShardsIt(String[] attributes, DiscoveryNodes nodes)
public ShardIterator preferAttributesActiveInitializingShardsIt(String[] attributes, DiscoveryNodes nodes, int seed)
public ShardRouting primaryShard()
public List<ShardRouting> replicaShards()
public List<ShardRouting> replicaShardsWithState(ShardRoutingState... states)
public List<ShardRouting> shardsWithState(ShardRoutingState state)
Copyright © 2009–2017. All rights reserved.