Package io.pravega.client.tables
Interface IteratorState
-
public interface IteratorStateRepresents 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
IteratorStateinstance 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, anIteratorStateinstance is non-transferable between different types of iterations or between different Key-Value Tables. It is OK to pass aIteratorStategenerated from aKeyValueTableinstance to anotherKeyValueTableinstance for the same Key-Value Table.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static IteratorStatefromBytes(java.nio.ByteBuffer buffer)Creates a newIteratorStatefrom the givenByteBuffer.booleanisEmpty()Gets a value indicating whether thisIteratorStateinstance is empty.java.nio.ByteBuffertoBytes()Serializes thisIteratorStateto aByteBuffer.
-
-
-
Method Detail
-
toBytes
java.nio.ByteBuffer toBytes()
Serializes thisIteratorStateto aByteBuffer. This can later be used to create a newIteratorStateusingfromBytes(ByteBuffer).- Returns:
- A
ByteBuffer.
-
isEmpty
boolean isEmpty()
Gets a value indicating whether thisIteratorStateinstance is empty.- Returns:
- True if empty, false otherwise.
-
fromBytes
static IteratorState fromBytes(java.nio.ByteBuffer buffer)
Creates a newIteratorStatefrom the givenByteBuffer.- Parameters:
buffer- AByteBuffercreated viatoBytes().- Returns:
- A
IteratorState.
-
-