KeyT
- Type of the Key.public class TableKey<KeyT>
extends java.lang.Object
KeyValueTable
Key with a Version
.Modifier and Type | Method and Description |
---|---|
KeyT |
getKey()
The Key.
|
Version |
getVersion()
The Version.
|
static <KeyT> TableKey<KeyT> |
notExists(KeyT key)
Creates a new
TableKey with a version that indicates the key must not exist. |
java.lang.String |
toString() |
static <KeyT> TableKey<KeyT> |
unversioned(KeyT key)
Creates a new
TableKey with no specific version. |
static <KeyT> TableKey<KeyT> |
versioned(KeyT key,
Version version)
Creates a new
TableKey with a specific version. |
public static <KeyT> TableKey<KeyT> unversioned(KeyT key)
TableKey
with no specific version. When used with KeyValueTable.removeAll(java.lang.String, java.lang.Iterable<io.pravega.client.tables.TableKey<KeyT>>)
, this
TableKey
will be treated as an unconditional removal.KeyT
- Key Type.key
- The Key.TableKey
(version set to Version.NO_VERSION
).public static <KeyT> TableKey<KeyT> notExists(KeyT key)
TableKey
with a version that indicates the key must not exist. When used with
KeyValueTable.removeAll(java.lang.String, java.lang.Iterable<io.pravega.client.tables.TableKey<KeyT>>)
, this TableKey
will be treated conditional removal.
By itself, this is not a useful scenario (removing a key conditioned on it not existing in the first place doesn't
make much sense). However, when used in combination with other removals (KeyValueTable.removeAll(java.lang.String, java.lang.Iterable<io.pravega.client.tables.TableKey<KeyT>>)
accepts
multiple TableKey
s), this can be used to condition the entire batch on a particular TableKey
's
inexistence (i.e., only perform these removals iff a certain TableKey
is not present).
KeyT
- Key Typekey
- The Key.TableKey
with a version set to Version.NOT_EXISTS
.public static <KeyT> TableKey<KeyT> versioned(KeyT key, Version version)
TableKey
with a specific version. When used with KeyValueTable.removeAll(java.lang.String, java.lang.Iterable<io.pravega.client.tables.TableKey<KeyT>>)
, this
TableKey
will be treated as a conditional removal, conditioned on the Key existing and having the specified
version.KeyT
- Key Type.key
- The Key.version
- The Version.TableKey
.@NonNull public KeyT getKey()
public Version getVersion()
KeyValueTable
for details on
conditional updates.public java.lang.String toString()
toString
in class java.lang.Object