/** * Returns true iff the active shard count in the shard routing table is enough * to meet the required shard count represented by this instance. */ public boolean enoughShardsActive(final IndexShardRoutingTable shardRoutingTable) { final int activeShardCount = shardRoutingTable.activeShards().size(); if (this == ActiveShardCount.ALL) { // adding 1 for the primary in addition to the total number of replicas, // which gives us the total number of shard copies return activeShardCount == shardRoutingTable.replicaShards().size() + 1; } else if (this == ActiveShardCount.DEFAULT) { return activeShardCount >= 1; } else { return activeShardCount >= value; } }
int shardId = cursor.value; IndexShardRoutingTable indexShard = shards.get(shardId); if (indexShard.replicaShards().isEmpty()) {
List<ShardRouting> replicaShardRoutings = allocation.routingTable().shardRoutingTable(index, shard).replicaShards(); if (request.getCurrentNode() != null) {
/** * Returns true iff the active shard count in the shard routing table is enough * to meet the required shard count represented by this instance. */ public boolean enoughShardsActive(final IndexShardRoutingTable shardRoutingTable) { final int activeShardCount = shardRoutingTable.activeShards().size(); if (this == ActiveShardCount.ALL) { // adding 1 for the primary in addition to the total number of replicas, // which gives us the total number of shard copies return activeShardCount == shardRoutingTable.replicaShards().size() + 1; } else if (this == ActiveShardCount.DEFAULT) { return activeShardCount >= 1; } else { return activeShardCount >= value; } }
/** * Returns true iff the active shard count in the shard routing table is enough * to meet the required shard count represented by this instance. */ public boolean enoughShardsActive(final IndexShardRoutingTable shardRoutingTable) { final int activeShardCount = shardRoutingTable.activeShards().size(); if (this == ActiveShardCount.ALL) { // adding 1 for the primary in addition to the total number of replicas, // which gives us the total number of shard copies return activeShardCount == shardRoutingTable.replicaShards().size() + 1; } else if (this == ActiveShardCount.DEFAULT) { return activeShardCount >= 1; } else { return activeShardCount >= value; } }
/** * Returns true iff the active shard count in the shard routing table is enough * to meet the required shard count represented by this instance. */ public boolean enoughShardsActive(final IndexShardRoutingTable shardRoutingTable) { final int activeShardCount = shardRoutingTable.activeShards().size(); if (this == ActiveShardCount.ALL) { // adding 1 for the primary in addition to the total number of replicas, // which gives us the total number of shard copies return activeShardCount == shardRoutingTable.replicaShards().size() + 1; } else if (this == ActiveShardCount.DEFAULT) { return activeShardCount >= 1; } else { return activeShardCount >= value; } }
int shardId = cursor.value; IndexShardRoutingTable indexShard = shards.get(shardId); if (indexShard.replicaShards().isEmpty()) {
int shardId = cursor.value; IndexShardRoutingTable indexShard = shards.get(shardId); if (indexShard.replicaShards().isEmpty()) {
int shardId = cursor.value; IndexShardRoutingTable indexShard = shards.get(shardId); if (indexShard.replicaShards().isEmpty()) {
List<ShardRouting> replicaShardRoutings = allocation.routingTable().shardRoutingTable(index, shard).replicaShards(); if (request.getCurrentNode() != null) {
List<ShardRouting> replicaShardRoutings = allocation.routingTable().shardRoutingTable(index, shard).replicaShards(); if (request.getCurrentNode() != null) {
List<ShardRouting> replicaShardRoutings = allocation.routingTable().shardRoutingTable(index, shard).replicaShards(); if (request.getCurrentNode() != null) {
int shardId = cursor.value; IndexShardRoutingTable indexShard = shards.get(shardId); if (indexShard.replicaShards().isEmpty()) {