Class FDBIndexedRecord<M extends Message>
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.FDBIndexedRecord<M>
-
- Type Parameters:
M
- type used to represent stored records
- All Implemented Interfaces:
FDBRecord<M>
,FDBStoredSizes
@API(MAINTAINED) public class FDBIndexedRecord<M extends Message> extends Object implements FDBRecord<M>, FDBStoredSizes
A record that has been loaded via an index.
-
-
Constructor Summary
Constructors Constructor Description FDBIndexedRecord(IndexEntry indexEntry, FDBStoredRecord<M> storedRecord)
Wrap a stored record with an index entry that pointed to it.FDBIndexedRecord(Index index, IndexEntry indexEntry, FDBStoredRecord<M> storedRecord)
Deprecated.useFDBIndexedRecord(IndexEntry, FDBStoredRecord)
instead
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Index
getIndex()
Get the index for this record.IndexEntry
getIndexEntry()
Get the index entry for this record.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.FDBStoredRecord<M>
getStoredRecord()
int
getValueSize()
Get the size in bytes of all values used to store this record.FDBRecordVersion
getVersion()
Get theFDBRecordVersion
associated with this record (ornull
).int
hashCode()
boolean
hasStoredRecord()
When scanning for orphaned index entries, this method must be used to determine whether or not a record exists before callinggetStoredRecord()
.boolean
hasVersion()
Get whether aFDBRecordVersion
has been set for thisStoredRecord
.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.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.apple.foundationdb.record.provider.foundationdb.FDBStoredSizes
addSizeLogInfo
-
-
-
-
Constructor Detail
-
FDBIndexedRecord
@API(DEPRECATED) @Deprecated public FDBIndexedRecord(@Nonnull Index index, @Nonnull IndexEntry indexEntry, @Nullable FDBStoredRecord<M> storedRecord)
Deprecated.useFDBIndexedRecord(IndexEntry, FDBStoredRecord)
insteadWrap a stored record with an index entry that pointed to it.- Parameters:
index
- the index that this record originated fromindexEntry
- the index entry that produced this recordstoredRecord
- theFDBStoredRecord
containing the record's data
-
FDBIndexedRecord
@API(INTERNAL) public FDBIndexedRecord(@Nonnull IndexEntry indexEntry, @Nullable FDBStoredRecord<M> storedRecord)
Wrap a stored record with an index entry that pointed to it. This method is internal, and it generally should not be called be external clients.- Parameters:
indexEntry
- the index entry that produced this recordstoredRecord
- theFDBStoredRecord
containing the record's data
-
-
Method Detail
-
getIndex
@Nonnull public Index getIndex()
Get the index for this record.- Returns:
- the index that contained the entry pointing to this record
-
getIndexEntry
@Nonnull public IndexEntry getIndexEntry()
Get the index entry for this record.- Returns:
- the index entry that pointed to this record
-
hasStoredRecord
public boolean hasStoredRecord()
When scanning for orphaned index entries, this method must be used to determine whether or not a record exists before callinggetStoredRecord()
.- Returns:
true
if this record has anFDBStoredRecord
-
getStoredRecord
@Nonnull public FDBStoredRecord<M> getStoredRecord()
-
getPrimaryKey
@Nonnull public Tuple getPrimaryKey()
Description copied from interface:FDBRecord
Get the primary key for this record.- Specified by:
getPrimaryKey
in interfaceFDBRecord<M extends Message>
- Returns:
- primary key for this record
-
getRecordType
@Nonnull public RecordType getRecordType()
Description copied from interface:FDBRecord
Get the record type for this record.- Specified by:
getRecordType
in interfaceFDBRecord<M extends Message>
- Returns:
- record type for this record
-
getRecord
@Nonnull public M getRecord()
Description copied from interface:FDBRecord
Get the Protobuf message form of this record.
-
hasVersion
public boolean hasVersion()
Description copied from interface:FDBRecord
Get whether aFDBRecordVersion
has been set for thisStoredRecord
.- Specified by:
hasVersion
in interfaceFDBRecord<M extends Message>
- Returns:
true
if this record has a version
-
getVersion
@Nullable public FDBRecordVersion getVersion()
Description copied from interface:FDBRecord
Get theFDBRecordVersion
associated with this record (ornull
).- Specified by:
getVersion
in interfaceFDBRecord<M extends Message>
- Returns:
- the version for this record
-
getKeyCount
public int getKeyCount()
Description copied from interface:FDBStoredSizes
Get the number of keys used to store this record.- Specified by:
getKeyCount
in interfaceFDBStoredSizes
- Returns:
- number of keys
-
getKeySize
public int getKeySize()
Description copied from interface:FDBStoredSizes
Get the size in bytes of all keys used to store this record.- Specified by:
getKeySize
in interfaceFDBStoredSizes
- Returns:
- size in bytes
-
getValueSize
public int getValueSize()
Description copied from interface:FDBStoredSizes
Get the size in bytes of all values used to store this record.- Specified by:
getValueSize
in interfaceFDBStoredSizes
- Returns:
- size in bytes
-
isSplit
public boolean isSplit()
Description copied from interface:FDBStoredSizes
Get whether this record is split between two or more key-value pairs.- Specified by:
isSplit
in interfaceFDBStoredSizes
- Returns:
true
if split
-
isVersionedInline
public boolean isVersionedInline()
Description copied from interface:FDBStoredSizes
Get whether this record was stored with an associated version. In particular, this states whether there was a version stored directly with the record in the database, which should only be true if the format version of the database is greater than or equal toFDBRecordStore.SAVE_VERSION_WITH_RECORD_FORMAT_VERSION
.- Specified by:
isVersionedInline
in interfaceFDBStoredSizes
- Returns:
true
if this record is stored with a version in-line
-
-