From: Jianjian Huo Date: Mon, 4 Apr 2016 21:18:50 +0000 (-0700) Subject: kv/KeyValueDB: add a new interface for single delete. X-Git-Tag: v11.0.0~826^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9c60532eaed88a9a9d33dc31d8dcd2a11a96c362;p=ceph.git kv/KeyValueDB: add a new interface for single delete. 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 --- diff --git a/src/kv/KeyValueDB.h b/src/kv/KeyValueDB.h index aef93a3eb3c4..92296f534dcb 100644 --- a/src/kv/KeyValueDB.h +++ b/src/kv/KeyValueDB.h @@ -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