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 simple
ShardsIterator that iterates a list or sub-list of
shard indexRoutings.-
Constructor Summary
Constructors Constructor Description PlainShardsIterator(java.util.List<ShardRouting> shards) -
Method Summary
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
-
Constructor Details
-
Method Details
-
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
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
Description copied from interface:ShardsIteratorReturns theShardRoutings that this shards iterator holds.- Specified by:
getShardRoutingsin interfaceShardsIterator
-
iterator
- Specified by:
iteratorin interfacejava.lang.Iterable<ShardRouting>
-