Skip to content

Commit

Permalink
Add new value value type for wide-column entities (#10211)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #10211

Test Plan: `make check`

Reviewed By: riversand963

Differential Revision: D37294067

Pulled By: ltamasi

fbshipit-source-id: 3b26f1964746ba4e3654579cb07cd975a29c7319
  • Loading branch information
ltamasi authored and facebook-github-bot committed Jun 21, 2022
1 parent 5015435 commit 8f59c41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion db/dbformat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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("");

Expand All @@ -46,6 +46,8 @@ EntryType GetEntryType(ValueType value_type) {
return kEntryRangeDeletion;
case kTypeBlobIndex:
return kEntryBlobIndex;
case kTypeWideColumnEntity:
return kEntryWideColumnEntity;
default:
return kEntryOther;
}
Expand Down
8 changes: 5 additions & 3 deletions db/dbformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/rocksdb/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ enum EntryType {
kEntryRangeDeletion,
kEntryBlobIndex,
kEntryDeleteWithTimestamp,
kEntryWideColumnEntity,
kEntryOther,
};

Expand Down

0 comments on commit 8f59c41

Please sign in to comment.