From 3192654e80554b98ba0f7a9208aadd68d9f98957 Mon Sep 17 00:00:00 2001 From: kimchy Date: Sun, 13 Mar 2011 19:51:21 +0200 Subject: [PATCH] add iterator based on specific index --- .../elasticsearch/cluster/routing/IndexShardRoutingTable.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java index dca9abbad8d..92998f0868d 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java @@ -103,6 +103,10 @@ public class IndexShardRoutingTable implements Iterable { return new PlainShardIterator(shardId, shards); } + public ShardIterator shardsIt(int index) { + return new PlainShardIterator(shardId, shards, index); + } + public ShardIterator shardsRandomIt() { return new PlainShardIterator(shardId, shards, counter.getAndIncrement()); }