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, waitforEach, spliteratorpublic 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)
ReadResultSetget in interface ReadResultSet<E>index - the indexpublic long getSequence(int index)
ReadResultSetgetSequence in interface ReadResultSet<E>index - the indexCluster.getClusterVersion()public int size()
ReadResultSetReadResultSet.readCount().size in interface ReadResultSet<E>public long getNextSequenceToReadFrom()
ReadResultSetReadResultSet.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()
PortablegetFactoryId in interface Portablepublic int getClassId()
PortablegetClassId in interface Portablepublic void writePortable(PortableWriter writer) throws IOException
PortablewritePortable in interface Portablewriter - PortableWriterIOExceptionpublic void readPortable(PortableReader reader) throws IOException
PortablereadPortable in interface Portablereader - PortableReaderIOExceptionCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.