Package io.pravega.client.tables
Interface KeyValueTableIterator.Builder
-
- Enclosing interface:
- KeyValueTableIterator
public static interface KeyValueTableIterator.Builder
Defines a Builder for aKeyValueTableIterator
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description KeyValueTableIterator
all()
Creates a newKeyValueTableIterator
that returns all theTableKey
/TableEntry
instances in the associatedKeyValueTable
.KeyValueTableIterator
forPrefix(java.nio.ByteBuffer primaryKeyPrefix)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with Primary Keys (seeTableKey.getPrimaryKey()
that begin with the given prefix.KeyValueTableIterator
forPrimaryKey(@NonNull java.nio.ByteBuffer primaryKey)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with the same Primary Key (seeTableKey.getPrimaryKey()
.KeyValueTableIterator
forPrimaryKey(@NonNull java.nio.ByteBuffer primaryKey, java.nio.ByteBuffer secondaryKeyPrefix)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with the same Primary Key (seeTableKey.getPrimaryKey()
and all Secondary keys (seeTableKey.getSecondaryKey()
) that begin with the given prefix.KeyValueTableIterator
forPrimaryKey(@NonNull java.nio.ByteBuffer primaryKey, java.nio.ByteBuffer fromSecondaryKey, java.nio.ByteBuffer toSecondaryKey)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with the same Primary Key (seeTableKey.getPrimaryKey()
.KeyValueTableIterator
forRange(java.nio.ByteBuffer fromPrimaryKey, java.nio.ByteBuffer toPrimaryKey)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with Primary Keys (seeTableKey.getPrimaryKey()
between the two values.KeyValueTableIterator.Builder
maxIterationSize(int maxIterationSize)
Sets the maximum number of items to return with each call toAsyncIterator.getNext()
.
-
-
-
Method Detail
-
maxIterationSize
KeyValueTableIterator.Builder maxIterationSize(int maxIterationSize)
Sets the maximum number of items to return with each call toAsyncIterator.getNext()
.- Parameters:
maxIterationSize
- The maximum number of items to return with each call toAsyncIterator.getNext()
.- Returns:
- This instance.
-
forPrimaryKey
KeyValueTableIterator forPrimaryKey(@NonNull @NonNull java.nio.ByteBuffer primaryKey)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with the same Primary Key (seeTableKey.getPrimaryKey()
. This will iterate through allTableKey
/TableEntry
instances matching the given Primary Key.- Parameters:
primaryKey
- AByteBuffer
representing the full Primary Key to search.- Returns:
- A new
KeyValueTableIterator
that can be used for the iteration.
-
forPrimaryKey
KeyValueTableIterator forPrimaryKey(@NonNull @NonNull java.nio.ByteBuffer primaryKey, @Nullable java.nio.ByteBuffer fromSecondaryKey, @Nullable java.nio.ByteBuffer toSecondaryKey)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with the same Primary Key (seeTableKey.getPrimaryKey()
. Depending on the arguments provided, this may iterate through allTableKey
/TableEntry
instances matching the given Primary Key or a sub-range.- Parameters:
primaryKey
- AByteBuffer
representing the full Primary Key to search.fromSecondaryKey
- AByteBuffer
that indicates the Secondary Key (seeTableKey.getSecondaryKey()
) to begin the iteration at. If not provided (null), the iterator will begin with the firstTableKey
/TableEntry
that has the given Primary Key. This argument is inclusive.toSecondaryKey
- AByteBuffer
that indicates the Secondary Key (seeTableKey.getSecondaryKey()
) to end the iteration at. If not provided (null), the iterator will end with the lastTableKey
/TableEntry
that has the given Primary Key. This argument is inclusive.- Returns:
- A new
KeyValueTableIterator
that can be used for the iteration.
-
forPrimaryKey
KeyValueTableIterator forPrimaryKey(@NonNull @NonNull java.nio.ByteBuffer primaryKey, @Nullable java.nio.ByteBuffer secondaryKeyPrefix)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with the same Primary Key (seeTableKey.getPrimaryKey()
and all Secondary keys (seeTableKey.getSecondaryKey()
) that begin with the given prefix. Depending on the arguments provided, this may iterate through allTableKey
/TableEntry
instances matching the given Primary Key or a sub-range.- Parameters:
primaryKey
- AByteBuffer
representing the full Primary Key to search.secondaryKeyPrefix
- AByteBuffer
that indicates the Secondary Key prefix for allTableKey
/TableEntry
instances to return. If not provided (null), the iterator will list allTableKey
/TableEntry
instances that match the given Primary Key.- Returns:
- A new
KeyValueTableIterator
that can be used for the iteration.
-
forRange
KeyValueTableIterator forRange(@Nullable java.nio.ByteBuffer fromPrimaryKey, @Nullable java.nio.ByteBuffer toPrimaryKey)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with Primary Keys (seeTableKey.getPrimaryKey()
between the two values. Depending on the arguments provided, this may iterate through allTableKey
/TableEntry
instances within theKeyValueTable
or a sub-range.- Parameters:
fromPrimaryKey
- AByteBuffer
that indicates the Primary Key (seeTableKey.getPrimaryKey()
) to begin the iteration at. If not provided (null), the iterator will begin with the firstTableKey
/TableEntry
in theKeyValueTable
. This argument is inclusive.toPrimaryKey
- AByteBuffer
that indicates the Primary Key (seeTableKey.getPrimaryKey()
) to end the iteration at. If not provided (null), the iterator will end with the lastTableKey
/TableEntry
in theKeyValueTable
. This argument is inclusive.- Returns:
- A new
KeyValueTableIterator
that can be used for the iteration.
-
forPrefix
KeyValueTableIterator forPrefix(@Nullable java.nio.ByteBuffer primaryKeyPrefix)
Creates a newKeyValueTableIterator
that returnsTableKey
/TableEntry
instances with Primary Keys (seeTableKey.getPrimaryKey()
that begin with the given prefix. Depending on the arguments provided, this may iterate through allTableKey
/TableEntry
instances within theKeyValueTable
or a sub-range.- Parameters:
primaryKeyPrefix
- AByteBuffer
that indicates the Primary Key prefix for allTableKey
/TableEntry
instances to return. If not provided (null), the iterator will list allTableKey
/TableEntry
instances in theKeyValueTable
.- Returns:
- A new
KeyValueTableIterator
that can be used for the iteration.
-
all
KeyValueTableIterator all()
Creates a newKeyValueTableIterator
that returns all theTableKey
/TableEntry
instances in the associatedKeyValueTable
.- Returns:
- A new
KeyValueTableIterator
that can be used for the iteration.
-
-