From: Samuel Just Date: Fri, 26 Jul 2019 22:02:56 +0000 (-0700) Subject: src/kv: add support for fetching implementation specific properties X-Git-Tag: v15.1.0~1367^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c261ea9a45ed0ff07ae15364ab7904bc810320e9;p=ceph.git src/kv: add support for fetching implementation specific properties Only implemented for rocksdb for now. Signed-off-by: Samuel Just --- diff --git a/src/kv/KeyValueDB.h b/src/kv/KeyValueDB.h index 2ac43e7daac8..0e4fed97cf4c 100644 --- a/src/kv/KeyValueDB.h +++ b/src/kv/KeyValueDB.h @@ -424,6 +424,17 @@ public: virtual PerfCounters *get_perf_counters() { return nullptr; } + + /** + * Access implementation specific integral property corresponding + * to passed property and prefic. + * Return value is true if property is valid for prefix, populates out. + */ + virtual bool get_property( + const std::string &property, + uint64_t *out) { + return false; + } protected: /// List of matching prefixes/ColumnFamilies and merge operators std::vectorGetIntProperty(property, out); +} + int64_t RocksDBStore::estimate_prefix_size(const string& prefix, const string& key_prefix) { diff --git a/src/kv/RocksDBStore.h b/src/kv/RocksDBStore.h index e11d43b9ae10..254f6f3afda5 100644 --- a/src/kv/RocksDBStore.h +++ b/src/kv/RocksDBStore.h @@ -193,6 +193,10 @@ public: return logger; } + bool get_property( + const std::string &property, + uint64_t *out) final; + int64_t estimate_prefix_size(const string& prefix, const string& key_prefix) override;