primaryShardsActive
public int primaryShardsActive()
Calculates the number of primary shards in active state in routing table
- Returns:
- number of active primary shards
Diffable<IndexRoutingTable>
, SimpleDiffable<IndexRoutingTable>
, Writeable
IndexRoutingTable
represents routing information for a single
index. The routing table maintains a list of all shards in the index. A
single shard in this context has one more instances namely exactly one
primary
and 1 or more replicas. In other
words, each instance of a shard is considered a replica while only one
replica per shard is a primary
replica. The primary
replica
can be seen as the "leader" of the shard acting as the primary entry point
for operations on a specific shard.
Note: The term replica is not directly
reflected in the routing table or in related classes, replicas are
represented as ShardRouting
.
SimpleDiffable.CompleteDiff<T extends Diffable<T>>
Writeable.Reader<V>, Writeable.Writer<V>
EMPTY
boolean
true
if all shards are primary and active.boolean
true
if all primary shards are in
ShardRoutingState.UNASSIGNED
state.boolean
static IndexRoutingTable.Builder
builder(ShardRoutingRoleStrategy shardRoutingRoleStrategy,
Index index)
static IndexRoutingTable.Builder
boolean
getIndex()
int
hashCode()
int
numberOfNodesShardsAreAllocatedOn(String... excludedNodes)
IndexRoutingTable
excluding the nodes with the node ids give as
the excludedNodes
parameter.int
int
ShardRoutingState.UNASSIGNED
state.static Diff<IndexRoutingTable>
static IndexRoutingTable
readFrom(StreamInput in)
boolean
readyForSearch(ClusterState clusterState)
shard(int shardId)
shardsWithState(ShardRoutingState state)
int
size()
void
writeTo(StreamOutput out)
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
diff
IndexRoutingTable
excluding the nodes with the node ids give as
the excludedNodes
parameter.excludedNodes
- id of nodes that will be excludedtrue
if all shards are primary and active. Otherwise false
.true
if an index is available to service search queries.ShardRoutingState.UNASSIGNED
state.state
- ShardRoutingState
to retrieveList
of shards that match one of the given states
IOException
IOException
Writeable
writeTo
in interface Writeable
IOException