]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/librados_test_stub/TestRadosClient.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / test / librados_test_stub / TestRadosClient.h
index 993382f7b9823646eef980fe1d39f2b76421cd10..e7f8d075175ef87d788bc692ef5730098c890745 100644 (file)
@@ -5,6 +5,7 @@
 #define CEPH_TEST_RADOS_CLIENT_H
 
 #include <map>
+#include <memory>
 #include <list>
 #include <string>
 #include <vector>
 
 #include "include/rados/librados.hpp"
 #include "common/config.h"
+#include "common/config_obs.h"
 #include "include/buffer_fwd.h"
 #include "test/librados_test_stub/TestWatchNotify.h"
 
 class Finisher;
 
+namespace boost { namespace asio { struct io_context; }}
+namespace ceph { namespace async { struct io_context_pool; }}
+
 namespace librados {
 
 class TestIoCtxImpl;
 
-class TestRadosClient {
+class TestRadosClient : public md_config_obs_t {
 public:
 
   static void Deallocate(librados::TestRadosClient* client)
@@ -99,10 +104,14 @@ public:
   virtual int aio_watch_flush(AioCompletionImpl *c);
   virtual int watch_flush() = 0;
 
-  virtual bool is_blacklisted() const = 0;
-  virtual int blacklist_add(const std::string& client_address,
+  virtual bool is_blocklisted() const = 0;
+  virtual int blocklist_add(const std::string& client_address,
                            uint32_t expire_seconds) = 0;
 
+  virtual int wait_for_latest_osd_map() {
+    return 0;
+  }
+
   Finisher *get_aio_finisher() {
     return m_aio_finisher;
   }
@@ -117,6 +126,8 @@ public:
 
   void finish_aio_completion(AioCompletionImpl *c, int r);
 
+  boost::asio::io_context& get_io_context();
+
 protected:
   virtual ~TestRadosClient();
 
@@ -125,7 +136,12 @@ protected:
   virtual void transaction_finish(const std::string& nspace,
                                   const std::string &oid) = 0;
 
+  const char** get_tracked_conf_keys() const override;
+  void handle_conf_change(const ConfigProxy& conf,
+                          const std::set<std::string> &changed) override;
+
 private:
+  struct IOContextPool;
 
   CephContext *m_cct;
   std::atomic<uint64_t> m_refcount = { 0 };
@@ -138,6 +154,7 @@ private:
   std::vector<Finisher *> m_finishers;
   boost::hash<std::string> m_hash;
 
+  std::unique_ptr<ceph::async::io_context_pool> m_io_context_pool;
 };
 
 } // namespace librados