Package io.pravega.client.tables
Interface IteratorState
-
public interface IteratorState
Represents the state of a resumable iterator. Such an iterator can be executed asynchronously and continued after an interruption. Each iteration will result in a new request to the server (which is stateless). The entire state of the iterator is encoded in this object and and is used by the server to decide what to return for the next iteration call.Each
IteratorState
instance is coupled to the Key-Value Table that it was created for and is tailored for the type of iteration that generates it (i.e.,KeyValueTable.keyIterator(java.lang.String, int, io.pravega.client.tables.IteratorState)
vsKeyValueTable.entryIterator(java.lang.String, int, io.pravega.client.tables.IteratorState)
). As such, anIteratorState
instance is non-transferable between different types of iterations or between different Key-Value Tables. It is OK to pass aIteratorState
generated from aKeyValueTable
instance to anotherKeyValueTable
instance for the same Key-Value Table.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static IteratorState
fromBytes(java.nio.ByteBuffer buffer)
Creates a newIteratorState
from the givenByteBuffer
.boolean
isEmpty()
Gets a value indicating whether thisIteratorState
instance is empty.java.nio.ByteBuffer
toBytes()
Serializes thisIteratorState
to aByteBuffer
.
-
-
-
Method Detail
-
toBytes
java.nio.ByteBuffer toBytes()
Serializes thisIteratorState
to aByteBuffer
. This can later be used to create a newIteratorState
usingfromBytes(ByteBuffer)
.- Returns:
- A
ByteBuffer
.
-
isEmpty
boolean isEmpty()
Gets a value indicating whether thisIteratorState
instance is empty.- Returns:
- True if empty, false otherwise.
-
fromBytes
static IteratorState fromBytes(java.nio.ByteBuffer buffer)
Creates a newIteratorState
from the givenByteBuffer
.- Parameters:
buffer
- AByteBuffer
created viatoBytes()
.- Returns:
- A
IteratorState
.
-
-