public class PortableReadResultSet<E> extends Object implements Portable, ReadResultSet<E>
SEQUENCE_UNAVAILABLE
Constructor and Description |
---|
PortableReadResultSet() |
PortableReadResultSet(int readCount,
List<Data> items,
long[] seqs,
long nextSeq) |
Modifier and Type | Method and Description |
---|---|
E |
get(int index)
Gets the item at the given index.
|
int |
getClassId()
Returns class identifier for this portable class.
|
List<Data> |
getDataItems() |
int |
getFactoryId()
Returns PortableFactory ID for this portable class
|
long |
getNextSequenceToReadFrom()
Returns the sequence of the item following the last read item.
|
long |
getSequence(int index)
Return the sequence number for the item at the given index.
|
Iterator<E> |
iterator() |
int |
readCount()
Returns the number of items that have been read before filtering.
|
void |
readPortable(PortableReader reader)
Read portable fields using PortableReader
|
void |
setSerializationService(SerializationService serializationService) |
int |
size()
Return the result set size.
|
void |
writePortable(PortableWriter writer)
Serialize this portable object using PortableWriter
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public void setSerializationService(SerializationService serializationService)
public int readCount()
ReadResultSet
If no filter is set, then the readCount
will be equal to
ReadResultSet.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 ReadResultSet.size()
.
Otherwise you will be re-reading the same filtered messages.
readCount
in interface ReadResultSet<E>
public E get(int index)
ReadResultSet
get
in interface ReadResultSet<E>
index
- the indexpublic long getSequence(int index)
ReadResultSet
getSequence
in interface ReadResultSet<E>
index
- the indexCluster.getClusterVersion()
public int size()
ReadResultSet
ReadResultSet.readCount()
.size
in interface ReadResultSet<E>
public long getNextSequenceToReadFrom()
ReadResultSet
ReadResultSet.readCount()
. In cases when the
reader tolerates lost items, this is not the case.
For instance, if the reader requests an item with a stale sequence (one
which has already been overwritten), the read will jump to the oldest
sequence and read from there.
Similarly, if the reader requests an item in the future (e.g. because
the partition was lost and the reader was unaware of this), the read
method will jump back to the newest available sequence.
Because of these jumps and only in the case when the reader is loss
tolerant, the next sequence must be retrieved using this method.
A return value of -1 means that the
information is not available.getNextSequenceToReadFrom
in interface ReadResultSet<E>
public int getFactoryId()
Portable
getFactoryId
in interface Portable
public int getClassId()
Portable
getClassId
in interface Portable
public void writePortable(PortableWriter writer) throws IOException
Portable
writePortable
in interface Portable
writer
- PortableWriterIOException
public void readPortable(PortableReader reader) throws IOException
Portable
readPortable
in interface Portable
reader
- PortableReaderIOException
Copyright © 2022 Hazelcast, Inc.. All Rights Reserved.