Package io.pravega.client.tables.impl
Class TableSegmentEntry
- java.lang.Object
-
- io.pravega.client.tables.impl.TableSegmentEntry
-
public class TableSegmentEntry extends java.lang.ObjectEntry in aTableSegment.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull TableSegmentKeygetKey()ATableSegmentKeyrepresenting the Key of this Table Entry.io.netty.buffer.ByteBufgetValue()AByteBufrepresenting the contents (value) of this Table Entry.static TableSegmentEntrynotExists(byte[] key, byte[] value)Creates a newTableSegmentEntrywith a version that indicates the key must not exist.static TableSegmentEntrynotExists(io.netty.buffer.ByteBuf key, io.netty.buffer.ByteBuf value)Creates a newTableSegmentEntrywith a version that indicates the key must not exist.static TableSegmentEntrynotFound(io.netty.buffer.ByteBuf key)Creates a newTableSegmentEntryfor a response that indicates it does not exist.static TableSegmentEntryunversioned(byte[] key, byte[] value)Creates a newTableSegmentEntrywith no specific version.static TableSegmentEntryunversioned(io.netty.buffer.ByteBuf key, io.netty.buffer.ByteBuf value)Creates a newTableSegmentEntrywith no specific version.static TableSegmentEntryversioned(byte[] key, byte[] value, long version)Creates a newTableSegmentEntrywith a specific version.static TableSegmentEntryversioned(io.netty.buffer.ByteBuf key, io.netty.buffer.ByteBuf value, long version)Creates a newTableSegmentEntrywith a specific version.
-
-
-
Method Detail
-
unversioned
public static TableSegmentEntry unversioned(io.netty.buffer.ByteBuf key, io.netty.buffer.ByteBuf value)
Creates a newTableSegmentEntrywith no specific version. When used withTableSegment.put(io.pravega.client.tables.impl.TableSegmentEntry), thisTableSegmentEntrywill be treated as an unconditional update.- Parameters:
key- AByteBufrepresenting the contents of the Table Entry Key.value- AByteBufrepresenting the Table Entry Value.- Returns:
- An unversioned
TableSegmentEntry.
-
unversioned
public static TableSegmentEntry unversioned(byte[] key, byte[] value)
Creates a newTableSegmentEntrywith no specific version. When used withTableSegment.put(io.pravega.client.tables.impl.TableSegmentEntry), thisTableSegmentEntrywill be treated as an unconditional update.- Parameters:
key- A byte array representing the contents of the Table Key. This will be wrapped in aByteBuf.value- A byte array representing the contents Table Entry Value. This will be wrapped in aByteBuf.- Returns:
- An unversioned
TableSegmentEntry.
-
versioned
public static TableSegmentEntry versioned(io.netty.buffer.ByteBuf key, io.netty.buffer.ByteBuf value, long version)
Creates a newTableSegmentEntrywith a specific version. When used withTableSegment.put(io.pravega.client.tables.impl.TableSegmentEntry), thisTableSegmentEntrywill be treated as a conditional update, conditioned on the key existing and having the specified version.- Parameters:
key- AByteBufrepresenting the contents of the Table Entry Key.value- AByteBufrepresenting the Table Entry Value.version- The version to set. Consider usingunversioned(io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf),notExists(io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf)ornotFound(io.netty.buffer.ByteBuf)for special-case versions.- Returns:
- A versioned
TableSegmentEntry.
-
versioned
public static TableSegmentEntry versioned(byte[] key, byte[] value, long version)
Creates a newTableSegmentEntrywith a specific version. When used withTableSegment.put(io.pravega.client.tables.impl.TableSegmentEntry), thisTableSegmentEntrywill be treated as a conditional update, conditioned on the key existing and having the specified version.- Parameters:
key- A byte array representing the contents of the Table Key. This will be wrapped in aByteBuf.value- A byte array representing the contents Table Entry Value. This will be wrapped in aByteBuf.version- The version to set. Consider usingunversioned(io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf),notExists(io.netty.buffer.ByteBuf, io.netty.buffer.ByteBuf)ornotFound(io.netty.buffer.ByteBuf)for special-case versions.- Returns:
- A versioned
TableSegmentEntry.
-
notExists
public static TableSegmentEntry notExists(io.netty.buffer.ByteBuf key, io.netty.buffer.ByteBuf value)
Creates a newTableSegmentEntrywith a version that indicates the key must not exist. When used withTableSegment.put(io.pravega.client.tables.impl.TableSegmentEntry), thisTableSegmentEntrywill be treated as a conditional update, conditioned on the key not existing.- Parameters:
key- AByteBufrepresenting the contents of the Table Entry Key.value- AByteBufrepresenting the Table Entry Value.- Returns:
- A
TableSegmentEntrywith a version set toTableSegmentKeyVersion.NOT_EXISTS.
-
notExists
public static TableSegmentEntry notExists(byte[] key, byte[] value)
Creates a newTableSegmentEntrywith a version that indicates the key must not exist. When used withTableSegment.put(io.pravega.client.tables.impl.TableSegmentEntry), thisTableSegmentEntrywill be treated as a conditional update, conditioned on the key not existing.- Parameters:
key- A byte array representing the contents of the Table Key. This will be wrapped in aByteBuf.value- A byte array representing the contents Table Entry Value. This will be wrapped in aByteBuf.- Returns:
- A
TableSegmentEntrywith a version set toTableSegmentKeyVersion.NOT_EXISTS.
-
notFound
public static TableSegmentEntry notFound(io.netty.buffer.ByteBuf key)
Creates a newTableSegmentEntryfor a response that indicates it does not exist. This is usually invoked internally from theTableSegmentimplementation to construct the response. ThisTableSegmentEntryshould not be used as an argument forTableSegment.put(io.pravega.client.tables.impl.TableSegmentEntry)calls.- Parameters:
key- AByteBufrepresenting the contents of the Table Entry Key.- Returns:
- A
TableSegmentEntrywith a version set toTableSegmentKeyVersion.NOT_EXISTSand agetValue()set to null.
-
getKey
@NonNull public @NonNull TableSegmentKey getKey()
ATableSegmentKeyrepresenting the Key of this Table Entry.
-
getValue
public io.netty.buffer.ByteBuf getValue()
AByteBufrepresenting the contents (value) of this Table Entry. May be null ifgetKey()indicates that it does not exist.
-
-