Modifier and Type | Class and Description |
---|---|
static class |
SplitHelper.FoundSplitWithoutStartException
Exception thrown when only part of a split record is found.
|
static class |
SplitHelper.KeyValueUnsplitter
This cursor may exceed out-of-band limits in order to ensure that it only ever stops in between (split) records.
|
static class |
SplitHelper.SingleKeyUnsplitter
Unsplit a single record from a given range scan.
|
static class |
SplitHelper.SizeInfo
Accumulator for key-value sizes while loading / saving split records.
|
Modifier and Type | Field and Description |
---|---|
static long |
RECORD_VERSION
Special split point added to end of the key when a record is associated with a version.
|
static int |
SPLIT_RECORD_SIZE
If a record is greater than this size (in bytes),
it will be split into multiple kv pairs.
|
static long |
START_SPLIT_RECORD
Minimum index used when a record is split.
|
static long |
UNSPLIT_RECORD
Value added to the end of the key when a record is not split.
|
Modifier and Type | Method and Description |
---|---|
static void |
deleteSplit(FDBRecordContext context,
Subspace subspace,
Tuple key,
boolean splitLongRecords,
boolean missingUnsplitRecordSuffix,
boolean clearBasedOnPreviousSizeInfo,
FDBStoredSizes previousSizeInfo)
Delete the serialized representation of a record.
|
static CompletableFuture<Boolean> |
keyExists(ReadTransaction tr,
FDBTransactionContext context,
Subspace subspace,
Tuple key,
boolean splitLongRecords,
boolean missingUnsplitRecordSuffix)
Checks to see if a given key exists.
|
static CompletableFuture<com.apple.foundationdb.record.provider.foundationdb.FDBRawRecord> |
loadWithSplit(ReadTransaction tr,
FDBRecordContext context,
Subspace subspace,
Tuple key,
boolean splitLongRecords,
boolean missingUnsplitRecordSuffix,
SplitHelper.SizeInfo sizeInfo)
Load serialized byte array that may be split among several keys.
|
static void |
saveWithSplit(FDBRecordContext context,
Subspace subspace,
Tuple key,
byte[] serialized,
FDBRecordVersion version)
Save serialized representation using multiple keys if necessary.
|
static void |
saveWithSplit(FDBRecordContext context,
Subspace subspace,
Tuple key,
byte[] serialized,
FDBRecordVersion version,
boolean splitLongRecords,
boolean omitUnsplitSuffix,
boolean clearBasedOnPreviousSizeInfo,
FDBStoredSizes previousSizeInfo,
SplitHelper.SizeInfo sizeInfo)
Save serialized representation using multiple keys if necessary, clearing only as much as needed.
|
static Tuple |
unpackKey(Subspace subspace,
KeyValue kv) |
public static final int SPLIT_RECORD_SIZE
public static final long RECORD_VERSION
public static final long UNSPLIT_RECORD
public static final long START_SPLIT_RECORD
public static void saveWithSplit(@Nonnull FDBRecordContext context, @Nonnull Subspace subspace, @Nonnull Tuple key, @Nonnull byte[] serialized, @Nullable FDBRecordVersion version)
context
- write transactionsubspace
- subspace to save inkey
- key within subspaceserialized
- serialized representationversion
- the version to store inline with this recordpublic static void saveWithSplit(@Nonnull FDBRecordContext context, @Nonnull Subspace subspace, @Nonnull Tuple key, @Nonnull byte[] serialized, @Nullable FDBRecordVersion version, boolean splitLongRecords, boolean omitUnsplitSuffix, boolean clearBasedOnPreviousSizeInfo, @Nullable FDBStoredSizes previousSizeInfo, @Nullable SplitHelper.SizeInfo sizeInfo)
context
- write transactionsubspace
- subspace to save inkey
- key within subspaceserialized
- serialized representationversion
- the version to store inline with this recordsplitLongRecords
- true
if multiple keys should be used; if false
, serialized
must fit in a single keyomitUnsplitSuffix
- if splitLongRecords
is false
, then this will omit a suffix added to the end of the key if true
for backwards-compatibility reasonsclearBasedOnPreviousSizeInfo
- if splitLongRecords
, whether to use previousSizeInfo
to determine how much to clearpreviousSizeInfo
- if clearBasedOnPreviousSizeInfo
, the FDBStoredSizes
for any old record, or null
if there was no old recordsizeInfo
- optional size information to populatepublic static CompletableFuture<com.apple.foundationdb.record.provider.foundationdb.FDBRawRecord> loadWithSplit(@Nonnull ReadTransaction tr, @Nonnull FDBRecordContext context, @Nonnull Subspace subspace, @Nonnull Tuple key, boolean splitLongRecords, boolean missingUnsplitRecordSuffix, @Nullable SplitHelper.SizeInfo sizeInfo)
tr
- read transactioncontext
- transaction contextsubspace
- subspace containing serialized valuekey
- key within subspacesplitLongRecords
- true
if multiple keys should be used; if false
, serialized
must fit in a single keymissingUnsplitRecordSuffix
- if splitLongRecords
is false
and this is true
, this will assume keys are missing a suffix for backwards compatibility reasonssizeInfo
- optional size information to populatepublic static CompletableFuture<Boolean> keyExists(@Nonnull ReadTransaction tr, @Nonnull FDBTransactionContext context, @Nonnull Subspace subspace, @Nonnull Tuple key, boolean splitLongRecords, boolean missingUnsplitRecordSuffix)
tr
- read transactioncontext
- transaction contextsubspace
- subspace containing serialized valuekey
- key within subspacesplitLongRecords
- true
if multiple keys should be used; if false
, serialized
must fit in a single keymissingUnsplitRecordSuffix
- if splitLongRecords
is false
and this is true
, this will assume keys are missing a suffix for backwards compatibility reasonstrue
if the provided key exists, false otherwise.public static void deleteSplit(@Nonnull FDBRecordContext context, @Nonnull Subspace subspace, @Nonnull Tuple key, boolean splitLongRecords, boolean missingUnsplitRecordSuffix, boolean clearBasedOnPreviousSizeInfo, @Nullable FDBStoredSizes previousSizeInfo)
context
- write transactionsubspace
- subspace to delete fromkey
- primary key of the record to delete within subspace
splitLongRecords
- true
if multiple keys should be used; if false
, serialized
must fit in a single keymissingUnsplitRecordSuffix
- if splitLongRecords
is false
and this is true
, this will assume keys are missing a suffix for backwards compatibility reasonsclearBasedOnPreviousSizeInfo
- if splitLongRecords
, whether to use previousSizeInfo
to determine how much to clearpreviousSizeInfo
- if clearBasedOnPreviousSizeInfo
, the FDBStoredSizes
for any old record, or null
if there was no old record