]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: add override in header file 13774/head
authorliuchang0812 <liuchang0812@gmail.com>
Wed, 22 Feb 2017 11:51:51 +0000 (19:51 +0800)
committerliuchang0812 <liuchang0812@gmail.com>
Fri, 3 Mar 2017 11:21:44 +0000 (19:21 +0800)
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
68 files changed:
src/ceph_fuse.cc
src/client/Client.h
src/client/ObjecterWriteback.h
src/cls/cephfs/cls_cephfs.cc
src/cls/hello/cls_hello.cc
src/cls/rgw/cls_rgw_client.cc
src/cls/rgw/cls_rgw_client.h
src/cls/user/cls_user_client.cc
src/cls/user/cls_user_client.h
src/common/Cond.h
src/common/ContextCompletion.h
src/common/Continuation.h
src/common/Finisher.h
src/common/Formatter.h
src/common/HTMLFormatter.h
src/common/OutputDataSocket.h
src/common/PrebufferedStreambuf.h
src/common/PrioritizedQueue.h
src/common/SubProcess.h
src/common/Throttle.h
src/common/TracepointProvider.h
src/common/WeightedPriorityQueue.h
src/common/WorkQueue.h
src/common/admin_socket.h
src/common/bloom_filter.hpp
src/common/buffer.cc
src/common/ceph_context.cc
src/common/ceph_context.h
src/common/ceph_json.h
src/common/deleter.h
src/compressor/AsyncCompressor.h
src/compressor/CompressionPlugin.h
src/compressor/snappy/CompressionPluginSnappy.h
src/compressor/zlib/CompressionPluginZlib.h
src/compressor/zstd/CompressionPluginZstd.h
src/crush/CrushTreeDumper.h
src/erasure-code/ErasureCode.h
src/erasure-code/isa/ErasureCodeIsa.h
src/erasure-code/isa/ErasureCodePluginIsa.h
src/erasure-code/jerasure/ErasureCodeJerasure.h
src/erasure-code/jerasure/ErasureCodePluginJerasure.h
src/erasure-code/lrc/ErasureCodeLrc.h
src/erasure-code/lrc/ErasureCodePluginLrc.h
src/erasure-code/shec/ErasureCodePluginShec.h
src/erasure-code/shec/ErasureCodeShec.h
src/global/signal_handler.cc
src/include/Context.h
src/include/buffer.h
src/include/rados/librados.hpp
src/journal/FutureImpl.h
src/journal/JournalMetadata.cc
src/journal/JournalMetadata.h
src/journal/JournalPlayer.cc
src/journal/JournalPlayer.h
src/journal/JournalRecorder.h
src/journal/JournalTrimmer.h
src/journal/Journaler.h
src/journal/ObjectPlayer.h
src/journal/ObjectRecorder.h
src/journal/Utils.h
src/key_value_store/kv_flat_btree_async.h
src/kv/KeyValueDB.h
src/kv/LevelDBStore.cc
src/kv/LevelDBStore.h
src/kv/MemDB.h
src/kv/RocksDBStore.cc
src/kv/RocksDBStore.h
src/log/Log.h

index 824be1272d5b54267fd55fbbb30ce1f72e0223e6..099ceb0020d93f74b90129e8b195c5e71f16d806 100644 (file)
@@ -153,7 +153,7 @@ int main(int argc, const char **argv, const char *envp[]) {
        cfuse = cf;
        client = cl;
       }
-      ~RemountTest() {}
+      ~RemountTest() override {}
       void *entry() override {
 #if defined(__linux__)
        int ver = get_linux_version();
index baa79ab94810671554627095ef3cfbe8a94288f8..b6253fbab7652994c76aa9f957db47be176311ad 100644 (file)
@@ -259,7 +259,7 @@ class Client : public Dispatcher, public md_config_obs_t {
   public:
     explicit CommandHook(Client *client);
     bool call(std::string command, cmdmap_t &cmdmap, std::string format,
-             bufferlist& out);
+             bufferlist& out) override;
   };
   CommandHook m_command_hook;
 
@@ -554,13 +554,13 @@ protected:
 
   // friends
   friend class SyntheticClient;
-  bool ms_dispatch(Message *m);
+  bool ms_dispatch(Message *m) override;
 
-  void ms_handle_connect(Connection *con);
-  bool ms_handle_reset(Connection *con);
-  void ms_handle_remote_reset(Connection *con);
-  bool ms_handle_refused(Connection *con);
-  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new);
+  void ms_handle_connect(Connection *con) override;
+  bool ms_handle_reset(Connection *con) override;
+  void ms_handle_remote_reset(Connection *con) override;
+  bool ms_handle_refused(Connection *con) override;
+  bool ms_get_authorizer(int dest_type, AuthAuthorizer **authorizer, bool force_new) override;
 
   int authenticate();
 
@@ -591,7 +591,7 @@ protected:
   void clear_filer_flags(int flags);
 
   Client(Messenger *m, MonClient *mc);
-  ~Client();
+  ~Client() override;
   void tear_down_cache();
 
   void update_metadata(std::string const &k, std::string const &v);
@@ -751,8 +751,8 @@ private:
     Client *client;
     Fh *f;
     C_Readahead(Client *c, Fh *f);
-    ~C_Readahead();
-    void finish(int r);
+    ~C_Readahead() override;
+    void finish(int r) override;
   };
 
   int _read_sync(Fh *f, uint64_t off, uint64_t len, bufferlist *bl, bool *checkeof);
@@ -1219,9 +1219,9 @@ public:
   void ll_register_callbacks(struct client_callback_args *args);
   int test_dentry_handling(bool can_invalidate);
 
-  virtual const char** get_tracked_conf_keys() const;
-  virtual void handle_conf_change(const struct md_config_t *conf,
-                                 const std::set <std::string> &changed);
+  const char** get_tracked_conf_keys() const override;
+  void handle_conf_change(const struct md_config_t *conf,
+                                 const std::set <std::string> &changed) override;
 };
 
 #endif
