M
- type used to represent stored records@API(value=MAINTAINED) public class FDBStoredRecord<M extends Message> extends Object implements FDBIndexableRecord<M>
Constructor and Description |
---|
FDBStoredRecord(Tuple primaryKey,
RecordType recordType,
M record,
FDBStoredSizes size,
FDBRecordVersion recordVersion) |
FDBStoredRecord(Tuple primaryKey,
RecordType recordType,
M record,
int keyCount,
int keySize,
int valueSize,
boolean split,
boolean versionedInline,
FDBRecordVersion recordVersion) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getKeyCount()
Get the number of keys used to store this record.
|
int |
getKeySize()
Get the size in bytes of all keys used to store this record.
|
Tuple |
getPrimaryKey()
Get the primary key for this record.
|
M |
getRecord()
Get the Protobuf message form of this record.
|
RecordType |
getRecordType()
Get the record type for this record.
|
int |
getValueSize()
Get the size in bytes of all values used to store this record.
|
FDBRecordVersion |
getVersion()
Get the
FDBRecordVersion associated with this record (or null ). |
int |
hashCode() |
boolean |
hasVersion()
Get whether a
FDBRecordVersion has been set for this StoredRecord . |
boolean |
isSplit()
Get whether this record is split between two or more key-value pairs.
|
boolean |
isVersionedInline()
Get whether this record was stored with an associated version.
|
static <M extends Message> |
newBuilder()
Get a builder for a stored record.
|
static <M extends Message> |
newBuilder(M record)
Get a builder for a stored record.
|
String |
toString() |
FDBStoredRecord<M> |
withCommittedVersion(byte[] committedVersion)
Get this record with an updated version after committing.
|
FDBStoredRecord<M> |
withVersion(FDBRecordVersion recordVersion)
Copy this record with a different version.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addSizeLogInfo
public FDBStoredRecord(@Nonnull Tuple primaryKey, @Nonnull RecordType recordType, @Nonnull M record, @Nonnull FDBStoredSizes size, @Nullable FDBRecordVersion recordVersion)
@Nonnull public Tuple getPrimaryKey()
FDBRecord
getPrimaryKey
in interface FDBRecord<M extends Message>
@Nonnull public RecordType getRecordType()
FDBRecord
getRecordType
in interface FDBRecord<M extends Message>
@Nonnull public M getRecord()
FDBRecord
public boolean hasVersion()
FDBRecord
FDBRecordVersion
has been set for this StoredRecord
.hasVersion
in interface FDBRecord<M extends Message>
true
if this record has a version@Nullable public FDBRecordVersion getVersion()
FDBRecord
FDBRecordVersion
associated with this record (or null
).getVersion
in interface FDBRecord<M extends Message>
public int getKeyCount()
FDBStoredSizes
getKeyCount
in interface FDBStoredSizes
public int getKeySize()
FDBStoredSizes
getKeySize
in interface FDBStoredSizes
public int getValueSize()
FDBStoredSizes
getValueSize
in interface FDBStoredSizes
public boolean isSplit()
FDBStoredSizes
isSplit
in interface FDBStoredSizes
true
if splitpublic boolean isVersionedInline()
FDBStoredSizes
FDBRecordStore.SAVE_VERSION_WITH_RECORD_FORMAT_VERSION
.isVersionedInline
in interface FDBStoredSizes
true
if this record is stored with a version in-line@Nonnull public static <M extends Message> FDBStoredRecordBuilder<M> newBuilder()
M
- type used to represent stored records@Nonnull public static <M extends Message> FDBStoredRecordBuilder<M> newBuilder(@Nonnull M record)
M
- type used to represent stored recordsrecord
- Protobuf record@Nonnull public FDBStoredRecord<M> withVersion(@Nullable FDBRecordVersion recordVersion)
recordVersion
- new version@Nonnull public FDBStoredRecord<M> withCommittedVersion(@Nullable byte[] committedVersion)
committedVersion
- the result of FDBRecordContext.getVersionStamp()