java.lang.Iterable<ShardIt>
public final class GroupShardsIterator<ShardIt extends ShardIterator>
extends java.lang.Object
implements java.lang.Iterable<ShardIt>
ShardIterator
s. Each ShardIterator
iterated by this Iterable
represents a group of shards.
ShardsIterators are always returned in ascending order independently of their order at construction
time. The incoming iterators are sorted to ensure consistent iteration behavior across Nodes / JVMs.Constructor | Description |
---|---|
GroupShardsIterator(java.util.List<ShardIt> iterators) |
Constructs a enw GroupShardsIterator from the given list.
|
Modifier and Type | Method | Description |
---|---|---|
ShardIt |
get(int index) |
|
java.util.Iterator<ShardIt> |
iterator() |
|
int |
size() |
Return the number of groups
|
int |
totalSize() |
Returns the total number of shards within all groups
|
int |
totalSizeWith1ForEmpty() |
Returns the total number of shards plus the number of empty groups
|
public GroupShardsIterator(java.util.List<ShardIt> iterators)
public int totalSize()
public int totalSizeWith1ForEmpty()
public int size()
public java.util.Iterator<ShardIt> iterator()
iterator
in interface java.lang.Iterable<ShardIt extends ShardIterator>
public ShardIt get(int index)