index d9b0647482d03d7aeffbee4f2ae08d0abe9989d9..97cb228d5b89705e0403b722ae615f5d8874633d 100644 (file)
@@ -12,29 +12,29 @@ class ObjecterWriteback : public WritebackHandler {
     : m_objecter(o),
       m_finisher(fin),
       m_lock(lock) { }
-  virtual ~ObjecterWriteback() {}
+  ~ObjecterWriteback() override {}
 
-  virtual void read(const object_t& oid, uint64_t object_no,
+  void read(const object_t& oid, uint64_t object_no,
                    const object_locator_t& oloc, uint64_t off, uint64_t len,
                    snapid_t snapid, bufferlist *pbl, uint64_t trunc_size,
-                   __u32 trunc_seq, int op_flags, Context *onfinish) {
+                   __u32 trunc_seq, int op_flags, Context *onfinish) override {
     m_objecter->read_trunc(oid, oloc, off, len, snapid, pbl, 0,
                           trunc_size, trunc_seq,
                           new C_OnFinisher(new C_Lock(m_lock, onfinish),
                                            m_finisher));
   }
 
-  virtual bool may_copy_on_write(const object_t& oid, uint64_t read_off,
-                                uint64_t read_len, snapid_t snapid) {
+  bool may_copy_on_write(const object_t& oid, uint64_t read_off,
+                                uint64_t read_len, snapid_t snapid) override {
     return false;
   }
 
-  virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
+  ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
                           uint64_t off, uint64_t len,
                           const SnapContext& snapc, const bufferlist &bl,
                           ceph::real_time mtime, uint64_t trunc_size,
                           __u32 trunc_seq, ceph_tid_t journal_tid,
-                          Context *oncommit) {
+                          Context *oncommit) override {
     return m_objecter->write_trunc(oid, oloc, off, len, snapc, bl, mtime, 0,
                                   trunc_size, trunc_seq,
                                   new C_OnFinisher(new C_Lock(m_lock,
@@ -42,13 +42,13 @@ class ObjecterWriteback : public WritebackHandler {
                                                    m_finisher));
   }
 
-  virtual bool can_scattered_write() { return true; }
+  bool can_scattered_write() override { return true; }
   using WritebackHandler::write;
-  virtual ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
+  ceph_tid_t write(const object_t& oid, const object_locator_t& oloc,
                            vector<pair<uint64_t, bufferlist> >& io_vec,
                           const SnapContext& snapc, ceph::real_time mtime,
                           uint64_t trunc_size, __u32 trunc_seq,
-                          Context *oncommit) {
+                          Context *oncommit) override {
     ObjectOperation op;
     for (vector<pair<uint64_t, bufferlist> >::iterator p = io_vec.begin();
         p != io_vec.end();
index 61c51823704a98d88270447791fbffca9adb1366..6ae1f8d28807c52513d583d0da21097f9cdda97b 100644 (file)
@@ -145,7 +145,7 @@ public:
     return 0;
   }
 
-  ~PGLSCephFSFilter() {}
+  ~PGLSCephFSFilter() override {}
   bool reject_empty_xattr() override { return false; }
   bool filter(const hobject_t &obj, bufferlist& xattr_data,
                       bufferlist& outdata) override;
index 48759255b6fafed36d8659d02f2686c0d8650192..030c775bfe0fc91e2fa759802db39acd2ef06d7f 100644 (file)
@@ -262,7 +262,7 @@ public:
     return 0;
   }
 
-  ~PGLSHelloFilter() {}
+  ~PGLSHelloFilter() override {}
   bool filter(const hobject_t &obj, bufferlist& xattr_data,
                       bufferlist& outdata) override
   {
index e981abd5624e3aa462f1bc92a98c4747895d2e23..c521a038056fe486d45982ff3666095a9da77f82 100644 (file)
@@ -24,7 +24,7 @@ private:
   int *ret_code;
 public:
   ClsBucketIndexOpCtx(T* _data, int *_ret_code) : data(_data), ret_code(_ret_code) { assert(data); }
-  ~ClsBucketIndexOpCtx() {}
+  ~ClsBucketIndexOpCtx() override {}
   void handle_completion(int r, bufferlist& outbl) override {
     if (r >= 0) {
       try {
@@ -520,7 +520,7 @@ class GetDirHeaderCompletion : public ObjectOperationCompletion {
   RGWGetDirHeader_CB *ret_ctx;
 public:
   explicit GetDirHeaderCompletion(RGWGetDirHeader_CB *_ctx) : ret_ctx(_ctx) {}
-  ~GetDirHeaderCompletion() {
+  ~GetDirHeaderCompletion() override {
     ret_ctx->put();
   }
   void handle_completion(int r, bufferlist& outbl) override {
index be7106a6c34f9658dee0bd2cc4e9864dd884b836..084e2578052e1366de93863b6eb8cbad9a11221c 100644 (file)
@@ -122,7 +122,7 @@ public:
 
 class RGWGetDirHeader_CB : public RefCountedObject {
 public:
-  virtual ~RGWGetDirHeader_CB() {}
+  ~RGWGetDirHeader_CB() override {}
   virtual void handle_response(int r, rgw_bucket_dir_header& header) = 0;
 };
 
@@ -285,9 +285,9 @@ public:
 
 class CLSRGWIssueBucketIndexInit : public CLSRGWConcurrentIO {
 protected:
-  int issue_op(int shard_id, const string& oid);
-  int valid_ret_code() { return -EEXIST; }
-  void cleanup();
+  int issue_op(int shard_id, const string& oid) override;
+  int valid_ret_code() override { return -EEXIST; }
+  void cleanup() override;
 public:
   CLSRGWIssueBucketIndexInit(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
                      uint32_t _max_aio) :
@@ -297,7 +297,7 @@ public:
 class CLSRGWIssueSetTagTimeout : public CLSRGWConcurrentIO {
   uint64_t tag_timeout;
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const string& oid) override;
 public:
   CLSRGWIssueSetTagTimeout(librados::IoCtx& ioc, map<int, string>& _bucket_objs,
                      uint32_t _max_aio, uint64_t _tag_timeout) :
@@ -368,7 +368,7 @@ class CLSRGWIssueBucketList : public CLSRGWConcurrentIO {
   bool list_versions;
   map<int, rgw_cls_list_ret>& result;
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const string& oid) override;
 public:
   CLSRGWIssueBucketList(librados::IoCtx& io_ctx, const cls_rgw_obj_key& _start_obj,
                         const string& _filter_prefix, uint32_t _num_entries,
@@ -385,7 +385,7 @@ class CLSRGWIssueBILogList : public CLSRGWConcurrentIO {
   BucketIndexShardsManager& marker_mgr;
   uint32_t max;
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const string& oid) override;
 public:
   CLSRGWIssueBILogList(librados::IoCtx& io_ctx, BucketIndexShardsManager& _marker_mgr, uint32_t _max,
                        map<int, string>& oids,
@@ -398,12 +398,12 @@ class CLSRGWIssueBILogTrim : public CLSRGWConcurrentIO {
   BucketIndexShardsManager& start_marker_mgr;
   BucketIndexShardsManager& end_marker_mgr;
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const string& oid) override;
   // Trim until -ENODATA is returned.
-  int valid_ret_code() { return -ENODATA; }
-  bool need_multiple_rounds() { return true; }
-  void add_object(int shard, const string& oid) { objs_container[shard] = oid; }
-  void reset_container(map<int, string>& objs) {
+  int valid_ret_code() override { return -ENODATA; }
+  bool need_multiple_rounds() override { return true; }
+  void add_object(int shard, const string& oid) override { objs_container[shard] = oid; }
+  void reset_container(map<int, string>& objs) override {
     objs_container.swap(objs);
     iter = objs_container.begin();
     objs.clear();
@@ -427,7 +427,7 @@ public:
 class CLSRGWIssueBucketCheck : public CLSRGWConcurrentIO /*<map<string, struct rgw_cls_check_index_ret> >*/ {
   map<int, struct rgw_cls_check_index_ret>& result;
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const string& oid) override;
 public:
   CLSRGWIssueBucketCheck(librados::IoCtx& ioc, map<int, string>& oids, map<int, struct rgw_cls_check_index_ret>& bucket_objs_ret,
                      uint32_t _max_aio) :
@@ -436,7 +436,7 @@ public:
 
 class CLSRGWIssueBucketRebuild : public CLSRGWConcurrentIO {
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const string& oid) override;
 public:
   CLSRGWIssueBucketRebuild(librados::IoCtx& io_ctx, map<int, string>& bucket_objs,
                            uint32_t max_aio) : CLSRGWConcurrentIO(io_ctx, bucket_objs, max_aio) {}
@@ -445,7 +445,7 @@ public:
 class CLSRGWIssueGetDirHeader : public CLSRGWConcurrentIO {
   map<int, rgw_cls_list_ret>& result;
 protected:
-  int issue_op(int shard_id, const string& oid);
+  int issue_op(int shard_id, const string& oid) override;
 public:
   CLSRGWIssueGetDirHeader(librados::IoCtx& io_ctx, map<int, string>& oids, map<int, rgw_cls_list_ret>& dir_headers,
                           uint32_t max_aio) :
index 8bb7d8447b17a474c153de803abbef46fbfa0e47..2625adda3cde9f2226017c89416034f2c6c6778d 100644 (file)
@@ -97,7 +97,7 @@ class ClsUserGetHeaderCtx : public ObjectOperationCompletion {
   int *pret;
 public:
   ClsUserGetHeaderCtx(cls_user_header *_h, RGWGetUserHeader_CB *_ctx, int *_pret) : header(_h), ret_ctx(_ctx), pret(_pret) {}
-  ~ClsUserGetHeaderCtx() {
+  ~ClsUserGetHeaderCtx() override {
     if (ret_ctx) {
       ret_ctx->put();
     }
index 5a1d9441200ab4a36a486a439413cd8a50fb5dcf..9465faa7c51bbaedf3f9718eb8e7c06105196f8b 100644 (file)
@@ -11,7 +11,7 @@
 
 class RGWGetUserHeader_CB : public RefCountedObject {
 public:
-  virtual ~RGWGetUserHeader_CB() {}
+  ~RGWGetUserHeader_CB() override {}
   virtual void handle_response(int r, cls_user_header& header) = 0;
 };
 
index de625429273f111d253822e9710998c34f1bfc6c..14022768303ad5050e8ffb7eeff82d6605d33116 100644 (file)
@@ -139,7 +139,7 @@ public:
   C_Cond(Cond *c, bool *d, int *r) : cond(c), done(d), rval(r) {
     *done = false;
   }
-  void finish(int r) {
+  void finish(int r) override {
     *done = true;
     *rval = r;
     cond->Signal();
@@ -162,7 +162,7 @@ public:
   C_SafeCond(Mutex *l, Cond *c, bool *d, int *r=0) : lock(l), cond(c), done(d), rval(r) {
     *done = false;
   }
-  void finish(int r) {
+  void finish(int r) override {
     lock->Lock();
     if (rval)
       *rval = r;
@@ -185,10 +185,10 @@ class C_SaferCond : public Context {
   int rval;      ///< return value
 public:
   C_SaferCond() : lock("C_SaferCond"), done(false), rval(0) {}
-  void finish(int r) { complete(r); }
+  void finish(int r) override { complete(r); }
 
   /// We overload complete in order to not delete the context
-  void complete(int r) {
+  void complete(int r) override {
     Mutex::Locker l(lock);
     done = true;
     rval = r;
index 2cf5d55cb0c053491a9713337b021367ad5dc0c8..a8b5b689f00f03adc1454fa222955e31d858d9f6 100644 (file)
@@ -34,7 +34,7 @@ public:
     m_context_completion.start_op();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     m_context_completion.finish_op(r);
   }
 
index 856c6b8b47f693338d324770e8b9642041375448..394856973ab692e7c8ab9ac7082c108cd2eefa03 100644 (file)
@@ -58,7 +58,7 @@ class Continuation {
     Callback(Continuation *c, int stage) :
       continuation(c),
       stage_to_activate(stage) {}
-    void finish(int r) {
+    void finish(int r) override {
       continuation->continue_function(r, stage_to_activate);
     }
   };
index ffdddf632e8d3726bbc0a48367cc1a1ed87ae140..5947fa77df149f0700a10b0d5884c8a6050ad2aa 100644 (file)
@@ -63,7 +63,7 @@ class Finisher {
   struct FinisherThread : public Thread {
     Finisher *fin;    
     explicit FinisherThread(Finisher *f) : fin(f) {}
-    void* entry() { return (void*)fin->finisher_thread_entry(); }
+    void* entry() override { return (void*)fin->finisher_thread_entry(); }
   } finisher_thread;
 
  public:
@@ -174,14 +174,14 @@ public:
     assert(con != NULL);
   }
 
-  ~C_OnFinisher() {
+  ~C_OnFinisher() override {
     if (con != nullptr) {
       delete con;
       con = nullptr;
     }
   }
 
-  void finish(int r) {
+  void finish(int r) override {
     fin->queue(con, r);
     con = nullptr;
   }
index d2c3df26d84219e103c406bd6dc791d7bda375a1..a4cf3e13cd58c1040fdf417a733b3944b9082060 100644 (file)
@@ -93,25 +93,25 @@ namespace ceph {
   public:
     explicit JSONFormatter(bool p = false);
 
-    virtual void set_status(int status, const char* status_name) {};
-    virtual void output_header() {};
-    virtual void output_footer() {};
-    void flush(std::ostream& os);
+    void set_status(int status, const char* status_name) override {};
+    void output_header() override {};
+    void output_footer() override {};
+    void flush(std::ostream& os) override;
     using Formatter::flush; // don't hide Formatter::flush(bufferlist &bl)
-    void reset();
-    virtual void open_array_section(const char *name);
-    void open_array_section_in_ns(const char *name, const char *ns);
-    void open_object_section(const char *name);
-    void open_object_section_in_ns(const char *name, const char *ns);
-    void close_section();
-    void dump_unsigned(const char *name, uint64_t u);
-    void dump_int(const char *name, int64_t u);
-    void dump_float(const char *name, double d);
-    void dump_string(const char *name, const std::string& s);
-    std::ostream& dump_stream(const char *name);
-    void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap);
-    int get_len() const;
-    void write_raw_data(const char *data);
+    void reset() override;
+    void open_array_section(const char *name) override;
+    void open_array_section_in_ns(const char *name, const char *ns) override;
+    void open_object_section(const char *name) override;
+    void open_object_section_in_ns(const char *name, const char *ns) override;
+    void close_section() override;
+    void dump_unsigned(const char *name, uint64_t u) override;
+    void dump_int(const char *name, int64_t u) override;
+    void dump_float(const char *name, double d) override;
+    void dump_string(const char *name, const std::string& s) override;
+    std::ostream& dump_stream(const char *name) override;
+    void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
+    int get_len() const override;
+    void write_raw_data(const char *data) override;
 
   private:
 
@@ -138,31 +138,31 @@ namespace ceph {
     static const char *XML_1_DTD;
     XMLFormatter(bool pretty = false, bool lowercased = false, bool underscored = true);
 
-    virtual void set_status(int status, const char* status_name) {}
-    virtual void output_header();
-    virtual void output_footer();
+    void set_status(int status, const char* status_name) override {}
+    void output_header() override;
+    void output_footer() override;
 
-    void flush(std::ostream& os);
+    void flush(std::ostream& os) override;
     using Formatter::flush; // don't hide Formatter::flush(bufferlist &bl)
-    void reset();
-    void open_array_section(const char *name);
-    void open_array_section_in_ns(const char *name, const char *ns);
-    void open_object_section(const char *name);
-    void open_object_section_in_ns(const char *name, const char *ns);
-    void close_section();
-    void dump_unsigned(const char *name, uint64_t u);
-    void dump_int(const char *name, int64_t u);
-    void dump_float(const char *name, double d);
-    void dump_string(const char *name, const std::string& s);
-    std::ostream& dump_stream(const char *name);
-    void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap);
-    int get_len() const;
-    void write_raw_data(const char *data);
+    void reset() override;
+    void open_array_section(const char *name) override;
+    void open_array_section_in_ns(const char *name, const char *ns) override;
+    void open_object_section(const char *name) override;
+    void open_object_section_in_ns(const char *name, const char *ns) override;
+    void close_section() override;
+    void dump_unsigned(const char *name, uint64_t u) override;
+    void dump_int(const char *name, int64_t u) override;
+    void dump_float(const char *name, double d) override;
+    void dump_string(const char *name, const std::string& s) override;
+    std::ostream& dump_stream(const char *name) override;
+    void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
+    int get_len() const override;
+    void write_raw_data(const char *data) override;
 
     /* with attrs */
-    void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs);
-    void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs);
-    void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs);
+    void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
+    void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
+    void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs) override;
 
   protected:
     void open_section_in_ns(const char *name, const char *ns, const FormatterAttrs *attrs);
@@ -185,31 +185,31 @@ namespace ceph {
   public:
     explicit TableFormatter(bool keyval = false);
 
-    virtual void set_status(int status, const char* status_name) {};
-    virtual void output_header() {};
-    virtual void output_footer() {};
-    void flush(std::ostream& os);
+    void set_status(int status, const char* status_name) override {};
+    void output_header() override {};
+    void output_footer() override {};
+    void flush(std::ostream& os) override;
     using Formatter::flush; // don't hide Formatter::flush(bufferlist &bl)
-    void reset();
-    virtual void open_array_section(const char *name);
-    void open_array_section_in_ns(const char *name, const char *ns);
-    void open_object_section(const char *name);
-    void open_object_section_in_ns(const char *name, const char *ns);
-
-    void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs);
-    void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs);
-
-    void close_section();
-    void dump_unsigned(const char *name, uint64_t u);
-    void dump_int(const char *name, int64_t u);
-    void dump_float(const char *name, double d);
-    void dump_string(const char *name, const std::string& s);
-    void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap);
-    void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs);
-    std::ostream& dump_stream(const char *name);
-
-    int get_len() const;
-    void write_raw_data(const char *data);
+    void reset() override;
+    void open_array_section(const char *name) override;
+    void open_array_section_in_ns(const char *name, const char *ns) override;
+    void open_object_section(const char *name) override;
+    void open_object_section_in_ns(const char *name, const char *ns) override;
+
+    void open_array_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
+    void open_object_section_with_attrs(const char *name, const FormatterAttrs& attrs) override;
+
+    void close_section() override;
+    void dump_unsigned(const char *name, uint64_t u) override;
+    void dump_int(const char *name, int64_t u) override;
+    void dump_float(const char *name, double d) override;
+    void dump_string(const char *name, const std::string& s) override;
+    void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
+    void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs) override;
+    std::ostream& dump_stream(const char *name) override;
+
+    int get_len() const override;
+    void write_raw_data(const char *data) override;
     void get_attrs_str(const FormatterAttrs *attrs, std::string& attrs_str);
 
   private:
index 69c82a537f39fa33a941284a7f4e09b409a97912..23fc8765599ae4760c06c671339397e732e969c3 100644 (file)
@@ -21,21 +21,21 @@ namespace ceph {
   class HTMLFormatter : public XMLFormatter {
   public:
     explicit HTMLFormatter(bool pretty = false);
-    ~HTMLFormatter();
-    void reset();
+    ~HTMLFormatter() override;
+    void reset() override;
 
-    virtual void set_status(int status, const char* status_name);
-    virtual void output_header();
+    void set_status(int status, const char* status_name) override;
+    void output_header() override;
 
-    void dump_unsigned(const char *name, uint64_t u);
-    void dump_int(const char *name, int64_t u);
-    void dump_float(const char *name, double d);
-    void dump_string(const char *name, const std::string& s);
-    std::ostream& dump_stream(const char *name);
-    void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap);
+    void dump_unsigned(const char *name, uint64_t u) override;
+    void dump_int(const char *name, int64_t u) override;
+    void dump_float(const char *name, double d) override;
+    void dump_string(const char *name, const std::string& s) override;
+    std::ostream& dump_stream(const char *name) override;
+    void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override;
 
     /* with attrs */
-    void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs);
+    void dump_string_with_attrs(const char *name, const std::string& s, const FormatterAttrs& attrs) override;
   private:
     template <typename T> void dump_template(const char *name, T arg);
 
index f581a56bf031d2928bed02074893010c368c9e05..44490679fbf12860d8cfe8216ca304b696b480c4 100644 (file)
@@ -30,7 +30,7 @@ class OutputDataSocket : public Thread
 {
 public:
   OutputDataSocket(CephContext *cct, uint64_t _backlog);
-  virtual ~OutputDataSocket();
+  ~OutputDataSocket() override;
 
   bool init(const std::string &path);
   
@@ -43,7 +43,7 @@ protected:
   std::string create_shutdown_pipe(int *pipe_rd, int *pipe_wr);
   std::string bind_and_listen(const std::string &sock_path, int *fd);
 
-  void *entry();
+  void *entry() override;
   bool do_accept();
 
   void handle_connection(int fd);
index ac123810b6bc033d239b668fd082ee7e69245301..55012d12ea4958088411d3e8acc45e907874d425 100644 (file)
@@ -30,10 +30,10 @@ public:
   PrebufferedStreambuf(char *buf, size_t len);
 
   // called when the buffer fills up
-  int_type overflow(int_type c);
+  int_type overflow(int_type c) override;
 
   // called when we read and need more data
-  int_type underflow();
+  int_type underflow() override;
 
   /// return a string copy (inefficiently)
   std::string get_str() const;
index a831be52fdb488f643e0cbaf6d6b900e71355d4c..a1f23f1f86cc69e0baaad368722f30ad421f8304 100644 (file)
@@ -237,7 +237,7 @@ public:
       min_cost(min_c)
   {}
 
-  unsigned length() const override final {
+  unsigned length() const final {
     unsigned total = 0;
     for (typename SubQueues::const_iterator i = queue.begin();
         i != queue.end();
@@ -255,7 +255,7 @@ public:
   }
 
   void remove_by_filter(
-      std::function<bool (T)> f) override final {
+      std::function<bool (T)> f) final {
     for (typename SubQueues::iterator i = queue.begin();
         i != queue.end();
         ) {
@@ -281,7 +281,7 @@ public:
     }
   }
 
-  void remove_by_class(K k, std::list<T> *out = 0) override final {
+  void remove_by_class(K k, std::list<T> *out = 0) final {
     for (typename SubQueues::iterator i = queue.begin();
         i != queue.end();
         ) {
@@ -306,15 +306,15 @@ public:
     }
   }
 
-  void enqueue_strict(K cl, unsigned priority, T item) override final {
+  void enqueue_strict(K cl, unsigned priority, T item) final {
     high_queue[priority].enqueue(cl, 0, item);
   }
 
-  void enqueue_strict_front(K cl, unsigned priority, T item) override final {
+  void enqueue_strict_front(K cl, unsigned priority, T item) final {
     high_queue[priority].enqueue_front(cl, 0, item);
   }
 
-  void enqueue(K cl, unsigned priority, unsigned cost, T item) override final {
+  void enqueue(K cl, unsigned priority, unsigned cost, T item) final {
     if (cost < min_cost)
       cost = min_cost;
     if (cost > max_tokens_per_subqueue)
@@ -322,7 +322,7 @@ public:
     create_queue(priority)->enqueue(cl, cost, item);
   }
 
-  void enqueue_front(K cl, unsigned priority, unsigned cost, T item) override final {
+  void enqueue_front(K cl, unsigned priority, unsigned cost, T item) final {
     if (cost < min_cost)
       cost = min_cost;
     if (cost > max_tokens_per_subqueue)
@@ -330,13 +330,13 @@ public:
     create_queue(priority)->enqueue_front(cl, cost, item);
   }
 
-  bool empty() const override final {
+  bool empty() const final {
     assert(total_priority >= 0);
     assert((total_priority == 0) || !(queue.empty()));
     return queue.empty() && high_queue.empty();
   }
 
-  T dequeue() override final {
+  T dequeue() final {
     assert(!empty());
 
     if (!(high_queue.empty())) {
@@ -380,7 +380,7 @@ public:
     return ret;
   }
 
-  void dump(ceph::Formatter *f) const override final {
+  void dump(ceph::Formatter *f) const final {
     f->dump_int("total_priority", total_priority);
     f->dump_int("max_tokens_per_subqueue", max_tokens_per_subqueue);
     f->dump_int("min_cost", min_cost);
index 0630a4681429c349959cb9f3f26d1ffc401b9c0f..2295aade48a3c3af644c91f15fccbec361440c95 100644 (file)
@@ -116,7 +116,7 @@ public:
                  int timeout = 0, int sigkill = SIGKILL);
 
 protected:
-  virtual void exec();
+  void exec() override;
 
 private:
   int timeout;
index 96768aadccf434e0b7161dc8b6e20723b009c0c6..b07c9e47923c440803b1012dc991689bf71188e4 100644 (file)
@@ -264,7 +264,7 @@ public:
   }
 
 protected:
-  virtual void finish(int r);
+  void finish(int r) override;
 
 private:
   OrderedThrottle *m_ordered_throttle;
index 6454f45a8c54d117725d20fc052d6e522282afb9..9efc482c6ef8986f9b638dfc13b232a4814493fe 100644 (file)
@@ -52,7 +52,7 @@ public:
 
   TracepointProvider(CephContext *cct, const char *library,
                      const char *config_key);
-  virtual ~TracepointProvider();
+  ~TracepointProvider() override;
 
   template <const Traits &traits>
   static void initialize(CephContext *cct) {
@@ -63,11 +63,11 @@ public:
   }
 
 protected:
-  virtual const char** get_tracked_conf_keys() const {
+  const char** get_tracked_conf_keys() const override {
     return m_config_keys;
   }
-  virtual void handle_conf_change(const struct md_config_t *conf,
-                                  const std::set <std::string> &changed);
+  void handle_conf_change(const struct md_config_t *conf,
+                                  const std::set <std::string> &changed) override;
 
 private:
   CephContext *m_cct;
index bef8bc01dbc096e64486d3e056962fd0cbd0e865..10d6f0d4514e4b25063045f9ef8a9bd63214cd95 100644 (file)
@@ -335,30 +335,30 @@ class WeightedPriorityQueue :  public OpQueue <T, K>
       {
        std::srand(time(0));
       }
-    unsigned length() const override final {
+    unsigned length() const final {
       return strict.size + normal.size;
     }
-    void remove_by_filter(std::function<bool (T)> f) override final {
+    void remove_by_filter(std::function<bool (T)> f) final {
       strict.filter_list_pairs(f);
       normal.filter_list_pairs(f);
     }
-    void remove_by_class(K cl, std::list<T>* removed = 0) override final {
+    void remove_by_class(K cl, std::list<T>* removed = 0) final {
       strict.filter_class(cl, removed);
       normal.filter_class(cl, removed);
     }
-    bool empty() const override final {
+    bool empty() const final {
       return !(strict.size + normal.size);
     }
-    void enqueue_strict(K cl, unsigned p, T item) override final {
+    void enqueue_strict(K cl, unsigned p, T item) final {
       strict.insert(p, cl, 0, item);
     }
-    void enqueue_strict_front(K cl, unsigned p, T item) override final {
+    void enqueue_strict_front(K cl, unsigned p, T item) final {
       strict.insert(p, cl, 0, item, true);
     }
-    void enqueue(K cl, unsigned p, unsigned cost, T item) override final {
+    void enqueue(K cl, unsigned p, unsigned cost, T item) final {
       normal.insert(p, cl, cost, item);
     }
-    void enqueue_front(K cl, unsigned p, unsigned cost, T item) override final {
+    void enqueue_front(K cl, unsigned p, unsigned cost, T item) final {
       normal.insert(p, cl, cost, item, true);
     }
     T dequeue() override {
index 18427b48c0cac0f431379e401575ad1d80b55946..d67d84ef7faeee26f3544ddedb36282f6a9558e9 100644 (file)
@@ -87,11 +87,11 @@ private:
   string _thread_num_option;
   const char **_conf_keys;
 
-  const char **get_tracked_conf_keys() const {
+  const char **get_tracked_conf_keys() const override {
     return _conf_keys;
   }
   void handle_conf_change(const struct md_config_t *conf,
-                         const std::set <std::string> &changed);
+                         const std::set <std::string> &changed) override;
 
 public:
   /** @brief Work queue that processes several submitted items at once.
@@ -107,7 +107,7 @@ public:
     virtual void _process_finish(const list<T*> &) {}
 
     // virtual methods from WorkQueue_ below
-    void *_void_dequeue() {
+    void *_void_dequeue() override {
       list<T*> *out(new list<T*>);
       _dequeue(out);
       if (!out->empty()) {
@@ -117,10 +117,10 @@ public:
        return 0;
       }
     }
-    void _void_process(void *p, TPHandle &handle) {
+    void _void_process(void *p, TPHandle &handle) override {
       _process(*((list<T*>*)p), handle);
     }
-    void _void_process_finish(void *p) {
+    void _void_process_finish(void *p) override {
       _process_finish(*(list<T*>*)p);
       delete (list<T*> *)p;
     }
@@ -133,7 +133,7 @@ public:
       : WorkQueue_(std::move(n), ti, sti), pool(p) {
       pool->add_work_queue(this);
     }
-    ~BatchWorkQueue() {
+    ~BatchWorkQueue() override {
       pool->remove_work_queue(this);
     }
 
@@ -186,11 +186,11 @@ public:
     list<U> to_finish;
     virtual void _enqueue(T) = 0;
     virtual void _enqueue_front(T) = 0;
-    virtual bool _empty() = 0;
+    bool _empty() override = 0;
     virtual U _dequeue() = 0;
     virtual void _process_finish(U) {}
 
-    void *_void_dequeue() {
+    void *_void_dequeue() override {
       {
        Mutex::Locker l(_lock);
        if (_empty())
@@ -200,7 +200,7 @@ public:
       }
       return ((void*)1); // Not used
     }
-    void _void_process(void *, TPHandle &handle) {
+    void _void_process(void *, TPHandle &handle) override {
       _lock.Lock();
       assert(!to_process.empty());
       U u = to_process.front();
@@ -214,7 +214,7 @@ public:
       _lock.Unlock();
     }
 
-    void _void_process_finish(void *) {
+    void _void_process_finish(void *) override {
       _lock.Lock();
       assert(!to_finish.empty());
       U u = to_finish.front();
@@ -224,14 +224,14 @@ public:
       _process_finish(u);
     }
 
-    void _clear() {}
+    void _clear() override {}
 
   public:
     WorkQueueVal(string n, time_t ti, time_t sti, ThreadPool *p)
       : WorkQueue_(std::move(n), ti, sti), _lock("WorkQueueVal::lock"), pool(p) {
       pool->add_work_queue(this);
     }
-    ~WorkQueueVal() {
+    ~WorkQueueVal() override {
       pool->remove_work_queue(this);
     }
     void queue(T item) {
@@ -275,13 +275,13 @@ public:
     virtual void _process_finish(T *) {}
 
     // implementation of virtual methods from WorkQueue_
-    void *_void_dequeue() {
+    void *_void_dequeue() override {
       return (void *)_dequeue();
     }
-    void _void_process(void *p, TPHandle &handle) {
+    void _void_process(void *p, TPHandle &handle) override {
       _process(static_cast<T *>(p), handle);
     }
-    void _void_process_finish(void *p) {
+    void _void_process_finish(void *p) override {
       _process_finish(static_cast<T *>(p));
     }
 
@@ -294,7 +294,7 @@ public:
       : WorkQueue_(std::move(n), ti, sti), pool(p) {
       pool->add_work_queue(this);
     }
-    ~WorkQueue() {
+    ~WorkQueue() override {
       pool->remove_work_queue(this);
     }
     
@@ -346,7 +346,7 @@ public:
   template<typename T>
   class PointerWQ : public WorkQueue_ {
   public:
-    ~PointerWQ() {
+    ~PointerWQ() override {
       m_pool->remove_work_queue(this);
       assert(m_processing == 0);
     }
@@ -374,15 +374,15 @@ public:
     PointerWQ(string n, time_t ti, time_t sti, ThreadPool* p)
       : WorkQueue_(std::move(n), ti, sti), m_pool(p), m_processing(0) {
     }
-    virtual void _clear() {
+    void _clear() override {
       assert(m_pool->_lock.is_locked());
       m_items.clear();
     }
-    virtual bool _empty() {
+    bool _empty() override {
       assert(m_pool->_lock.is_locked());
       return m_items.empty();
     }
-    virtual void *_void_dequeue() {
+    void *_void_dequeue() override {
       assert(m_pool->_lock.is_locked());
       if (m_items.empty()) {
         return NULL;
@@ -393,10 +393,10 @@ public:
       m_items.pop_front();
       return item;
     }
-    virtual void _void_process(void *item, ThreadPool::TPHandle &handle) {
+    void _void_process(void *item, ThreadPool::TPHandle &handle) override {
       process(reinterpret_cast<T *>(item));
     }
-    virtual void _void_process_finish(void *item) {
+    void _void_process_finish(void *item) override {
       assert(m_pool->_lock.is_locked());
       assert(m_processing > 0);
       --m_processing;
@@ -442,7 +442,7 @@ private:
     ThreadPool *pool;
     // cppcheck-suppress noExplicitConstructor
     WorkThread(ThreadPool *p) : pool(p) {}
-    void *entry() {
+    void *entry() override {
       pool->worker(this);
       return 0;
     }
@@ -458,7 +458,7 @@ private:
 
 public:
   ThreadPool(CephContext *cct_, string nm, string tn, int n, const char *option = NULL);
-  virtual ~ThreadPool();
+  ~ThreadPool() override;
 
   /// return number of threads currently running
   int get_num_threads() {
@@ -565,7 +565,7 @@ class C_QueueInWQ : public Context {
 public:
   C_QueueInWQ(GenContextWQ *wq, GenContext<ThreadPool::TPHandle &> *c)
     : wq(wq), c(c) {}
-  void finish(int) {
+  void finish(int) override {
     wq->queue(c);
   }
 };
@@ -588,14 +588,14 @@ public:
     ThreadPool::PointerWQ<Context>::queue(ctx);
   }
 protected:
-  virtual void _clear() {
+  void _clear() override {
     ThreadPool::PointerWQ<Context>::_clear();
 
     Mutex::Locker locker(m_lock);
     m_context_results.clear();
   }
 
-  virtual void process(Context *ctx) {
+  void process(Context *ctx) override {
     int result = 0;
     {
       Mutex::Locker locker(m_lock);
@@ -658,7 +658,7 @@ public:
                                                                  sharded_pool(tp) {
       tp->set_wq(this);
     }
-    virtual ~ShardedWQ() {}
+    ~ShardedWQ() override {}
 
     void queue(T item) {
       _enqueue(item);
@@ -681,7 +681,7 @@ private:
     uint32_t thread_index;
     WorkThreadSharded(ShardedThreadPool *p, uint32_t pthread_index): pool(p),
       thread_index(pthread_index) {}
-    void *entry() {
+    void *entry() override {
       pool->shardedthreadpool_worker(thread_index);
       return 0;
     }
index 252647147e9b32f17fb0fef27f02d90dcf880db5..2529d547a772c1aa8a45748687793a9b499bafff 100644 (file)
@@ -40,7 +40,7 @@ class AdminSocket : public Thread
 {
 public:
   AdminSocket(CephContext *cct);
-  virtual ~AdminSocket();
+  ~AdminSocket() override;
 
   /**
    * register an admin socket command
@@ -89,7 +89,7 @@ private:
   std::string destroy_shutdown_pipe();
   std::string bind_and_listen(const std::string &sock_path, int *fd);
 
-  void *entry();
+  void *entry() override;
   bool do_accept();
 
   CephContext *m_cct;
index 8e826c4af6db9413d43802df9215d744baa23646..286a96589c6b80bcb5ebeada2b56969252c507a9 100644 (file)
@@ -557,7 +557,7 @@ public:
     size_list.push_back(table_size_);
   }
 
-  inline virtual std::size_t size() const
+  inline std::size_t size() const override
   {
     return size_list.back() * bits_per_char;
   }
@@ -601,7 +601,7 @@ public:
     return true;
   }
 
-  virtual inline double approx_unique_element_count() const {
+  inline double approx_unique_element_count() const override {
     // this is not a very good estimate; a better solution should have
     // some asymptotic behavior as density() approaches 1.0.
     //
@@ -611,7 +611,7 @@ public:
 
 private:
 
-  inline virtual void compute_indices(const bloom_type& hash, std::size_t& bit_index, std::size_t& bit) const
+  inline void compute_indices(const bloom_type& hash, std::size_t& bit_index, std::size_t& bit) const override
   {
     bit_index = hash;
     for (std::size_t i = 0; i < size_list.size(); ++i)
index 2de7e1661b3d0a6067ac2c303d96f97a7ac3a29a..56b5770fa012ca92ff2dd4378e6e570250f134ba 100644 (file)
@@ -255,7 +255,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       inc_total_alloc(len);
       inc_history_alloc(len);
     }
-    ~raw_combined() {
+    ~raw_combined() override {
       dec_total_alloc(len);
     }
     raw* clone_empty() override {
@@ -309,7 +309,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       inc_total_alloc(len);
       bdout << "raw_malloc " << this << " alloc " << (void *)data << " " << l << " " << buffer::get_total_alloc() << bendl;
     }
-    ~raw_malloc() {
+    ~raw_malloc() override {
       free(data);
       dec_total_alloc(len);
       bdout << "raw_malloc " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
@@ -332,7 +332,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       inc_history_alloc(len);
       bdout << "raw_mmap " << this << " alloc " << (void *)data << " " << l << " " << buffer::get_total_alloc() << bendl;
     }
-    ~raw_mmap_pages() {
+    ~raw_mmap_pages() override {
       ::munmap(data, len);
       dec_total_alloc(len);
       bdout << "raw_mmap " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
@@ -357,7 +357,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       inc_history_alloc(len);
       bdout << "raw_posix_aligned " << this << " alloc " << (void *)data << " l=" << l << ", align=" << align << " total_alloc=" << buffer::get_total_alloc() << bendl;
     }
-    ~raw_posix_aligned() {
+    ~raw_posix_aligned() override {
       mempool::buffer_data::alloc_char.deallocate_aligned(data, len);
       dec_total_alloc(len);
       bdout << "raw_posix_aligned " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
@@ -439,7 +439,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
            << buffer::get_total_alloc() << bendl;
     }
 
-    ~raw_pipe() {
+    ~raw_pipe() override {
       if (data)
        free(data);
       close_pipe(pipefds);
@@ -595,7 +595,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       inc_total_alloc(len);
       bdout << "raw_char " << this << " alloc " << (void *)data << " " << l << " " << buffer::get_total_alloc() << bendl;
     }
-    ~raw_char() {
+    ~raw_char() override {
       if (data)
        mempool::buffer_data::alloc_char.deallocate(data, len);
       dec_total_alloc(len);
@@ -624,7 +624,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     bool is_shareable() override {
       return false; // !shareable, will force make_shareable()
     }
-    ~raw_unshareable() {
+    ~raw_unshareable() override {
       delete[] data;
     }
   };
@@ -634,7 +634,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     MEMPOOL_CLASS_HELPERS();
 
     raw_static(const char *d, unsigned l) : raw((char*)d, l) { }
-    ~raw_static() {}
+    ~raw_static() override {}
     raw* clone_empty() override {
       return new buffer::raw_char(len);
     }
@@ -645,7 +645,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
    public:
     raw_claim_buffer(const char *b, unsigned l, deleter d)
         : raw((char*)b, l), del(std::move(d)) { }
-    ~raw_claim_buffer() {}
+    ~raw_claim_buffer() override {}
     raw* clone_empty() override {
       return new buffer::raw_char(len);
     }
index 689ecca451f7148b4faea55ea62fc07c919cff53..a63858e2b3b82f43e2d485cec62a8f76adbb6560 100644 (file)
@@ -51,7 +51,7 @@ class LockdepObs : public md_config_obs_t {
 public:
   explicit LockdepObs(CephContext *cct) : m_cct(cct), m_registered(false) {
   }
-  ~LockdepObs() {
+  ~LockdepObs() override {
     if (m_registered) {
       lockdep_unregister_ceph_context(m_cct);
     }
@@ -91,7 +91,7 @@ public:
       "get mempool stats");
     assert(r == 0);
   }
-  ~MempoolObs() {
+  ~MempoolObs() override {
     cct->_conf->remove_observer(this);
     cct->get_admin_socket()->unregister_command("dump_mempools");
   }
@@ -138,7 +138,7 @@ public:
   {
   }
 
-  ~CephContextServiceThread() {}
+  ~CephContextServiceThread() override {}
 
   void *entry() override
   {
index 761094aa99b03910ec0dd2a7841fa8fe2c90b720..0026b6851dd6057b732f95e43da5e5dc949d44b4 100644 (file)
@@ -213,7 +213,7 @@ private:
   struct TypedSingletonWrapper : public SingletonWrapper {
     TypedSingletonWrapper(T *p) : singleton(p) {
     }
-    virtual ~TypedSingletonWrapper() {
+    ~TypedSingletonWrapper() override {
       delete singleton;
     }
 
index b3961cc783262c39d162a70d051074a4cbacf2f3..18cf06fd4f198e4e88496fea3ec5f5268964de75 100644 (file)
@@ -88,7 +88,7 @@ class JSONParser : public JSONObj
   bool success;
 public:
   JSONParser();
-  virtual ~JSONParser();
+  ~JSONParser() override;
   void handle_data(const char *s, int len);
 
   bool parse(const char *buf_, int len);
index 6671f6b0e7a2794403c0aafa4a7fe6079eb10752..a13cf1f92dd2e92f4b5395eacfe457742f2a14be 100644 (file)
@@ -140,7 +140,7 @@ struct lambda_deleter_impl final : deleter::impl {
   Deleter del;
   lambda_deleter_impl(deleter next, Deleter&& del)
           : impl(std::move(next)), del(std::move(del)) {}
-  virtual ~lambda_deleter_impl() override { del(); }
+  ~lambda_deleter_impl() override { del(); }
 };
 
 template <typename Object>
@@ -183,7 +183,7 @@ deleter make_deleter(Object o) {
 struct free_deleter_impl final : deleter::impl {
   void* obj;
   free_deleter_impl(void* obj) : impl(deleter()), obj(obj) {}
-  virtual ~free_deleter_impl() override { std::free(obj); }
+  ~free_deleter_impl() override { std::free(obj); }
 };
 /// \endcond
 
index 9744b0c9cabae98e1e160fa77f24b92faf695f19..3c453f82ceb388009100a334b76fc80e5a8b28f5 100644 (file)
@@ -58,17 +58,17 @@ class AsyncCompressor {
     CompressWQ(AsyncCompressor *ac, time_t timeout, time_t suicide_timeout, ThreadPool *tp)
       : ThreadPool::WorkQueue<Job>("AsyncCompressor::CompressWQ", timeout, suicide_timeout, tp), async_compressor(ac) {}
 
-    bool _enqueue(Job *item) {
+    bool _enqueue(Job *item) override {
       job_queue.push_back(item);
       return true;
     }
-    void _dequeue(Job *item) {
+    void _dequeue(Job *item) override {
       ceph_abort();
     }
-    bool _empty() {
+    bool _empty() override {
       return job_queue.empty();
     }
-    Job* _dequeue() {
+    Job* _dequeue() override {
       if (job_queue.empty())
         return NULL;
       Job *item = NULL;
@@ -100,8 +100,8 @@ class AsyncCompressor {
         item->status.set(ERROR);
       }
     }
-    void _process_finish(Job *item) {}
-    void _clear() {}
+    void _process_finish(Job *item) override {}
+    void _clear() override {}
   } compress_wq;
   friend class CompressWQ;
   void _compress(bufferlist &in, bufferlist &out);
index 299840aa3ffc1df1fa5d184c57c3bf4a8890c785..d2e253f2dc100869257aa7c010d72cd7b8c2f480 100644 (file)
@@ -33,7 +33,7 @@ namespace ceph {
                                           compressor(0) 
     {}
     
-    virtual ~CompressionPlugin() {}
+    ~CompressionPlugin() override {}
 
     virtual int factory(CompressorRef *cs,
                                          std::ostream *ss) = 0;
index a744a5df137fc556be62f40197fbea874477c161..758d606e0e65a7ba5ded74524c0458b8d4680397 100644 (file)
@@ -27,8 +27,8 @@ public:
   explicit CompressionPluginSnappy(CephContext* cct) : CompressionPlugin(cct)
   {}
 
-  virtual int factory(CompressorRef *cs,
-                      std::ostream *ss)
+  int factory(CompressorRef *cs,
+                      std::ostream *ss) override
   {
     if (compressor == 0) {
       SnappyCompressor *interface = new SnappyCompressor();
index 18692a3eeddee342e8b0633c2d9555d0fe44bcec..b27ec87104f563279904c4f474621a6b2d40fdfc 100644 (file)
@@ -32,8 +32,8 @@ public:
   explicit CompressionPluginZlib(CephContext *cct) : CompressionPlugin(cct)
   {}
 
-  virtual int factory(CompressorRef *cs,
-                      std::ostream *ss)
+  int factory(CompressorRef *cs,
+                      std::ostream *ss) override
   {
     bool isal;
     if (cct->_conf->compressor_zlib_isal) {
index 59c52cfeeaedf41abb3175e8043c45b1345c2d29..c85951705a40626f882c47595338b537dbb24739 100644 (file)
@@ -28,8 +28,8 @@ public:
   explicit CompressionPluginZstd(CephContext* cct) : CompressionPlugin(cct)
   {}
 
-  virtual int factory(CompressorRef *cs,
-                      std::ostream *ss)
+  int factory(CompressorRef *cs,
+                      std::ostream *ss) override
   {
     if (compressor == 0) {
       ZstdCompressor *interface = new ZstdCompressor();
index 41cf1a9af4eac6f958656137fb6c77b9a35a7f58..3286fc72c31850200bb0dd08fd08316c2c50ac60 100644 (file)
@@ -158,7 +158,7 @@ namespace CrushTreeDumper {
     explicit FormattingDumper(const CrushWrapper *crush) : Dumper<Formatter>(crush) {}
 
   protected:
-    virtual void dump_item(const Item &qi, Formatter *f) {
+    void dump_item(const Item &qi, Formatter *f) override {
       f->open_object_section("item");
       dump_item_fields(qi, f);
       dump_bucket_children(qi, f);
index bad6d8140f37c04d5497766de693d92883998b2d..6ca39d6f98343614c825087a45084aa8e7f0784b 100644 (file)
@@ -35,50 +35,50 @@ namespace ceph {
     vector<int> chunk_mapping;
     ErasureCodeProfile _profile;
 
-    virtual ~ErasureCode() {}
+    ~ErasureCode() override {}
 
-    virtual int init(ErasureCodeProfile &profile, ostream *ss) {
+    int init(ErasureCodeProfile &profile, ostream *ss) override {
       _profile = profile;
       return 0;
     }
 
-    virtual const ErasureCodeProfile &get_profile() const {
+    const ErasureCodeProfile &get_profile() const override {
       return _profile;
     }
 
     int sanity_check_k(int k, ostream *ss);
 
-    virtual unsigned int get_coding_chunk_count() const {
+    unsigned int get_coding_chunk_count() const override {
       return get_chunk_count() - get_data_chunk_count();
     }
 
-    virtual int minimum_to_decode(const set<int> &want_to_read,
+    int minimum_to_decode(const set<int> &want_to_read,
                                   const set<int> &available_chunks,
-                                  set<int> *minimum);
+                                  set<int> *minimum) override;
 
-    virtual int minimum_to_decode_with_cost(const set<int> &want_to_read,
+    int minimum_to_decode_with_cost(const set<int> &want_to_read,
                                             const map<int, int> &available,
-                                            set<int> *minimum);
+                                            set<int> *minimum) override;
 
     int encode_prepare(const bufferlist &raw,
                        map<int, bufferlist> &encoded) const;
 
-    virtual int encode(const set<int> &want_to_encode,
+    int encode(const set<int> &want_to_encode,
                        const bufferlist &in,
-                       map<int, bufferlist> *encoded);
+                       map<int, bufferlist> *encoded) override;
 
-    virtual int encode_chunks(const set<int> &want_to_encode,
-                              map<int, bufferlist> *encoded);
+    int encode_chunks(const set<int> &want_to_encode,
+                              map<int, bufferlist> *encoded) override;
 
-    virtual int decode(const set<int> &want_to_read,
+    int decode(const set<int> &want_to_read,
                        const map<int, bufferlist> &chunks,
-                       map<int, bufferlist> *decoded);
+                       map<int, bufferlist> *decoded) override;
 
-    virtual int decode_chunks(const set<int> &want_to_read,
+    int decode_chunks(const set<int> &want_to_read,
                               const map<int, bufferlist> &chunks,
-                              map<int, bufferlist> *decoded);
+                              map<int, bufferlist> *decoded) override;
 
-    virtual const vector<int> &get_chunk_mapping() const;
+    const vector<int> &get_chunk_mapping() const override;
 
     int to_mapping(const ErasureCodeProfile &profile,
                   ostream *ss);
@@ -101,8 +101,8 @@ namespace ceph {
                         const std::string &default_value,
                         ostream *ss);
 
-    virtual int decode_concat(const map<int, bufferlist> &chunks,
-                             bufferlist *decoded);
+    int decode_concat(const map<int, bufferlist> &chunks,
+                             bufferlist *decoded) override;
 
   protected:
     int parse(const ErasureCodeProfile &profile,
index 63aa5f34036043ad0fdceab2fc6ccefed4032b53..17ba4ff30e00107d8e5a5abb40ede79dcd86adcf 100644 (file)
@@ -64,37 +64,37 @@ public:
   {
   }
 
-  virtual
-  ~ErasureCodeIsa()
+  
+  ~ErasureCodeIsa() override
   {
   }
 
-  virtual int create_ruleset(const string &name,
+  int create_ruleset(const string &name,
                              CrushWrapper &crush,
-                             ostream *ss) const;
+                             ostream *ss) const override;
 
-  virtual unsigned int
-  get_chunk_count() const
+  unsigned int
+  get_chunk_count() const override
   {
     return k + m;
   }
 
-  virtual unsigned int
-  get_data_chunk_count() const
+  unsigned int
+  get_data_chunk_count() const override
   {
     return k;
   }
 
-  virtual unsigned int get_chunk_size(unsigned int object_size) const;
+  unsigned int get_chunk_size(unsigned int object_size) const override;
 
-  virtual int encode_chunks(const set<int> &want_to_encode,
-                            map<int, bufferlist> *encoded);
+  int encode_chunks(const set<int> &want_to_encode,
+                            map<int, bufferlist> *encoded) override;
 
-  virtual int decode_chunks(const set<int> &want_to_read,
+  int decode_chunks(const set<int> &want_to_read,
                             const map<int, bufferlist> &chunks,
-                            map<int, bufferlist> *decoded);
+                            map<int, bufferlist> *decoded) override;
 
-  virtual int init(ErasureCodeProfile &profile, ostream *ss);
+  int init(ErasureCodeProfile &profile, ostream *ss) override;
 
   virtual void isa_encode(char **data,
                           char **coding,
@@ -138,30 +138,30 @@ public:
     matrixtype = matrix;
   }
 
-  virtual
-  ~ErasureCodeIsaDefault()
+  
+  ~ErasureCodeIsaDefault() override
   {
 
   }
 
-  virtual void isa_encode(char **data,
+  void isa_encode(char **data,
                           char **coding,
-                          int blocksize);
+                          int blocksize) override;
 
   virtual bool erasure_contains(int *erasures, int i);
 
-  virtual int isa_decode(int *erasures,
+  int isa_decode(int *erasures,
                          char **data,
                          char **coding,
-                         int blocksize);
+                         int blocksize) override;
 
-  virtual unsigned get_alignment() const;
+  unsigned get_alignment() const override;
 
-  virtual void prepare();
+  void prepare() override;
 
  private:
-  virtual int parse(ErasureCodeProfile &profile,
-                    ostream *ss);
+  int parse(ErasureCodeProfile &profile,
+                    ostream *ss) override;
 };
 
 #endif
index 7ed5aed6645a28c18a6bed20b7f236bf3004e78f..cbe841a6d7cbe1173265a87b5fbd96a39eb2cf7b 100644 (file)
@@ -25,10 +25,10 @@ class ErasureCodePluginIsa : public ErasureCodePlugin {
 public:
   ErasureCodeIsaTableCache tcache;
 
-  virtual int factory(const std::string &directory,
+  int factory(const std::string &directory,
                      ErasureCodeProfile &profile,
                      ErasureCodeInterfaceRef *erasure_code,
-                     ostream *ss);
+                     ostream *ss) override;
 };
 
 #endif
index 31d049fbe9d5d0208d78e5a68c40d1ae694b0fb4..da341175ecc5ddd29d6b5d9192e34db6ca74bf03 100644 (file)
@@ -49,30 +49,30 @@ public:
     per_chunk_alignment(false)
   {}
 
-  virtual ~ErasureCodeJerasure() {}
+  ~ErasureCodeJerasure() override {}
   
-  virtual int create_ruleset(const string &name,
+  int create_ruleset(const string &name,
                             CrushWrapper &crush,
-                            ostream *ss) const;
+                            ostream *ss) const override;
 
-  virtual unsigned int get_chunk_count() const {
+  unsigned int get_chunk_count() const override {
     return k + m;
   }
 
-  virtual unsigned int get_data_chunk_count() const {
+  unsigned int get_data_chunk_count() const override {
     return k;
   }
 
-  virtual unsigned int get_chunk_size(unsigned int object_size) const;
+  unsigned int get_chunk_size(unsigned int object_size) const override;
 
-  virtual int encode_chunks(const set<int> &want_to_encode,
-                           map<int, bufferlist> *encoded);
+  int encode_chunks(const set<int> &want_to_encode,
+                           map<int, bufferlist> *encoded) override;
 
-  virtual int decode_chunks(const set<int> &want_to_read,
+  int decode_chunks(const set<int> &want_to_read,
                            const map<int, bufferlist> &chunks,
-                           map<int, bufferlist> *decoded);
+                           map<int, bufferlist> *decoded) override;
 
-  virtual int init(ErasureCodeProfile &profile, ostream *ss);
+  int init(ErasureCodeProfile &profile, ostream *ss) override;
 
   virtual void jerasure_encode(char **data,
                                char **coding,
@@ -100,22 +100,22 @@ public:
     DEFAULT_M = "3";
     DEFAULT_W = "8";
   }
-  virtual ~ErasureCodeJerasureReedSolomonVandermonde() {
+  ~ErasureCodeJerasureReedSolomonVandermonde() override {
     if (matrix)
       free(matrix);
   }
 
-  virtual void jerasure_encode(char **data,
+  void jerasure_encode(char **data,
                                char **coding,
-                               int blocksize);
-  virtual int jerasure_decode(int *erasures,
+                               int blocksize) override;
+  int jerasure_decode(int *erasures,
                                char **data,
                                char **coding,
-                               int blocksize);
-  virtual unsigned get_alignment() const;
-  virtual void prepare();
+                               int blocksize) override;
+  unsigned get_alignment() const override;
+  void prepare() override;
 private:
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+  int parse(ErasureCodeProfile &profile, ostream *ss) override;
 };
 
 class ErasureCodeJerasureReedSolomonRAID6 : public ErasureCodeJerasure {
@@ -129,22 +129,22 @@ public:
     DEFAULT_K = "7";
     DEFAULT_W = "8";
   }
-  virtual ~ErasureCodeJerasureReedSolomonRAID6() {
+  ~ErasureCodeJerasureReedSolomonRAID6() override {
     if (matrix)
       free(matrix);
   }
 
-  virtual void jerasure_encode(char **data,
+  void jerasure_encode(char **data,
                                char **coding,
-                               int blocksize);
-  virtual int jerasure_decode(int *erasures,
+                               int blocksize) override;
+  int jerasure_decode(int *erasures,
                                char **data,
                                char **coding,
-                               int blocksize);
-  virtual unsigned get_alignment() const;
-  virtual void prepare();
+                               int blocksize) override;
+  unsigned get_alignment() const override;
+  void prepare() override;
 private:
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+  int parse(ErasureCodeProfile &profile, ostream *ss) override;
 };
 
 #define DEFAULT_PACKETSIZE "2048"
@@ -165,24 +165,24 @@ public:
     DEFAULT_M = "3";
     DEFAULT_W = "8";
   }
-  virtual ~ErasureCodeJerasureCauchy() {
+  ~ErasureCodeJerasureCauchy() override {
     if (bitmatrix)
       free(bitmatrix);
     if (schedule)
       free(schedule);
   }
 
-  virtual void jerasure_encode(char **data,
+  void jerasure_encode(char **data,
                                char **coding,
-                               int blocksize);
-  virtual int jerasure_decode(int *erasures,
+                               int blocksize) override;
+  int jerasure_decode(int *erasures,
                                char **data,
                                char **coding,
-                               int blocksize);
-  virtual unsigned get_alignment() const;
+                               int blocksize) override;
+  unsigned get_alignment() const override;
   void prepare_schedule(int *matrix);
 private:
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+  int parse(ErasureCodeProfile &profile, ostream *ss) override;
 };
 
 class ErasureCodeJerasureCauchyOrig : public ErasureCodeJerasureCauchy {
@@ -191,7 +191,7 @@ public:
     ErasureCodeJerasureCauchy("cauchy_orig")
   {}
 
-  virtual void prepare();
+  void prepare() override;
 };
 
 class ErasureCodeJerasureCauchyGood : public ErasureCodeJerasureCauchy {
@@ -200,7 +200,7 @@ public:
     ErasureCodeJerasureCauchy("cauchy_good")
   {}
 
-  virtual void prepare();
+  void prepare() override;
 };
 
 class ErasureCodeJerasureLiberation : public ErasureCodeJerasure {
@@ -219,25 +219,25 @@ public:
     DEFAULT_M = "2";
     DEFAULT_W = "7";
   }
-  virtual ~ErasureCodeJerasureLiberation();
+  ~ErasureCodeJerasureLiberation() override;
 
-  virtual void jerasure_encode(char **data,
+  void jerasure_encode(char **data,
                                char **coding,
-                               int blocksize);
-  virtual int jerasure_decode(int *erasures,
+                               int blocksize) override;
+  int jerasure_decode(int *erasures,
                                char **data,
                                char **coding,
-                               int blocksize);
-  virtual unsigned get_alignment() const;
+                               int blocksize) override;
+  unsigned get_alignment() const override;
   virtual bool check_k(ostream *ss) const;
   virtual bool check_w(ostream *ss) const;
   virtual bool check_packetsize_set(ostream *ss) const;
   virtual bool check_packetsize(ostream *ss) const;
   virtual int revert_to_default(ErasureCodeProfile &profile,
                                ostream *ss);
-  virtual void prepare();
+  void prepare() override;
 private:
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+  int parse(ErasureCodeProfile &profile, ostream *ss) override;
 };
 
 class ErasureCodeJerasureBlaumRoth : public ErasureCodeJerasureLiberation {
@@ -247,8 +247,8 @@ public:
   {
   }
 
-  virtual bool check_w(ostream *ss) const;
-  virtual void prepare();
+  bool check_w(ostream *ss) const override;
+  void prepare() override;
 };
 
 class ErasureCodeJerasureLiber8tion : public ErasureCodeJerasureLiberation {
@@ -261,9 +261,9 @@ public:
     DEFAULT_W = "8";
   }
 
-  virtual void prepare();
+  void prepare() override;
 private:
-  virtual int parse(ErasureCodeProfile &profile, ostream *ss);
+  int parse(ErasureCodeProfile &profile, ostream *ss) override;
 };
 
 #endif
index b52da8b5b273dfd3a24ece29fe53b6826aed6b11..9b5dc2f4c52e04ce4922e50acabaf87684d8c8db 100644 (file)
 
 class ErasureCodePluginJerasure : public ErasureCodePlugin {
 public:
-  virtual int factory(const std::string& directory,
+  int factory(const std::string& directory,
                      ErasureCodeProfile &profile,
                      ErasureCodeInterfaceRef *erasure_code,
-                     ostream *ss);
+                     ostream *ss) override;
 };
 
 #endif
index e54688a97bb806ae81a3b38101d8304986138a5a..c12a8ad353d1fa893a8570479694b83af2429ef7 100644 (file)
@@ -81,37 +81,37 @@ public:
     ruleset_steps.push_back(Step("chooseleaf", "host", 0));
   }
 
-  virtual ~ErasureCodeLrc() {}
+  ~ErasureCodeLrc() override {}
 
   set<int> get_erasures(const set<int> &need,
                        const set<int> &available) const;
 
-  virtual int minimum_to_decode(const set<int> &want_to_read,
+  int minimum_to_decode(const set<int> &want_to_read,
                                const set<int> &available,
-                               set<int> *minimum);
+                               set<int> *minimum) override;
 
-  virtual int create_ruleset(const string &name,
+  int create_ruleset(const string &name,
                             CrushWrapper &crush,
-                            ostream *ss) const;
+                            ostream *ss) const override;
 
-  virtual unsigned int get_chunk_count() const {
+  unsigned int get_chunk_count() const override {
     return chunk_count;
   }
 
-  virtual unsigned int get_data_chunk_count() const {
+  unsigned int get_data_chunk_count() const override {
     return data_chunk_count;
   }
 
-  virtual unsigned int get_chunk_size(unsigned int object_size) const;
+  unsigned int get_chunk_size(unsigned int object_size) const override;
 
-  virtual int encode_chunks(const set<int> &want_to_encode,
-                           map<int, bufferlist> *encoded);
+  int encode_chunks(const set<int> &want_to_encode,
+                           map<int, bufferlist> *encoded) override;
 
-  virtual int decode_chunks(const set<int> &want_to_read,
+  int decode_chunks(const set<int> &want_to_read,
                            const map<int, bufferlist> &chunks,
-                           map<int, bufferlist> *decoded);
+                           map<int, bufferlist> *decoded) override;
 
-  virtual int init(ErasureCodeProfile &profile, ostream *ss);
+  int init(ErasureCodeProfile &profile, ostream *ss) override;
 
   virtual int parse(ErasureCodeProfile &profile, ostream *ss);
 
index a0dbe74e9dafafeef02c8b8e9951ebd9a9a34ea6..0d38f8c701f94b87479505fd4ad663fbc77f4896 100644 (file)
 
 class ErasureCodePluginLrc : public ErasureCodePlugin {
 public:
-  virtual int factory(const std::string &directory,
+  int factory(const std::string &directory,
                      ErasureCodeProfile &profile,
                      ErasureCodeInterfaceRef *erasure_code,
-                     ostream *ss);
+                     ostream *ss) override;
 };
 
 #endif
index fa642974ea0fc56fcf37b2737ea0f284d3647417..72b59a466b21af2d65352d527d5480bfac7f8ccb 100644 (file)
@@ -25,10 +25,10 @@ class ErasureCodePluginShec : public ErasureCodePlugin {
 public:
   ErasureCodeShecTableCache tcache;
 
-  virtual int factory(const std::string &directory,
+  int factory(const std::string &directory,
                      ErasureCodeProfile &profile,
                      ErasureCodeInterfaceRef *erasure_code,
-                     ostream *ss);
+                     ostream *ss) override;
 };
 
 #endif
index bf07b804193735507201d4527d6417b35032ad54..b3c46014637baf6a36bac774474822298fa0b994 100644 (file)
@@ -68,44 +68,44 @@ public:
     matrix(0)
   {}
 
-  virtual ~ErasureCodeShec() {}
+  ~ErasureCodeShec() override {}
 
-  virtual int create_ruleset(const string &name,
+  int create_ruleset(const string &name,
                             CrushWrapper &crush,
-                            ostream *ss) const;
+                            ostream *ss) const override;
 
-  virtual unsigned int get_chunk_count() const {
+  unsigned int get_chunk_count() const override {
     return k + m;
   }
 
-  virtual unsigned int get_data_chunk_count() const {
+  unsigned int get_data_chunk_count() const override {
     return k;
   }
 
-  virtual unsigned int get_chunk_size(unsigned int object_size) const;
+  unsigned int get_chunk_size(unsigned int object_size) const override;
 
-  virtual int minimum_to_decode(const set<int> &want_to_read,
+  int minimum_to_decode(const set<int> &want_to_read,
                                const set<int> &available_chunks,
-                               set<int> *minimum);
+                               set<int> *minimum) override;
 
-  virtual int minimum_to_decode_with_cost(const set<int> &want_to_read,
+  int minimum_to_decode_with_cost(const set<int> &want_to_read,
                                          const map<int, int> &available,
-                                         set<int> *minimum);
+                                         set<int> *minimum) override;
 
-  virtual int encode(const set<int> &want_to_encode,
+  int encode(const set<int> &want_to_encode,
                     const bufferlist &in,
-                    map<int, bufferlist> *encoded);
-  virtual int encode_chunks(const set<int> &want_to_encode,
-                           map<int, bufferlist> *encoded);
+                    map<int, bufferlist> *encoded) override;
+  int encode_chunks(const set<int> &want_to_encode,
+                           map<int, bufferlist> *encoded) override;
 
-  virtual int decode(const set<int> &want_to_read,
+  int decode(const set<int> &want_to_read,
                     const map<int, bufferlist> &chunks,
-                    map<int, bufferlist> *decoded);
-  virtual int decode_chunks(const set<int> &want_to_read,
+                    map<int, bufferlist> *decoded) override;
+  int decode_chunks(const set<int> &want_to_read,
                            const map<int, bufferlist> &chunks,
-                           map<int, bufferlist> *decoded);
+                           map<int, bufferlist> *decoded) override;
 
-  virtual int init(ErasureCodeProfile &profile, ostream *ss);
+  int init(ErasureCodeProfile &profile, ostream *ss) override;
   virtual void shec_encode(char **data,
                           char **coding,
                           int blocksize) = 0;
@@ -140,21 +140,21 @@ public:
     ErasureCodeShec(technique, _tcache)
   {}
 
-  virtual ~ErasureCodeShecReedSolomonVandermonde() {
+  ~ErasureCodeShecReedSolomonVandermonde() override {
   }
 
-  virtual void shec_encode(char **data,
+  void shec_encode(char **data,
                           char **coding,
-                          int blocksize);
-  virtual int shec_decode(int *erasures,
+                          int blocksize) override;
+  int shec_decode(int *erasures,
                          int *avails,
                          char **data,
                          char **coding,
-                         int blocksize);
-  virtual unsigned get_alignment() const;
-  virtual void prepare();
+                         int blocksize) override;
+  unsigned get_alignment() const override;
+  void prepare() override;
 private:
-  virtual int parse(const ErasureCodeProfile &profile);
+  int parse(const ErasureCodeProfile &profile) override;
 };
 
 #endif
index 2f894efd7ec8f0bf81c70e0314e3ab3e8bb96e35..2ddc0149893f2a2beaabc523e27999ffae73e7ff 100644 (file)
@@ -240,7 +240,7 @@ struct SignalHandler : public Thread {
     create("signal_handler");
   }
 
-  ~SignalHandler() {
+  ~SignalHandler() override {
     shutdown();
   }
 
index 57250e7c006aa28f525d4c2745733e7247063685..bf992d0a2bf9bcfcfbaaedc2b14eae2411a1c93c 100644 (file)
@@ -80,7 +80,7 @@ class ContainerContext : public Context {
   T obj;
 public:
   ContainerContext(T &obj) : obj(obj) {}
-  void finish(int r) {}
+  void finish(int r) override {}
 };
 template <typename T>
 ContainerContext<T> *make_container_context(T &&t) {
@@ -92,7 +92,7 @@ struct Wrapper : public Context {
   Context *to_run;
   T val;
   Wrapper(Context *to_run, T val) : to_run(to_run), val(val) {}
-  void finish(int r) {
+  void finish(int r) override {
     if (to_run)
       to_run->complete(r);
   }
@@ -111,7 +111,7 @@ template <typename T>
 struct LambdaContext : public Context {
   T t;
   LambdaContext(T &&t) : t(std::forward<T>(t)) {}
-  void finish(int) {
+  void finish(int) override {
     t();
   }
 };
@@ -124,7 +124,7 @@ template <typename F, typename T>
 struct LambdaGenContext : GenContext<T> {
   F f;
   LambdaGenContext(F &&f) : f(std::forward<F>(f)) {}
-  void finish(T t) {
+  void finish(T t) override {
     f(std::forward<T>(t));
   }
 };
@@ -180,7 +180,7 @@ inline void finish_contexts(CephContext *cct, std::vector<Context*>& finished,
 
 class C_NoopContext : public Context {
 public:
-  void finish(int r) { }
+  void finish(int r) override { }
 };
 
 
@@ -188,10 +188,10 @@ struct C_Lock : public Context {
   Mutex *lock;
   Context *fin;
   C_Lock(Mutex *l, Context *c) : lock(l), fin(c) {}
-  ~C_Lock() {
+  ~C_Lock() override {
     delete fin;
   }
-  void finish(int r) {
+  void finish(int r) override {
     if (fin) {
       lock->Lock();
       fin->complete(r);
@@ -224,12 +224,12 @@ public:
   void take(std::list<ContextType*>& ls) {
     contexts.splice(contexts.end(), ls);
   }
-  void complete(int r) {
+  void complete(int r) override {
     // Neuter any ContextInstanceType custom complete(), because although
     // I want to look like it, I don't actually want to run its code.
     Context::complete(r);
   }
-  void finish(int r) {
+  void finish(int r) override {
     finish_contexts(cct, contexts, r);
   }
   bool empty() { return contexts.empty(); }
@@ -307,18 +307,18 @@ private:
     C_GatherBase *gather;
   public:
     C_GatherSub(C_GatherBase *g) : gather(g) {}
-    void complete(int r) {
+    void complete(int r) override {
       // Cancel any customized complete() functionality
       // from the Context subclass we're templated for,
       // we only want to hit that in onfinish, not at each
       // sub finish.  e.g. MDSInternalContext.
       Context::complete(r);
     }
-    void finish(int r) {
+    void finish(int r) override {
       gather->sub_finish(this, r);
       gather = 0;
     }
-    ~C_GatherSub() {
+    ~C_GatherSub() override {
       if (gather)
        gather->sub_finish(this, 0);
     }
@@ -333,7 +333,7 @@ public:
   {
     mydout(cct,10) << "C_GatherBase " << this << ".new" << dendl;
   }
-  ~C_GatherBase() {
+  ~C_GatherBase() override {
     mydout(cct,10) << "C_GatherBase " << this << ".delete" << dendl;
   }
   void set_finisher(ContextType *onfinish_) {
@@ -364,7 +364,7 @@ public:
     mydout(cct,10) << "C_GatherBase " << this << ".new_sub is " << sub_created_count << " " << s << dendl;
     return s;
   }
-  void finish(int r) {
+  void finish(int r) override {
     ceph_abort();    // nobody should ever call me.
   }
 
@@ -485,7 +485,7 @@ public:
   {
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     m_callback(r);
   }
 private:
index a016bab4c642c452dba306411f8c76af32123d6c..4d4942adaabf6e4e5191894627090188153c552b 100644 (file)
@@ -77,19 +77,19 @@ namespace buffer CEPH_BUFFER_API {
    */
 
   struct error : public std::exception{
-    const char *what() const throw ();
+    const char *what() const throw () override;
   };
   struct bad_alloc : public error {
-    const char *what() const throw ();
+    const char *what() const throw () override;
   };
   struct end_of_buffer : public error {
-    const char *what() const throw ();
+    const char *what() const throw () override;
   };
   struct malformed_input : public error {
     explicit malformed_input(const std::string& w) {
       snprintf(buf, sizeof(buf), "buffer::malformed_input: %s", w.c_str());
     }
-    const char *what() const throw ();
+    const char *what() const throw () override;
   private:
     char buf[256];
   };
index 76c01def5258be6b3bb7ff535c6c5f38ecfed455..a8000e13099ad8796fe67609fe7f57daa8e935a2 100644 (file)
@@ -342,7 +342,7 @@ namespace librados
     time_t *unused;
   public:
     ObjectWriteOperation() : unused(NULL) {}
-    ~ObjectWriteOperation() {}
+    ~ObjectWriteOperation() override {}
 
     void mtime(time_t *pt);
     void mtime2(struct timespec *pts);
@@ -457,7 +457,7 @@ namespace librados
   {
   public:
     ObjectReadOperation() {}
-    ~ObjectReadOperation() {}
+    ~ObjectReadOperation() override {}
 
     void stat(uint64_t *psize, time_t *pmtime, int *prval);
     void stat2(uint64_t *psize, struct timespec *pts, int *prval);
index 96d2d24f3bc3ea4bf8862fc80c05244d83851ade..1c02c9a2d11e76feb998b3665d2e98d95a4fd636 100644 (file)
@@ -89,11 +89,11 @@ private:
   struct C_ConsistentAck : public Context {
     FutureImplPtr future;
     C_ConsistentAck(FutureImpl *_future) : future(_future) {}
-    virtual void complete(int r) {
+    void complete(int r) override {
       future->consistent(r);
       future.reset();
     }
-    virtual void finish(int r) {}
+    void finish(int r) override {}
   };
 
   uint64_t m_tag_tid;
index acbe3cb27078001bd22fda3a19d6c90932de7262..3d6fcfb2eca4e1091380b17f9cfe048cf9cada7f 100644 (file)
@@ -37,7 +37,7 @@ struct C_GetClient : public Context {
       client_id(client_id), client(client), on_finish(on_finish) {
     async_op_tracker.start_op();
   }
-  ~C_GetClient() {
+  ~C_GetClient() override {
     async_op_tracker.finish_op();
   }
 
@@ -95,7 +95,7 @@ struct C_AllocateTag : public Context {
     async_op_tracker.start_op();
     tag->data = data;
   }
-  ~C_AllocateTag() {
+  ~C_AllocateTag() override {
     async_op_tracker.finish_op();
   }
 
@@ -216,7 +216,7 @@ struct C_GetTag : public Context {
       tag_tid(tag_tid), tag(tag), on_finish(on_finish) {
     async_op_tracker.start_op();
   }
-  ~C_GetTag() {
+  ~C_GetTag() override {
     async_op_tracker.finish_op();
   }
 
@@ -275,7 +275,7 @@ struct C_GetTags : public Context {
       tags(tags), on_finish(on_finish) {
     async_op_tracker.start_op();
   }
-  ~C_GetTags() {
+  ~C_GetTags() override {
     async_op_tracker.finish_op();
   }
 
@@ -357,7 +357,7 @@ struct C_AssertActiveTag : public Context {
       client_id(client_id), tag_tid(tag_tid), on_finish(on_finish) {
     async_op_tracker.start_op();
   }
-  ~C_AssertActiveTag() {
+  ~C_AssertActiveTag() override {
     async_op_tracker.finish_op();
   }
 
index 24c3a69361fa02df86c67d3909f5a2dccdc99a7c..9eb78a644751546b4fe1a3614c8cde41f225d313 100644 (file)
@@ -46,7 +46,7 @@ public:
   JournalMetadata(ContextWQ *work_queue, SafeTimer *timer, Mutex *timer_lock,
                   librados::IoCtx &ioctx, const std::string &oid,
                   const std::string &client_id, const Settings &settings);
-  ~JournalMetadata();
+  ~JournalMetadata() override;
 
   void init(Context *on_init);
   void shut_down(Context *on_finish);
@@ -180,11 +180,11 @@ private:
     C_WatchCtx(JournalMetadata *_journal_metadata)
       : journal_metadata(_journal_metadata) {}
 
-    virtual void handle_notify(uint64_t notify_id, uint64_t cookie,
-                               uint64_t notifier_id, bufferlist& bl) {
+    void handle_notify(uint64_t notify_id, uint64_t cookie,
+                               uint64_t notifier_id, bufferlist& bl) override {
       journal_metadata->handle_watch_notify(notify_id, cookie);
     }
-    virtual void handle_error(uint64_t cookie, int err) {
+    void handle_error(uint64_t cookie, int err) override {
       journal_metadata->handle_watch_error(err);
     }
   };
@@ -196,10 +196,10 @@ private:
       : journal_metadata(_journal_metadata) {
       journal_metadata->m_async_op_tracker.start_op();
     }
-    virtual ~C_WatchReset() {
+    ~C_WatchReset() override {
       journal_metadata->m_async_op_tracker.finish_op();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       journal_metadata->handle_watch_reset();
     }
   };
@@ -211,10 +211,10 @@ private:
       : journal_metadata(_journal_metadata) {
       journal_metadata->m_async_op_tracker.start_op();
     }
-    virtual ~C_CommitPositionTask() {
+    ~C_CommitPositionTask() override {
       journal_metadata->m_async_op_tracker.finish_op();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       Mutex::Locker locker(journal_metadata->m_lock);
       journal_metadata->handle_commit_position_task();
     };
@@ -228,10 +228,10 @@ private:
       : journal_metadata(_journal_metadata), on_safe(_on_safe) {
       journal_metadata->m_async_op_tracker.start_op();
     }
-    virtual ~C_AioNotify() {
+    ~C_AioNotify() override {
       journal_metadata->m_async_op_tracker.finish_op();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       journal_metadata->handle_notified(r);
       if (on_safe != nullptr) {
         on_safe->complete(0);
@@ -247,10 +247,10 @@ private:
       : journal_metadata(_journal_metadata), on_safe(_on_safe) {
       journal_metadata->m_async_op_tracker.start_op();
     }
-    virtual ~C_NotifyUpdate() {
+    ~C_NotifyUpdate() override {
       journal_metadata->m_async_op_tracker.finish_op();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       if (r == 0) {
         journal_metadata->async_notify_update(on_safe);
         return;
@@ -270,10 +270,10 @@ private:
       Mutex::Locker locker(journal_metadata->m_lock);
       journal_metadata->m_async_op_tracker.start_op();
     }
-    virtual ~C_ImmutableMetadata() {
+    ~C_ImmutableMetadata() override {
       journal_metadata->m_async_op_tracker.finish_op();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       journal_metadata->handle_immutable_metadata(r, on_finish);
     }
   };
@@ -291,10 +291,10 @@ private:
       Mutex::Locker locker(journal_metadata->m_lock);
       journal_metadata->m_async_op_tracker.start_op();
     }
-    virtual ~C_Refresh() {
+    ~C_Refresh() override {
       journal_metadata->m_async_op_tracker.finish_op();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       journal_metadata->handle_refresh_complete(this, r);
     }
   };
index b313820c4a83f606fcb671fccd23162f0161680d..73c672b317570e712358cb4288812adc8a05d5ba 100644 (file)
@@ -21,7 +21,7 @@ struct C_HandleComplete : public Context {
     : replay_handler(_replay_handler) {
     replay_handler->get();
   }
-  ~C_HandleComplete() {
+  ~C_HandleComplete() override {
     replay_handler->put();
   }
   void finish(int r) override {
@@ -36,7 +36,7 @@ struct C_HandleEntriesAvailable : public Context {
       : replay_handler(_replay_handler) {
     replay_handler->get();
   }
-  ~C_HandleEntriesAvailable() {
+  ~C_HandleEntriesAvailable() override {
     replay_handler->put();
   }
   void finish(int r) override {
index ff5732bd8aa7dbcff3497b37d8f3424d43d2546b..f46f17a8ebc54ee2f6a129ab76e25e3c74af8187 100644 (file)
@@ -65,10 +65,10 @@ private:
     C_Fetch(JournalPlayer *p, uint64_t o) : player(p), object_num(o) {
       player->m_async_op_tracker.start_op();
     }
-    virtual ~C_Fetch() {
+    ~C_Fetch() override {
       player->m_async_op_tracker.finish_op();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       player->handle_fetched(object_num, r);
     }
   };
@@ -80,11 +80,11 @@ private:
       : player(player), object_num(object_num) {
       player->m_async_op_tracker.start_op();
     }
-    virtual ~C_Watch() {
+    ~C_Watch() override {
       player->m_async_op_tracker.finish_op();
     }
 
-    virtual void finish(int r) override {
+    void finish(int r) override {
       player->handle_watch(object_num, r);
     }
   };
index 7a4af52ee83ab5feca0664ab1bab0303adef94e1..e27a4ee8f30bbb43585bcab534ee8e2ffcb54493 100644 (file)
@@ -42,7 +42,7 @@ private:
     Listener(JournalRecorder *_journal_recorder)
       : journal_recorder(_journal_recorder) {}
 
-    virtual void handle_update(JournalMetadata *) {
+    void handle_update(JournalMetadata *) override {
       journal_recorder->handle_update();
     }
   };
@@ -54,10 +54,10 @@ private:
       : journal_recorder(_journal_recorder) {
     }
 
-    virtual void closed(ObjectRecorder *object_recorder) {
+    void closed(ObjectRecorder *object_recorder) override {
       journal_recorder->handle_closed(object_recorder);
     }
-    virtual void overflow(ObjectRecorder *object_recorder) {
+    void overflow(ObjectRecorder *object_recorder) override {
       journal_recorder->handle_overflow(object_recorder);
     }
   };
@@ -68,7 +68,7 @@ private:
     C_AdvanceObjectSet(JournalRecorder *_journal_recorder)
       : journal_recorder(_journal_recorder) {
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       journal_recorder->handle_advance_object_set(r);
     }
   };
index 4cda12e5704dc387d6e5c2c5a43fe1b0e73b1474..0b27923992d0d4f5d94662f20def4cda0e738a87 100644 (file)
@@ -39,7 +39,7 @@ private:
     MetadataListener(JournalTrimmer *journal_trimmer)
       : journal_trimmer(journal_trimmer) {
     }
-    void handle_update(JournalMetadata *) {
+    void handle_update(JournalMetadata *) override {
       journal_trimmer->handle_metadata_updated();
     }
   };
@@ -51,11 +51,11 @@ private:
       : journal_trimmer(_journal_trimmer) {
       journal_trimmer->m_async_op_tracker.start_op();
     }
-    virtual ~C_CommitPositionSafe() {
+    ~C_CommitPositionSafe() override {
       journal_trimmer->m_async_op_tracker.finish_op();
     }
 
-    virtual void finish(int r) {
+    void finish(int r) override {
     }
   };
 
index a14ea344d4adc2e59f6b89298f52a5ae1f49d952..bd3529d06a7559d90fb98fe2ebf24a771a4b4f42 100644 (file)
@@ -123,7 +123,7 @@ private:
     C_InitJournaler(Journaler *_journaler, Context *_on_safe)
       : journaler(_journaler), on_safe(_on_safe) {
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       if (r == 0) {
        r = journaler->init_complete();
       }
index cff33dc3bcd9c37849b6de64309a9e70de3847a6..3d495ba7ff7ae0336f4717cdba7752b088a65e1b 100644 (file)
@@ -39,7 +39,7 @@ public:
   ObjectPlayer(librados::IoCtx &ioctx, const std::string &object_oid_prefix,
                uint64_t object_num, SafeTimer &timer, Mutex &timer_lock,
                uint8_t order, uint64_t max_fetch_bytes);
-  ~ObjectPlayer();
+  ~ObjectPlayer() override;
 
   inline const std::string &get_oid() const {
     return m_oid;
@@ -88,19 +88,19 @@ private:
     bufferlist read_bl;
     C_Fetch(ObjectPlayer *o, Context *ctx) : object_player(o), on_finish(ctx) {
     }
-    virtual void finish(int r);
+    void finish(int r) override;
   };
   struct C_WatchTask : public Context {
     ObjectPlayerPtr object_player;
     C_WatchTask(ObjectPlayer *o) : object_player(o) {
     }
-    virtual void finish(int r);
+    void finish(int r) override;
   };
   struct C_WatchFetch : public Context {
     ObjectPlayerPtr object_player;
     C_WatchFetch(ObjectPlayer *o) : object_player(o) {
     }
-    virtual void finish(int r);
+    void finish(int r) override;
   };
 
   librados::IoCtx m_ioctx;
index 67380e43ae123a83814f0e983bdced5ae7e6aec1..aad46690134e94e50e38c60b3ecfb9bb1efce914 100644 (file)
@@ -42,7 +42,7 @@ public:
                  ContextWQ *work_queue, SafeTimer &timer, Mutex &timer_lock,
                  Handler *handler, uint8_t order, uint32_t flush_interval,
                  uint64_t flush_bytes, double flush_age);
-  ~ObjectRecorder();
+  ~ObjectRecorder() override;
 
   inline uint64_t get_object_number() const {
     return m_object_number;
@@ -79,13 +79,13 @@ private:
   struct FlushHandler : public FutureImpl::FlushHandler {
     ObjectRecorder *object_recorder;
     FlushHandler(ObjectRecorder *o) : object_recorder(o) {}
-    virtual void get() {
+    void get() override {
       object_recorder->get();
     }
-    virtual void put() {
+    void put() override {
       object_recorder->put();
     }
-    virtual void flush(const FutureImplPtr &future) {
+    void flush(const FutureImplPtr &future) override {
       Mutex::Locker locker(*(object_recorder->m_lock));
       object_recorder->flush(future);
     }
@@ -94,7 +94,7 @@ private:
     ObjectRecorder *object_recorder;
     C_AppendTask(ObjectRecorder *o) : object_recorder(o) {
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       object_recorder->handle_append_task();
     }
   };
@@ -105,7 +105,7 @@ private:
         : object_recorder(o), tid(_tid) {
       object_recorder->get();
     }
-    virtual void finish(int r) {
+    void finish(int r) override {
       object_recorder->handle_append_flushed(tid, r);
       object_recorder->put();
     }
index b0cee75ae828e2bdd11323c55147c959303df6fc..c5695e58353fa51c9b07ef383a2c9643a097392b 100644 (file)
@@ -22,7 +22,7 @@ struct C_AsyncCallback : public Context {
   C_AsyncCallback(M journal_metadata, Context *on_finish)
     : journal_metadata(journal_metadata), on_finish(on_finish) {
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     journal_metadata->queue(on_finish, r);
   }
 };
index 727afe487d13451219a5755ef1ae9783f680decd..f16ba6d9a99e479d3d09635e84774e751ac8107a 100644 (file)
@@ -749,15 +749,15 @@ public:
   /**
    * returns 0
    */
-  int nothing();
+  int nothing() override;
   /**
    * 10% chance of waiting wait_ms seconds
    */
-  int wait();
+  int wait() override;
   /**
    * 10% chance of killing the client.
    */
-  int suicide();
+  int suicide() override;
 
 KvFlatBtreeAsync(int k_val, string name, int cache, double cache_r,
     bool verb)
@@ -815,18 +815,18 @@ KvFlatBtreeAsync(int k_val, string name, int cache, double cache_r,
    * If inject is wait and wait_time is set, wait will have a 10% chance of
    * sleeping for waite_time miliseconds.
    */
-  void set_inject(injection_t inject, int wait_time);
+  void set_inject(injection_t inject, int wait_time) override;
 
   /**
    * sets up the rados and io_ctx of this KvFlatBtreeAsync. If the don't already
    * exist, creates the index and max object.
    */
-  int setup(int argc, const char** argv);
+  int setup(int argc, const char** argv) override;
 
   int set(const string &key, const bufferlist &val,
-        bool update_on_existing);
+        bool update_on_existing) override;
 
-  int remove(const string &key);
+  int remove(const string &key) override;
 
   /**
    * returns true if all of the following are true:
@@ -840,23 +840,23 @@ KvFlatBtreeAsync(int k_val, string name, int cache, double cache_r,
    *
    * @pre: no operations are in progress
    */
-  bool is_consistent();
+  bool is_consistent() override;
 
   /**
    * returns an ASCII representation of the index and sub objects, showing
    * stats about each object and all omaps. Don't use if you have more than
    * about 10 objects.
    */
-  string str();
+  string str() override;
 
-  int get(const string &key, bufferlist *val);
+  int get(const string &key, bufferlist *val) override;
 
   //async versions of these methods
   void aio_get(const string &key, bufferlist *val, callback cb,
-      void *cb_args, int * err);
+      void *cb_args, int * err) override;
   void aio_set(const string &key, const bufferlist &val, bool exclusive,
-      callback cb, void * cb_args, int * err);
-  void aio_remove(const string &key, callback cb, void *cb_args, int * err);
+      callback cb, void * cb_args, int * err) override;
+  void aio_remove(const string &key, callback cb, void *cb_args, int * err) override;
 
   //these methods that deal with multiple keys at once are efficient, but make
   //no guarantees about atomicity!
@@ -866,7 +866,7 @@ KvFlatBtreeAsync(int k_val, string name, int cache, double cache_r,
    * attempt to do this safely - make sure this is the only operation running
    * when it is called!
    */
-  int remove_all();
+  int remove_all() override;
 
   /**
    * This does not add prefixes to the index and therefore DOES NOT guarantee
@@ -890,10 +890,10 @@ KvFlatBtreeAsync(int k_val, string name, int cache, double cache_r,
    * * The keys are distributed across the range of keys in the store
    * * there is a small number of keys compared to k
    */
-  int set_many(const map<string, bufferlist> &in_map);
+  int set_many(const map<string, bufferlist> &in_map) override;
 
-  int get_all_keys(std::set<string> *keys);
-  int get_all_keys_and_values(map<string,bufferlist> *kv_map);
+  int get_all_keys(std::set<string> *keys) override;
+  int get_all_keys_and_values(map<string,bufferlist> *kv_map) override;
 
 };
 
index d56ac819552a13756245ea7cb5d6b75179c26c3d..52d434e2bd38ca01da99d84c14504ad62066be44 100644 (file)
@@ -226,28 +226,28 @@ public:
   public:
     IteratorImpl(const std::string &prefix, WholeSpaceIterator iter) :
       prefix(prefix), generic_iter(iter) { }
-    virtual ~IteratorImpl() { }
+    ~IteratorImpl() override { }
 
-    int seek_to_first() {
+    int seek_to_first() override {
       return generic_iter->seek_to_first(prefix);
     }
     int seek_to_last() {
       return generic_iter->seek_to_last(prefix);
     }
-    int upper_bound(const std::string &after) {
+    int upper_bound(const std::string &after) override {
       return generic_iter->upper_bound(prefix, after);
     }
-    int lower_bound(const std::string &to) {
+    int lower_bound(const std::string &to) override {
       return generic_iter->lower_bound(prefix, to);
     }
-    bool valid() {
+    bool valid() override {
       if (!generic_iter->valid())
        return false;
       return generic_iter->raw_key_is_prefixed(prefix);
     }
     // Note that next() and prev() shouldn't validate iters,
     // it's responsibility of caller to ensure they're valid.
-    int next(bool validate=true) {
+    int next(bool validate=true) override {
       if (validate) {
         if (valid())
           return generic_iter->next();
@@ -266,19 +266,19 @@ public:
         return generic_iter->prev();  
       }      
     }
-    std::string key() {
+    std::string key() override {
       return generic_iter->key();
     }
     std::pair<std::string, std::string> raw_key() {
       return generic_iter->raw_key();
     }
-    bufferlist value() {
+    bufferlist value() override {
       return generic_iter->value();
     }
     bufferptr value_as_ptr() {
       return generic_iter->value_as_ptr();
     }
-    int status() {
+    int status() override {
       return generic_iter->status();
     }
   };
index a1895b639f4ebdc3e4377ec06ae21075cdf33726..b9951e15dd8b46c9bcb89f2dad280c8b50fa9c17 100644 (file)
@@ -22,7 +22,7 @@ public:
   explicit CephLevelDBLogger(CephContext *c) : cct(c) {
     cct->get();
   }
-  ~CephLevelDBLogger() {
+  ~CephLevelDBLogger() override {
     cct->put();
   }
 
index ce55bf41bbe0bff23bbbc411b332aa1be03b6d25..c4abbf63b3fc1925c0bd16ad428ebc0907c371b6 100644 (file)
@@ -74,7 +74,7 @@ class LevelDBStore : public KeyValueDB {
     LevelDBStore *db;
   public:
     explicit CompactThread(LevelDBStore *d) : db(d) {}
-    void *entry() {
+    void *entry() override {
       db->compact_thread_entry();
       return NULL;
     }
@@ -92,21 +92,21 @@ class LevelDBStore : public KeyValueDB {
 
 public:
   /// compact the underlying leveldb store
-  void compact();
+  void compact() override;
 
   /// compact db for all keys with a given prefix
-  void compact_prefix(const string& prefix) {
+  void compact_prefix(const string& prefix) override {
     compact_range(prefix, past_prefix(prefix));
   }
-  void compact_prefix_async(const string& prefix) {
+  void compact_prefix_async(const string& prefix) override {
     compact_range_async(prefix, past_prefix(prefix));
   }
   void compact_range(const string& prefix,
-                    const string& start, const string& end) {
+                    const string& start, const string& end) override {
     compact_range(combine_strings(prefix, start), combine_strings(prefix, end));
   }
   void compact_range_async(const string& prefix,
-                          const string& start, const string& end) {
+                          const string& start, const string& end) override {
     compact_range_async(combine_strings(prefix, start),
                        combine_strings(prefix, end));
   }
@@ -165,21 +165,21 @@ public:
     options()
   {}
 
-  ~LevelDBStore();
+  ~LevelDBStore() override;
 
   static int _test_init(const string& dir);
-  int init(string option_str="");
+  int init(string option_str="") override;
 
   /// Opens underlying db
-  int open(ostream &out) {
+  int open(ostream &out) override {
     return do_open(out, false);
   }
   /// Creates underlying db if missing and opens it
-  int create_and_open(ostream &out) {
+  int create_and_open(ostream &out) override {
     return do_open(out, true);
   }
 
-  void close();
+  void close() override;
 
   class LevelDBTransactionImpl : public KeyValueDB::TransactionImpl {
   public:
@@ -189,32 +189,32 @@ public:
     void set(
       const string &prefix,
       const string &k,
-      const bufferlist &bl);
+      const bufferlist &bl) override;
     using KeyValueDB::TransactionImpl::set;
     void rmkey(
       const string &prefix,
-      const string &k);
+      const string &k) override;
     void rmkeys_by_prefix(
       const string &prefix
-      );
+      ) override;
     using KeyValueDB::TransactionImpl::rmkey;
   };
 
-  KeyValueDB::Transaction get_transaction() {
+  KeyValueDB::Transaction get_transaction() override {
     return std::make_shared<LevelDBTransactionImpl>(this);
   }
 
-  int submit_transaction(KeyValueDB::Transaction t);
-  int submit_transaction_sync(KeyValueDB::Transaction t);
+  int submit_transaction(KeyValueDB::Transaction t) override;
+  int submit_transaction_sync(KeyValueDB::Transaction t) override;
   int get(
     const string &prefix,
     const std::set<string> &key,
     std::map<string, bufferlist> *out
-    );
+    ) override;
 
   int get(const string &prefix, 
     const string &key,   
-    bufferlist *value);
+    bufferlist *value) override;
 
   using KeyValueDB::get;
 
@@ -225,22 +225,22 @@ public:
   public:
     explicit LevelDBWholeSpaceIteratorImpl(leveldb::Iterator *iter) :
       dbiter(iter) { }
-    virtual ~LevelDBWholeSpaceIteratorImpl() { }
+    ~LevelDBWholeSpaceIteratorImpl() override { }
 
-    int seek_to_first() {
+    int seek_to_first() override {
       dbiter->SeekToFirst();
       return dbiter->status().ok() ? 0 : -1;
     }
-    int seek_to_first(const string &prefix) {
+    int seek_to_first(const string &prefix) override {
       leveldb::Slice slice_prefix(prefix);
       dbiter->Seek(slice_prefix);
       return dbiter->status().ok() ? 0 : -1;
     }
-    int seek_to_last() {
+    int seek_to_last() override {
       dbiter->SeekToLast();
       return dbiter->status().ok() ? 0 : -1;
     }
-    int seek_to_last(const string &prefix) {
+    int seek_to_last(const string &prefix) override {
       string limit = past_prefix(prefix);
       leveldb::Slice slice_limit(limit);
       dbiter->Seek(slice_limit);
@@ -252,7 +252,7 @@ public:
       }
       return dbiter->status().ok() ? 0 : -1;
     }
-    int upper_bound(const string &prefix, const string &after) {
+    int upper_bound(const string &prefix, const string &after) override {
       lower_bound(prefix, after);
       if (valid()) {
        pair<string,string> key = raw_key();
@@ -261,36 +261,36 @@ public:
       }
       return dbiter->status().ok() ? 0 : -1;
     }
-    int lower_bound(const string &prefix, const string &to) {
+    int lower_bound(const string &prefix, const string &to) override {
       string bound = combine_strings(prefix, to);
       leveldb::Slice slice_bound(bound);
       dbiter->Seek(slice_bound);
       return dbiter->status().ok() ? 0 : -1;
     }
-    bool valid() {
+    bool valid() override {
       return dbiter->Valid();
     }
-    int next() {
+    int next() override {
       if (valid())
        dbiter->Next();
       return dbiter->status().ok() ? 0 : -1;
     }
-    int prev() {
+    int prev() override {
       if (valid())
        dbiter->Prev();
       return dbiter->status().ok() ? 0 : -1;
     }
-    string key() {
+    string key() override {
       string out_key;
       split_key(dbiter->key(), 0, &out_key);
       return out_key;
     }
-    pair<string,string> raw_key() {
+    pair<string,string> raw_key() override {
       string prefix, key;
       split_key(dbiter->key(), &prefix, &key);
       return make_pair(prefix, key);
     }
-    bool raw_key_is_prefixed(const string &prefix) {
+    bool raw_key_is_prefixed(const string &prefix) override {
       leveldb::Slice key = dbiter->key();
       if ((key.size() > prefix.length()) && (key[prefix.length()] == '\0')) {
         return memcmp(key.data(), prefix.c_str(), prefix.length()) == 0;
@@ -298,16 +298,16 @@ public:
         return false;
       }
     }
-    bufferlist value() {
+    bufferlist value() override {
       return to_bufferlist(dbiter->value());
     }
 
-    bufferptr value_as_ptr() {
+    bufferptr value_as_ptr() override {
       leveldb::Slice data = dbiter->value();
       return bufferptr(data.data(), data.size());
     }
 
-    int status() {
+    int status() override {
       return dbiter->status().ok() ? 0 : -1;
     }
   };
@@ -322,7 +322,7 @@ public:
     return limit;
   }
 
-  virtual uint64_t get_estimated_size(map<string,uint64_t> &extra) {
+  uint64_t get_estimated_size(map<string,uint64_t> &extra) override {
     DIR *store_dir = opendir(path.c_str());
     if (!store_dir) {
       lderr(cct) << __func__ << " something happened opening the store: "
@@ -390,7 +390,7 @@ err:
 
 
 protected:
-  WholeSpaceIterator _get_iterator() {
+  WholeSpaceIterator _get_iterator() override {
     return std::make_shared<LevelDBWholeSpaceIteratorImpl>(
        db->NewIterator(leveldb::ReadOptions()));
   }
index 565b94a7fa615014a9cf8c9987d590677f06e4b9..d3c8268cc43ce34bd1fe185d311d556c5b36ecdf 100644 (file)
@@ -46,7 +46,7 @@ class MemDB : public KeyValueDB
 
   int transaction_rollback(KeyValueDB::Transaction t);
   int _open(ostream &out);
-  void close();
+  void close() override;
   bool _get(const string &prefix, const string &k, bufferlist *out);
   bool _get_locked(const string &prefix, const string &k, bufferlist *out);
   std::string _get_data_fn();
@@ -62,9 +62,9 @@ public:
     //Nothing as of now
   }
 
-  ~MemDB();
-  virtual int set_merge_operator(const std::string& prefix,
-         std::shared_ptr<MergeOperator> mop);
+  ~MemDB() override;
+  int set_merge_operator(const std::string& prefix,
+         std::shared_ptr<MergeOperator> mop) override;
 
   std::shared_ptr<MergeOperator> _find_merge_op(std::string prefix);
 
@@ -85,13 +85,13 @@ public:
         get_ops() { return ops; };
 
     void set(const std::string &prefix, const std::string &key,
-      const bufferlist &val);
+      const bufferlist &val) override;
     using KeyValueDB::TransactionImpl::set;
-    void rmkey(const std::string &prefix, const std::string &k);
+    void rmkey(const std::string &prefix, const std::string &k) override;
     using KeyValueDB::TransactionImpl::rmkey;
-    void rmkeys_by_prefix(const std::string &prefix);
+    void rmkeys_by_prefix(const std::string &prefix) override;
 
-    void merge(const std::string &prefix, const std::string &key, const bufferlist  &value);
+    void merge(const std::string &prefix, const std::string &key, const bufferlist  &value) override;
     void clear() {
       ops.clear();
     }
@@ -99,7 +99,7 @@ public:
     {
       ops.clear();
     }
-    ~MDBTransactionImpl() {};
+    ~MDBTransactionImpl() override {};
   };
 
 private:
@@ -114,19 +114,19 @@ private:
 
 public:
 
-  int init(string option_str="") { m_options = option_str; return 0; }
+  int init(string option_str="") override { m_options = option_str; return 0; }
   int _init(bool format);
 
   int do_open(ostream &out, bool create);
-  int open(ostream &out) { return do_open(out, false); }
-  int create_and_open(ostream &out) { return do_open(out, true); }
+  int open(ostream &out) override { return do_open(out, false); }
+  int create_and_open(ostream &out) override { return do_open(out, true); }
 
-  KeyValueDB::Transaction get_transaction() {
+  KeyValueDB::Transaction get_transaction() override {
     return std::shared_ptr<MDBTransactionImpl>(new MDBTransactionImpl(this));
   }
 
-  int submit_transaction(Transaction);
-  int submit_transaction_sync(Transaction);
+  int submit_transaction(Transaction) override;
+  int submit_transaction_sync(Transaction) override;
 
   int get(const std::string &prefix, const std::set<std::string> &key,
     std::map<std::string, bufferlist> *out) override;
@@ -161,34 +161,34 @@ public:
     void free_last();
 
 
-    int seek_to_first(const std::string &k);
-    int seek_to_last(const std::string &k);
+    int seek_to_first(const std::string &k) override;
+    int seek_to_last(const std::string &k) override;
 
-    int seek_to_first() { return seek_to_first(std::string()); };
-    int seek_to_last() { return seek_to_last(std::string()); };
+    int seek_to_first() override { return seek_to_first(std::string()); };
+    int seek_to_last() override { return seek_to_last(std::string()); };
 
-    int upper_bound(const std::string &prefix, const std::string &after);
-    int lower_bound(const std::string &prefix, const std::string &to);
-    bool valid();
+    int upper_bound(const std::string &prefix, const std::string &after) override;
+    int lower_bound(const std::string &prefix, const std::string &to) override;
+    bool valid() override;
     bool iterator_validate();
 
-    int next();
-    int prev();
-    int status() { return 0; };
+    int next() override;
+    int prev() override;
+    int status() override { return 0; };
 
-    std::string key();
-    std::pair<std::string,std::string> raw_key();
-    bool raw_key_is_prefixed(const std::string &prefix);
-    bufferlist value();
-    ~MDBWholeSpaceIteratorImpl();
+    std::string key() override;
+    std::pair<std::string,std::string> raw_key() override;
+    bool raw_key_is_prefixed(const std::string &prefix) override;
+    bufferlist value() override;
+    ~MDBWholeSpaceIteratorImpl() override;
   };
 
-  uint64_t get_estimated_size(std::map<std::string,uint64_t> &extra) {
+  uint64_t get_estimated_size(std::map<std::string,uint64_t> &extra) override {
       std::lock_guard<std::mutex> l(m_lock);
       return m_allocated_bytes;
   };
 
-  int get_statfs(struct store_statfs_t *buf) {
+  int get_statfs(struct store_statfs_t *buf) override {
     std::lock_guard<std::mutex> l(m_lock);
     buf->reset();
     buf->total = m_total_bytes;
@@ -199,7 +199,7 @@ public:
 
 protected:
 
-  WholeSpaceIterator _get_iterator() {
+  WholeSpaceIterator _get_iterator() override {
     return std::shared_ptr<KeyValueDB::WholeSpaceIteratorImpl>(
       new MDBWholeSpaceIteratorImpl(&m_map, &m_lock, &iterator_seq_no, m_using_btree));
   }
index 29f9d0f1e145081a7f74c11fd32d92281c8c72ea..3fcc14a209cd5640f1af2b5f495a34da34294d3f 100644 (file)
@@ -100,7 +100,7 @@ public:
   explicit CephRocksdbLogger(CephContext *c) : cct(c) {
     cct->get();
   }
-  ~CephRocksdbLogger() {
+  ~CephRocksdbLogger() override {
     cct->put();
   }
 
index 7c0d59035046a42d38aef653083dd845a436639b..0d15ca4818b979c55a0883571c01c05b994cabcd 100644 (file)
@@ -86,7 +86,7 @@ class RocksDBStore : public KeyValueDB {
     RocksDBStore *db;
   public:
     explicit CompactThread(RocksDBStore *d) : db(d) {}
-    void *entry() {
+    void *entry() override {
       db->compact_thread_entry();
       return NULL;
     }
@@ -102,24 +102,24 @@ public:
   /// compact the underlying rocksdb store
   bool compact_on_mount;
   bool disableWAL;
-  void compact();
+  void compact() override;
 
   int tryInterpret(const string key, const string val, rocksdb::Options &opt);
   int ParseOptionsFromString(const string opt_str, rocksdb::Options &opt);
   static int _test_init(const string& dir);
-  int init(string options_str);
+  int init(string options_str) override;
   /// compact rocksdb for all keys with a given prefix
-  void compact_prefix(const string& prefix) {
+  void compact_prefix(const string& prefix) override {
     compact_range(prefix, past_prefix(prefix));
   }
-  void compact_prefix_async(const string& prefix) {
+  void compact_prefix_async(const string& prefix) override {
     compact_range_async(prefix, past_prefix(prefix));
   }
 
-  void compact_range(const string& prefix, const string& start, const string& end) {
+  void compact_range(const string& prefix, const string& start, const string& end) override {
     compact_range(combine_strings(prefix, start), combine_strings(prefix, end));
   }
-  void compact_range_async(const string& prefix, const string& start, const string& end) {
+  void compact_range_async(const string& prefix, const string& start, const string& end) override {
     compact_range_async(combine_strings(prefix, start), combine_strings(prefix, end));
   }
 
@@ -138,20 +138,20 @@ public:
     disableWAL(false)
   {}
 
-  ~RocksDBStore();
+  ~RocksDBStore() override;
 
   static bool check_omap_dir(string &omap_dir);
   /// Opens underlying db
-  int open(ostream &out) {
+  int open(ostream &out) override {
     return do_open(out, false);
   }
   /// Creates underlying db if missing and opens it
-  int create_and_open(ostream &out);
+  int create_and_open(ostream &out) override;
 
-  void close();
+  void close() override;
 
   void split_stats(const std::string &s, char delim, std::vector<std::string> &elems);
-  void get_statistics(Formatter *f);
+  void get_statistics(Formatter *f) override;
 
   struct  RocksWBHandler: public rocksdb::WriteBatch::Handler {
     std::string seen ;
@@ -204,7 +204,7 @@ public:
       }
       return out;
     }
-    virtual void Put(const rocksdb::Slice& key,
+    void Put(const rocksdb::Slice& key,
                     const rocksdb::Slice& value) override {
       string prefix ((key.ToString()).substr(0,1));
       string key_to_decode ((key.ToString()).substr(2,string::npos));
@@ -214,14 +214,14 @@ public:
             + " Value size = " + std::to_string(size) + ")";
       num_seen++;
     }
-    virtual void SingleDelete(const rocksdb::Slice& key) override {
+    void SingleDelete(const rocksdb::Slice& key) override {
       string prefix ((key.ToString()).substr(0,1));
       string key_to_decode ((key.ToString()).substr(2,string::npos));
       seen += "\nSingleDelete(Prefix = "+ prefix + " Key = " 
             + pretty_binary_string(key_to_decode) + ")";
       num_seen++;
     }
-    virtual void Delete(const rocksdb::Slice& key) override {
+    void Delete(const rocksdb::Slice& key) override {
       string prefix ((key.ToString()).substr(0,1));
       string key_to_decode ((key.ToString()).substr(2,string::npos));
       seen += "\nDelete( Prefix = " + prefix + " key = " 
@@ -229,7 +229,7 @@ public:
 
       num_seen++;
     }
-    virtual void Merge(const rocksdb::Slice& key,
+    void Merge(const rocksdb::Slice& key,
                       const rocksdb::Slice& value) override {
       string prefix ((key.ToString()).substr(0,1));
       string key_to_decode ((key.ToString()).substr(2,string::npos));
@@ -240,7 +240,7 @@ public:
 
       num_seen++;
     }
-    virtual bool Continue() override { return num_seen < 50; }
+    bool Continue() override { return num_seen < 50; }
 
   };
 
@@ -279,12 +279,12 @@ public:
       const bufferlist &bl) override;
   };
 
-  KeyValueDB::Transaction get_transaction() {
+  KeyValueDB::Transaction get_transaction() override {
     return std::make_shared<RocksDBTransactionImpl>(this);
   }
 
-  int submit_transaction(KeyValueDB::Transaction t);
-  int submit_transaction_sync(KeyValueDB::Transaction t);
+  int submit_transaction(KeyValueDB::Transaction t) override;
+  int submit_transaction_sync(KeyValueDB::Transaction t) override;
   int get(
     const string &prefix,
     const std::set<string> &key,
@@ -310,23 +310,23 @@ public:
     explicit RocksDBWholeSpaceIteratorImpl(rocksdb::Iterator *iter) :
       dbiter(iter) { }
     //virtual ~RocksDBWholeSpaceIteratorImpl() { }
-    ~RocksDBWholeSpaceIteratorImpl();
-
-    int seek_to_first();
-    int seek_to_first(const string &prefix);
-    int seek_to_last();
-    int seek_to_last(const string &prefix);
-    int upper_bound(const string &prefix, const string &after);
-    int lower_bound(const string &prefix, const string &to);
-    bool valid();
-    int next();
-    int prev();
-    string key();
-    pair<string,string> raw_key();
-    bool raw_key_is_prefixed(const string &prefix);
-    bufferlist value();
-    bufferptr value_as_ptr();
-    int status();
+    ~RocksDBWholeSpaceIteratorImpl() override;
+
+    int seek_to_first() override;
+    int seek_to_first(const string &prefix) override;
+    int seek_to_last() override;
+    int seek_to_last(const string &prefix) override;
+    int upper_bound(const string &prefix, const string &after) override;
+    int lower_bound(const string &prefix, const string &to) override;
+    bool valid() override;
+    int next() override;
+    int prev() override;
+    string key() override;
+    pair<string,string> raw_key() override;
+    bool raw_key_is_prefixed(const string &prefix) override;
+    bufferlist value() override;
+    bufferptr value_as_ptr() override;
+    int status() override;
     size_t key_size() override;
     size_t value_size() override;
   };
@@ -359,11 +359,11 @@ public:
 
   class MergeOperatorRouter;
   friend class MergeOperatorRouter;
-  virtual int set_merge_operator(const std::string& prefix,
-                                std::shared_ptr<KeyValueDB::MergeOperator> mop);
+  int set_merge_operator(const std::string& prefix,
+                                std::shared_ptr<KeyValueDB::MergeOperator> mop) override;
   string assoc_name; ///< Name of associative operator
 
-  virtual uint64_t get_estimated_size(map<string,uint64_t> &extra) {
+  uint64_t get_estimated_size(map<string,uint64_t> &extra) override {
     DIR *store_dir = opendir(path.c_str());
     if (!store_dir) {
       lderr(cct) << __func__ << " something happened opening the store: "
@@ -431,7 +431,7 @@ err:
 
 
 protected:
-  WholeSpaceIterator _get_iterator();
+  WholeSpaceIterator _get_iterator() override;
 };
 
 
index a8ef1c8a69700cc1e44c9312c754385654e11f77..ce77daabc41fd4db38ed1a0490724d571dce9100 100644 (file)
@@ -51,7 +51,7 @@ class Log : private Thread
 
   bool m_inject_segv;
 
-  void *entry();
+  void *entry() override;
 
   void _flush(EntryQueue *q, EntryQueue *requeue, bool crash);
 
@@ -59,7 +59,7 @@ class Log : private Thread
 
 public:
   explicit Log(SubsystemMap *s);
-  virtual ~Log();
+  ~Log() override;
 
   void set_flush_on_exit();