Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / bench / testfilestore_backend.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2
3 #ifndef TESTFILESTOREBACKENDH
4 #define TESTFILESTOREBACKENDH
5
6 #include "common/Finisher.h"
7 #include "backend.h"
8 #include "include/Context.h"
9 #include "os/ObjectStore.h"
10
11 class TestFileStoreBackend : public Backend {
12   ObjectStore *os;
13   Finisher finisher;
14   map<string, ObjectStore::Sequencer> osrs;
15   const bool write_infos;
16
17 public:
18   TestFileStoreBackend(ObjectStore *os, bool write_infos);
19   ~TestFileStoreBackend() override {
20     finisher.stop();
21   }
22   void write(
23     const string &oid,
24     uint64_t offset,
25     const bufferlist &bl,
26     Context *on_applied,
27     Context *on_commit) override;
28
29   void read(
30     const string &oid,
31     uint64_t offset,
32     uint64_t length,
33     bufferlist *bl,
34     Context *on_complete) override;
35 };
36
37 #endif