E
- item typepublic interface ReadResultSet<E> extends Iterable<E>
Ringbuffer.readManyAsync(long, int, int, com.hazelcast.core.IFunction)
operation.
Important:
If an item is retrieved multiple times from the result set, a new instance is returned for every invocation. This is done
to prevent unexpected sharing if the ICompletableFuture
is shared between multiple threads.
Modifier and Type | Method and Description |
---|---|
E |
get(int index)
Gets the item at the given index.
|
long |
getSequence(int index)
Return the sequence number for the item at the given index.
|
int |
readCount()
Returns the number of items that have been read before filtering.
|
int |
size()
Return the result set size.
|
forEach, iterator, spliterator
int readCount()
If no filter is set, then the readCount will be equal to size()
. But if a filter is applied, it could be that items
are read, but are filtered out. So if you are trying to make another read based on the ReadResultSet then you should
increment the sequence by readCount and not by size. Otherwise you will be re-reading the same filtered messages.
E get(int index)
index
- the indexIllegalArgumentException
- if index out of bounds.long getSequence(int index)
UnsupportedOperationException
if there are no
sequences available. This can happen when the cluster version is
Versions.V3_8
or lower.index
- the indexIllegalArgumentException
- if index out of bounds.UnsupportedOperationException
- if the sequence IDs are not availableCluster.getClusterVersion()
int size()
readCount()
.Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.