Class PlainShardsIterator
- java.lang.Object
-
- org.elasticsearch.cluster.routing.PlainShardsIterator
-
- All Implemented Interfaces:
java.lang.Iterable<ShardRouting>,ShardsIterator
- Direct Known Subclasses:
PlainShardIterator
public class PlainShardsIterator extends java.lang.Object implements ShardsIterator
A simpleShardsIteratorthat iterates a list or sub-list ofshard indexRoutings.
-
-
Constructor Summary
Constructors Constructor Description PlainShardsIterator(java.util.List<ShardRouting> shards)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ShardRouting>getShardRoutings()Returns theShardRoutings that this shards iterator holds.java.util.Iterator<ShardRouting>iterator()ShardRoutingnextOrNull()Returns the next shard, ornullif none available.intremaining()Return the number of shards remaining in thisShardsIteratorvoidreset()Resets the iterator to its initial state.intsize()The number of shard routing instances.intsizeActive()The number of active shard routing instances-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.cluster.routing.ShardsIterator
equals, hashCode
-
-
-
-
Constructor Detail
-
PlainShardsIterator
public PlainShardsIterator(java.util.List<ShardRouting> shards)
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:ShardsIteratorResets the iterator to its initial state.- Specified by:
resetin interfaceShardsIterator
-
remaining
public int remaining()
Description copied from interface:ShardsIteratorReturn the number of shards remaining in thisShardsIterator- Specified by:
remainingin interfaceShardsIterator- Returns:
- number of shard remaining
-
nextOrNull
public ShardRouting nextOrNull()
Description copied from interface:ShardsIteratorReturns the next shard, ornullif none available.- Specified by:
nextOrNullin interfaceShardsIterator
-
size
public int size()
Description copied from interface:ShardsIteratorThe number of shard routing instances.- Specified by:
sizein interfaceShardsIterator- Returns:
- number of shard routing instances in this iterator
-
sizeActive
public int sizeActive()
Description copied from interface:ShardsIteratorThe number of active shard routing instances- Specified by:
sizeActivein interfaceShardsIterator- Returns:
- number of active shard routing instances
-
getShardRoutings
public java.util.List<ShardRouting> getShardRoutings()
Description copied from interface:ShardsIteratorReturns theShardRoutings that this shards iterator holds.- Specified by:
getShardRoutingsin interfaceShardsIterator
-
iterator
public java.util.Iterator<ShardRouting> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<ShardRouting>
-
-