]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: add override for common submodule and misc 13443/head
authorliuchang0812 <liuchang0812@gmail.com>
Thu, 16 Feb 2017 02:49:13 +0000 (10:49 +0800)
committerliuchang0812 <liuchang0812@gmail.com>
Thu, 16 Feb 2017 05:32:22 +0000 (13:32 +0800)
Fixes: http://tracker.ceph.com/issues/18922
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
85 files changed:
src/auth/Crypto.cc
src/ceph_fuse.cc
src/client/Client.cc
src/client/SyntheticClient.cc
src/cls/cephfs/cls_cephfs.cc
src/cls/hello/cls_hello.cc
src/cls/journal/cls_journal_client.cc
src/cls/log/cls_log_client.cc
src/cls/statelog/cls_statelog_client.cc
src/cls/timeindex/cls_timeindex_client.cc
src/cls/user/cls_user_client.cc
src/cls/version/cls_version_client.cc
src/common/Timer.cc
src/common/admin_socket.cc
src/common/buffer.cc
src/common/ceph_context.cc
src/common/pick_address.cc
src/crush/CrushTester.cc
src/crush/CrushWrapper.cc
src/global/signal_handler.cc
src/journal/JournalMetadata.cc
src/journal/JournalPlayer.cc
src/journal/JournalRecorder.cc
src/journal/JournalTrimmer.cc
src/kv/LevelDBStore.cc
src/kv/RocksDBStore.cc
src/msg/async/AsyncConnection.cc
src/msg/async/AsyncMessenger.cc
src/msg/async/Event.cc
src/msg/async/PosixStack.cc
src/msg/async/Stack.cc
src/msg/simple/Pipe.cc
src/test/ObjectMap/KeyValueDBMemory.cc
src/test/ObjectMap/test_keyvaluedb_iterators.cc
src/test/ObjectMap/test_object_map.cc
src/test/TestTimers.cc
src/test/admin_socket.cc
src/test/bench/bencher.cc
src/test/bench/small_io_bench_fs.cc
src/test/bench/tp_bench.cc
src/test/bench_log.cc
src/test/bufferlist.cc
src/test/ceph_crypto.cc
src/test/cls_lua/test_cls_lua.cc
src/test/cls_replica_log/test_cls_replica_log.cc
src/test/common/Throttle.cc
src/test/common/dns_resolve.cc
src/test/common/test_async_compressor.cc
src/test/common/test_prioritized_queue.cc
src/test/common/test_shared_cache.cc
src/test/common/test_sharedptr_registry.cc
src/test/common/test_weighted_priority_queue.cc
src/test/compressor/compressor_plugin_example.cc
src/test/compressor/test_compression.cc
src/test/crypto.cc
src/test/encoding/ceph_dencoder.cc
src/test/erasure-code/ErasureCodePluginExample.cc
src/test/erasure-code/TestErasureCode.cc
src/test/erasure-code/TestErasureCodePlugin.cc
src/test/gather.cc
src/test/journal/test_FutureImpl.cc
src/test/journal/test_JournalMetadata.cc
src/test/journal/test_JournalPlayer.cc
src/test/journal/test_JournalRecorder.cc
src/test/journal/test_JournalTrimmer.cc
src/test/journal/test_Journaler.cc
src/test/journal/test_ObjectRecorder.cc
src/test/msgr/perf_msgr_client.cc
src/test/msgr/perf_msgr_server.cc
src/test/msgr/test_async_driver.cc
src/test/msgr/test_async_networkstack.cc
src/test/msgr/test_msgr.cc
src/test/multi_stress_watch.cc
src/test/objectstore_bench.cc
src/test/perf_local.cc
src/test/system/rados_list_parallel.cc
src/test/system/rados_open_pools_parallel.cc
src/test/test_snap_mapper.cc
src/test/test_stress_watch.cc
src/test/test_trans.cc
src/test/test_xlist.cc
src/test/xattr_bench.cc
src/tools/ceph_objectstore_tool.cc
src/tools/rados/rados.cc
src/tools/scratchtoolpp.cc

