提交 8f59c41c 编写于 作者: L Levi Tamasi 提交者: Facebook GitHub Bot

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
上级 50154357
...@@ -26,7 +26,7 @@ namespace ROCKSDB_NAMESPACE { ...@@ -26,7 +26,7 @@ namespace ROCKSDB_NAMESPACE {
// and the value type is embedded as the low 8 bits in the sequence // 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 // number in internal keys, we need to use the highest-numbered
// ValueType, not the lowest). // ValueType, not the lowest).
const ValueType kValueTypeForSeek = kTypeDeletionWithTimestamp; const ValueType kValueTypeForSeek = kTypeWideColumnEntity;
const ValueType kValueTypeForSeekForPrev = kTypeDeletion; const ValueType kValueTypeForSeekForPrev = kTypeDeletion;
const std::string kDisableUserTimestamp(""); const std::string kDisableUserTimestamp("");
...@@ -46,6 +46,8 @@ EntryType GetEntryType(ValueType value_type) { ...@@ -46,6 +46,8 @@ EntryType GetEntryType(ValueType value_type) {
return kEntryRangeDeletion; return kEntryRangeDeletion;
case kTypeBlobIndex: case kTypeBlobIndex:
return kEntryBlobIndex; return kEntryBlobIndex;
case kTypeWideColumnEntity:
return kEntryWideColumnEntity;
default: default:
return kEntryOther; return kEntryOther;
} }
......
...@@ -66,7 +66,9 @@ enum ValueType : unsigned char { ...@@ -66,7 +66,9 @@ enum ValueType : unsigned char {
kTypeBeginUnprepareXID = 0x13, // WAL only. kTypeBeginUnprepareXID = 0x13, // WAL only.
kTypeDeletionWithTimestamp = 0x14, kTypeDeletionWithTimestamp = 0x14,
kTypeCommitXIDAndTimestamp = 0x15, // WAL only 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 // Defined in dbformat.cc
...@@ -76,8 +78,8 @@ extern const ValueType kValueTypeForSeekForPrev; ...@@ -76,8 +78,8 @@ extern const ValueType kValueTypeForSeekForPrev;
// Checks whether a type is an inline value type // Checks whether a type is an inline value type
// (i.e. a type used in memtable skiplist and sst file datablock). // (i.e. a type used in memtable skiplist and sst file datablock).
inline bool IsValueType(ValueType t) { inline bool IsValueType(ValueType t) {
return t <= kTypeMerge || t == kTypeSingleDeletion || t == kTypeBlobIndex || return t <= kTypeMerge || kTypeSingleDeletion == t || kTypeBlobIndex == t ||
kTypeDeletionWithTimestamp == t; kTypeDeletionWithTimestamp == t || kTypeWideColumnEntity == t;
} }
// Checks whether a type is from user operation // Checks whether a type is from user operation
......
...@@ -58,6 +58,7 @@ enum EntryType { ...@@ -58,6 +58,7 @@ enum EntryType {
kEntryRangeDeletion, kEntryRangeDeletion,
kEntryBlobIndex, kEntryBlobIndex,
kEntryDeleteWithTimestamp, kEntryDeleteWithTimestamp,
kEntryWideColumnEntity,
kEntryOther, kEntryOther,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册