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 theShardRouting
s that this shards iterator holds.java.util.Iterator<ShardRouting>
iterator()
ShardRouting
nextOrNull()
Returns the next shard, ornull
if none available.int
remaining()
Return the number of shards remaining in thisShardsIterator
void
reset()
Resets the iterator to its initial state.int
size()
The number of shard routing instances.int
sizeActive()
The number of active shard routing instances
-
Constructor Details
-
Method Details
-
reset
public void reset()Description copied from interface:ShardsIterator
Resets the iterator to its initial state.- Specified by:
reset
in interfaceShardsIterator
-
remaining
public int remaining()Description copied from interface:ShardsIterator
Return the number of shards remaining in thisShardsIterator
- Specified by:
remaining
in interfaceShardsIterator
- Returns:
- number of shard remaining
-
nextOrNull
Description copied from interface:ShardsIterator
Returns the next shard, ornull
if none available.- Specified by:
nextOrNull
in interfaceShardsIterator
-
size
public int size()Description copied from interface:ShardsIterator
The number of shard routing instances.- Specified by:
size
in interfaceShardsIterator
- Returns:
- number of shard routing instances in this iterator
-
sizeActive
public int sizeActive()Description copied from interface:ShardsIterator
The number of active shard routing instances- Specified by:
sizeActive
in interfaceShardsIterator
- Returns:
- number of active shard routing instances
-
getShardRoutings
Description copied from interface:ShardsIterator
Returns theShardRouting
s that this shards iterator holds.- Specified by:
getShardRoutings
in interfaceShardsIterator
-
iterator
- Specified by:
iterator
in interfacejava.lang.Iterable<ShardRouting>
-