Add new value value type for wide-column entities (#10211)

Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/10211

Test Plan: `make check`

Reviewed By: riversand963

Differential Revision: D37294067

Pulled By: ltamasi

fbshipit-source-id: 3b26f1964746ba4e3654579cb07cd975a29c7319
main
Levi Tamasi 2 years ago committed by Facebook GitHub Bot
parent 501543573a
commit 8f59c41cc7
  1. 4
      db/dbformat.cc
  2. 6
      db/dbformat.h
  3. 1
      include/rocksdb/types.h

@ -26,7 +26,7 @@ namespace ROCKSDB_NAMESPACE {
// and the value type is embedded as the low 8 bits in the sequence
// number in internal keys, we need to use the highest-numbered
// ValueType, not the lowest).
const ValueType kValueTypeForSeek = kTypeDeletionWithTimestamp;
const ValueType kValueTypeForSeek = kTypeWideColumnEntity;
const ValueType kValueTypeForSeekForPrev = kTypeDeletion;
const std::string kDisableUserTimestamp("");
@ -46,6 +46,8 @@ EntryType GetEntryType(ValueType value_type) {
return kEntryRangeDeletion;
case kTypeBlobIndex:
return kEntryBlobIndex;
case kTypeWideColumnEntity:
return kEntryWideColumnEntity;
default:
return kEntryOther;
}

@ -66,6 +66,8 @@ enum ValueType : unsigned char {
kTypeBeginUnprepareXID = 0x13, // WAL only.
kTypeDeletionWithTimestamp = 0x14,
kTypeCommitXIDAndTimestamp = 0x15, // WAL only
kTypeWideColumnEntity = 0x16,
kTypeColumnFamilyWideColumnEntity = 0x17, // WAL only
kMaxValue = 0x7F // Not used for storing records.
};
@ -76,8 +78,8 @@ extern const ValueType kValueTypeForSeekForPrev;
// Checks whether a type is an inline value type
// (i.e. a type used in memtable skiplist and sst file datablock).
inline bool IsValueType(ValueType t) {
return t <= kTypeMerge || t == kTypeSingleDeletion || t == kTypeBlobIndex ||
kTypeDeletionWithTimestamp == t;
return t <= kTypeMerge || kTypeSingleDeletion == t || kTypeBlobIndex == t ||
kTypeDeletionWithTimestamp == t || kTypeWideColumnEntity == t;
}
// Checks whether a type is from user operation

@ -58,6 +58,7 @@ enum EntryType {
kEntryRangeDeletion,
kEntryBlobIndex,
kEntryDeleteWithTimestamp,
kEntryWideColumnEntity,
kEntryOther,
};

Loading…
Cancel
Save