From 92593d511a924be37361d673c0313e183c72e2c8 Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Mon, 17 Aug 2020 16:24:35 -0700 Subject: [PATCH] Add a new EntryType for deletion with timestamp (#7195) Summary: Add `kEntryDeleteWithTimestamp` to `EntryType` which is a public API. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7195 Test Plan: make check Reviewed By: ajkr Differential Revision: D22914704 Pulled By: riversand963 fbshipit-source-id: 886f73c6b70c527cad1c8fc9fc8d3afe60e1ea39 --- HISTORY.md | 3 +++ db/dbformat.cc | 2 ++ include/rocksdb/types.h | 2 ++ 3 files changed, 7 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 7b249b7fc..f9d10e831 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -12,6 +12,9 @@ ### Performance Improvements * Reduce thread number for multiple DB instances by re-using one global thread for statistics dumping and persisting. +### Public API Change +* Expose kTypeDeleteWithTimestamp in EntryType and update GetEntryType() accordingly. + ## 6.12 (2020-07-28) ### Public API Change * Encryption file classes now exposed for inheritance in env_encryption.h diff --git a/db/dbformat.cc b/db/dbformat.cc index 85411ed3e..40e9917ec 100644 --- a/db/dbformat.cc +++ b/db/dbformat.cc @@ -32,6 +32,8 @@ EntryType GetEntryType(ValueType value_type) { return kEntryPut; case kTypeDeletion: return kEntryDelete; + case kTypeDeletionWithTimestamp: + return kEntryDeleteWithTimestamp; case kTypeSingleDeletion: return kEntrySingleDelete; case kTypeMerge: diff --git a/include/rocksdb/types.h b/include/rocksdb/types.h index 4d004b69d..a4ab9c07a 100644 --- a/include/rocksdb/types.h +++ b/include/rocksdb/types.h @@ -18,6 +18,7 @@ typedef uint64_t SequenceNumber; const SequenceNumber kMinUnCommittedSeq = 1; // 0 is always committed // User-oriented representation of internal key types. +// Ordering of this enum entries should not change. enum EntryType { kEntryPut, kEntryDelete, @@ -25,6 +26,7 @@ enum EntryType { kEntryMerge, kEntryRangeDeletion, kEntryBlobIndex, + kEntryDeleteWithTimestamp, kEntryOther, };