index 3746975ca9ddcbc9cd421c40969f94081489c792..922db84793dbbdce36b037e3332d6080b29fa546 100644 (file)
@@ -67,12 +67,12 @@ uint64_t get_random(uint64_t min_val, uint64_t max_val)
 class CryptoNoneKeyHandler : public CryptoKeyHandler {
 public:
   int encrypt(const bufferlist& in,
-              bufferlist& out, std::string *error) const {
+              bufferlist& out, std::string *error) const override {
     out = in;
     return 0;
   }
   int decrypt(const bufferlist& in,
-             bufferlist& out, std::string *error) const {
+             bufferlist& out, std::string *error) const override {
     out = in;
     return 0;
   }
@@ -82,16 +82,16 @@ class CryptoNone : public CryptoHandler {
 public:
   CryptoNone() { }
   ~CryptoNone() {}
-  int get_type() const {
+  int get_type() const override {
     return CEPH_CRYPTO_NONE;
   }
-  int create(bufferptr& secret) {
+  int create(bufferptr& secret) override {
     return 0;
   }
-  int validate_secret(const bufferptr& secret) {
+  int validate_secret(const bufferptr& secret) override {
     return 0;
   }
-  CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) {
+  CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) override {
     return new CryptoNoneKeyHandler;
   }
 };
@@ -104,12 +104,12 @@ class CryptoAES : public CryptoHandler {
 public:
   CryptoAES() { }
   ~CryptoAES() {}
-  int get_type() const {
+  int get_type() const override {
     return CEPH_CRYPTO_AES;
   }
-  int create(bufferptr& secret);
-  int validate_secret(const bufferptr& secret);
-  CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error);
+  int create(bufferptr& secret) override;
+  int validate_secret(const bufferptr& secret) override;
+  CryptoKeyHandler *get_key_handler(const bufferptr& secret, string& error) override;
 };
 
 #ifdef USE_CRYPTOPP
@@ -312,11 +312,11 @@ public:
   }
 
   int encrypt(const bufferlist& in,
-             bufferlist& out, std::string *error) const {
+             bufferlist& out, std::string *error) const override {
     return nss_aes_operation(CKA_ENCRYPT, mechanism, key, param, in, out, error);
   }
   int decrypt(const bufferlist& in,
-              bufferlist& out, std::string *error) const {
+              bufferlist& out, std::string *error) const override {
     return nss_aes_operation(CKA_DECRYPT, mechanism, key, param, in, out, error);
   }
 };
index a2d7287c9a449035c10d7db02b4243669eb51d64..d44b2b9d7228f3560caffaa00c53661507db4def 100644 (file)
@@ -149,8 +149,8 @@ int main(int argc, const char **argv, const char *envp[]) {
        cfuse = cf;
        client = cl;
       }
-      virtual ~RemountTest() {}
-      virtual void *entry() {
+      ~RemountTest() {}
+      void *entry() override {
 #if defined(__linux__)
        int ver = get_linux_version();
        assert(ver != 0);
index b1ffba576d81bf7ab0f8e1d8ed2524c4c37339dc..fd0dcde3240b3873e6554e74a9b2686952bed977 100644 (file)
@@ -2985,7 +2985,7 @@ private:
   InodeRef inode;
 public:
   C_Client_FlushComplete(Client *c, Inode *in) : client(c), inode(in) { }
-  void finish(int r) {
+  void finish(int r) override {
     assert(client->client_lock.is_locked_by_me());
     if (r != 0) {
       client_t const whoami = client->whoami;  // For the benefit of ldout prefix
@@ -3633,7 +3633,7 @@ public:
     else
       ino = in->vino();
   }
-  void finish(int r) {
+  void finish(int r) override {
     // _async_invalidate takes the lock when it needs to, call this back from outside of lock.
     assert(!client->client_lock.is_locked_by_me());
     client->_async_invalidate(ino, offset, length);
@@ -3940,7 +3940,7 @@ private:
   Client *client;
 public:
   explicit C_Client_Remount(Client *c) : client(c) {}
-  void finish(int r) {
+  void finish(int r) override {
     assert (r == 0);
     r = client->remount_cb(client->callback_handle);
     if (r != 0) {
@@ -4835,7 +4835,7 @@ public:
       if (!del)
        ino.ino = inodeno_t();
   }
-  void finish(int r) {
+  void finish(int r) override {
     // _async_dentry_invalidate is responsible for its own locking
     assert(!client->client_lock.is_locked_by_me());
     client->_async_dentry_invalidate(dirino, ino, name);
@@ -5812,7 +5812,7 @@ class C_C_Tick : public Context {
   Client *client;
 public:
   explicit C_C_Tick(Client *c) : client(c) {}
-  void finish(int r) {
+  void finish(int r) override {
     // Called back via Timer, which takes client_lock for us
     assert(client->client_lock.is_locked_by_me());
     client->tick();
@@ -12441,7 +12441,7 @@ public:
   C_Client_RequestInterrupt(Client *c, MetaRequest *r) : client(c), req(r) {
     req->get();
   }
-  void finish(int r) {
+  void finish(int r) override {
     Mutex::Locker l(client->client_lock);
     assert(req->head.op == CEPH_MDS_OP_SETFILELOCK);
     client->_interrupt_filelock(req);
index 4650fed25d0cc25587412fbba07d825a88285b74..4b0bae38c88757ecb8900b5b470ab85d2fc01a18 100644 (file)
@@ -2221,7 +2221,7 @@ public:
     (*ref)++;
     lock.Unlock();
   }
-  void finish(int) {
+  void finish(int) override {
     lock.Lock();
     (*ref)--;
     cond.Signal();
index 3537f68450b970beab1516ff0e5847f86a7d8f22..61c51823704a98d88270447791fbffca9adb1366 100644 (file)
@@ -127,7 +127,7 @@ class PGLSCephFSFilter : public PGLSFilter {
 protected:
   std::string scrub_tag;
 public:
-  int init(bufferlist::iterator& params) {
+  int init(bufferlist::iterator& params) override {
     try {
       InodeTagFilterArgs args;
       args.decode(params);
@@ -145,10 +145,10 @@ public:
     return 0;
   }
 
-  virtual ~PGLSCephFSFilter() {}
-  virtual bool reject_empty_xattr() { return false; }
-  virtual bool filter(const hobject_t &obj, bufferlist& xattr_data,
-                      bufferlist& outdata);
+  ~PGLSCephFSFilter() {}
+  bool reject_empty_xattr() override { return false; }
+  bool filter(const hobject_t &obj, bufferlist& xattr_data,
+                      bufferlist& outdata) override;
 };
 
 bool PGLSCephFSFilter::filter(const hobject_t &obj,
index d181d3fab60bc41f8f7e2583786047004b67cb39..48759255b6fafed36d8659d02f2686c0d8650192 100644 (file)
@@ -252,7 +252,7 @@ static int bad_writer(cls_method_context_t hctx, bufferlist *in, bufferlist *out
 class PGLSHelloFilter : public PGLSFilter {
   string val;
 public:
-  int init(bufferlist::iterator& params) {
+  int init(bufferlist::iterator& params) override {
     try {
       ::decode(xattr, params);
       ::decode(val, params);
@@ -262,9 +262,9 @@ public:
     return 0;
   }
 
-  virtual ~PGLSHelloFilter() {}
-  virtual bool filter(const hobject_t &obj, bufferlist& xattr_data,
-                      bufferlist& outdata)
+  ~PGLSHelloFilter() {}
+  bool filter(const hobject_t &obj, bufferlist& xattr_data,
+                      bufferlist& outdata) override
   {
     if (val.size() != xattr_data.length())
       return false;
index 8d25dee647943a0d0d58f768936a6029e11607cc..88f221328a449d0b84ca4c5ce1b1a5766d234737 100644 (file)
@@ -54,7 +54,7 @@ struct C_ClientList : public C_AioExec {
     rados_completion->release();
   }
 
-  virtual void complete(int r) {
+  void complete(int r) override {
     if (r < 0) {
       finish(r);
       return;
@@ -81,7 +81,7 @@ struct C_ClientList : public C_AioExec {
     }
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     on_finish->complete(r);
     delete this;
   }
@@ -115,7 +115,7 @@ struct C_ImmutableMetadata : public C_AioExec {
     rados_completion->release();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     if (r == 0) {
       try {
         bufferlist::iterator iter = outbl.begin();
@@ -155,7 +155,7 @@ struct C_MutableMetadata : public C_AioExec {
     rados_completion->release();
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     if (r == 0) {
       try {
         bufferlist::iterator iter = outbl.begin();
index 88e104597330db5193a9a2ff33841157299648af..799f7eb43dfb8c140b915d42cda9e9cbac91a18b 100644 (file)
@@ -88,7 +88,7 @@ class LogListCtx : public ObjectOperationCompletion {
 public:
   LogListCtx(list<cls_log_entry> *_entries, string *_marker, bool *_truncated) :
                                       entries(_entries), marker(_marker), truncated(_truncated) {}
-  void handle_completion(int r, bufferlist& outbl) {
+  void handle_completion(int r, bufferlist& outbl) override {
     if (r >= 0) {
       cls_log_list_ret ret;
       try {
@@ -128,7 +128,7 @@ class LogInfoCtx : public ObjectOperationCompletion {
   cls_log_header *header;
 public:
   explicit LogInfoCtx(cls_log_header *_header) : header(_header) {}
-  void handle_completion(int r, bufferlist& outbl) {
+  void handle_completion(int r, bufferlist& outbl) override {
     if (r >= 0) {
       cls_log_info_ret ret;
       try {
index 2ba38686a08eb1fd5a910e43fb21f5fd26c33e47..1b68c6f3fb3dfa35842d49e1c8368bd5f4b08176 100644 (file)
@@ -74,7 +74,7 @@ class StateLogListCtx : public ObjectOperationCompletion {
 public:
   StateLogListCtx(list<cls_statelog_entry> *_entries, string *_marker, bool *_truncated) :
                                       entries(_entries), marker(_marker), truncated(_truncated) {}
-  void handle_completion(int r, bufferlist& outbl) {
+  void handle_completion(int r, bufferlist& outbl) override {
     if (r >= 0) {
       cls_statelog_list_ret ret;
       try {
index 6b9abce2e7bb5b0ade64a2a9adc99c135b2de62f..778cf12e0665815ff07c1a8ca44c191e6ae62aa0 100644 (file)
@@ -111,7 +111,7 @@ public:
                    bool *_truncated)
     : entries(_entries), marker(_marker), truncated(_truncated) {}
 
-  void handle_completion(int r, bufferlist& outbl) {
+  void handle_completion(int r, bufferlist& outbl) override {
     if (r >= 0) {
       cls_timeindex_list_ret ret;
       try {
index b2b4cbb64846081b4a6eb155ba99c1b4e1bc9e1b..8bb7d8447b17a474c153de803abbef46fbfa0e47 100644 (file)
@@ -49,7 +49,7 @@ class ClsUserListCtx : public ObjectOperationCompletion {
 public:
   ClsUserListCtx(list<cls_user_bucket_entry> *_entries, string *_marker, bool *_truncated, int *_pret) :
                                       entries(_entries), marker(_marker), truncated(_truncated), pret(_pret) {}
-  void handle_completion(int r, bufferlist& outbl) {
+  void handle_completion(int r, bufferlist& outbl) override {
     if (r >= 0) {
       cls_user_list_buckets_ret ret;
       try {
@@ -102,7 +102,7 @@ public:
       ret_ctx->put();
     }
   }
-  void handle_completion(int r, bufferlist& outbl) {
+  void handle_completion(int r, bufferlist& outbl) override {
     if (r >= 0) {
       cls_user_get_header_ret ret;
       try {
index fafc62e7537154bf78fc2efeb203bbe89fdec220..4c463e3e35a279c0b71ba19168e3737af01fe2c4 100644 (file)
@@ -61,7 +61,7 @@ class VersionReadCtx : public ObjectOperationCompletion {
   obj_version *objv;
 public:
   explicit VersionReadCtx(obj_version *_objv) : objv(_objv) {}
-  void handle_completion(int r, bufferlist& outbl) {
+  void handle_completion(int r, bufferlist& outbl) override {
     if (r >= 0) {
       cls_version_read_ret ret;
       try {
index 20545e12481b3236cda661f2aff332ef7964691a..fb7a1bfbc03640302574f0b617d71821f55a7a79 100644 (file)
@@ -34,7 +34,7 @@ class SafeTimerThread : public Thread {
   SafeTimer *parent;
 public:
   explicit SafeTimerThread(SafeTimer *s) : parent(s) {}
-  void *entry() {
+  void *entry() override {
     parent->timer_thread();
     return NULL;
   }
index d449277326141631913d122473557d874d01cc66..bc1feec69c31cdc6a0fb151031d1c296bdb1b9cd 100644 (file)
@@ -488,8 +488,8 @@ int AdminSocket::unregister_command(std::string command)
 
 class VersionHook : public AdminSocketHook {
 public:
-  virtual bool call(std::string command, cmdmap_t &cmdmap, std::string format,
-                   bufferlist& out) {
+  bool call(std::string command, cmdmap_t &cmdmap, std::string format,
+                   bufferlist& out) override {
     if (command == "0") {
       out.append(CEPH_ADMIN_SOCK_VERSION);
     } else {
@@ -512,7 +512,7 @@ class HelpHook : public AdminSocketHook {
   AdminSocket *m_as;
 public:
   explicit HelpHook(AdminSocket *as) : m_as(as) {}
-  bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) {
+  bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) override {
     Formatter *f = Formatter::create(format, "json-pretty", "json-pretty");
     f->open_object_section("help");
     for (map<string,string>::iterator p = m_as->m_help.begin();
@@ -534,7 +534,7 @@ class GetdescsHook : public AdminSocketHook {
   AdminSocket *m_as;
 public:
   explicit GetdescsHook(AdminSocket *as) : m_as(as) {}
-  bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) {
+  bool call(string command, cmdmap_t &cmdmap, string format, bufferlist& out) override {
     int cmdnum = 0;
     JSONFormatter jf(false);
     jf.open_object_section("command_descriptions");
index 883e7131183e5b6f3095e1d13e00bec2c46eb508..2de7e1661b3d0a6067ac2c303d96f97a7ac3a29a 100644 (file)
@@ -258,7 +258,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     ~raw_combined() {
       dec_total_alloc(len);
     }
-    raw* clone_empty() {
+    raw* clone_empty() override {
       return create(len, alignment);
     }
 
@@ -314,7 +314,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       dec_total_alloc(len);
       bdout << "raw_malloc " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
     }
-    raw* clone_empty() {
+    raw* clone_empty() override {
       return new raw_malloc(len);
     }
   };
@@ -337,7 +337,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       dec_total_alloc(len);
       bdout << "raw_mmap " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
     }
-    raw* clone_empty() {
+    raw* clone_empty() override {
       return new raw_mmap_pages(len);
     }
   };
@@ -362,7 +362,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       dec_total_alloc(len);
       bdout << "raw_posix_aligned " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
     }
-    raw* clone_empty() {
+    raw* clone_empty() override {
       return new raw_posix_aligned(len, align);
     }
   };
@@ -448,7 +448,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
            << buffer::get_total_alloc() << bendl;
     }
 
-    bool can_zero_copy() const {
+    bool can_zero_copy() const override {
       return true;
     }
 
@@ -465,7 +465,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       return 0;
     }
 
-    int zero_copy_to_fd(int fd, loff_t *offset) {
+    int zero_copy_to_fd(int fd, loff_t *offset) override {
       assert(!source_consumed);
       int flags = SPLICE_F_NONBLOCK;
       ssize_t r = safe_splice_exact(pipefds[0], NULL, fd, offset, len, flags);
@@ -478,13 +478,13 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       return 0;
     }
 
-    buffer::raw* clone_empty() {
+    buffer::raw* clone_empty() override {
       // cloning doesn't make sense for pipe-based buffers,
       // and is only used by unit tests for other types of buffers
       return NULL;
     }
 
-    char *get_data() {
+    char *get_data() override {
       if (data)
        return data;
       return copy_pipe(pipefds);
@@ -601,7 +601,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
       dec_total_alloc(len);
       bdout << "raw_char " << this << " free " << (void *)data << " " << buffer::get_total_alloc() << bendl;
     }
-    raw* clone_empty() {
+    raw* clone_empty() override {
       return new raw_char(len);
     }
   };
@@ -618,10 +618,10 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     }
     raw_unshareable(unsigned l, char *b) : raw(b, l) {
     }
-    raw* clone_empty() {
+    raw* clone_empty() override {
       return new raw_char(len);
     }
-    bool is_shareable() {
+    bool is_shareable() override {
       return false; // !shareable, will force make_shareable()
     }
     ~raw_unshareable() {
@@ -635,7 +635,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
 
     raw_static(const char *d, unsigned l) : raw((char*)d, l) { }
     ~raw_static() {}
-    raw* clone_empty() {
+    raw* clone_empty() override {
       return new buffer::raw_char(len);
     }
   };
@@ -646,7 +646,7 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
     raw_claim_buffer(const char *b, unsigned l, deleter d)
         : raw((char*)b, l), del(std::move(d)) { }
     ~raw_claim_buffer() {}
-    raw* clone_empty() {
+    raw* clone_empty() override {
       return new buffer::raw_char(len);
     }
   };
index bf47a224696eb3b9226547135db7fee7742ff00a..689ecca451f7148b4faea55ea62fc07c919cff53 100644 (file)
@@ -51,19 +51,19 @@ class LockdepObs : public md_config_obs_t {
 public:
   explicit LockdepObs(CephContext *cct) : m_cct(cct), m_registered(false) {
   }
-  virtual ~LockdepObs() {
+  ~LockdepObs() {
     if (m_registered) {
       lockdep_unregister_ceph_context(m_cct);
     }
   }
 
-  const char** get_tracked_conf_keys() const {
+  const char** get_tracked_conf_keys() const override {
     static const char *KEYS[] = {"lockdep", NULL};
     return KEYS;
   }
 
   void handle_conf_change(const md_config_t *conf,
-                          const std::set <std::string> &changed) {
+                          const std::set <std::string> &changed) override {
     if (conf->lockdep && !m_registered) {
       lockdep_register_ceph_context(m_cct);
       m_registered = true;
@@ -97,7 +97,7 @@ public:
   }
 
   // md_config_obs_t
-  const char** get_tracked_conf_keys() const {
+  const char** get_tracked_conf_keys() const override {
     static const char *KEYS[] = {
       "mempool_debug",
       NULL
@@ -106,7 +106,7 @@ public:
   }
 
   void handle_conf_change(const md_config_t *conf,
-                          const std::set <std::string> &changed) {
+                          const std::set <std::string> &changed) override {
     if (changed.count("mempool_debug")) {
       mempool::set_debug_mode(cct->_conf->mempool_debug);
     }
@@ -114,7 +114,7 @@ public:
 
   // AdminSocketHook
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
-           bufferlist& out) {
+           bufferlist& out) override {
     if (command == "dump_mempools") {
       std::unique_ptr<Formatter> f(Formatter::create(format));
       f->open_object_section("mempools");
@@ -140,7 +140,7 @@ public:
 
   ~CephContextServiceThread() {}
 
-  void *entry()
+  void *entry() override
   {
     while (1) {
       Mutex::Locker l(_lock);
@@ -203,7 +203,7 @@ class LogObs : public md_config_obs_t {
 public:
   explicit LogObs(ceph::logging::Log *l) : log(l) {}
 
-  const char** get_tracked_conf_keys() const {
+  const char** get_tracked_conf_keys() const override {
     static const char *KEYS[] = {
       "log_file",
       "log_max_new",
@@ -224,7 +224,7 @@ public:
   }
 
   void handle_conf_change(const md_config_t *conf,
-                          const std::set <std::string> &changed) {
+                          const std::set <std::string> &changed) override {
     // stderr
     if (changed.count("log_to_stderr") || changed.count("err_to_stderr")) {
       int l = conf->log_to_stderr ? 99 : (conf->err_to_stderr ? -1 : -2);
@@ -287,7 +287,7 @@ class CephContextObs : public md_config_obs_t {
 public:
   explicit CephContextObs(CephContext *cct) : cct(cct) {}
 
-  const char** get_tracked_conf_keys() const {
+  const char** get_tracked_conf_keys() const override {
     static const char *KEYS[] = {
       "enable_experimental_unrecoverable_data_corrupting_features",
       "crush_location",
@@ -297,7 +297,7 @@ public:
   }
 
   void handle_conf_change(const md_config_t *conf,
-                          const std::set <std::string> &changed) {
+                          const std::set <std::string> &changed) override {
     if (changed.count(
          "enable_experimental_unrecoverable_data_corrupting_features")) {
       ceph_spin_lock(&cct->_feature_lock);
@@ -364,7 +364,7 @@ public:
   explicit CephContextHook(CephContext *cct) : m_cct(cct) {}
 
   bool call(std::string command, cmdmap_t& cmdmap, std::string format,
-           bufferlist& out) {
+           bufferlist& out) override {
     m_cct->do_command(command, cmdmap, format, &out);
     return true;
   }
index ebce2d553d718d5ebd9e18dccffdc185db75b9b4..06d58e46cd6df3284fea6b1d06ccf0c6c1079fb2 100644 (file)
@@ -56,11 +56,11 @@ struct Observer : public md_config_obs_t {
     keys[1] = NULL;
   }
 
-  const char** get_tracked_conf_keys() const {
+  const char** get_tracked_conf_keys() const override {
     return (const char **)keys;
   }
   void handle_conf_change(const struct md_config_t *conf,
-                         const std::set <std::string> &changed) {
+                         const std::set <std::string> &changed) override {
     // do nothing.
   }
 };
index 635b66530f2872f4547e85c9bf80c2352aac8e38..5cf68da2f46d5b67070c5d0298d95d93ecff753a 100644 (file)
@@ -417,7 +417,7 @@ namespace {
   public:
     CrushWalker(const CrushWrapper *crush, unsigned max_id)
       : Parent(crush), max_id(max_id) {}
-    void dump_item(const CrushTreeDumper::Item &qi, DumbFormatter *) {
+    void dump_item(const CrushTreeDumper::Item &qi, DumbFormatter *) override {
       int type = -1;
       if (qi.is_bucket()) {
        if (!crush->get_item_name(qi.id)) {
index 6f81606e11295ed31b7ac4ebe6c9305e34eea6e4..932c2c91a9c35593e7aed2cb2b0e3b0fa070cac7 100644 (file)
@@ -1687,7 +1687,7 @@ public:
   }
 
 protected:
-  virtual void dump_item(const CrushTreeDumper::Item &qi, ostream *out) {
+  void dump_item(const CrushTreeDumper::Item &qi, ostream *out) override {
     *out << qi.id << "\t"
         << weightf_t(qi.weight) << "\t";
 
index 66db79d2b2094e87d1a2b1d517b563642c6cff44..2f894efd7ec8f0bf81c70e0314e3ab3e8bb96e35 100644 (file)
@@ -256,7 +256,7 @@ struct SignalHandler : public Thread {
   }
 
   // thread entry point
-  void *entry() {
+  void *entry() override {
     while (!stop) {
       // build fd list
       struct pollfd fds[33];
index 967529ddb68edeea91d73033082d26ae9e9a6241..acbe3cb27078001bd22fda3a19d6c90932de7262 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();
   }
-  virtual ~C_GetClient() {
+  ~C_GetClient() {
     async_op_tracker.finish_op();
   }
 
@@ -70,7 +70,7 @@ struct C_GetClient : public Context {
     complete(r);
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
     on_finish->complete(r);
   }
 };
@@ -95,7 +95,7 @@ struct C_AllocateTag : public Context {
     async_op_tracker.start_op();
     tag->data = data;
   }
-  virtual ~C_AllocateTag() {
+  ~C_AllocateTag() {
     async_op_tracker.finish_op();
   }
 
@@ -193,7 +193,7 @@ struct C_AllocateTag : public Context {
     complete(r);
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
     on_finish->complete(r);
   }
 };
@@ -216,7 +216,7 @@ struct C_GetTag : public Context {
       tag_tid(tag_tid), tag(tag), on_finish(on_finish) {
     async_op_tracker.start_op();
   }
-  virtual ~C_GetTag() {
+  ~C_GetTag() {
     async_op_tracker.finish_op();
   }
 
@@ -245,7 +245,7 @@ struct C_GetTag : public Context {
     complete(r);
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
     on_finish->complete(r);
   }
 };
@@ -275,7 +275,7 @@ struct C_GetTags : public Context {
       tags(tags), on_finish(on_finish) {
     async_op_tracker.start_op();
   }
-  virtual ~C_GetTags() {
+  ~C_GetTags() {
     async_op_tracker.finish_op();
   }
 
@@ -318,7 +318,7 @@ struct C_GetTags : public Context {
     complete(r);
   }
 
-  virtual void finish(int r) override {
+  void finish(int r) override {
     on_finish->complete(r);
   }
 };
@@ -330,7 +330,7 @@ struct C_FlushCommitPosition : public Context {
   C_FlushCommitPosition(Context *commit_position_ctx, Context *on_finish)
     : commit_position_ctx(commit_position_ctx), on_finish(on_finish) {
   }
-  virtual void finish(int r) override {
+  void finish(int r) override {
     if (commit_position_ctx != nullptr) {
       commit_position_ctx->complete(r);
     }
@@ -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();
   }
-  virtual ~C_AssertActiveTag() {
+  ~C_AssertActiveTag() {
     async_op_tracker.finish_op();
   }
 
@@ -393,7 +393,7 @@ struct C_AssertActiveTag : public Context {
     complete(r);
   }
 
-  virtual void finish(int r) {
+  void finish(int r) override {
     on_finish->complete(r);
   }
 };
index 09f2d2ca3f324bf04909aada0a4077e9c0031b56..b313820c4a83f606fcb671fccd23162f0161680d 100644 (file)
@@ -21,10 +21,10 @@ struct C_HandleComplete : public Context {
     : replay_handler(_replay_handler) {
     replay_handler->get();
   }
-  virtual ~C_HandleComplete() {
+  ~C_HandleComplete() {
     replay_handler->put();
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     replay_handler->handle_complete(r);
   }
 };
@@ -36,10 +36,10 @@ struct C_HandleEntriesAvailable : public Context {
       : replay_handler(_replay_handler) {
     replay_handler->get();
   }
-  virtual ~C_HandleEntriesAvailable() {
+  ~C_HandleEntriesAvailable() {
     replay_handler->put();
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
     replay_handler->handle_entries_available();
   }
 };
index 1917165008fecc69854d62f09983ee9f029c2fda..d0c6406a3ac4386b0581968f47f50cdd7b2bd124 100644 (file)
@@ -28,7 +28,7 @@ struct C_Flush : public Context {
       pending_flushes(_pending_flushes), ret_val(0) {
   }
 
-  virtual void complete(int r) {
+  void complete(int r) override {
     if (r < 0 && ret_val == 0) {
       ret_val = r;
     }
@@ -38,7 +38,7 @@ struct C_Flush : public Context {
       delete this;
     }
   }
-  virtual void finish(int r) {
+  void finish(int r) override {
   }
 };
 
index ec48f9aaed048450d54d0559cf144e53c83e021e..0e60a58437c9a7a51e1f8d62951649abe2630f02 100644 (file)
@@ -22,8 +22,8 @@ struct JournalTrimmer::C_RemoveSet : public Context {
 
   C_RemoveSet(JournalTrimmer *_journal_trimmer, uint64_t _object_set,
               uint8_t _splay_width);
-  virtual void complete(int r);
-  virtual void finish(int r) {
+  void complete(int r) override;
+  void finish(int r) override {
     journal_trimmer->handle_set_removed(r, object_set);
     journal_trimmer->m_async_op_tracker.finish_op();
   }
index b2793653ac423c62407cdcfaa6045f06021b61b2..a1895b639f4ebdc3e4377ec06ae21075cdf33726 100644 (file)
@@ -27,7 +27,7 @@ public:
   }
 
   // Write an entry to the log file with the specified format.
-  void Logv(const char* format, va_list ap) {
+  void Logv(const char* format, va_list ap) override {
     dout(1);
     char buf[65536];
     vsnprintf(buf, sizeof(buf), format, ap);
index 75f6941e67155cff805484e9276d7ab09e97e101..29f9d0f1e145081a7f74c11fd32d92281c8c72ea 100644 (file)
@@ -40,7 +40,7 @@ using std::string;
 class RocksDBStore::MergeOperatorRouter : public rocksdb::AssociativeMergeOperator {
   RocksDBStore& store;
   public:
-  const char *Name() const {
+  const char *Name() const override {
     // Construct a name that rocksDB will validate against. We want to
     // do this in a way that doesn't constrain the ordering of calls
     // to set_merge_operator, so sort the merge operators and then
@@ -59,11 +59,11 @@ class RocksDBStore::MergeOperatorRouter : public rocksdb::AssociativeMergeOperat
 
   MergeOperatorRouter(RocksDBStore &_store) : store(_store) {}
 
-  virtual bool Merge(const rocksdb::Slice& key,
+  bool Merge(const rocksdb::Slice& key,
                      const rocksdb::Slice* existing_value,
                      const rocksdb::Slice& value,
                      std::string* new_value,
-                     rocksdb::Logger* logger) const {
+                     rocksdb::Logger* logger) const override {
     // Check each prefix
     for (auto& p : store.merge_ops) {
       if (p.first.compare(0, p.first.length(),
@@ -105,7 +105,7 @@ public:
   }
 
   // Write an entry to the log file with the specified format.
-  void Logv(const char* format, va_list ap) {
+  void Logv(const char* format, va_list ap) override {
     Logv(rocksdb::INFO_LEVEL, format, ap);
   }
 
@@ -114,7 +114,7 @@ public:
   // of *this (see @SetInfoLogLevel and @GetInfoLogLevel) will not be
   // printed.
   void Logv(const rocksdb::InfoLogLevel log_level, const char* format,
-           va_list ap) {
+           va_list ap) override {
     int v = rocksdb::NUM_INFO_LOG_LEVELS - log_level - 1;
     dout(v);
     char buf[65536];
index 07add406807f67c66fb1510dc28b1bd37e3ab871..e5b39f1d4c33c1343682afea810b42b40c46bcf3 100644 (file)
@@ -52,7 +52,7 @@ class C_time_wakeup : public EventCallback {
 
  public:
   explicit C_time_wakeup(AsyncConnectionRef c): conn(c) {}
-  void do_request(int fd_or_id) {
+  void do_request(int fd_or_id) override {
     conn->wakeup_from(fd_or_id);
   }
 };
@@ -62,7 +62,7 @@ class C_handle_read : public EventCallback {
 
  public:
   explicit C_handle_read(AsyncConnectionRef c): conn(c) {}
-  void do_request(int fd_or_id) {
+  void do_request(int fd_or_id) override {
     conn->process();
   }
 };
@@ -72,7 +72,7 @@ class C_handle_write : public EventCallback {
 
  public:
   explicit C_handle_write(AsyncConnectionRef c): conn(c) {}
-  void do_request(int fd) {
+  void do_request(int fd) override {
     conn->handle_write();
   }
 };
@@ -81,7 +81,7 @@ class C_clean_handler : public EventCallback {
   AsyncConnectionRef conn;
  public:
   explicit C_clean_handler(AsyncConnectionRef c): conn(c) {}
-  void do_request(int id) {
+  void do_request(int id) override {
     conn->cleanup();
     delete this;
   }
@@ -92,7 +92,7 @@ class C_tick_wakeup : public EventCallback {
 
  public:
   explicit C_tick_wakeup(AsyncConnectionRef c): conn(c) {}
-  void do_request(int fd_or_id) {
+  void do_request(int fd_or_id) override {
     conn->tick(fd_or_id);
   }
 };
index 506b71be471ff06a756a6905cfa05a55dd292e7f..1e14ce1e0425a8dfc341a164fc08a20adc6ec03c 100644 (file)
@@ -50,7 +50,7 @@ class Processor::C_processor_accept : public EventCallback {
 
  public:
   explicit C_processor_accept(Processor *p): pro(p) {}
-  void do_request(int id) {
+  void do_request(int id) override {
     pro->accept();
   }
 };
@@ -232,7 +232,7 @@ class C_handle_reap : public EventCallback {
 
   public:
   explicit C_handle_reap(AsyncMessenger *m): msgr(m) {}
-  void do_request(int id) {
+  void do_request(int id) override {
     // judge whether is a time event
     msgr->reap_dead();
   }
index ca48d38be87827a9a8cb1c1030bb7d16d5410bfc..eee29fc51b701b95d5dcf6ab2ca8cb7fd7cd3807 100644 (file)
@@ -41,7 +41,7 @@ class C_handle_notify : public EventCallback {
 
  public:
   C_handle_notify(EventCenter *c, CephContext *cc): center(c), cct(cc) {}
-  void do_request(int fd_or_id) {
+  void do_request(int fd_or_id) override {
     char c[256];
     int r = 0;
     do {
index 7651961ec252df1f83e601f346269ed8d43d39fb..32f3b2b2ba974ed75524edd46abe26b677405ac5 100644 (file)
@@ -52,7 +52,7 @@ class PosixConnectedSocketImpl final : public ConnectedSocketImpl {
   explicit PosixConnectedSocketImpl(NetHandler &h, const entity_addr_t &sa, int f, bool connected)
       : handler(h), _fd(f), sa(sa), connected(connected) {}
 
-  virtual int is_connected() override {
+  int is_connected() override {
     if (connected)
       return 1;
 
@@ -67,11 +67,11 @@ class PosixConnectedSocketImpl final : public ConnectedSocketImpl {
     }
   }
 
-  virtual ssize_t zero_copy_read(bufferptr&) override {
+  ssize_t zero_copy_read(bufferptr&) override {
     return -EOPNOTSUPP;
   }
 
-  virtual ssize_t read(char *buf, size_t len) override {
+  ssize_t read(char *buf, size_t len) override {
     ssize_t r = ::read(_fd, buf, len);
     if (r < 0)
       r = -errno;
@@ -184,7 +184,7 @@ class PosixConnectedSocketImpl final : public ConnectedSocketImpl {
     return (ssize_t)sent;
   }
 
-  virtual ssize_t send(bufferlist &bl, bool more) {
+  ssize_t send(bufferlist &bl, bool more) override {
     size_t sent_bytes = 0;
     std::list<bufferptr>::const_iterator pb = bl.buffers().begin();
     uint64_t left_pbrs = bl.buffers().size();
@@ -229,13 +229,13 @@ class PosixConnectedSocketImpl final : public ConnectedSocketImpl {
 
     return static_cast<ssize_t>(sent_bytes);
   }
-  virtual void shutdown() {
+  void shutdown() override {
     ::shutdown(_fd, SHUT_RDWR);
   }
-  virtual void close() {
+  void close() override {
     ::close(_fd);
   }
-  virtual int fd() const override {
+  int fd() const override {
     return _fd;
   }
   friend class PosixServerSocketImpl;
@@ -248,11 +248,11 @@ class PosixServerSocketImpl : public ServerSocketImpl {
 
  public:
   explicit PosixServerSocketImpl(NetHandler &h, int f): handler(h), _fd(f) {}
-  virtual int accept(ConnectedSocket *sock, const SocketOptions &opts, entity_addr_t *out, Worker *w) override;
-  virtual void abort_accept() override {
+  int accept(ConnectedSocket *sock, const SocketOptions &opts, entity_addr_t *out, Worker *w) override;
+  void abort_accept() override {
     ::close(_fd);
   }
-  virtual int fd() const override {
+  int fd() const override {
     return _fd;
   }
 };
index 625e472d808d0deca7a430b1662cb7d854bede7c..edef7537fcb22a405116b605db709c8fc7262ad4 100644 (file)
@@ -180,7 +180,7 @@ class C_drain : public EventCallback {
   explicit C_drain(size_t c)
       : drain_lock("C_drain::drain_lock"),
         drain_count(c) {}
-  void do_request(int id) {
+  void do_request(int id) override {
     Mutex::Locker l(drain_lock);
     drain_count--;
     if (drain_count == 0) drain_cond.Signal();
index 1b531675d866bc7ed259e92df65e5cf1dc808b23..9cc82d30245eab63c79fee6bf11cfcd69a1f1c79 100644 (file)
@@ -88,7 +88,7 @@ public:
   ~DelayedDelivery() {
     discard();
   }
-  void *entry();
+  void *entry() override;
   void queue(utime_t release, Message *m) {
     Mutex::Locker l(delay_lock);
     delay_queue.push_back(make_pair(release, m));
index 690f6945c30074e511d80446346c65bcc2517d20..a7fc929ead30e06e0c1238679602d122fcf12271 100644 (file)
@@ -27,9 +27,9 @@ protected:
 
 public:
   explicit WholeSpaceMemIterator(KeyValueDBMemory *db) : db(db), ready(false) { }
-  virtual ~WholeSpaceMemIterator() { }
+  ~WholeSpaceMemIterator() { }
 
-  int seek_to_first() {
+  int seek_to_first() override {
     if (db->db.empty()) {
       it = db->db.end();
       ready = false;
@@ -40,7 +40,7 @@ public:
     return 0;
   }
 
-  int seek_to_first(const string &prefix) {
+  int seek_to_first(const string &prefix) override {
     it = db->db.lower_bound(make_pair(prefix, ""));
     if (db->db.empty() || (it == db->db.end())) {
       it = db->db.end();
@@ -51,7 +51,7 @@ public:
     return 0;
   }
 
-  int seek_to_last() {
+  int seek_to_last() override {
     it = db->db.end();
     if (db->db.empty()) {
       ready = false;
@@ -63,7 +63,7 @@ public:
     return 0;
   }
 
-  int seek_to_last(const string &prefix) {
+  int seek_to_last(const string &prefix) override {
     string tmp(prefix);
     tmp.append(1, (char) 0);
     it = db->db.upper_bound(make_pair(tmp,""));
@@ -78,7 +78,7 @@ public:
     return 0;
   }
 
-  int lower_bound(const string &prefix, const string &to) {
+  int lower_bound(const string &prefix, const string &to) override {
     it = db->db.lower_bound(make_pair(prefix,to));
     if ((db->db.empty()) || (it == db->db.end())) {
       it = db->db.end();
@@ -92,7 +92,7 @@ public:
     return 0;
   }
 
-  int upper_bound(const string &prefix, const string &after) {
+  int upper_bound(const string &prefix, const string &after) override {
     it = db->db.upper_bound(make_pair(prefix,after));
     if ((db->db.empty()) || (it == db->db.end())) {
       it = db->db.end();
@@ -104,7 +104,7 @@ public:
     return 0;
   }
 
-  bool valid() {
+  bool valid() override {
     return ready && (it != db->db.end());
   }
 
@@ -112,7 +112,7 @@ public:
     return ready && (it == db->db.begin());
   }
 
-  int prev() {
+  int prev() override {
     if (!begin() && ready)
       --it;
     else
@@ -120,38 +120,38 @@ public:
     return 0;
   }
 
-  int next() {
+  int next() override {
     if (valid())
       ++it;
     return 0;
   }
 
-  string key() {
+  string key() override {
     if (valid())
       return (*it).first.second;
     else
       return "";
   }
 
-  pair<string,string> raw_key() {
+  pair<string,string> raw_key() override {
     if (valid())
       return (*it).first;
     else
       return make_pair("", "");
   }
   
-  bool raw_key_is_prefixed(const string &prefix) {
+  bool raw_key_is_prefixed(const string &prefix) override {
     return prefix == (*it).first.first;
   }
 
-  bufferlist value() {
+  bufferlist value() override {
     if (valid())
       return (*it).second;
     else
       return bufferlist();
   }
 
-  int status() {
+  int status() override {
     return 0;
   }
 };
index 454719c40fe8e12faaf688610dd47fe16da31cbd..cd8e28a5213ba669f57ff511923221c21be1c6ae 100644 (file)
@@ -33,7 +33,7 @@ public:
   boost::scoped_ptr<KeyValueDB> db;
   boost::scoped_ptr<KeyValueDBMemory> mock;
 
-  virtual void SetUp() {
+  void SetUp() override {
     assert(!store_path.empty());
 
     KeyValueDB *db_ptr = KeyValueDB::create(g_ceph_context, "leveldb", store_path);
@@ -42,7 +42,7 @@ public:
     mock.reset(new KeyValueDBMemory());
   }
 
-  virtual void TearDown() { }
+  void TearDown() override { }
 
   ::testing::AssertionResult validate_db_clear(KeyValueDB *store) {
     KeyValueDB::WholeSpaceIterator it = store->get_iterator();
@@ -274,7 +274,7 @@ public:
     db->submit_transaction_sync(tx);
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     IteratorTest::SetUp();
 
     prefix1 = "_PREFIX_1_";
@@ -292,7 +292,7 @@ public:
     ASSERT_TRUE(validate_db_match());
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     IteratorTest::TearDown();
   }
 
@@ -543,7 +543,7 @@ public:
     db->submit_transaction_sync(tx);
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     IteratorTest::SetUp();
 
     prefix1 = "_PREFIX_1_";
@@ -560,7 +560,7 @@ public:
     ASSERT_TRUE(validate_db_match());
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     IteratorTest::TearDown();
   }
 
@@ -786,7 +786,7 @@ public:
     store->submit_transaction_sync(tx);
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     IteratorTest::SetUp();
 
     prefix1 = "_PREFIX_1_";
@@ -804,7 +804,7 @@ public:
     ASSERT_TRUE(validate_db_match());
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     IteratorTest::TearDown();
   }
 
@@ -1257,7 +1257,7 @@ public:
     store->submit_transaction_sync(tx);
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     IteratorTest::SetUp();
 
     prefix0 = "_PREFIX_0_";
@@ -1278,7 +1278,7 @@ public:
     ASSERT_TRUE(validate_db_match());
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     IteratorTest::TearDown();
   }
 
@@ -1519,7 +1519,7 @@ public:
     store->submit_transaction_sync(tx);
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     IteratorTest::SetUp();
 
     prefix1 = "_PREFIX_1_";
@@ -1535,7 +1535,7 @@ public:
     ASSERT_TRUE(validate_db_match());
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     IteratorTest::TearDown();
   }
 
@@ -1591,7 +1591,7 @@ TEST_F(KeySpaceIteration, BackwardIterationMockDB) {
 class EmptyStore : public IteratorTest
 {
 public:
-  virtual void SetUp() {
+  void SetUp() override {
     IteratorTest::SetUp();
 
     clear(db.get());
index e7eeda2646fc241c84f33f75ca8d158dcfccfe2d..5ad1bf9930a99a2ca0ce8fbd1eae5197051b31bf 100644 (file)
@@ -522,7 +522,7 @@ class ObjectMapTest : public ::testing::Test {
 public:
   boost::scoped_ptr< ObjectMap > db;
   ObjectMapTester tester;
-  virtual void SetUp() {
+  void SetUp() override {
     char *path = getenv("OBJECT_MAP_PATH");
     if (!path) {
       db.reset(new DBObjectMap(g_ceph_context, new KeyValueDBMemory()));
@@ -540,7 +540,7 @@ public:
     tester.db = db.get();
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     std::cerr << "Checking..." << std::endl;
     assert(db->check(std::cerr));
   }
index 69be6921ceff10f24b5d5fab6537613ce9aec903..77b64d9356e8dc1722dcd4567dee954fc14aa20b 100644 (file)
@@ -31,7 +31,7 @@ public:
   {
   }
 
-  virtual void finish(int r)
+  void finish(int r) override
   {
     array_lock.Lock();
     cout << "TestContext " << num << std::endl;
@@ -39,7 +39,7 @@ public:
     array_lock.Unlock();
   }
 
-  virtual ~TestContext()
+  ~TestContext()
   {
   }
 
@@ -55,7 +55,7 @@ public:
   {
   }
 
-  virtual void finish(int r)
+  void finish(int r) override
   {
     array_lock.Lock();
     cout << "StrictOrderTestContext " << num << std::endl;
@@ -63,7 +63,7 @@ public:
     array_lock.Unlock();
   }
 
-  virtual ~StrictOrderTestContext()
+  ~StrictOrderTestContext()
   {
   }
 };
index a3fdeaae538de6c801d38c2c3415f6368f779fac..2949400f84c2abf705853b07381b80a116a8361d 100644 (file)
@@ -120,7 +120,7 @@ TEST(AdminSocket, SendTooLongRequest) {
 }
 
 class MyTest : public AdminSocketHook {
-  bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) {
+  bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) override {
     std::vector<std::string> args;
     cmd_getval(g_ceph_context, cmdmap, "args", args);
     result.append(command);
@@ -152,7 +152,7 @@ TEST(AdminSocket, RegisterCommand) {
 }
 
 class MyTest2 : public AdminSocketHook {
-  bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) {
+  bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) override {
     std::vector<std::string> args;
     cmd_getval(g_ceph_context, cmdmap, "args", args);
     result.append(command);
@@ -204,7 +204,7 @@ public:
 
   BlockingHook() : _lock("BlockingHook::_lock") {}
 
-  bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) {
+  bool call(std::string command, cmdmap_t& cmdmap, std::string format, bufferlist& result) override {
     Mutex::Locker l(_lock);
     _cond.Wait(_lock);
     return true;
index 451637a0e3e1fb5367443d8c1ef3da9f31435d3b..9937c5c8c31a2f6e41c2297198566dee41133cbb 100644 (file)
@@ -13,7 +13,7 @@ struct C_Holder : public Context {
   explicit C_Holder(
     T obj)
     : obj(obj) {}
-  void finish(int r) {
+  void finish(int r) override {
     return;
   }
 };
@@ -27,7 +27,7 @@ struct OnDelete {
 struct Cleanup : public Context {
   Bencher *bench;
   explicit Cleanup(Bencher *bench) : bench(bench) {}
-  void finish(int r) {
+  void finish(int r) override {
     bench->complete_op();
   }
 };
@@ -40,7 +40,7 @@ struct OnWriteApplied : public Context {
     Bencher *bench, uint64_t seq,
     ceph::shared_ptr<OnDelete> on_delete
     ) : bench(bench), seq(seq), on_delete(on_delete) {}
-  void finish(int r) {
+  void finish(int r) override {
     bench->stat_collector->write_applied(seq);
   }
 };
@@ -53,7 +53,7 @@ struct OnWriteCommit : public Context {
     Bencher *bench, uint64_t seq,
     ceph::shared_ptr<OnDelete> on_delete
     ) : bench(bench), seq(seq), on_delete(on_delete) {}
-  void finish(int r) {
+  void finish(int r) override {
     bench->stat_collector->write_committed(seq);
   }
 };
@@ -64,7 +64,7 @@ struct OnReadComplete : public Context {
   boost::scoped_ptr<bufferlist> bl;
   OnReadComplete(Bencher *bench, uint64_t seq, bufferlist *bl) :
     bench(bench), seq(seq), bl(bl) {}
-  void finish(int r) {
+  void finish(int r) override {
     bench->stat_collector->read_complete(seq);
     bench->complete_op();
   }
index b02780ed2230b9b8a454c0c35a29762a56753abc..619f14d62bceb50e71faf237321701b21012f214 100644 (file)
@@ -30,7 +30,7 @@ using namespace std;
 struct MorePrinting : public DetailedStatCollector::AdditionalPrinting {
   CephContext *cct;
   explicit MorePrinting(CephContext *cct) : cct(cct) {}
-  void operator()(std::ostream *out) {
+  void operator()(std::ostream *out) override {
     bufferlist bl;
     Formatter *f = Formatter::create("json-pretty");
     cct->get_perfcounters_collection()->dump_formatted(f, 0);
index 9c81dc0ad11970c1bc6f586d0dd74713006835b3..599e03614d70b4bd0870e81cb3f66ea69d28ea75 100644 (file)
@@ -39,13 +39,13 @@ class Base : public Queueable {
 public:
   Base(DetailedStatCollector *col,
        Semaphore *sem) : col(col), sem(sem) {}
-  void queue(unsigned *item) {
+  void queue(unsigned *item) override {
     col->read_complete(*item);
     sem->Put();
     delete item;
   }
-  void start() {}
-  void stop() {}
+  void start() override {}
+  void stop() override {}
 };
 class WQWrapper : public Queueable {
   boost::scoped_ptr<ThreadPool::WorkQueue<unsigned> > wq;
@@ -53,9 +53,9 @@ class WQWrapper : public Queueable {
 public:
   WQWrapper(ThreadPool::WorkQueue<unsigned> *wq, ThreadPool *tp):
     wq(wq), tp(tp) {}
-  void queue(unsigned *item) { wq->queue(item); }
-  void start() { tp->start(); }
-  void stop() { tp->stop(); }
+  void queue(unsigned *item) override { wq->queue(item); }
+  void start() override { tp->start(); }
+  void stop() override { tp->stop(); }
 };
 class FinisherWrapper : public Queueable {
   class CB : public Context {
@@ -63,7 +63,7 @@ class FinisherWrapper : public Queueable {
     unsigned *item;
   public:
     CB(Queueable *next, unsigned *item) : next(next), item(item) {}
-    void finish(int) {
+    void finish(int) override {
       next->queue(item);
     }
   };
@@ -72,21 +72,21 @@ class FinisherWrapper : public Queueable {
 public:
   FinisherWrapper(CephContext *cct, Queueable *next) :
     f(cct), next(next) {}
-  void queue(unsigned *item) {
+  void queue(unsigned *item) override {
     f.queue(new CB(next, item));
   }
-  void start() { f.start(); }
-  void stop() { f.stop(); }
+  void start() override { f.start(); }
+  void stop() override { f.stop(); }
 };
 class PassAlong : public ThreadPool::WorkQueue<unsigned> {
   Queueable *next;
   list<unsigned*> q;
-  bool _enqueue(unsigned *item) {
+  bool _enqueue(unsigned *item) override {
     q.push_back(item);
     return true;
   }
-  void _dequeue(unsigned *item) { ceph_abort(); }
-  unsigned *_dequeue() {
+  void _dequeue(unsigned *item) override { ceph_abort(); }
+  unsigned *_dequeue() override {
     if (q.empty())
       return 0;
     unsigned *val = q.front();
@@ -96,8 +96,8 @@ class PassAlong : public ThreadPool::WorkQueue<unsigned> {
   void _process(unsigned *item, ThreadPool::TPHandle &) override {
     next->queue(item);
   }
-  void _clear() { q.clear(); }
-  bool _empty() { return q.empty(); }
+  void _clear() override { q.clear(); }
+  bool _empty() override { return q.empty(); }
 public:
   PassAlong(ThreadPool *tp, Queueable *_next) :
     ThreadPool::WorkQueue<unsigned>("TestQueue", 100, 100, tp), next(_next) {}
index ca8f2f3e0644f5590fb825737c441962f0a6060b..0e5bcfce51e7f672e58a06260693a9f3ff95ba85 100644 (file)
@@ -22,7 +22,7 @@ struct T : public Thread {
     mymap[10] = "bar";
   }
 
-  void *entry() {
+  void *entry() override {
     while (num-- > 0)
       generic_dout(0) << "this is a typical log line.  set "
                      << myset << " and map " << mymap << dendl;
index 253de0106dad5b83899665575c1726dbd994b25c..22b7082b1c0b0d942662461791a1a4b426877f3c 100644 (file)
@@ -249,7 +249,7 @@ TEST(BufferRaw, ostream) {
 #ifdef CEPH_HAVE_SPLICE
 class TestRawPipe : public ::testing::Test {
 protected:
-  virtual void SetUp() {
+  void SetUp() override {
     len = 4;
     ::unlink(FILENAME);
     snprintf(cmd, sizeof(cmd), "echo ABC > %s", FILENAME);
@@ -257,7 +257,7 @@ protected:
     fd = ::open(FILENAME, O_RDONLY);
     assert(fd >= 0);
   }
-  virtual void TearDown() {
+  void TearDown() override {
     ::close(fd);
     ::unlink(FILENAME);
   }
index cafe1691c2e08781e3eb0196971c6f1449799d36..2a35aeb08ba98cdf8f5e7e34c99eef17a20eb47d 100644 (file)
@@ -7,7 +7,7 @@
 
 class CryptoEnvironment: public ::testing::Environment {
 public:
-  void SetUp() {
+  void SetUp() override {
     ceph::crypto::init(g_ceph_context);
   }
 };
@@ -110,12 +110,12 @@ TEST(HMACSHA1, Restart) {
 
 class ForkDeathTest : public ::testing::Test {
  protected:
-  virtual void SetUp() {
+  void SetUp() override {
     // shutdown NSS so it can be reinitialized after the fork
     ceph::crypto::shutdown();
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     // undo the NSS shutdown we did in the parent process, after the
     // test is done
     ceph::crypto::init(g_ceph_context);
index dd49f0181a3565876fe10263a02909d11ee69f3c..e97dcef5c7df06744dd2917730fe1fb7767f3ce3 100644 (file)
@@ -539,7 +539,7 @@ class ClsLua : public ::testing::Test {
       ASSERT_EQ(0, destroy_one_pool_pp(pool_name, rados));
     }
 
-    virtual void SetUp() {
+    void SetUp() override {
       /* Grab test names to build unique objects */
       const ::testing::TestInfo* const test_info =
         ::testing::UnitTest::GetInstance()->current_test_info();
@@ -553,7 +553,7 @@ class ClsLua : public ::testing::Test {
       oid = ss_oid.str();
     }
 
-    virtual void TearDown() {
+    void TearDown() override {
     }
 
     /*
index 8c204caef046f059ee003cfa4aa81fa51a4c5aca..de6146e554aa0868f9aa836d825ca37141f4a3ed 100644 (file)
@@ -26,7 +26,7 @@ public:
   list<pair<string, utime_t> > entries;
   cls_replica_log_progress_marker progress;
 
-  void SetUp() {
+  void SetUp() override {
     pool_name = get_temp_pool_name();
     ASSERT_EQ("", create_one_pool_pp(pool_name, rados));
     ASSERT_EQ(0, rados.ioctx_create(pool_name.c_str(), ioctx));
index 000fb83a682b62cf4ef6b08c6d40b3a2adbd2c7e..979b6f161d30d64498a8f22c6bbb7dc7491e91de 100644 (file)
@@ -50,7 +50,7 @@ protected:
     {
     }
 
-    virtual void *entry() {
+    void *entry() override {
       usleep(5);
       waited = throttle.get(count);
       throttle.put(count);
index 1cf86087e0c92c192e09c1883e800a1a197556f7..275479694cec8e2819a8daa1b508ee9425cc883d 100644 (file)
@@ -33,11 +33,11 @@ using ::testing::StrEq;
 
 class DNSResolverTest : public ::testing::Test {
   protected:
-    virtual void SetUp() {
+    void SetUp() override {
       g_ceph_context->_conf->subsys.set_log_level(dout_subsys, TEST_DEBUG);
     }
 
-    virtual void TearDown()  {
+    void TearDown() override  {
       DNSResolver::get_instance(nullptr);
     }
 };
index 6e77306fdc0a2ab2ba35e73da417ecb70fa30bbe..e43b9bf172fc44318e7a7b148ea62419b68d6982 100644 (file)
@@ -27,12 +27,12 @@ typedef boost::mt11213b gen_type;
 class AsyncCompressorTest : public ::testing::Test {
  public:
   AsyncCompressor *async_compressor;
-  virtual void SetUp() {
+  void SetUp() override {
     cerr << __func__ << " start set up " << std::endl;
     async_compressor = new AsyncCompressor(g_ceph_context);
     async_compressor->init();
   }
-  virtual void TearDown() {
+  void TearDown() override {
     async_compressor->terminate();
     delete async_compressor;
   }
index 7b29413ac57ba3187cde9496d276e30b28dfce56..72de64149f8fc9ae71ac507c3ace4e1072914f3c 100644 (file)
@@ -19,13 +19,13 @@ protected:
   enum { item_size  = 100, };
   vector<Item> items;
 
-  virtual void SetUp() {
+  void SetUp() override {
     for (int i = 0; i < item_size; i++) {
       items.push_back(Item(i));
     }
     std::random_shuffle(items.begin(), items.end());
   }
-  virtual void TearDown() {
+  void TearDown() override {
     items.clear();
   }
 };
index d0a907d31644c4e5625cf4cc3e785dc2dddc07f4..7b7602ffe08ba4dec359de6102b22a36824675a7 100644 (file)
@@ -53,7 +53,7 @@ public:
       value(_value),
       in_method(_in_method) { }
 
-    virtual void * entry() {
+    void * entry() override {
       switch (in_method) {
       case LOWER_BOUND:
         ptr = cache.lower_bound(key);
index 925395aa099b56412c42473eae53c2eee3bf7f27..078259971e2bf0f698df4344fc70cd47c0ceac14 100644 (file)
@@ -53,7 +53,7 @@ public:
     {
     }
     
-    virtual void *entry() {
+    void *entry() override {
       switch(in_method) {
       case LOOKUP_OR_CREATE:
        if (value) 
@@ -303,7 +303,7 @@ public:
     int value;
   };
 
-  virtual void SetUp() {
+  void SetUp() override {
     died = UNDEFINED;
   }
 };
index 558b80c6e4fa2cdb48341318f7d7f10a071f35cb..b32c2ce2f0db98a9beffc241992a4cf171ca9fe6 100644 (file)
@@ -153,10 +153,10 @@ protected:
     }
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     srand(time(0));
   }
-  virtual void TearDown() {
+  void TearDown() override {
   }
 };
 
index 19135532a8f186e36eb6218f30f723b4218b5906..5a6ddd32ebf5787f0f4fd5b921b4b620b6d28370 100644 (file)
@@ -26,8 +26,8 @@ public:
   explicit CompressorPluginExample(CephContext* cct) : CompressionPlugin(cct)
   {}
 
-  virtual int factory(CompressorRef *cs,
-                     ostream *ss)
+  int factory(CompressorRef *cs,
+                     ostream *ss) override
   {
     if (compressor == 0) {
       CompressorExample *interface = new CompressorExample();
index 11e68932ad2a20727529a5a0d58ca0517a600d63..f4006c6d2ff1ca597ff8cc771d503ca3b349d5d1 100644 (file)
@@ -56,11 +56,11 @@ public:
     g_ceph_context->_conf->apply_changes(NULL);
   }
 
-  void SetUp() {
+  void SetUp() override {
     compressor = Compressor::create(g_ceph_context, plugin);
     ASSERT_TRUE(compressor);
   }
-  void TearDown() {
+  void TearDown() override {
     compressor.reset();
   }
 };
index f4a40cd41cde8c2436de3a4a528e205053d57b1f..df09b7d5dfcf431691d74194404a665893127219 100644 (file)
@@ -11,7 +11,7 @@
 
 class CryptoEnvironment: public ::testing::Environment {
 public:
-  void SetUp() {
+  void SetUp() override {
     ceph::crypto::init(g_ceph_context);
   }
 };
index 87e4fec2aa9ecbf1650f3e4e010dd16085fe3d45..676e7d4ad050406151ea0eb0d266e56383de53aa 100644 (file)
@@ -108,7 +108,7 @@ public:
     delete m_object;
   }
 
-  string decode(bufferlist bl, uint64_t seek) {
+  string decode(bufferlist bl, uint64_t seek) override {
     bufferlist::iterator p = bl.begin();
     p.seek(seek);
     try {
@@ -125,18 +125,18 @@ public:
     return string();
   }
 
-  virtual void encode(bufferlist& out, uint64_t features) = 0;
+  void encode(bufferlist& out, uint64_t features) override = 0;
 
-  void dump(ceph::Formatter *f) {
+  void dump(ceph::Formatter *f) override {
     m_object->dump(f);
   }
-  void generate() {
+  void generate() override {
     T::generate_test_instances(m_list);
   }
-  int num_generated() {
+  int num_generated() override {
     return m_list.size();
   }
-  string select_generated(unsigned i) {
+  string select_generated(unsigned i) override {
     // allow 0- or 1-based (by wrapping)
     if (i == 0)
       i = m_list.size();
@@ -148,7 +148,7 @@ public:
     return string();
   }
 
-  bool is_deterministic() {
+  bool is_deterministic() override {
     return !nondeterministic;
   }
 };
@@ -158,7 +158,7 @@ class DencoderImplNoFeatureNoCopy : public DencoderBase<T> {
 public:
   DencoderImplNoFeatureNoCopy(bool stray_ok, bool nondeterministic)
     : DencoderBase<T>(stray_ok, nondeterministic) {}
-  virtual void encode(bufferlist& out, uint64_t features) {
+  void encode(bufferlist& out, uint64_t features) override {
     out.clear();
     ::encode(*this->m_object, out);
   }
@@ -169,13 +169,13 @@ class DencoderImplNoFeature : public DencoderImplNoFeatureNoCopy<T> {
 public:
   DencoderImplNoFeature(bool stray_ok, bool nondeterministic)
     : DencoderImplNoFeatureNoCopy<T>(stray_ok, nondeterministic) {}
-  void copy() {
+  void copy() override {
     T *n = new T;
     *n = *this->m_object;
     delete this->m_object;
     this->m_object = n;
   }
-  void copy_ctor() {
+  void copy_ctor() override {
     T *n = new T(*this->m_object);
     delete this->m_object;
     this->m_object = n;
@@ -187,7 +187,7 @@ class DencoderImplFeaturefulNoCopy : public DencoderBase<T> {
 public:
   DencoderImplFeaturefulNoCopy(bool stray_ok, bool nondeterministic)
     : DencoderBase<T>(stray_ok, nondeterministic) {}
-  virtual void encode(bufferlist& out, uint64_t features) {
+  void encode(bufferlist& out, uint64_t features) override {
     out.clear();
     ::encode(*(this->m_object), out, features);
   }
@@ -198,13 +198,13 @@ class DencoderImplFeatureful : public DencoderImplFeaturefulNoCopy<T> {
 public:
   DencoderImplFeatureful(bool stray_ok, bool nondeterministic)
     : DencoderImplFeaturefulNoCopy<T>(stray_ok, nondeterministic) {}
-  void copy() {
+  void copy() override {
     T *n = new T;
     *n = *this->m_object;
     delete this->m_object;
     this->m_object = n;
   }
-  void copy_ctor() {
+  void copy_ctor() override {
     T *n = new T(*this->m_object);
     delete this->m_object;
     this->m_object = n;
@@ -224,7 +224,7 @@ public:
     m_object->put();
   }
 
-  string decode(bufferlist bl, uint64_t seek) {
+  string decode(bufferlist bl, uint64_t seek) override {
     bufferlist::iterator p = bl.begin();
     p.seek(seek);
     try {
@@ -250,21 +250,21 @@ public:
     return string();
   }
 
-  void encode(bufferlist& out, uint64_t features) {
+  void encode(bufferlist& out, uint64_t features) override {
     out.clear();
     encode_message(m_object, features, out);
   }
 
-  void dump(ceph::Formatter *f) {
+  void dump(ceph::Formatter *f) override {
     m_object->dump(f);
   }
-  void generate() {
+  void generate() override {
     //T::generate_test_instances(m_list);
   }
-  int num_generated() {
+  int num_generated() override {
     return m_list.size();
   }
-  string select_generated(unsigned i) {
+  string select_generated(unsigned i) override {
     // allow 0- or 1-based (by wrapping)
     if (i == 0)
       i = m_list.size();
@@ -276,7 +276,7 @@ public:
     m_object = *p;
     return string();
   }
-  bool is_deterministic() {
+  bool is_deterministic() override {
     return true;
   }
 
index adbda834eb899a8f896bea5c684471f894015b30..de105953a47a789b5c7aea01d979900c2b46875e 100644 (file)
 
 class ErasureCodePluginExample : 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
   {
     *erasure_code = ErasureCodeInterfaceRef(new ErasureCodeExample());
     (*erasure_code)->init(profile, ss);
index 55b12818f3e4df7ccfd906549be40471e88dc95a..ddd571fb5a4f6f3eebc0412b2436e4bf341cb7e6 100644 (file)
@@ -31,25 +31,25 @@ public:
 
   ErasureCodeTest(unsigned int _k, unsigned int _m, unsigned int _chunk_size) :
     k(_k), m(_m), chunk_size(_chunk_size) {}
-  virtual ~ErasureCodeTest() {}
+  ~ErasureCodeTest() {}
 
-  virtual int init(ErasureCodeProfile &profile, ostream *ss) {
+  int init(ErasureCodeProfile &profile, ostream *ss) override {
     return 0;
   }
 
-  virtual unsigned int get_chunk_count() const { return k + m; }
-  virtual unsigned int get_data_chunk_count() const { return k; }
-  virtual unsigned int get_chunk_size(unsigned int object_size) const {
+  unsigned int get_chunk_count() const override { return k + m; }
+  unsigned int get_data_chunk_count() const override { return k; }
+  unsigned int get_chunk_size(unsigned int object_size) const override {
     return chunk_size;
   }
-  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 {
     encode_chunks_encoded = *encoded;
     return 0;
   }
-  virtual int create_ruleset(const string &name,
+  int create_ruleset(const string &name,
                             CrushWrapper &crush,
-                            ostream *ss) const { return 0; }
+                            ostream *ss) const override { return 0; }
 
 };
 
index d86545b33b169da4e795d39375493328975bee7d..1476f64fb45c2e7202d8f5c0371e9fed46f8af96 100644 (file)
@@ -36,7 +36,7 @@ protected:
         instance.lock.Unlock();
     }
 
-    virtual void *entry() {
+    void *entry() override {
       ErasureCodeProfile profile;
       ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
       ErasureCodeInterfaceRef erasure_code;
index 5df344f23cdb908bab4ebb433fb27024aab423ef..49640362546607f8175f631f2ca9e0126cd25eea 100644 (file)
@@ -20,7 +20,7 @@ public:
   int *result;
   C_Checker(bool* _finish_called, int *r) :
     finish_called(_finish_called), result(r) {}
-  void finish(int r) { *finish_called = true; *result = r; }
+  void finish(int r) override { *finish_called = true; *result = r; }
 };
 
 TEST(ContextGather, Constructor) {
index af8ca7656424280f922a80594e31ced9a63129dd..f904c6eefbb9f216867dc7f0481248471e62f53c 100644 (file)
@@ -13,14 +13,14 @@ public:
     uint64_t refs;
     uint64_t flushes;
     FlushHandler() : refs(0), flushes(0) {}
-    virtual void get() {
+    void get() override {
       ++refs;
     }
-    virtual void put() {
+    void put() override {
       assert(refs > 0);
       --refs;
     }
-    virtual void flush(const journal::FutureImplPtr &future) {
+    void flush(const journal::FutureImplPtr &future) override {
       ++flushes;
     }
   };
index 560ee4e569f70ecfb2f024ab9d736bb9ef8f67d3..bdb3107f982a11a918d83752f328bee1cfbdb3b6 100644 (file)
@@ -9,7 +9,7 @@
 
 class TestJournalMetadata : public RadosTestFixture {
 public:
-  virtual void TearDown() {
+  void TearDown() override {
     for (MetadataList::iterator it = m_metadata_list.begin();
          it != m_metadata_list.end(); ++it) {
       (*it)->remove_listener(&m_listener);
index 6888ee06bb52c287c0f375283d8bbfaa9b8e9df9..7522198ec18ace9465f198c96279c6268457174d 100644 (file)
@@ -33,16 +33,16 @@ public:
       : lock("lock"), entries_available(false), complete(false),
         complete_result(0) {}
 
-    virtual void get() {}
-    virtual void put() {}
+    void get() override {}
+    void put() override {}
 
-    virtual void handle_entries_available() {
+    void handle_entries_available() override {
       Mutex::Locker locker(lock);
       entries_available = true;
       cond.Signal();
     }
 
-    virtual void handle_complete(int r) {
+    void handle_complete(int r) override {
       Mutex::Locker locker(lock);
       complete = true;
       complete_result = r;
@@ -50,7 +50,7 @@ public:
     }
   };
 
-  virtual void TearDown() {
+  void TearDown() override {
     for (JournalPlayers::iterator it = m_players.begin();
          it != m_players.end(); ++it) {
       delete *it;
index c06ea6df5b5a46fb7b6d327fc6705496374156ed..59cc3907f8b92372077827441a89dbab027383f2 100644 (file)
@@ -11,7 +11,7 @@
 class TestJournalRecorder : public RadosTestFixture {
 public:
 
-  virtual void TearDown() {
+  void TearDown() override {
     for (std::list<journal::JournalRecorder*>::iterator it = m_recorders.begin();
          it != m_recorders.end(); ++it) {
       delete *it;
index 8e09e870d2542c2c9211038b6e678a94221268dc..6d6917e4300de23e206bc69031150477ba75c56d 100644 (file)
@@ -11,7 +11,7 @@
 class TestJournalTrimmer : public RadosTestFixture {
 public:
 
-  virtual void TearDown() {
+  void TearDown() override {
     for (MetadataList::iterator it = m_metadata_list.begin();
          it != m_metadata_list.end(); ++it) {
       (*it)->remove_listener(&m_listener);
index 7b8be81b5607efd998752b236d0b1f22f9bf0cc3..4fd06ad6535f52674f686a812dc9081e5c3c8b5e 100644 (file)
@@ -18,14 +18,14 @@ public:
     return stringify(++_journal_id);
   }
 
-  virtual void SetUp() {
+  void SetUp() override {
     RadosTestFixture::SetUp();
     m_journal_id = get_temp_journal_id();
     m_journaler = new journal::Journaler(m_work_queue, m_timer, &m_timer_lock,
                                          m_ioctx, m_journal_id, CLIENT_ID, {});
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     delete m_journaler;
     RadosTestFixture::TearDown();
   }
index 1e0a366d7b410b9ce6cebccfbcbe6f3a1c3bfd38..ed071c8d56b45ef0faad98e8344bff9fbd93be7c 100644 (file)
@@ -31,12 +31,12 @@ public:
     Handler() : lock("lock") {
     }
 
-    virtual void closed(journal::ObjectRecorder *object_recorder) {
+    void closed(journal::ObjectRecorder *object_recorder) override {
       Mutex::Locker locker(lock);
       is_closed = true;
       cond.Signal();
     }
-    virtual void overflow(journal::ObjectRecorder *object_recorder) {
+    void overflow(journal::ObjectRecorder *object_recorder) override {
       Mutex::Locker locker(lock);
       journal::AppendBuffers append_buffers;
       object_lock->Lock();
@@ -59,7 +59,7 @@ public:
   double m_flush_age;
   Handler m_handler;
 
-  void TearDown() {
+  void TearDown() override {
     for (ObjectRecorders::iterator it = m_object_recorders.begin();
          it != m_object_recorders.end(); ++it) {
       C_SaferCond cond;
index f71682ce340319e2fc1de77c96c8313e04805b36..a5f5ef6591985fef5148594a071b867983b0193b 100644 (file)
@@ -38,8 +38,8 @@ class MessengerClient {
 
    public:
     ClientDispatcher(uint64_t delay, ClientThread *t): Dispatcher(g_ceph_context), think_time(delay), thread(t) {}
-    bool ms_can_fast_dispatch_any() const { return true; }
-    bool ms_can_fast_dispatch(Message *m) const {
+    bool ms_can_fast_dispatch_any() const override { return true; }
+    bool ms_can_fast_dispatch(Message *m) const override {
       switch (m->get_type()) {
       case CEPH_MSG_OSD_OPREPLY:
         return true;
@@ -48,16 +48,16 @@ class MessengerClient {
       }
     }
 
-    void ms_handle_fast_connect(Connection *con) {}
-    void ms_handle_fast_accept(Connection *con) {}
-    bool ms_dispatch(Message *m) { return true; }
-    void ms_fast_dispatch(Message *m);
-    bool ms_handle_reset(Connection *con) { return true; }
-    void ms_handle_remote_reset(Connection *con) {}
-    bool ms_handle_refused(Connection *con) { return false; }
+    void ms_handle_fast_connect(Connection *con) override {}
+    void ms_handle_fast_accept(Connection *con) override {}
+    bool ms_dispatch(Message *m) override { return true; }
+    void ms_fast_dispatch(Message *m) override;
+    bool ms_handle_reset(Connection *con) override { return true; }
+    void ms_handle_remote_reset(Connection *con) override {}
+    bool ms_handle_refused(Connection *con) override { return false; }
     bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
                               bufferlist& authorizer, bufferlist& authorizer_reply,
-                              bool& isvalid, CryptoKey& session_key) {
+                              bool& isvalid, CryptoKey& session_key) override {
       isvalid = true;
       return true;
     }
@@ -89,7 +89,7 @@ class MessengerClient {
       memset(ptr.c_str(), 0, msg_len);
       data.append(ptr);
     }
-    void *entry() {
+    void *entry() override {
       lock.Lock();
       for (int i = 0; i < ops; ++i) {
         if (inflight > uint64_t(concurrent)) {
index 86c652bb708cce5961d0ee684a789ef6602899f8..8ce3acb85b3966c42929cc52709fc01e7aa2fb7a 100644 (file)
@@ -40,17 +40,17 @@ class ServerDispatcher : public Dispatcher {
     OpWQ(time_t timeout, time_t suicide_timeout, ThreadPool *tp)
       : ThreadPool::WorkQueue<Message>("ServerDispatcher::OpWQ", timeout, suicide_timeout, tp) {}
 
-    bool _enqueue(Message *m) {
+    bool _enqueue(Message *m) override {
       messages.push_back(m);
       return true;
     }
-    void _dequeue(Message *m) {
+    void _dequeue(Message *m) override {
       ceph_abort();
     }
-    bool _empty() {
+    bool _empty() override {
       return messages.empty();
     }
-    Message *_dequeue() {
+    Message *_dequeue() override {
       if (messages.empty())
        return NULL;
       Message *m = messages.front();
@@ -63,8 +63,8 @@ class ServerDispatcher : public Dispatcher {
       m->get_connection()->send_message(reply);
       m->put();
     }
-    void _process_finish(Message *m) { }
-    void _clear() {
+    void _process_finish(Message *m) override { }
+    void _clear() override {
       assert(messages.empty());
     }
   } op_wq;
@@ -78,8 +78,8 @@ class ServerDispatcher : public Dispatcher {
   ~ServerDispatcher() {
     op_tp.stop();
   }
-  bool ms_can_fast_dispatch_any() const { return true; }
-  bool ms_can_fast_dispatch(Message *m) const {
+  bool ms_can_fast_dispatch_any() const override { return true; }
+  bool ms_can_fast_dispatch(Message *m) const override {
     switch (m->get_type()) {
     case CEPH_MSG_OSD_OP:
       return true;
@@ -88,20 +88,20 @@ class ServerDispatcher : public Dispatcher {
     }
   }
 
-  void ms_handle_fast_connect(Connection *con) {}
-  void ms_handle_fast_accept(Connection *con) {}
-  bool ms_dispatch(Message *m) { return true; }
-  bool ms_handle_reset(Connection *con) { return true; }
-  void ms_handle_remote_reset(Connection *con) {}
-  bool ms_handle_refused(Connection *con) { return false; }
-  void ms_fast_dispatch(Message *m) {
+  void ms_handle_fast_connect(Connection *con) override {}
+  void ms_handle_fast_accept(Connection *con) override {}
+  bool ms_dispatch(Message *m) override { return true; }
+  bool ms_handle_reset(Connection *con) override { return true; }
+  void ms_handle_remote_reset(Connection *con) override {}
+  bool ms_handle_refused(Connection *con) override { return false; }
+  void ms_fast_dispatch(Message *m) override {
     usleep(think_time);
     //cerr << __func__ << " reply message=" << m << std::endl;
     op_wq.queue(m);
   }
   bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
                             bufferlist& authorizer, bufferlist& authorizer_reply,
-                            bool& isvalid, CryptoKey& session_key) {
+                            bool& isvalid, CryptoKey& session_key) override {
     isvalid = true;
     return true;
   }
index 7773db77c57d4350301b1fdb8fe7110eb9564303..697198a38ded9802be1171f2b6a9d1ca1af0bfda 100644 (file)
@@ -65,7 +65,7 @@ class EventDriverTest : public ::testing::TestWithParam<const char*> {
   EventDriver *driver;
 
   EventDriverTest(): driver(0) {}
-  virtual void SetUp() {
+  void SetUp() override {
     cerr << __func__ << " start set up " << GetParam() << std::endl;
 #ifdef HAVE_EPOLL
     if (strcmp(GetParam(), "epoll"))
@@ -79,7 +79,7 @@ class EventDriverTest : public ::testing::TestWithParam<const char*> {
       driver = new SelectDriver(g_ceph_context);
     driver->init(NULL, 100);
   }
-  virtual void TearDown() {
+  void TearDown() override {
     delete driver;
   }
 };
@@ -250,7 +250,7 @@ TEST_P(EventDriverTest, NetworkSocketTest) {
 class FakeEvent : public EventCallback {
 
  public:
-  void do_request(int fd_or_id) {}
+  void do_request(int fd_or_id) override {}
 };
 
 TEST(EventCenterTest, FileEventExpansion) {
@@ -283,7 +283,7 @@ class Worker : public Thread {
     done = true; 
     center.wakeup();
   }
-  void* entry() {
+  void* entry() override {
     center.set_owner();
     while (!done)
       center.process_events(1000000);
@@ -298,7 +298,7 @@ class CountEvent: public EventCallback {
 
  public:
   CountEvent(atomic_t *atomic, Mutex *l, Cond *c): count(atomic), lock(l), cond(c) {}
-  void do_request(int id) {
+  void do_request(int id) override {
     lock->Lock();
     count->dec();
     cond->Signal();
index 585077c764b713a81be97678485a16b4fca5c1ea..e3b24f814d52ecda434ce90cff59d3ac4882f63d 100644 (file)
@@ -38,7 +38,7 @@ class NetworkWorkerTest : public ::testing::TestWithParam<const char*> {
   string addr, port_addr;
 
   NetworkWorkerTest() {}
-  virtual void SetUp() {
+  void SetUp() override {
     cerr << __func__ << " start set up " << GetParam() << std::endl;
     if (strncmp(GetParam(), "dpdk", 4)) {
       g_ceph_context->_conf->set_val("ms_type", "async+posix", false, false);
@@ -58,7 +58,7 @@ class NetworkWorkerTest : public ::testing::TestWithParam<const char*> {
     stack = NetworkStack::create(g_ceph_context, GetParam());
     stack->start();
   }
-  virtual void TearDown() {
+  void TearDown() override {
     stack->stop();
   }
   string get_addr() const {
@@ -83,7 +83,7 @@ class NetworkWorkerTest : public ::testing::TestWithParam<const char*> {
     std::atomic_bool done;
    public:
     C_dispatch(Worker *w, func &&_f): worker(w), f(std::move(_f)), done(false) {}
-    void do_request(int id) {
+    void do_request(int id) override {
       f(worker);
       done = true;
     }
@@ -120,7 +120,7 @@ class C_poll : public EventCallback {
 
  public:
   C_poll(EventCenter *c): center(c), woken(false) {}
-  void do_request(int r) {
+  void do_request(int r) override {
     woken = true;
   }
   bool poll(int milliseconds) {
@@ -626,7 +626,7 @@ class StressFactory {
     T *ctxt;
    public:
     C_delete(T *c): ctxt(c) {}
-    void do_request(int id) {
+    void do_request(int id) override {
       delete ctxt;
       delete this;
     }
@@ -651,7 +651,7 @@ class StressFactory {
       Client *c;
      public:
       Client_read_handle(Client *_c): c(_c) {}
-      void do_request(int id) {
+      void do_request(int id) override {
         c->do_read_request();
       }
     } read_ctxt;
@@ -660,7 +660,7 @@ class StressFactory {
       Client *c;
      public:
       Client_write_handle(Client *_c): c(_c) {}
-      void do_request(int id) {
+      void do_request(int id) override {
         c->do_write_request();
       }
     } write_ctxt;
@@ -790,7 +790,7 @@ class StressFactory {
       Server *s;
      public:
       Server_read_handle(Server *_s): s(_s) {}
-      void do_request(int id) {
+      void do_request(int id) override {
         s->do_read_request();
       }
     } read_ctxt;
@@ -799,7 +799,7 @@ class StressFactory {
       Server *s;
      public:
       Server_write_handle(Server *_s): s(_s) {}
-      void do_request(int id) {
+      void do_request(int id) override {
         s->do_write_request();
       }
     } write_ctxt;
@@ -903,7 +903,7 @@ class StressFactory {
    public:
     C_accept(StressFactory *f, ServerSocket s, ThreadData *data, Worker *w)
         : factory(f), bind_socket(std::move(s)), t_data(data), worker(w) {}
-    void do_request(int id) {
+    void do_request(int id) override {
       while (true) {
         entity_addr_t cli_addr;
         ConnectedSocket srv_socket;
index 02d42fe21b94c665835c2a146c780325b4e50506..71017f41ee641f32a07c2f2cda8e07c09f93eb7c 100644 (file)
@@ -63,14 +63,14 @@ class MessengerTest : public ::testing::TestWithParam<const char*> {
   Messenger *client_msgr;
 
   MessengerTest(): server_msgr(NULL), client_msgr(NULL) {}
-  virtual void SetUp() {
+  void SetUp() override {
     lderr(g_ceph_context) << __func__ << " start set up " << GetParam() << dendl;
     server_msgr = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::OSD(0), "server", getpid(), 0);
     client_msgr = Messenger::create(g_ceph_context, string(GetParam()), entity_name_t::CLIENT(-1), "client", getpid(), 0);
     server_msgr->set_default_policy(Messenger::Policy::stateless_server(0, 0));
     client_msgr->set_default_policy(Messenger::Policy::lossy_client(0, 0));
   }
-  virtual void TearDown() {
+  void TearDown() override {
     ASSERT_EQ(server_msgr->get_dispatch_queue_len(), 0);
     ASSERT_EQ(client_msgr->get_dispatch_queue_len(), 0);
     delete server_msgr;
@@ -102,8 +102,8 @@ class FakeDispatcher : public Dispatcher {
   explicit FakeDispatcher(bool s): Dispatcher(g_ceph_context), lock("FakeDispatcher::lock"),
                           is_server(s), got_new(false), got_remote_reset(false),
                           got_connect(false), loopback(false) {}
-  bool ms_can_fast_dispatch_any() const { return true; }
-  bool ms_can_fast_dispatch(Message *m) const {
+  bool ms_can_fast_dispatch_any() const override { return true; }
+  bool ms_can_fast_dispatch(Message *m) const override {
     switch (m->get_type()) {
     case CEPH_MSG_PING:
       return true;
@@ -112,7 +112,7 @@ class FakeDispatcher : public Dispatcher {
     }
   }
 
-  void ms_handle_fast_connect(Connection *con) {
+  void ms_handle_fast_connect(Connection *con) override {
     lock.Lock();
     lderr(g_ceph_context) << __func__ << " " << con << dendl;
     Session *s = static_cast<Session*>(con->get_priv());
@@ -126,7 +126,7 @@ class FakeDispatcher : public Dispatcher {
     cond.Signal();
     lock.Unlock();
   }
-  void ms_handle_fast_accept(Connection *con) {
+  void ms_handle_fast_accept(Connection *con) override {
     Session *s = static_cast<Session*>(con->get_priv());
     if (!s) {
       s = new Session(con);
@@ -134,7 +134,7 @@ class FakeDispatcher : public Dispatcher {
     }
     s->put();
   }
-  bool ms_dispatch(Message *m) {
+  bool ms_dispatch(Message *m) override {
     Session *s = static_cast<Session*>(m->get_connection()->get_priv());
     if (!s) {
       s = new Session(m->get_connection());
@@ -152,7 +152,7 @@ class FakeDispatcher : public Dispatcher {
     m->put();
     return true;
   }
-  bool ms_handle_reset(Connection *con) {
+  bool ms_handle_reset(Connection *con) override {
     Mutex::Locker l(lock);
     lderr(g_ceph_context) << __func__ << " " << con << dendl;
     Session *s = static_cast<Session*>(con->get_priv());
@@ -163,7 +163,7 @@ class FakeDispatcher : public Dispatcher {
     }
     return true;
   }
-  void ms_handle_remote_reset(Connection *con) {
+  void ms_handle_remote_reset(Connection *con) override {
     Mutex::Locker l(lock);
     lderr(g_ceph_context) << __func__ << " " << con << dendl;
     Session *s = static_cast<Session*>(con->get_priv());
@@ -175,10 +175,10 @@ class FakeDispatcher : public Dispatcher {
     got_remote_reset = true;
     cond.Signal();
   }
-  bool ms_handle_refused(Connection *con) {
+  bool ms_handle_refused(Connection *con) override {
     return false;
   }
-  void ms_fast_dispatch(Message *m) {
+  void ms_fast_dispatch(Message *m) override {
     Session *s = static_cast<Session*>(m->get_connection()->get_priv());
     if (!s) {
       s = new Session(m->get_connection());
@@ -203,7 +203,7 @@ class FakeDispatcher : public Dispatcher {
 
   bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
                             bufferlist& authorizer, bufferlist& authorizer_reply,
-                            bool& isvalid, CryptoKey& session_key) {
+                            bool& isvalid, CryptoKey& session_key) override {
     isvalid = true;
     return true;
   }
@@ -813,8 +813,8 @@ class SyntheticDispatcher : public Dispatcher {
   SyntheticDispatcher(bool s, SyntheticWorkload *wl):
       Dispatcher(g_ceph_context), lock("SyntheticDispatcher::lock"), is_server(s), got_new(false),
       got_remote_reset(false), got_connect(false), index(0), workload(wl) {}
-  bool ms_can_fast_dispatch_any() const { return true; }
-  bool ms_can_fast_dispatch(Message *m) const {
+  bool ms_can_fast_dispatch_any() const override { return true; }
+  bool ms_can_fast_dispatch(Message *m) const override {
     switch (m->get_type()) {
     case CEPH_MSG_PING:
     case MSG_COMMAND:
@@ -824,7 +824,7 @@ class SyntheticDispatcher : public Dispatcher {
     }
   }
 
-  void ms_handle_fast_connect(Connection *con) {
+  void ms_handle_fast_connect(Connection *con) override {
     Mutex::Locker l(lock);
     list<uint64_t> c = conn_sent[con];
     for (list<uint64_t>::iterator it = c.begin();
@@ -834,7 +834,7 @@ class SyntheticDispatcher : public Dispatcher {
     got_connect = true;
     cond.Signal();
   }
-  void ms_handle_fast_accept(Connection *con) {
+  void ms_handle_fast_accept(Connection *con) override {
     Mutex::Locker l(lock);
     list<uint64_t> c = conn_sent[con];
     for (list<uint64_t>::iterator it = c.begin();
@@ -843,11 +843,11 @@ class SyntheticDispatcher : public Dispatcher {
     conn_sent.erase(con);
     cond.Signal();
   }
-  bool ms_dispatch(Message *m) {
+  bool ms_dispatch(Message *m) override {
     ceph_abort();
   }
-  bool ms_handle_reset(Connection *con);
-  void ms_handle_remote_reset(Connection *con) {
+  bool ms_handle_reset(Connection *con) override;
+  void ms_handle_remote_reset(Connection *con) override {
     Mutex::Locker l(lock);
     list<uint64_t> c = conn_sent[con];
     for (list<uint64_t>::iterator it = c.begin();
@@ -856,10 +856,10 @@ class SyntheticDispatcher : public Dispatcher {
     conn_sent.erase(con);
     got_remote_reset = true;
   }
-  bool ms_handle_refused(Connection *con) {
+  bool ms_handle_refused(Connection *con) override {
     return false;
   }
-  void ms_fast_dispatch(Message *m) {
+  void ms_fast_dispatch(Message *m) override {
     // MSG_COMMAND is used to disorganize regular message flow
     if (m->get_type() == MSG_COMMAND) {
       m->put();
@@ -893,7 +893,7 @@ class SyntheticDispatcher : public Dispatcher {
 
   bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
                             bufferlist& authorizer, bufferlist& authorizer_reply,
-                            bool& isvalid, CryptoKey& session_key) {
+                            bool& isvalid, CryptoKey& session_key) override {
     isvalid = true;
     return true;
   }
@@ -1373,8 +1373,8 @@ class MarkdownDispatcher : public Dispatcher {
   atomic_t count;
   explicit MarkdownDispatcher(bool s): Dispatcher(g_ceph_context), lock("MarkdownDispatcher::lock"),
                               last_mark(false), count(0) {}
-  bool ms_can_fast_dispatch_any() const { return false; }
-  bool ms_can_fast_dispatch(Message *m) const {
+  bool ms_can_fast_dispatch_any() const override { return false; }
+  bool ms_can_fast_dispatch(Message *m) const override {
     switch (m->get_type()) {
     case CEPH_MSG_PING:
       return true;
@@ -1383,16 +1383,16 @@ class MarkdownDispatcher : public Dispatcher {
     }
   }
 
-  void ms_handle_fast_connect(Connection *con) {
+  void ms_handle_fast_connect(Connection *con) override {
     lderr(g_ceph_context) << __func__ << " " << con << dendl;
     Mutex::Locker l(lock);
     conns.insert(con);
   }
-  void ms_handle_fast_accept(Connection *con) {
+  void ms_handle_fast_accept(Connection *con) override {
     Mutex::Locker l(lock);
     conns.insert(con);
   }
-  bool ms_dispatch(Message *m) {
+  bool ms_dispatch(Message *m) override {
     lderr(g_ceph_context) << __func__ << " conn: " << m->get_connection() << dendl;
     Mutex::Locker l(lock);
     count.inc();
@@ -1416,27 +1416,27 @@ class MarkdownDispatcher : public Dispatcher {
     m->put();
     return true;
   }
-  bool ms_handle_reset(Connection *con) {
+  bool ms_handle_reset(Connection *con) override {
     lderr(g_ceph_context) << __func__ << " " << con << dendl;
     Mutex::Locker l(lock);
     conns.erase(con);
     usleep(rand() % 500);
     return true;
   }
-  void ms_handle_remote_reset(Connection *con) {
+  void ms_handle_remote_reset(Connection *con) override {
     Mutex::Locker l(lock);
     conns.erase(con);
     lderr(g_ceph_context) << __func__ << " " << con << dendl;
   }
-  bool ms_handle_refused(Connection *con) {
+  bool ms_handle_refused(Connection *con) override {
     return false;
   }
-  void ms_fast_dispatch(Message *m) {
+  void ms_fast_dispatch(Message *m) override {
     ceph_abort();
   }
   bool ms_verify_authorizer(Connection *con, int peer_type, int protocol,
                             bufferlist& authorizer, bufferlist& authorizer_reply,
-                            bool& isvalid, CryptoKey& session_key) {
+                            bool& isvalid, CryptoKey& session_key) override {
     isvalid = true;
     return true;
   }
index 4dc5489d51d746b51e333c2b8186d74edb45eca4..ecd7e28dc17c6460bd2451f033ffaeeae38fa6b0 100644 (file)
@@ -22,7 +22,7 @@ static sem_t sem;
 class WatchNotifyTestCtx : public WatchCtx
 {
 public:
-    void notify(uint8_t opcode, uint64_t ver, bufferlist& bl)
+    void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) override
     {
       sem_post(&sem);
     }
index 484fe8ec8df9b1026881e6328ab7831fb1bf26e8..303208f8a49f2ebaa95c9d0f149d8022c2eff3a8 100644 (file)
@@ -87,7 +87,7 @@ class C_NotifyCond : public Context {
 public:
   C_NotifyCond(std::mutex *mutex, std::condition_variable *cond, bool *done)
     : mutex(mutex), cond(cond), done(done) {}
-  void finish(int r) {
+  void finish(int r) override {
     std::lock_guard<std::mutex> lock(*mutex);
     *done = true;
     cond->notify_one();
index 5fba4b443d12ae92834c9d3bd51d3f4a07babbcc..a74ef8342adb8f6042950ea97268229bcac63cee 100644 (file)
@@ -330,7 +330,7 @@ class CondPingPong {
     CondPingPong *p;
    public:
     explicit Consumer(CondPingPong *p): p(p) {}
-    void* entry() {
+    void* entry() override {
       p->consume();
       return 0;
     }
@@ -473,7 +473,7 @@ class CenterWorker : public Thread {
     done = true;
     center.wakeup();
   }
-  void* entry() {
+  void* entry() override {
     center.set_owner();
     bind_thread_to_cpu(2);
     while (!done)
@@ -487,7 +487,7 @@ class CountEvent: public EventCallback {
 
  public:
   explicit CountEvent(atomic_t *atomic): count(atomic) {}
-  void do_request(int id) {
+  void do_request(int id) override {
     count->dec();
   }
 };
@@ -749,7 +749,7 @@ double test_spinlock()
 // Helper for spawn_thread. This is the main function that the thread executes
 // (intentionally empty).
 class ThreadHelper : public Thread {
-  void *entry() { return 0; }
+  void *entry() override { return 0; }
 };
 
 // Measure the cost of start and joining with a thread.
@@ -768,7 +768,7 @@ double spawn_thread()
 
 class FakeContext : public Context {
  public:
-  virtual void finish(int r) {}
+  void finish(int r) override {}
 };
 
 // Measure the cost of starting and stopping a Dispatch::Timer.
index ff1cfaeee6e39420fdfdd6a349e59bd2d0f848de..cb1724767673edc2be5d3e9468e92c5ad3aec019 100644 (file)
@@ -56,7 +56,7 @@ public:
   {
   }
 
-  int run(void)
+  int run(void) override
   {
     int ret_val = 0;
     rados_t cl;
@@ -141,7 +141,7 @@ public:
   {
   }
 
-  int run(void)
+  int run(void) override
   {
     int ret_val = 0;
     rados_t cl;
@@ -223,7 +223,7 @@ int main(int argc, const char **argv)
   const char *num_objects = getenv("NUM_OBJECTS");
   const std::string pool = get_temp_pool_name(argv[0]);
   if (num_objects) {
-    g_num_objects = atoi(num_objects); 
+    g_num_objects = atoi(num_objects);
     if (g_num_objects == 0)
       return 100;
   }
@@ -343,6 +343,6 @@ int main(int argc, const char **argv)
   rados_connect(cl);
   rados_pool_delete(cl, pool.c_str());
 
-  printf("******* SUCCESS **********\n"); 
+  printf("******* SUCCESS **********\n");
   return EXIT_SUCCESS;
 }
index fbaaf2a6e5e46175353c928670bf9e65b6f1dc73..12d2f44a53c8abf6a50720bf14e3b445950186ad 100644 (file)
@@ -63,7 +63,7 @@ public:
   {
   }
 
-  int run()
+  int run() override
   {
     rados_t cl;
     RETURN1_IF_NONZERO(rados_create(&cl, NULL));
index a48fd03a95185fdecb09ef9a3f51372170e63c86..46969e92065856dd51654706726b9a3fbcafac08 100644 (file)
@@ -44,7 +44,7 @@ class PausyAsyncMap : public MapCacher::StoreDriver<string, bufferlist> {
   struct Remove : public _Op {
     set<string> to_remove;
     explicit Remove(const set<string> &to_remove) : to_remove(to_remove) {}
-    void operate(map<string, bufferlist> *store) {
+    void operate(map<string, bufferlist> *store) override {
       for (set<string>::iterator i = to_remove.begin();
           i != to_remove.end();
           ++i) {
@@ -55,7 +55,7 @@ class PausyAsyncMap : public MapCacher::StoreDriver<string, bufferlist> {
   struct Insert : public _Op {
     map<string, bufferlist> to_insert;
     explicit Insert(const map<string, bufferlist> &to_insert) : to_insert(to_insert) {}
-    void operate(map<string, bufferlist> *store) {
+    void operate(map<string, bufferlist> *store) override {
       for (map<string, bufferlist>::iterator i = to_insert.begin();
           i != to_insert.end();
           ++i) {
@@ -67,7 +67,7 @@ class PausyAsyncMap : public MapCacher::StoreDriver<string, bufferlist> {
   struct Callback : public _Op {
     Context *context;
     explicit Callback(Context *c) : context(c) {}
-    void operate(map<string, bufferlist> *store) {
+    void operate(map<string, bufferlist> *store) override {
       context->complete(0);
     }
   };
@@ -77,13 +77,13 @@ public:
     list<Op> ops;
     list<Op> callbacks;
   public:
-    void set_keys(const map<string, bufferlist> &i) {
+    void set_keys(const map<string, bufferlist> &i) override {
       ops.push_back(Op(new Insert(i)));
     }
-    void remove_keys(const set<string> &r) {
+    void remove_keys(const set<string> &r) override {
       ops.push_back(Op(new Remove(r)));
     }
-    void add_callback(Context *c) {
+    void add_callback(Context *c) override {
       callbacks.push_back(Op(new Callback(c)));
     }
   };
@@ -103,7 +103,7 @@ private:
   public:
     explicit Doer(PausyAsyncMap *parent) :
       parent(parent), lock("Doer lock"), stopping(0), paused(false) {}
-    virtual void *entry() {
+    void *entry() override {
       while (1) {
        list<Op> ops;
        {
@@ -172,7 +172,7 @@ public:
   }
   int get_keys(
     const set<string> &keys,
-    map<string, bufferlist> *out) {
+    map<string, bufferlist> *out) override {
     Mutex::Locker l(lock);
     for (set<string>::const_iterator i = keys.begin();
         i != keys.end();
@@ -185,7 +185,7 @@ public:
   }
   int get_next(
     const string &key,
-    pair<string, bufferlist> *next) {
+    pair<string, bufferlist> *next) override {
     Mutex::Locker l(lock);
     map<string, bufferlist>::iterator j = store.upper_bound(key);
     if (j != store.end()) {
@@ -213,7 +213,7 @@ public:
     public:
       OnFinish(Mutex *lock, Cond *cond, bool *done)
        : lock(lock), cond(cond), done(done) {}
-      void finish(int) {
+      void finish(int) override {
        Mutex::Locker l(*lock);
        *done = true;
        cond->Signal();
@@ -364,7 +364,7 @@ public:
       cur = next.first;
     }
   }
-  virtual void SetUp() {
+  void SetUp() override {
     driver.reset(new PausyAsyncMap());
     cache.reset(new MapCacher::MapCacher<string, bufferlist>(driver.get()));
     names.clear();
@@ -374,7 +374,7 @@ public:
       names.insert(random_string(1 + (random_size() % 10)));
     }
   }
-  virtual void TearDown() {
+  void TearDown() override {
     driver->stop();
     cache.reset();
     driver.reset();
@@ -587,12 +587,12 @@ protected:
   map<pg_t, ceph::shared_ptr<MapperVerifier> > mappers;
   uint32_t pgnum;
 
-  virtual void SetUp() {
+  void SetUp() override {
     driver.reset(new PausyAsyncMap());
     pgnum = 0;
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     driver->stop();
     mappers.clear();
     driver.reset();
index 5077b13bf6a4c7bb4bd287efb2042c02c33dbef9..ff964df17ed30ff20e944bc523bd8811765ce82d 100644 (file)
@@ -28,7 +28,7 @@ static atomic_t stop_flag;
 class WatchNotifyTestCtx : public WatchCtx
 {
 public:
-    void notify(uint8_t opcode, uint64_t ver, bufferlist& bl)
+    void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) override
     {
       sem_post(sem);
     }
@@ -42,7 +42,7 @@ struct WatcherUnwatcher : public Thread {
   string pool;
   explicit WatcherUnwatcher(string& _pool) : pool(_pool) {}
 
-  void *entry() {
+  void *entry() override {
     Rados cluster;
     connect_cluster_pp(cluster);
     while (!stop_flag.read()) {
index db297f63db9766852f948ffe7f72b5660ebd684e..394b9892aaa8572211aa157982710048c87ed7bd 100644 (file)
@@ -25,7 +25,7 @@
 #define dout_prefix *_dout
 
 struct Foo : public Thread {
-  void *entry() {
+  void *entry() override {
     dout(0) << "foo started" << dendl;
     sleep(1);
     dout(0) << "foo asserting 0" << dendl;
index c34f8c54042079c06d853dc3aa23cd6faed65320..f13bf41dd68809369476e4cccd388d259882de84 100644 (file)
@@ -26,13 +26,13 @@ protected:
   // for filling up an ItemList
   Refs refs;
 
-  virtual void SetUp() {
+  void SetUp() override {
     for (int i = 0; i < 13; i++) {
       items.push_back(new Item(i));
       refs.push_back(&items.back()->xitem);
     }
   }
-  virtual void TearDown() {
+  void TearDown() override {
     for (Items::iterator i = items.begin(); i != items.end(); ++i) {
       delete *i;
     }
index 2e016925fa157f31280b01d160ad1747b5bba381..4e5f1a79253d4785bc58dd9a1348e13f93be7441 100644 (file)
@@ -66,7 +66,7 @@ public:
     (*in_progress)++;
   }
 
-  void finish(int r) {
+  void finish(int r) override {
     Mutex::Locker l(*lock);
     (*in_progress)--;
     cond->Signal();
index d7d1319f6c35bc915d0eb820f3f7b91ba73cfe9f..2e96d8950becf1b448f2e300ef016d40a67fdb20 100644 (file)
@@ -266,7 +266,7 @@ struct lookup_ghobject : public action_on_object_t {
   lookup_ghobject(const string& name, const boost::optional<std::string>& nspace, bool need_snapset = false) : _name(name),
                  _namespace(nspace), _need_snapset(need_snapset) { }
 
-  virtual int call(ObjectStore *store, coll_t coll, ghobject_t &ghobj, object_info_t &oi) {
+  int call(ObjectStore *store, coll_t coll, ghobject_t &ghobj, object_info_t &oi) override {
     if (_need_snapset && !ghobj.hobj.has_snapset())
       return 0;
     if ((_name.length() == 0 || ghobj.hobj.oid.name == _name) &&
@@ -1829,8 +1829,8 @@ struct do_fix_lost : public action_on_object_t {
 
   explicit do_fix_lost(ObjectStore::Sequencer *_osr) : osr(_osr) {}
 
-  virtual int call(ObjectStore *store, coll_t coll,
-                  ghobject_t &ghobj, object_info_t &oi) {
+  int call(ObjectStore *store, coll_t coll,
+                  ghobject_t &ghobj, object_info_t &oi) override {
     if (oi.is_lost()) {
       cout << coll << "/" << ghobj << " is lost";
       if (!dry_run)
index c460bbdd61887247c897805c0a54164cd51e099c..5a100e264eeda9d83d0b58fd61912da504ea0e11 100644 (file)
@@ -493,11 +493,11 @@ class RadosWatchCtx : public librados::WatchCtx2 {
   string name;
 public:
   RadosWatchCtx(IoCtx& io, const char *imgname) : ioctx(io), name(imgname) {}
-  virtual ~RadosWatchCtx() {}
+  ~RadosWatchCtx() {}
   void handle_notify(uint64_t notify_id,
                     uint64_t cookie,
                     uint64_t notifier_id,
-                    bufferlist& bl) {
+                    bufferlist& bl) override {
     cout << "NOTIFY"
         << " cookie " << cookie
         << " notify_id " << notify_id
@@ -506,7 +506,7 @@ public:
     bl.hexdump(cout);
     ioctx.notify_ack(name, notify_id, cookie, bl);
   }
-  void handle_error(uint64_t cookie, int err) {
+  void handle_error(uint64_t cookie, int err) override {
     cout << "ERROR"
         << " cookie " << cookie
         << " err " << cpp_strerror(err)
@@ -886,15 +886,15 @@ class RadosBencher : public ObjBencher {
   OpWriteDest write_destination;
 
 protected:
-  int completions_init(int concurrentios) {
+  int completions_init(int concurrentios) override {
     completions = new librados::AioCompletion *[concurrentios];
     return 0;
   }
-  void completions_done() {
+  void completions_done() override {
     delete[] completions;
     completions = NULL;
   }
-  int create_completion(int slot, void (*cb)(void *, void*), void *arg) {
+  int create_completion(int slot, void (*cb)(void *, void*), void *arg) override {
     completions[slot] = rados.aio_create_completion((void *) arg, 0, cb);
 
     if (!completions[slot])
@@ -902,18 +902,18 @@ protected:
 
     return 0;
   }
-  void release_completion(int slot) {
+  void release_completion(int slot) override {
     completions[slot]->release();
     completions[slot] = 0;
   }
 
   int aio_read(const std::string& oid, int slot, bufferlist *pbl, size_t len,
-              size_t offset) {
+              size_t offset) override {
     return io_ctx.aio_read(oid, completions[slot], pbl, len, 0);
   }
 
   int aio_write(const std::string& oid, int slot, bufferlist& bl, size_t len,
-               size_t offset) {
+               size_t offset) override {
     librados::ObjectWriteOperation op;
 
     if (write_destination & OP_WRITE_DEST_OBJ) {
@@ -941,33 +941,33 @@ protected:
     return io_ctx.aio_operate(oid, completions[slot], &op);
   }
 
-  int aio_remove(const std::string& oid, int slot) {
+  int aio_remove(const std::string& oid, int slot) override {
     return io_ctx.aio_remove(oid, completions[slot]);
   }
 
-  int sync_read(const std::string& oid, bufferlist& bl, size_t len) {
+  int sync_read(const std::string& oid, bufferlist& bl, size_t len) override {
     return io_ctx.read(oid, bl, len, 0);
   }
-  int sync_write(const std::string& oid, bufferlist& bl, size_t len) {
+  int sync_write(const std::string& oid, bufferlist& bl, size_t len) override {
     return io_ctx.write_full(oid, bl);
   }
 
-  int sync_remove(const std::string& oid) {
+  int sync_remove(const std::string& oid) override {
     return io_ctx.remove(oid);
   }
 
-  bool completion_is_done(int slot) {
+  bool completion_is_done(int slot) override {
     return completions[slot]->is_safe();
   }
 
-  int completion_wait(int slot) {
+  int completion_wait(int slot) override {
     return completions[slot]->wait_for_safe_and_cb();
   }
-  int completion_ret(int slot) {
+  int completion_ret(int slot) override {
     return completions[slot]->get_return_value();
   }
 
-  bool get_objects(std::list<Object>* objects, int num) {
+  bool get_objects(std::list<Object>* objects, int num) override {
     int count = 0;
 
     if (!iterator_valid) {
@@ -992,7 +992,7 @@ protected:
     return true;
   }
 
-  void set_namespace( const std::string& ns) {
+  void set_namespace( const std::string& ns) override {
     io_ctx.set_namespace(ns);
   }
 
index f91424467878097896cbb330f6d71072fa36fb70..9d6077461bdbaf1f75e17e243593e36134a2fc0a 100644 (file)
@@ -38,7 +38,7 @@ void buf_to_hex(const unsigned char *buf, int len, char *str)
 class C_Watch : public WatchCtx {
 public:
   C_Watch() {}
-  void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) {
+  void notify(uint8_t opcode, uint64_t ver, bufferlist& bl) override {
     cout << "C_Watch::notify() opcode=" << (int)opcode << " ver=" << ver << std::endl;
   }
 };