Remove unused assignedReplicasIncludingRelocating from ShardsIterator interface (#21687)

This commit is contained in:
Luca Cavanna 2016-11-23 22:25:51 +01:00 committed by GitHub
parent 887ada4819
commit 6a16a60c7e
2 changed files with 0 additions and 33 deletions

View File

@ -73,32 +73,6 @@ public class PlainShardsIterator implements ShardsIterator {
return count;
}
@Override
public int assignedReplicasIncludingRelocating() {
int count = 0;
for (ShardRouting shard : shards) {
if (shard.unassigned()) {
continue;
}
// if the shard is primary and relocating, add one to the counter since we perform it on the replica as well
// (and we already did it on the primary)
if (shard.primary()) {
if (shard.relocating()) {
count++;
}
} else {
count++;
// if we are relocating the replica, we want to perform the index operation on both the relocating
// shard and the target shard. This means that we won't loose index operations between end of recovery
// and reassignment of the shard by the master node
if (shard.relocating()) {
count++;
}
}
}
return count;
}
@Override
public Iterable<ShardRouting> asUnordered() {
return shards;

View File

@ -42,13 +42,6 @@ public interface ShardsIterator {
*/
int sizeActive();
/**
* Returns the number of replicas in this iterator that are not in the
* {@link ShardRoutingState#UNASSIGNED}. The returned double-counts replicas
* that are in the state {@link ShardRoutingState#RELOCATING}
*/
int assignedReplicasIncludingRelocating();
/**
* Returns the next shard, or <tt>null</tt> if none available.
*/