initial code repo
[stor4nfv.git] / src / ceph / src / test / bench / testfilestore_backend.h
diff --git a/src/ceph/src/test/bench/testfilestore_backend.h b/src/ceph/src/test/bench/testfilestore_backend.h
new file mode 100644 (file)
index 0000000..412d93c
--- /dev/null
@@ -0,0 +1,37 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+
+#ifndef TESTFILESTOREBACKENDH
+#define TESTFILESTOREBACKENDH
+
+#include "common/Finisher.h"
+#include "backend.h"
+#include "include/Context.h"
+#include "os/ObjectStore.h"
+
+class TestFileStoreBackend : public Backend {
+  ObjectStore *os;
+  Finisher finisher;
+  map<string, ObjectStore::Sequencer> osrs;
+  const bool write_infos;
+
+public:
+  TestFileStoreBackend(ObjectStore *os, bool write_infos);
+  ~TestFileStoreBackend() override {
+    finisher.stop();
+  }
+  void write(
+    const string &oid,
+    uint64_t offset,
+    const bufferlist &bl,
+    Context *on_applied,
+    Context *on_commit) override;
+
+  void read(
+    const string &oid,
+    uint64_t offset,
+    uint64_t length,
+    bufferlist *bl,
+    Context *on_complete) override;
+};
+
+#endif