add iterator based on specific index

This commit is contained in:
kimchy 2011-03-13 19:51:21 +02:00
parent 96dfdcf97c
commit 3192654e80
1 changed files with 4 additions and 0 deletions

View File

@ -103,6 +103,10 @@ public class IndexShardRoutingTable implements Iterable<ShardRouting> {
return new PlainShardIterator(shardId, shards); return new PlainShardIterator(shardId, shards);
} }
public ShardIterator shardsIt(int index) {
return new PlainShardIterator(shardId, shards, index);
}
public ShardIterator shardsRandomIt() { public ShardIterator shardsRandomIt() {
return new PlainShardIterator(shardId, shards, counter.getAndIncrement()); return new PlainShardIterator(shardId, shards, counter.getAndIncrement());
} }