]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/KeyValueDB: add a new interface for single delete.
authorJianjian Huo <jianjian.huo@ssi.samsung.com>
Mon, 4 Apr 2016 21:18:50 +0000 (14:18 -0700)
committerJianjian Huo <jianjian.huo@ssi.samsung.com>
Mon, 25 Apr 2016 23:35:24 +0000 (16:35 -0700)
This is useful for log-insert-merge tree based key value store, such as
RocksDB, to avoid more LSM compactions for already deleted key value pairs.

Signed-off-by: Jianjian Huo <jianjian.huo@ssi.samsung.com>
src/kv/KeyValueDB.h

index aef93a3eb3c422f155d8bc88004b9da83e70a22d..92296f534dcba7ddef5a2268d86e76d44403f2e4 100644 (file)
@@ -88,6 +88,16 @@ public:
       const std::string &k           ///< [in] Key to remove
       ) = 0;
 
+    /// Remove Single Key which exists and was not overwritten.
+    /// This API is only related to performance optimization, and should only be 
+    /// re-implemented by log-insert-merge tree based keyvalue stores(such as RocksDB). 
+    /// If a key is overwritten (by calling set multiple times), then the result
+    /// of calling rm_single_key on this key is undefined.
+    virtual void rm_single_key(
+      const std::string &prefix,   ///< [in] Prefix to search for
+      const std::string &k           ///< [in] Key to remove
+      ) { return rmkey(prefix, k);}
+
     /// Removes keys beginning with prefix
     virtual void rmkeys_by_prefix(
       const std::string &prefix ///< [in] Prefix by which to remove keys