sb.append(TAB).append(TAB).append(shard).append(": "); sb.append("p_term [").append(indexMetaData.primaryTerm(shard)).append("], "); sb.append("isa_ids ").append(indexMetaData.inSyncAllocationIds(shard)).append("\n");
Collectors.groupingBy(staleShard -> staleShard.getShardId())).entrySet()) { int shardNumber = shardEntry.getKey().getId(); Set<String> oldInSyncAllocations = oldIndexMetaData.inSyncAllocationIds(shardNumber); Set<String> idsToRemove = shardEntry.getValue().stream().map(e -> e.getAllocationId()).collect(Collectors.toSet()); assert idsToRemove.stream().allMatch(id -> oldRoutingTable.getByAllocationId(shardEntry.getKey(), id) == null) :
updates.addedAllocationIds + ", removed ids: " + updates.removedAllocationIds; Set<String> oldInSyncAllocationIds = oldIndexMetaData.inSyncAllocationIds(shardId.id());
Set<String> inSyncAllocationIds = indexMetaData.inSyncAllocationIds(task.shardId.id());
"from the routing table"); final Set<String> inSyncAllocationIds = indexMetaData.inSyncAllocationIds(shardRouting.id()); if (shardRouting.active() && inSyncAllocationIds.contains(shardRouting.allocationId().getId()) == false) {
ShardId shardId = new ShardId(index, shardNumber); final RecoverySource primaryRecoverySource; if (indexMetaData.inSyncAllocationIds(shardNumber).isEmpty() == false) {
final IndexMetaData indexMetaData = clusterState.metaData().index(shard.shardId().getIndex()); final long primaryTerm = indexMetaData.primaryTerm(shard.shardId().id()); final Set<String> inSyncIds = indexMetaData.inSyncAllocationIds(shard.shardId().id()); final IndexShardRoutingTable indexShardRoutingTable = routingTable.shardRoutingTable(shardRouting.shardId()); final Set<String> pre60AllocationIds = indexShardRoutingTable.assignedShards()
final Set<String> inSyncAllocationIds = indexMetaData.inSyncAllocationIds(unassignedShard.id()); final boolean snapshotRestore = unassignedShard.recoverySource().getType() == RecoverySource.Type.SNAPSHOT;
sb.append(TAB).append(TAB).append(shard).append(": "); sb.append("p_term [").append(indexMetaData.primaryTerm(shard)).append("], "); sb.append("isa_ids ").append(indexMetaData.inSyncAllocationIds(shard)).append("\n");
protected Set<String> getInSyncAllocationIds(ShardId shardId, ClusterState clusterState) { IndexMetaData indexMetaData = clusterState.metaData().index(shardId.getIndex()); if (indexMetaData != null) { return indexMetaData.inSyncAllocationIds(shardId.id()); } return Collections.emptySet(); }
sb.append(TAB).append(TAB).append(shard).append(": "); sb.append("p_term [").append(indexMetaData.primaryTerm(shard)).append("], "); sb.append("isa_ids ").append(indexMetaData.inSyncAllocationIds(shard)).append("\n");
sb.append(TAB).append(TAB).append(shard).append(": "); sb.append("p_term [").append(indexMetaData.primaryTerm(shard)).append("], "); sb.append("isa_ids ").append(indexMetaData.inSyncAllocationIds(shard)).append("\n");
Collectors.groupingBy(staleShard -> staleShard.getShardId())).entrySet()) { int shardNumber = shardEntry.getKey().getId(); Set<String> oldInSyncAllocations = oldIndexMetaData.inSyncAllocationIds(shardNumber); Set<String> idsToRemove = shardEntry.getValue().stream().map(e -> e.getAllocationId()).collect(Collectors.toSet()); assert idsToRemove.stream().allMatch(id -> oldRoutingTable.getByAllocationId(shardEntry.getKey(), id) == null) :
"from the routing table"); final Set<String> inSyncAllocationIds = indexMetaData.inSyncAllocationIds(shardRouting.id()); if (shardRouting.active() && inSyncAllocationIds.contains(shardRouting.allocationId().getId()) == false) {
"from the routing table"); final Set<String> inSyncAllocationIds = indexMetaData.inSyncAllocationIds(shardRouting.id()); if (shardRouting.active() && inSyncAllocationIds.contains(shardRouting.allocationId().getId()) == false) {
final IndexMetaData indexMetaData = clusterState.metaData().index(shard.shardId().getIndex()); final long primaryTerm = indexMetaData.primaryTerm(shard.shardId().id()); final Set<String> inSyncIds = indexMetaData.inSyncAllocationIds(shard.shardId().id()); final IndexShardRoutingTable indexShardRoutingTable = routingTable.shardRoutingTable(shardRouting.shardId()); final Set<String> pre60AllocationIds = indexShardRoutingTable.assignedShards()
ShardId shardId = new ShardId(index, shardNumber); final RecoverySource primaryRecoverySource; if (indexMetaData.inSyncAllocationIds(shardNumber).isEmpty() == false) {
final IndexMetaData indexMetaData = clusterState.metaData().index(shard.shardId().getIndex()); final long primaryTerm = indexMetaData.primaryTerm(shard.shardId().id()); final Set<String> inSyncIds = indexMetaData.inSyncAllocationIds(shard.shardId().id()); final IndexShardRoutingTable indexShardRoutingTable = routingTable.shardRoutingTable(shardRouting.shardId()); final Set<String> pre60AllocationIds = indexShardRoutingTable.assignedShards()
ShardId shardId = new ShardId(index, shardNumber); final RecoverySource primaryRecoverySource; if (indexMetaData.inSyncAllocationIds(shardNumber).isEmpty() == false) {
ShardId shardId = new ShardId(index, shardNumber); final RecoverySource primaryRecoverySource; if (indexMetaData.inSyncAllocationIds(shardNumber).isEmpty() == false) {