summaryrefslogtreecommitdiffstats
path: root/src/test/ObjectMap
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ObjectMap')
-rw-r--r--src/test/ObjectMap/KeyValueDBMemory.cc21
-rw-r--r--src/test/ObjectMap/KeyValueDBMemory.h9
2 files changed, 29 insertions, 1 deletions
diff --git a/src/test/ObjectMap/KeyValueDBMemory.cc b/src/test/ObjectMap/KeyValueDBMemory.cc
index 234e963397e..cfe25930d6a 100644
--- a/src/test/ObjectMap/KeyValueDBMemory.cc
+++ b/src/test/ObjectMap/KeyValueDBMemory.cc
@@ -132,12 +132,26 @@ public:
return "";
}
+ string_view key_as_sv() override {
+ if (valid())
+ return (*it).first.second;
+ else
+ return "";
+ }
+
pair<string,string> raw_key() override {
if (valid())
return (*it).first;
else
return make_pair("", "");
}
+
+ pair<string_view,string_view> raw_key_as_sv() override {
+ if (valid())
+ return (*it).first;
+ else
+ return make_pair("", "");
+ }
bool raw_key_is_prefixed(const string &prefix) override {
return prefix == (*it).first.first;
@@ -150,6 +164,13 @@ public:
return bufferlist();
}
+ std::string_view value_as_sv() override {
+ if (valid())
+ return std::string_view{it->second.c_str(), it->second.length()};
+ else
+ return std::string_view();
+ }
+
int status() override {
return 0;
}
diff --git a/src/test/ObjectMap/KeyValueDBMemory.h b/src/test/ObjectMap/KeyValueDBMemory.h
index de84ede9049..8f6381dd52b 100644
--- a/src/test/ObjectMap/KeyValueDBMemory.h
+++ b/src/test/ObjectMap/KeyValueDBMemory.h
@@ -69,7 +69,14 @@ public:
explicit TransactionImpl_(KeyValueDBMemory *db) : db(db) {}
-
+ // dummy implementation
+ size_t get_count() const override {
+ return 0;
+ }
+ // dummy implementation
+ size_t get_size_bytes() const override {
+ return 0;
+ }
struct SetOp : public Context {
KeyValueDBMemory *db;
std::pair<std::string,std::string> key;