From 8f59c41cc7448c1c0cce8a66d05cd1d9d945b792 Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Mon, 20 Jun 2022 18:04:08 -0700 Subject: [PATCH] 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 --- db/dbformat.cc | 4 +++- db/dbformat.h | 8 +++++--- include/rocksdb/types.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/db/dbformat.cc b/db/dbformat.cc index ae9f1b30f..6717341d0 100644 --- a/db/dbformat.cc +++ b/db/dbformat.cc @@ -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; } diff --git a/db/dbformat.h b/db/dbformat.h index dd5eee50b..cdd0285b6 100644 --- a/db/dbformat.h +++ b/db/dbformat.h @@ -66,7 +66,9 @@ enum ValueType : unsigned char { kTypeBeginUnprepareXID = 0x13, // WAL only. kTypeDeletionWithTimestamp = 0x14, kTypeCommitXIDAndTimestamp = 0x15, // WAL only - kMaxValue = 0x7F // Not used for storing records. + kTypeWideColumnEntity = 0x16, + kTypeColumnFamilyWideColumnEntity = 0x17, // WAL only + kMaxValue = 0x7F // Not used for storing records. }; // Defined in dbformat.cc @@ -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 diff --git a/include/rocksdb/types.h b/include/rocksdb/types.h index 20cff59b8..421abf3cd 100644 --- a/include/rocksdb/types.h +++ b/include/rocksdb/types.h @@ -58,6 +58,7 @@ enum EntryType { kEntryRangeDeletion, kEntryBlobIndex, kEntryDeleteWithTimestamp, + kEntryWideColumnEntity, kEntryOther, };