Package io.pravega.client.tables
Interface KeyValueTableIterator
-
@Beta public interface KeyValueTableIterator
Defines a preconfigured Iterator for aKeyValueTable
, which can be used to iterate overTableKey
orTableEntry
instances. SeeKeyValueTableIterator.Builder
for configuring, andkeys()
andentries()
for running.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
KeyValueTableIterator.Builder
Defines a Builder for aKeyValueTableIterator
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description io.pravega.common.util.AsyncIterator<IteratorItem<TableEntry>>
entries()
Creates a new Iterator overTableEntry
instances in the associatedKeyValueTable
.io.pravega.common.util.AsyncIterator<IteratorItem<TableKey>>
keys()
Creates a new Iterator forTableKey
s in the associatedKeyValueTable
.
-
-
-
Method Detail
-
keys
io.pravega.common.util.AsyncIterator<IteratorItem<TableKey>> keys()
Creates a new Iterator forTableKey
s in the associatedKeyValueTable
. This is preferred toentries()
if all that is needed is theTableKey
s as less I/O is involved both server-side and between the server and client.- Returns:
- An
AsyncIterator
that can be used to iterate over Keys in thisKeyValueTable
. The returnedAsyncIterator
guarantees the serialization of invocations toAsyncIterator.getNext()
. SeeAsyncIterator.asSequential(java.util.concurrent.Executor)
.
-
entries
io.pravega.common.util.AsyncIterator<IteratorItem<TableEntry>> entries()
Creates a new Iterator overTableEntry
instances in the associatedKeyValueTable
. This should be used if both the Keys and their associated Values are needed and is preferred to usingkeys()
to get the Keys and then issuingKeyValueTable.get(io.pravega.client.tables.TableKey)
/KeyValueTable.getAll(java.lang.Iterable<io.pravega.client.tables.TableKey>)
to retrieve the Values.- Returns:
- An
AsyncIterator
that can be used to iterate over Entries in thisKeyValueTable
. The returnedAsyncIterator
guarantees the serialization of invocations toAsyncIterator.getNext()
. SeeAsyncIterator.asSequential(java.util.concurrent.Executor)
.
-
-