From cdc88879e0499a7b539b8bd3e2f76fcf2fcff477 Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Wed, 15 Feb 2017 21:15:38 +0800 Subject: [PATCH] rgw: add override in rgw subsystem Fixes: http://tracker.ceph.com/issues/18922 Signed-off-by: liuchang0812 --- src/cls/rgw/cls_rgw_client.cc | 4 +- src/rgw/librgw.cc | 2 +- src/rgw/rgw_auth.cc | 10 ++--- src/rgw/rgw_bucket.cc | 34 +++++++-------- src/rgw/rgw_coroutine.cc | 2 +- src/rgw/rgw_data_sync.cc | 58 +++++++++++++------------- src/rgw/rgw_log.cc | 2 +- src/rgw/rgw_main.cc | 2 +- src/rgw/rgw_metadata.cc | 18 ++++---- src/rgw/rgw_op.cc | 10 ++--- src/rgw/rgw_policy_s3.cc | 4 +- src/rgw/rgw_quota.cc | 62 ++++++++++++++-------------- src/rgw/rgw_rados.cc | 52 +++++++++++------------ src/rgw/rgw_realm_reloader.cc | 2 +- src/rgw/rgw_rest_bucket.cc | 42 +++++++++---------- src/rgw/rgw_rest_client.cc | 4 +- src/rgw/rgw_rest_realm.cc | 4 +- src/rgw/rgw_rest_s3.cc | 8 ++-- src/rgw/rgw_rest_usage.cc | 12 +++--- src/rgw/rgw_rest_user.cc | 78 +++++++++++++++++------------------ src/rgw/rgw_sync.cc | 48 ++++++++++----------- src/rgw/rgw_user.cc | 18 ++++---- 22 files changed, 238 insertions(+), 238 deletions(-) diff --git a/src/cls/rgw/cls_rgw_client.cc b/src/cls/rgw/cls_rgw_client.cc index 437c888098c..e981abd5624 100644 --- a/src/cls/rgw/cls_rgw_client.cc +++ b/src/cls/rgw/cls_rgw_client.cc @@ -25,7 +25,7 @@ private: public: ClsBucketIndexOpCtx(T* _data, int *_ret_code) : data(_data), ret_code(_ret_code) { assert(data); } ~ClsBucketIndexOpCtx() {} - void handle_completion(int r, bufferlist& outbl) { + void handle_completion(int r, bufferlist& outbl) override { if (r >= 0) { try { bufferlist::iterator iter = outbl.begin(); @@ -523,7 +523,7 @@ public: ~GetDirHeaderCompletion() { ret_ctx->put(); } - void handle_completion(int r, bufferlist& outbl) { + void handle_completion(int r, bufferlist& outbl) override { struct rgw_cls_list_ret ret; try { bufferlist::iterator iter = outbl.begin(); diff --git a/src/rgw/librgw.cc b/src/rgw/librgw.cc index 2ee969267e7..4150a6f9dc6 100644 --- a/src/rgw/librgw.cc +++ b/src/rgw/librgw.cc @@ -70,7 +70,7 @@ namespace rgw { class C_InitTimeout : public Context { public: C_InitTimeout() {} - void finish(int r) { + void finish(int r) override { derr << "Initialization timeout, failed to initialize" << dendl; exit(1); } diff --git a/src/rgw/rgw_auth.cc b/src/rgw/rgw_auth.cc index fb623d6cca6..af8ce42cf38 100644 --- a/src/rgw/rgw_auth.cc +++ b/src/rgw/rgw_auth.cc @@ -41,23 +41,23 @@ rgw_auth_transform_old_authinfo(req_state * const s) is_admin(is_admin) { } - uint32_t get_perms_from_aclspec(const aclspec_t& aclspec) const { + uint32_t get_perms_from_aclspec(const aclspec_t& aclspec) const override { return rgw_perms_from_aclspec_default_strategy(id, aclspec); } - bool is_admin_of(const rgw_user& acct_id) const { + bool is_admin_of(const rgw_user& acct_id) const override { return is_admin; } - bool is_owner_of(const rgw_user& acct_id) const { + bool is_owner_of(const rgw_user& acct_id) const override { return id == acct_id; } - uint32_t get_perm_mask() const { + uint32_t get_perm_mask() const override { return perm_mask; } - void to_str(std::ostream& out) const { + void to_str(std::ostream& out) const override { out << "RGWDummyIdentityApplier(auth_id=" << id << ", perm_mask=" << perm_mask << ", is_admin=" << is_admin << ")"; diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index a1ec0f0a0b0..88e8a5d1532 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1924,9 +1924,9 @@ void RGWBucketCompleteInfo::decode_json(JSONObj *obj) { class RGWBucketMetadataHandler : public RGWMetadataHandler { public: - string get_type() { return "bucket"; } + string get_type() override { return "bucket"; } - int get(RGWRados *store, string& entry, RGWMetadataObject **obj) { + int get(RGWRados *store, string& entry, RGWMetadataObject **obj) override { RGWObjVersionTracker ot; RGWBucketEntryPoint be; @@ -1948,7 +1948,7 @@ public: } int put(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker, - real_time mtime, JSONObj *obj, sync_type_t sync_type) { + real_time mtime, JSONObj *obj, sync_type_t sync_type) override { RGWBucketEntryPoint be, old_be; try { decode_json_obj(be, obj); @@ -1996,7 +1996,7 @@ public: RGWListRawObjsCtx ctx; }; - int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) { + int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) override { RGWBucketEntryPoint be; RGWObjectCtx obj_ctx(store); @@ -2024,12 +2024,12 @@ public: return 0; } - void get_pool_and_oid(RGWRados *store, const string& key, rgw_bucket& bucket, string& oid) { + void get_pool_and_oid(RGWRados *store, const string& key, rgw_bucket& bucket, string& oid) override { oid = key; bucket = store->get_zone_params().domain_root; } - int list_keys_init(RGWRados *store, void **phandle) + int list_keys_init(RGWRados *store, void **phandle) override { list_keys_info *info = new list_keys_info; @@ -2040,7 +2040,7 @@ public: return 0; } - int list_keys_next(void *handle, int max, list& keys, bool *truncated) { + int list_keys_next(void *handle, int max, list& keys, bool *truncated) override { list_keys_info *info = static_cast(handle); string no_filter; @@ -2074,7 +2074,7 @@ public: return 0; } - void list_keys_complete(void *handle) { + void list_keys_complete(void *handle) override { list_keys_info *info = static_cast(handle); delete info; } @@ -2083,9 +2083,9 @@ public: class RGWBucketInstanceMetadataHandler : public RGWMetadataHandler { public: - string get_type() { return "bucket.instance"; } + string get_type() override { return "bucket.instance"; } - int get(RGWRados *store, string& oid, RGWMetadataObject **obj) { + int get(RGWRados *store, string& oid, RGWMetadataObject **obj) override { RGWBucketCompleteInfo bci; real_time mtime; @@ -2103,7 +2103,7 @@ public: } int put(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker, - real_time mtime, JSONObj *obj, sync_type_t sync_type) { + real_time mtime, JSONObj *obj, sync_type_t sync_type) override { RGWBucketCompleteInfo bci, old_bci; try { decode_json_obj(bci, obj); @@ -2178,7 +2178,7 @@ public: RGWListRawObjsCtx ctx; }; - int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) { + int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) override { RGWBucketInfo info; RGWObjectCtx obj_ctx(store); @@ -2189,13 +2189,13 @@ public: return rgw_bucket_instance_remove_entry(store, entry, &info.objv_tracker); } - void get_pool_and_oid(RGWRados *store, const string& key, rgw_bucket& bucket, string& oid) { + void get_pool_and_oid(RGWRados *store, const string& key, rgw_bucket& bucket, string& oid) override { oid = RGW_BUCKET_INSTANCE_MD_PREFIX + key; rgw_bucket_instance_key_to_oid(oid); bucket = store->get_zone_params().domain_root; } - int list_keys_init(RGWRados *store, void **phandle) + int list_keys_init(RGWRados *store, void **phandle) override { list_keys_info *info = new list_keys_info; @@ -2206,7 +2206,7 @@ public: return 0; } - int list_keys_next(void *handle, int max, list& keys, bool *truncated) { + int list_keys_next(void *handle, int max, list& keys, bool *truncated) override { list_keys_info *info = static_cast(handle); string no_filter; @@ -2243,7 +2243,7 @@ public: return 0; } - void list_keys_complete(void *handle) { + void list_keys_complete(void *handle) override { list_keys_info *info = static_cast(handle); delete info; } @@ -2253,7 +2253,7 @@ public: * point, so that the log entries end up at the same log shard, so that we process them * in order */ - virtual void get_hash_key(const string& section, const string& key, string& hash_key) { + void get_hash_key(const string& section, const string& key, string& hash_key) override { string k; int pos = key.find(':'); if (pos < 0) diff --git a/src/rgw/rgw_coroutine.cc b/src/rgw/rgw_coroutine.cc index eccae8b1a8c..85ad290d020 100644 --- a/src/rgw/rgw_coroutine.cc +++ b/src/rgw/rgw_coroutine.cc @@ -14,7 +14,7 @@ class RGWCompletionManager::WaitContext : public Context { void *opaque; public: WaitContext(RGWCompletionManager *_cm, void *_opaque) : manager(_cm), opaque(_opaque) {} - void finish(int r) { + void finish(int r) override { manager->_wakeup(opaque); } }; diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 607cd6be374..c3c5a2b749c 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -213,7 +213,7 @@ public: } } - int operate() { + int operate() override { reenter(this) { yield { char buf[16]; @@ -292,7 +292,7 @@ public: } } - int operate() { + int operate() override { reenter(this) { yield { char buf[16]; @@ -349,7 +349,7 @@ public: map *_datalog_info) : RGWShardCollectCR(_sync_env->cct, READ_DATALOG_MAX_CONCURRENT), sync_env(_sync_env), num_shards(_num_shards), datalog_info(_datalog_info), shard_id(0) {} - bool spawn_next(); + bool spawn_next() override; }; bool RGWReadRemoteDataLogInfoCR::spawn_next() { @@ -377,7 +377,7 @@ public: : RGWSimpleCoroutine(env->store->ctx()), sync_env(env), http_op(NULL), shard_id(_shard_id), marker(_marker), max_entries(_max_entries), result(_result) {} - int send_request() { + int send_request() override { RGWRESTConn *conn = sync_env->conn; RGWRados *store = sync_env->store; @@ -411,7 +411,7 @@ public: return 0; } - int request_complete() { + int request_complete() override { int ret = http_op->wait(result); http_op->put(); if (ret < 0 && ret != -ENOENT) { @@ -442,7 +442,7 @@ public: shards.swap(_shards); iter = shards.begin(); } - bool spawn_next(); + bool spawn_next() override; }; bool RGWListRemoteDataLogCR::spawn_next() { @@ -482,7 +482,7 @@ public: sync_status_oid = RGWDataSyncStatusManager::sync_status_oid(sync_env->source_zone); } - int operate() { + int operate() override { int ret; reenter(this) { yield { @@ -713,7 +713,7 @@ public: delete entries_index; } - int operate() { + int operate() override { reenter(this) { entries_index = new RGWShardedOmapCRManager(sync_env->async_rados, store, this, num_shards, store->get_zone_params().log_pool, @@ -798,7 +798,7 @@ class RGWDataSyncShardMarkerTrack : public RGWSyncShardMarkerTrack key_to_marker; map marker_to_key; - void handle_finish(const string& marker) { + void handle_finish(const string& marker) override { map::iterator iter = marker_to_key.find(marker); if (iter == marker_to_key.end()) { return; @@ -816,7 +816,7 @@ public: marker_oid(_marker_oid), sync_marker(_marker) {} - RGWCoroutine *store_marker(const string& new_marker, uint64_t index_pos, const real_time& timestamp) { + RGWCoroutine *store_marker(const string& new_marker, uint64_t index_pos, const real_time& timestamp) override { sync_marker.marker = new_marker; sync_marker.pos = index_pos; @@ -900,7 +900,7 @@ public: } } - int operate(); + int operate() override; }; class RGWDataSyncSingleEntryCR : public RGWCoroutine { @@ -934,7 +934,7 @@ public: set_description() << "data sync single entry (source_zone=" << sync_env->source_zone << ") key=" <<_raw_key << " entry=" << entry_marker; } - int operate() { + int operate() override { reenter(this) { do { yield { @@ -1099,7 +1099,7 @@ public: marker_tracker = mt; } - int operate() { + int operate() override { int r; while (true) { switch (sync_marker.state) { @@ -1353,11 +1353,11 @@ public: sync_marker(_marker) { } - RGWCoroutine *alloc_cr() { + RGWCoroutine *alloc_cr() override { return new RGWDataSyncShardCR(sync_env, pool, shard_id, sync_marker, backoff_ptr()); } - RGWCoroutine *alloc_finisher_cr() { + RGWCoroutine *alloc_finisher_cr() override { RGWRados *store = sync_env->store; return new RGWSimpleRadosReadCR(sync_env->async_rados, store, store->get_zone_params().log_pool, RGWDataSyncStatusManager::shard_obj_name(sync_env->source_zone, shard_id), &sync_marker); @@ -1404,7 +1404,7 @@ public: } } - int operate() { + int operate() override { reenter(this) { /* read sync status */ @@ -1554,7 +1554,7 @@ public: sync_env(_sync_env), num_shards(_num_shards) { } - RGWCoroutine *alloc_cr() { + RGWCoroutine *alloc_cr() override { return new RGWDataSyncCR(sync_env, num_shards, backoff_ptr()); } @@ -1731,7 +1731,7 @@ public: : RGWCoroutine(_sync_env->cct), sync_env(_sync_env), instance_key(bs.get_key()), info(_info) {} - int operate() { + int operate() override { reenter(this) { yield { rgw_http_param_pair pairs[] = { { "type" , "bucket-index" }, @@ -1769,7 +1769,7 @@ public: status(_status) {} - int operate() { + int operate() override { reenter(this) { /* fetch current position in logs */ yield call(new RGWReadRemoteBucketIndexLogInfoCR(sync_env, bs, &info)); @@ -1857,7 +1857,7 @@ public: : RGWCoroutine(_sync_env->cct), sync_env(_sync_env), oid(RGWBucketSyncStatusManager::status_oid(sync_env->source_zone, bs)), status(_status) {} - int operate(); + int operate() override; }; int RGWReadBucketSyncStatusCoroutine::operate() @@ -1975,7 +1975,7 @@ public: instance_key(bs.get_key()), marker_position(_marker_position), result(_result) {} - int operate() { + int operate() override { reenter(this) { yield { rgw_http_param_pair pairs[] = { { "rgwx-bucket-instance", instance_key.c_str() }, @@ -2011,7 +2011,7 @@ public: : RGWCoroutine(_sync_env->cct), sync_env(_sync_env), instance_key(bs.get_key()), marker(_marker), result(_result) {} - int operate() { + int operate() override { reenter(this) { yield { rgw_http_param_pair pairs[] = { { "bucket-instance", instance_key.c_str() }, @@ -2047,7 +2047,7 @@ public: marker_oid(_marker_oid), sync_marker(_marker) {} - RGWCoroutine *store_marker(const rgw_obj_key& new_marker, uint64_t index_pos, const real_time& timestamp) { + RGWCoroutine *store_marker(const rgw_obj_key& new_marker, uint64_t index_pos, const real_time& timestamp) override { sync_marker.position = new_marker; sync_marker.count = index_pos; @@ -2071,7 +2071,7 @@ class RGWBucketIncSyncShardMarkerTrack : public RGWSyncShardMarkerTrack key_to_marker; map marker_to_key; - void handle_finish(const string& marker) { + void handle_finish(const string& marker) override { map::iterator iter = marker_to_key.find(marker); if (iter == marker_to_key.end()) { return; @@ -2089,7 +2089,7 @@ public: marker_oid(_marker_oid), sync_marker(_marker) {} - RGWCoroutine *store_marker(const string& new_marker, uint64_t index_pos, const real_time& timestamp) { + RGWCoroutine *store_marker(const string& new_marker, uint64_t index_pos, const real_time& timestamp) override { sync_marker.position = new_marker; map attrs; @@ -2185,7 +2185,7 @@ public: data_sync_module = sync_env->sync_module->get_data_handler(); } - int operate() { + int operate() override { reenter(this) { /* skip entries that are not complete */ if (op_state != CLS_RGW_STATE_COMPLETE) { @@ -2302,7 +2302,7 @@ public: logger.init(sync_env, "BucketFull", bs.get_key()); } - int operate(); + int operate() override; }; int RGWBucketShardFullSyncCR::operate() @@ -2450,7 +2450,7 @@ public: logger.init(sync_env, "BucketInc", bs.get_key()); } - int operate(); + int operate() override; }; int RGWBucketShardIncrementalSyncCR::operate() @@ -3045,7 +3045,7 @@ class DataLogTrimPollCR : public RGWCoroutine { last_trim(num_shards) {} - int operate(); + int operate() override; }; int DataLogTrimPollCR::operate() diff --git a/src/rgw/rgw_log.cc b/src/rgw/rgw_log.cc index b8cbcb5ae16..a6b60ffe5bb 100644 --- a/src/rgw/rgw_log.cc +++ b/src/rgw/rgw_log.cc @@ -98,7 +98,7 @@ class UsageLogger { UsageLogger *logger; public: explicit C_UsageLogTimeout(UsageLogger *_l) : logger(_l) {} - void finish(int r) { + void finish(int r) override { logger->flush(); logger->set_timer(); } diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 437f68e2de7..793ed27afa6 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -149,7 +149,7 @@ static void check_curl() class C_InitTimeout : public Context { public: C_InitTimeout() {} - void finish(int r) { + void finish(int r) override { derr << "Initialization timeout, failed to initialize" << dendl; exit(1); } diff --git a/src/rgw/rgw_metadata.cc b/src/rgw/rgw_metadata.cc index 57568873b41..5c65bcb869d 100644 --- a/src/rgw/rgw_metadata.cc +++ b/src/rgw/rgw_metadata.cc @@ -274,17 +274,17 @@ class RGWMetadataTopHandler : public RGWMetadataHandler { public: RGWMetadataTopHandler() {} - virtual string get_type() { return string(); } + string get_type() override { return string(); } - virtual int get(RGWRados *store, string& entry, RGWMetadataObject **obj) { return -ENOTSUP; } - virtual int put(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker, - real_time mtime, JSONObj *obj, sync_type_t sync_type) { return -ENOTSUP; } + int get(RGWRados *store, string& entry, RGWMetadataObject **obj) override { return -ENOTSUP; } + int put(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker, + real_time mtime, JSONObj *obj, sync_type_t sync_type) override { return -ENOTSUP; } - virtual void get_pool_and_oid(RGWRados *store, const string& key, rgw_bucket& bucket, string& oid) {} + void get_pool_and_oid(RGWRados *store, const string& key, rgw_bucket& bucket, string& oid) override {} - virtual int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) { return -ENOTSUP; } + int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) override { return -ENOTSUP; } - virtual int list_keys_init(RGWRados *store, void **phandle) { + int list_keys_init(RGWRados *store, void **phandle) override { iter_data *data = new iter_data; store->meta_mgr->get_sections(data->sections); data->iter = data->sections.begin(); @@ -293,7 +293,7 @@ public: return 0; } - virtual int list_keys_next(void *handle, int max, list& keys, bool *truncated) { + int list_keys_next(void *handle, int max, list& keys, bool *truncated) override { iter_data *data = static_cast(handle); for (int i = 0; i < max && data->iter != data->sections.end(); ++i, ++(data->iter)) { keys.push_back(*data->iter); @@ -303,7 +303,7 @@ public: return 0; } - virtual void list_keys_complete(void *handle) { + void list_keys_complete(void *handle) override { iter_data *data = static_cast(handle); delete data; diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index dd7fc693c2a..6cf90893320 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -62,7 +62,7 @@ static int forward_request_to_master(struct req_state *s, obj_version *objv, RGW class MultipartMetaFilter : public RGWAccessListFilter { public: MultipartMetaFilter() {} - bool filter(string& name, string& key) { + bool filter(string& name, string& key) override { int len = name.size(); if (len < 6) return false; @@ -2576,14 +2576,14 @@ class RGWPutObjProcessor_Multipart : public RGWPutObjProcessor_Atomic string upload_id; protected: - int prepare(RGWRados *store, string *oid_rand); + int prepare(RGWRados *store, string *oid_rand) override; int do_complete(size_t accounted_size, const string& etag, real_time *mtime, real_time set_mtime, map& attrs, real_time delete_at, const char *if_match, const char *if_nomatch) override; public: - bool immutable_head() { return true; } + bool immutable_head() override { return true; } RGWPutObjProcessor_Multipart(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, uint64_t _p, req_state *_s) : RGWPutObjProcessor_Atomic(obj_ctx, bucket_info, _s->bucket, _s->object.name, _p, _s->req_id, false), s(_s) {} }; @@ -2757,9 +2757,9 @@ class RGWPutObj_CB : public RGWGetDataCB RGWPutObj *op; public: RGWPutObj_CB(RGWPutObj *_op) : op(_op) {} - virtual ~RGWPutObj_CB() {} + ~RGWPutObj_CB() {} - int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) { + int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) override { return op->get_data_cb(bl, bl_ofs, bl_len); } }; diff --git a/src/rgw/rgw_policy_s3.cc b/src/rgw/rgw_policy_s3.cc index de5d97ae3dd..b242142ed32 100644 --- a/src/rgw/rgw_policy_s3.cc +++ b/src/rgw/rgw_policy_s3.cc @@ -47,7 +47,7 @@ public: class RGWPolicyCondition_StrEqual : public RGWPolicyCondition { protected: - bool check(const string& first, const string& second, string& msg) { + bool check(const string& first, const string& second, string& msg) override { bool ret = first.compare(second) == 0; if (!ret) { msg = "Policy condition failed: eq"; @@ -58,7 +58,7 @@ protected: class RGWPolicyCondition_StrStartsWith : public RGWPolicyCondition { protected: - bool check(const string& first, const string& second, string& msg) { + bool check(const string& first, const string& second, string& msg) override { bool ret = first.compare(0, second.size(), second) == 0; if (!ret) { msg = "Policy condition failed: starts-with"; diff --git a/src/rgw/rgw_quota.cc b/src/rgw/rgw_quota.cc index c364c27cbca..d1dd9e812c2 100644 --- a/src/rgw/rgw_quota.cc +++ b/src/rgw/rgw_quota.cc @@ -49,7 +49,7 @@ protected: uint64_t removed_bytes; public: StatsAsyncTestSet() : objs_delta(0), added_bytes(0), removed_bytes(0) {} - bool update(RGWQuotaCacheStats *entry) { + bool update(RGWQuotaCacheStats *entry) override { if (entry->async_refresh_time.sec() == 0) return false; @@ -258,9 +258,9 @@ public: RGWQuotaCache::AsyncRefreshHandler(_store, _cache), RGWGetBucketStats_CB(_bucket), user(_user) {} - void drop_reference() { put(); } - void handle_response(int r); - int init_fetch(); + void drop_reference() override { put(); } + void handle_response(int r) override; + int init_fetch() override; }; int BucketAsyncRefreshHandler::init_fetch() @@ -300,25 +300,25 @@ void BucketAsyncRefreshHandler::handle_response(const int r) class RGWBucketStatsCache : public RGWQuotaCache { protected: - bool map_find(const rgw_user& user, rgw_bucket& bucket, RGWQuotaCacheStats& qs) { + bool map_find(const rgw_user& user, rgw_bucket& bucket, RGWQuotaCacheStats& qs) override { return stats_map.find(bucket, qs); } - bool map_find_and_update(const rgw_user& user, rgw_bucket& bucket, lru_map::UpdateContext *ctx) { + bool map_find_and_update(const rgw_user& user, rgw_bucket& bucket, lru_map::UpdateContext *ctx) override { return stats_map.find_and_update(bucket, NULL, ctx); } - void map_add(const rgw_user& user, rgw_bucket& bucket, RGWQuotaCacheStats& qs) { + void map_add(const rgw_user& user, rgw_bucket& bucket, RGWQuotaCacheStats& qs) override { stats_map.add(bucket, qs); } - int fetch_stats_from_storage(const rgw_user& user, rgw_bucket& bucket, RGWStorageStats& stats); + int fetch_stats_from_storage(const rgw_user& user, rgw_bucket& bucket, RGWStorageStats& stats) override; public: explicit RGWBucketStatsCache(RGWRados *_store) : RGWQuotaCache(_store, _store->ctx()->_conf->rgw_bucket_quota_cache_size) { } - AsyncRefreshHandler *allocate_refresh_handler(const rgw_user& user, rgw_bucket& bucket) { + AsyncRefreshHandler *allocate_refresh_handler(const rgw_user& user, rgw_bucket& bucket) override { return new BucketAsyncRefreshHandler(store, this, user, bucket); } }; @@ -362,9 +362,9 @@ public: RGWGetUserStats_CB(_user), bucket(_bucket) {} - void drop_reference() { put(); } - int init_fetch(); - void handle_response(int r); + void drop_reference() override { put(); } + int init_fetch() override; + void handle_response(int r) override; }; int UserAsyncRefreshHandler::init_fetch() @@ -407,7 +407,7 @@ class RGWUserStatsCache : public RGWQuotaCache { BucketsSyncThread(CephContext *_cct, RGWUserStatsCache *_s) : cct(_cct), stats(_s), lock("RGWUserStatsCache::BucketsSyncThread") {} - void *entry() { + void *entry() override { ldout(cct, 20) << "BucketsSyncThread: start" << dendl; do { map buckets; @@ -459,7 +459,7 @@ class RGWUserStatsCache : public RGWQuotaCache { UserSyncThread(CephContext *_cct, RGWUserStatsCache *_s) : cct(_cct), stats(_s), lock("RGWUserStatsCache::UserSyncThread") {} - void *entry() { + void *entry() override { ldout(cct, 20) << "UserSyncThread: start" << dendl; do { int ret = stats->sync_all_users(); @@ -485,24 +485,24 @@ class RGWUserStatsCache : public RGWQuotaCache { BucketsSyncThread *buckets_sync_thread; UserSyncThread *user_sync_thread; protected: - bool map_find(const rgw_user& user, rgw_bucket& bucket, RGWQuotaCacheStats& qs) { + bool map_find(const rgw_user& user, rgw_bucket& bucket, RGWQuotaCacheStats& qs) override { return stats_map.find(user, qs); } - bool map_find_and_update(const rgw_user& user, rgw_bucket& bucket, lru_map::UpdateContext *ctx) { + bool map_find_and_update(const rgw_user& user, rgw_bucket& bucket, lru_map::UpdateContext *ctx) override { return stats_map.find_and_update(user, NULL, ctx); } - void map_add(const rgw_user& user, rgw_bucket& bucket, RGWQuotaCacheStats& qs) { + void map_add(const rgw_user& user, rgw_bucket& bucket, RGWQuotaCacheStats& qs) override { stats_map.add(user, qs); } - int fetch_stats_from_storage(const rgw_user& user, rgw_bucket& bucket, RGWStorageStats& stats); + int fetch_stats_from_storage(const rgw_user& user, rgw_bucket& bucket, RGWStorageStats& stats) override; int sync_bucket(const rgw_user& rgw_user, rgw_bucket& bucket); int sync_user(const rgw_user& user); int sync_all_users(); - void data_modified(const rgw_user& user, rgw_bucket& bucket); + void data_modified(const rgw_user& user, rgw_bucket& bucket) override; void swap_modified_buckets(map& out) { rwlock.get_write(); @@ -539,11 +539,11 @@ public: stop(); } - AsyncRefreshHandler *allocate_refresh_handler(const rgw_user& user, rgw_bucket& bucket) { + AsyncRefreshHandler *allocate_refresh_handler(const rgw_user& user, rgw_bucket& bucket) override { return new UserAsyncRefreshHandler(store, this, user, bucket); } - bool can_use_cached_stats(RGWQuotaInfo& quota, RGWStorageStats& stats) { + bool can_use_cached_stats(RGWQuotaInfo& quota, RGWStorageStats& stats) override { /* in the user case, the cached stats may contain a better estimation of the totals, as * the backend is only periodically getting updated. */ @@ -697,28 +697,28 @@ public: class RGWQuotaInfoDefApplier : public RGWQuotaInfoApplier { public: - virtual bool is_size_exceeded(const char * const entity, + bool is_size_exceeded(const char * const entity, const RGWQuotaInfo& qinfo, const RGWStorageStats& stats, - const uint64_t size) const; + const uint64_t size) const override; - virtual bool is_num_objs_exceeded(const char * const entity, + bool is_num_objs_exceeded(const char * const entity, const RGWQuotaInfo& qinfo, const RGWStorageStats& stats, - const uint64_t num_objs) const; + const uint64_t num_objs) const override; }; class RGWQuotaInfoRawApplier : public RGWQuotaInfoApplier { public: - virtual bool is_size_exceeded(const char * const entity, + bool is_size_exceeded(const char * const entity, const RGWQuotaInfo& qinfo, const RGWStorageStats& stats, - const uint64_t size) const; + const uint64_t size) const override; - virtual bool is_num_objs_exceeded(const char * const entity, + bool is_num_objs_exceeded(const char * const entity, const RGWQuotaInfo& qinfo, const RGWStorageStats& stats, - const uint64_t num_objs) const; + const uint64_t num_objs) const override; }; @@ -860,7 +860,7 @@ public: bucket_stats_cache(_store), user_stats_cache(_store, quota_threads) {} - virtual int check_quota(const rgw_user& user, + int check_quota(const rgw_user& user, rgw_bucket& bucket, RGWQuotaInfo& user_quota, RGWQuotaInfo& bucket_quota, @@ -905,7 +905,7 @@ public: return 0; } - virtual void update_stats(const rgw_user& user, rgw_bucket& bucket, int obj_delta, uint64_t added_bytes, uint64_t removed_bytes) { + void update_stats(const rgw_user& user, rgw_bucket& bucket, int obj_delta, uint64_t added_bytes, uint64_t removed_bytes) override { bucket_stats_cache.adjust_stats(user, bucket, obj_delta, added_bytes, removed_bytes); user_stats_cache.adjust_stats(user, bucket, obj_delta, added_bytes, removed_bytes); } diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 45ffb6d5beb..38851437623 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -2640,7 +2640,7 @@ class RGWWatcher : public librados::WatchCtx2 { RGWWatcher *watcher; public: explicit C_ReinitWatch(RGWWatcher *_watcher) : watcher(_watcher) {} - void finish(int r) { + void finish(int r) override { watcher->reinit(); } }; @@ -2649,7 +2649,7 @@ public: void handle_notify(uint64_t notify_id, uint64_t cookie, uint64_t notifier_id, - bufferlist& bl) { + bufferlist& bl) override { ldout(rados->ctx(), 10) << "RGWWatcher::handle_notify() " << " notify_id " << notify_id << " cookie " << cookie @@ -2660,7 +2660,7 @@ public: bufferlist reply_bl; // empty reply payload rados->control_pool_ctx.notify_ack(oid, notify_id, cookie, reply_bl); } - void handle_error(uint64_t cookie, int err) { + void handle_error(uint64_t cookie, int err) override { lderr(rados->ctx()) << "RGWWatcher::handle_error cookie " << cookie << " err " << cpp_strerror(err) << dendl; rados->remove_watcher(index); @@ -2832,7 +2832,7 @@ class RGWRadosThread { public: Worker(CephContext *_cct, RGWRadosThread *_p) : cct(_cct), processor(_p), lock("RGWRadosThread::Worker") {} - void *entry(); + void *entry() override; void stop() { Mutex::Locker l(lock); cond.Signal(); @@ -2928,14 +2928,14 @@ class RGWMetaNotifier : public RGWRadosThread { RGWMetaNotifierManager notify_mgr; RGWMetadataLog *const log; - uint64_t interval_msec() { + uint64_t interval_msec() override { return cct->_conf->rgw_md_notify_interval_msec; } public: RGWMetaNotifier(RGWRados *_store, RGWMetadataLog* log) : RGWRadosThread(_store), notify_mgr(_store), log(log) {} - int process(); + int process() override; }; int RGWMetaNotifier::process() @@ -2960,13 +2960,13 @@ int RGWMetaNotifier::process() class RGWDataNotifier : public RGWRadosThread { RGWDataNotifierManager notify_mgr; - uint64_t interval_msec() { + uint64_t interval_msec() override { return cct->_conf->rgw_md_notify_interval_msec; } public: RGWDataNotifier(RGWRados *_store) : RGWRadosThread(_store), notify_mgr(_store) {} - int process(); + int process() override; }; int RGWDataNotifier::process() @@ -2995,19 +2995,19 @@ int RGWDataNotifier::process() class RGWSyncProcessorThread : public RGWRadosThread { public: RGWSyncProcessorThread(RGWRados *_store) : RGWRadosThread(_store) {} - virtual ~RGWSyncProcessorThread() {} - virtual int init() = 0 ; - virtual int process() = 0; + ~RGWSyncProcessorThread() {} + int init() override = 0 ; + int process() override = 0; }; class RGWMetaSyncProcessorThread : public RGWSyncProcessorThread { RGWMetaSyncStatusManager sync; - uint64_t interval_msec() { + uint64_t interval_msec() override { return 0; /* no interval associated, it'll run once until stopped */ } - void stop_process() { + void stop_process() override { sync.stop(); } public: @@ -3021,7 +3021,7 @@ public: } RGWMetaSyncStatusManager* get_manager() { return &sync; } - int init() { + int init() override { int ret = sync.init(); if (ret < 0) { ldout(store->ctx(), 0) << "ERROR: sync.init() returned " << ret << dendl; @@ -3030,7 +3030,7 @@ public: return 0; } - int process() { + int process() override { sync.run(); return 0; } @@ -3041,7 +3041,7 @@ class RGWDataSyncProcessorThread : public RGWSyncProcessorThread RGWDataSyncStatusManager sync; bool initialized; - uint64_t interval_msec() { + uint64_t interval_msec() override { if (initialized) { return 0; /* no interval associated, it'll run once until stopped */ } else { @@ -3049,7 +3049,7 @@ class RGWDataSyncProcessorThread : public RGWSyncProcessorThread return DATA_SYNC_INIT_WAIT_SEC * 1000; } } - void stop_process() { + void stop_process() override { sync.stop(); } public: @@ -3065,11 +3065,11 @@ public: } RGWDataSyncStatusManager* get_manager() { return &sync; } - int init() { + int init() override { return 0; } - int process() { + int process() override { while (!initialized) { if (going_down()) { return 0; @@ -6767,7 +6767,7 @@ public: progress_data(_progress_data), extra_data_len(0), data_len(0) {} - int handle_data(bufferlist& bl, off_t ofs, off_t len) { + int handle_data(bufferlist& bl, off_t ofs, off_t len) override { if (progress_cb) { progress_cb(ofs, progress_data); } @@ -6826,7 +6826,7 @@ public: bufferlist& get_extra_data() { return extra_data_bl; } - void set_extra_data_len(uint64_t len) { + void set_extra_data_len(uint64_t len) override { extra_data_len = len; } @@ -6972,7 +6972,7 @@ class RGWGetExtraDataCB : public RGWGetDataCB { bufferlist extra_data; public: RGWGetExtraDataCB() {} - int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) { + int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) override { if (extra_data.length() < extra_data_len) { off_t max = extra_data_len - extra_data.length(); if (max > bl_len) { @@ -9700,7 +9700,7 @@ struct get_obj_data : public RefCountedObject { total_read(0), lock("get_obj_data"), data_lock("get_obj_data::data_lock"), client_cb(NULL), throttle(cct, "get_obj_data", cct->_conf->rgw_get_obj_window_size, false) {} - virtual ~get_obj_data() { } + ~get_obj_data() { } void set_cancelled(int r) { cancelled.set(1); err_code.set(r); @@ -10983,7 +10983,7 @@ public: : cb(_cb), pendings(_pendings), stats(), ret_code(0), should_cb(true), lock("RGWGetBucketStatsContext") {} - void handle_response(int r, rgw_bucket_dir_header& header) { + void handle_response(int r, rgw_bucket_dir_header& header) override { Mutex::Locker l(lock); if (should_cb) { if ( r >= 0) { @@ -11039,7 +11039,7 @@ public: explicit RGWGetUserStatsContext(RGWGetUserStats_CB * const cb) : cb(cb) {} - void handle_response(int r, cls_user_header& header) { + void handle_response(int r, cls_user_header& header) override { const cls_user_stats& hs = header.stats; if (r >= 0) { RGWStorageStats stats; @@ -11580,7 +11580,7 @@ struct RGWAccessListFilterPrefix : public RGWAccessListFilter { string prefix; explicit RGWAccessListFilterPrefix(const string& _prefix) : prefix(_prefix) {} - virtual bool filter(string& name, string& key) { + bool filter(string& name, string& key) override { return (prefix.compare(key.substr(0, prefix.size())) == 0); } }; diff --git a/src/rgw/rgw_realm_reloader.cc b/src/rgw/rgw_realm_reloader.cc index 4edf347742b..a1d17831798 100644 --- a/src/rgw/rgw_realm_reloader.cc +++ b/src/rgw/rgw_realm_reloader.cc @@ -41,7 +41,7 @@ class RGWRealmReloader::C_Reload : public Context { RGWRealmReloader* reloader; public: C_Reload(RGWRealmReloader* reloader) : reloader(reloader) {} - void finish(int r) { reloader->reload(); } + void finish(int r) override { reloader->reload(); } }; void RGWRealmReloader::handle_notify(RGWRealmNotify type, diff --git a/src/rgw/rgw_rest_bucket.cc b/src/rgw/rgw_rest_bucket.cc index bf14b1ee52e..62252ca6cc3 100644 --- a/src/rgw/rgw_rest_bucket.cc +++ b/src/rgw/rgw_rest_bucket.cc @@ -14,13 +14,13 @@ class RGWOp_Bucket_Info : public RGWRESTOp { public: RGWOp_Bucket_Info() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("buckets", RGW_CAP_READ); } - void execute(); + void execute() override; - virtual const string name() { return "get_bucket_info"; } + const string name() override { return "get_bucket_info"; } }; void RGWOp_Bucket_Info::execute() @@ -51,13 +51,13 @@ class RGWOp_Get_Policy : public RGWRESTOp { public: RGWOp_Get_Policy() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("buckets", RGW_CAP_READ); } - void execute(); + void execute() override; - virtual const string name() { return "get_policy"; } + const string name() override { return "get_policy"; } }; void RGWOp_Get_Policy::execute() @@ -81,13 +81,13 @@ class RGWOp_Check_Bucket_Index : public RGWRESTOp { public: RGWOp_Check_Bucket_Index() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("buckets", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "check_bucket_index"; } + const string name() override { return "check_bucket_index"; } }; void RGWOp_Check_Bucket_Index::execute() @@ -115,13 +115,13 @@ class RGWOp_Bucket_Link : public RGWRESTOp { public: RGWOp_Bucket_Link() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("buckets", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "link_bucket"; } + const string name() override { return "link_bucket"; } }; void RGWOp_Bucket_Link::execute() @@ -149,13 +149,13 @@ class RGWOp_Bucket_Unlink : public RGWRESTOp { public: RGWOp_Bucket_Unlink() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("buckets", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "unlink_bucket"; } + const string name() override { return "unlink_bucket"; } }; void RGWOp_Bucket_Unlink::execute() @@ -181,13 +181,13 @@ class RGWOp_Bucket_Remove : public RGWRESTOp { public: RGWOp_Bucket_Remove() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("buckets", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "remove_bucket"; } + const string name() override { return "remove_bucket"; } }; void RGWOp_Bucket_Remove::execute() @@ -211,13 +211,13 @@ class RGWOp_Object_Remove: public RGWRESTOp { public: RGWOp_Object_Remove() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("buckets", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "remove_object"; } + const string name() override { return "remove_object"; } }; void RGWOp_Object_Remove::execute() diff --git a/src/rgw/rgw_rest_client.cc b/src/rgw/rgw_rest_client.cc index f02b17a97a5..907640a9840 100644 --- a/src/rgw/rgw_rest_client.cc +++ b/src/rgw/rgw_rest_client.cc @@ -319,7 +319,7 @@ class RGWRESTStreamOutCB : public RGWGetDataCB { RGWRESTStreamWriteRequest *req; public: explicit RGWRESTStreamOutCB(RGWRESTStreamWriteRequest *_req) : req(_req) {} - int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len); /* callback for object iteration when sending data */ + int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) override; /* callback for object iteration when sending data */ }; int RGWRESTStreamOutCB::handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) @@ -797,7 +797,7 @@ class StreamIntoBufferlist : public RGWGetDataCB { bufferlist& bl; public: StreamIntoBufferlist(bufferlist& _bl) : bl(_bl) {} - int handle_data(bufferlist& inbl, off_t bl_ofs, off_t bl_len) { + int handle_data(bufferlist& inbl, off_t bl_ofs, off_t bl_len) override { bl.claim_append(inbl); return bl_len; } diff --git a/src/rgw/rgw_rest_realm.cc b/src/rgw/rgw_rest_realm.cc index 99fd60b1d06..b4cde344c8e 100644 --- a/src/rgw/rgw_rest_realm.cc +++ b/src/rgw/rgw_rest_realm.cc @@ -242,7 +242,7 @@ public: int verify_permission() override { return 0; } void execute() override; void send_response() override; - const string name() { return "get_realm"; } + const string name() override { return "get_realm"; } }; void RGWOp_Realm_Get::execute() @@ -277,7 +277,7 @@ void RGWOp_Realm_Get::send_response() class RGWHandler_Realm : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get() { return new RGWOp_Realm_Get; } + RGWOp *op_get() override { return new RGWOp_Realm_Get; } }; RGWRESTMgr_Realm::RGWRESTMgr_Realm() diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 7acaab32d5f..0174c123fae 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -698,7 +698,7 @@ void RGWGetBucketVersioning_ObjStore_S3::send_response() class RGWSetBucketVersioningParser : public RGWXMLParser { - XMLObj *alloc_obj(const char *el) { + XMLObj *alloc_obj(const char *el) override { return new XMLObj; } @@ -901,7 +901,7 @@ class RGWLocationConstraint : public XMLObj public: RGWLocationConstraint() {} ~RGWLocationConstraint() {} - bool xml_end(const char *el) { + bool xml_end(const char *el) override { if (!el) return false; @@ -922,7 +922,7 @@ public: class RGWCreateBucketParser : public RGWXMLParser { - XMLObj *alloc_obj(const char *el) { + XMLObj *alloc_obj(const char *el) override { return new XMLObj; } @@ -2545,7 +2545,7 @@ void RGWGetRequestPayment_ObjStore_S3::send_response() class RGWSetRequestPaymentParser : public RGWXMLParser { - XMLObj *alloc_obj(const char *el) { + XMLObj *alloc_obj(const char *el) override { return new XMLObj; } diff --git a/src/rgw/rgw_rest_usage.cc b/src/rgw/rgw_rest_usage.cc index 6073429256a..ea4430e3c11 100644 --- a/src/rgw/rgw_rest_usage.cc +++ b/src/rgw/rgw_rest_usage.cc @@ -14,12 +14,12 @@ class RGWOp_Usage_Get : public RGWRESTOp { public: RGWOp_Usage_Get() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("usage", RGW_CAP_READ); } - void execute(); + void execute() override; - virtual const string name() { return "get_usage"; } + const string name() override { return "get_usage"; } }; void RGWOp_Usage_Get::execute() { @@ -58,12 +58,12 @@ class RGWOp_Usage_Delete : public RGWRESTOp { public: RGWOp_Usage_Delete() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("usage", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "trim_usage"; } + const string name() override { return "trim_usage"; } }; void RGWOp_Usage_Delete::execute() { diff --git a/src/rgw/rgw_rest_user.cc b/src/rgw/rgw_rest_user.cc index ec869d6638d..e92cef009c5 100644 --- a/src/rgw/rgw_rest_user.cc +++ b/src/rgw/rgw_rest_user.cc @@ -17,13 +17,13 @@ class RGWOp_User_Info : public RGWRESTOp { public: RGWOp_User_Info() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_READ); } - void execute(); + void execute() override; - virtual const string name() { return "get_user_info"; } + const string name() override { return "get_user_info"; } }; void RGWOp_User_Info::execute() @@ -58,13 +58,13 @@ class RGWOp_User_Create : public RGWRESTOp { public: RGWOp_User_Create() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "create_user"; } + const string name() override { return "create_user"; } }; void RGWOp_User_Create::execute() @@ -191,13 +191,13 @@ class RGWOp_User_Modify : public RGWRESTOp { public: RGWOp_User_Modify() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "modify_user"; } + const string name() override { return "modify_user"; } }; void RGWOp_User_Modify::execute() @@ -287,13 +287,13 @@ class RGWOp_User_Remove : public RGWRESTOp { public: RGWOp_User_Remove() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "remove_user"; } + const string name() override { return "remove_user"; } }; void RGWOp_User_Remove::execute() @@ -322,13 +322,13 @@ class RGWOp_Subuser_Create : public RGWRESTOp { public: RGWOp_Subuser_Create() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "create_subuser"; } + const string name() override { return "create_subuser"; } }; void RGWOp_Subuser_Create::execute() @@ -401,13 +401,13 @@ class RGWOp_Subuser_Modify : public RGWRESTOp { public: RGWOp_Subuser_Modify() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "modify_subuser"; } + const string name() override { return "modify_subuser"; } }; void RGWOp_Subuser_Modify::execute() @@ -466,13 +466,13 @@ class RGWOp_Subuser_Remove : public RGWRESTOp { public: RGWOp_Subuser_Remove() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "remove_subuser"; } + const string name() override { return "remove_subuser"; } }; void RGWOp_Subuser_Remove::execute() @@ -507,13 +507,13 @@ class RGWOp_Key_Create : public RGWRESTOp { public: RGWOp_Key_Create() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "create_access_key"; } + const string name() override { return "create_access_key"; } }; void RGWOp_Key_Create::execute() @@ -571,13 +571,13 @@ class RGWOp_Key_Remove : public RGWRESTOp { public: RGWOp_Key_Remove() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "remove_access_key"; } + const string name() override { return "remove_access_key"; } }; void RGWOp_Key_Remove::execute() @@ -624,13 +624,13 @@ class RGWOp_Caps_Add : public RGWRESTOp { public: RGWOp_Caps_Add() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "add_user_caps"; } + const string name() override { return "add_user_caps"; } }; void RGWOp_Caps_Add::execute() @@ -660,13 +660,13 @@ class RGWOp_Caps_Remove : public RGWRESTOp { public: RGWOp_Caps_Remove() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "remove_user_caps"; } + const string name() override { return "remove_user_caps"; } }; void RGWOp_Caps_Remove::execute() @@ -715,13 +715,13 @@ class RGWOp_Quota_Info : public RGWRESTOp { public: RGWOp_Quota_Info() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_READ); } - void execute(); + void execute() override; - virtual const string name() { return "get_quota_info"; } + const string name() override { return "get_quota_info"; } }; @@ -782,13 +782,13 @@ class RGWOp_Quota_Set : public RGWRESTOp { public: RGWOp_Quota_Set() {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("users", RGW_CAP_WRITE); } - void execute(); + void execute() override; - virtual const string name() { return "set_quota_info"; } + const string name() override { return "set_quota_info"; } }; /** diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index d7d83eb659a..e6da6e8c880 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -195,7 +195,7 @@ public: sync_env(_sync_env), period(period), num_shards(_num_shards), mdlog_info(_mdlog_info), shard_id(0) {} - bool spawn_next(); + bool spawn_next() override; }; class RGWListRemoteMDLogCR : public RGWShardCollectCR { @@ -220,7 +220,7 @@ public: shards.swap(_shards); iter = shards.begin(); } - bool spawn_next(); + bool spawn_next() override; }; RGWRemoteMetaLog::~RGWRemoteMetaLog() @@ -377,7 +377,7 @@ class RGWAsyncReadMDLogEntries : public RGWAsyncRadosRequest { bool *truncated; protected: - int _send_request() { + int _send_request() override { real_time from_time; real_time end_time; @@ -427,7 +427,7 @@ public: } } - int send_request() { + int send_request() override { marker = *pmarker; req = new RGWAsyncReadMDLogEntries(this, stack->create_completion_notifier(), sync_env->store, mdlog, shard_id, &marker, @@ -436,7 +436,7 @@ public: return 0; } - int request_complete() { + int request_complete() override { int ret = req->get_ret_status(); if (ret >= 0 && !entries->empty()) { *pmarker = marker; @@ -460,7 +460,7 @@ public: : RGWCoroutine(env->store->ctx()), env(env), http_op(NULL), period(period), shard_id(_shard_id), shard_info(_shard_info) {} - int operate() { + int operate() override { auto store = env->store; RGWRESTConn *conn = store->rest_master_conn; reenter(this) { @@ -520,7 +520,7 @@ public: : RGWSimpleCoroutine(env->store->ctx()), sync_env(env), http_op(NULL), period(period), shard_id(_shard_id), marker(_marker), max_entries(_max_entries), result(_result) {} - int send_request() { + int send_request() override { RGWRESTConn *conn = sync_env->conn; RGWRados *store = sync_env->store; @@ -555,7 +555,7 @@ public: return 0; } - int request_complete() { + int request_complete() override { int ret = http_op->wait(result); http_op->put(); if (ret < 0 && ret != -ENOENT) { @@ -606,7 +606,7 @@ public: } } - int operate() { + int operate() override { int ret; reenter(this) { yield { @@ -702,7 +702,7 @@ public: } - int handle_data(rgw_meta_sync_info& data); + int handle_data(rgw_meta_sync_info& data) override; }; int RGWReadSyncStatusCoroutine::handle_data(rgw_meta_sync_info& data) @@ -781,7 +781,7 @@ public: std::back_inserter(sections)); } - int operate() { + int operate() override { RGWRESTConn *conn = sync_env->conn; reenter(this) { @@ -928,7 +928,7 @@ public: pbl(_pbl) { } - int operate() { + int operate() override { RGWRESTConn *conn = sync_env->conn; reenter(this) { yield { @@ -969,7 +969,7 @@ class RGWAsyncMetaStoreEntry : public RGWAsyncRadosRequest { string raw_key; bufferlist bl; protected: - int _send_request() { + int _send_request() override { int ret = store->meta_mgr->put(raw_key, bl, RGWMetadataHandler::APPLY_ALWAYS); if (ret < 0) { ldout(store->ctx(), 0) << "ERROR: can't store key: " << raw_key << " ret=" << ret << dendl; @@ -1005,14 +1005,14 @@ public: } } - int send_request() { + int send_request() override { req = new RGWAsyncMetaStoreEntry(this, stack->create_completion_notifier(), sync_env->store, raw_key, bl); sync_env->async_rados->queue(req); return 0; } - int request_complete() { + int request_complete() override { return req->get_ret_status(); } }; @@ -1021,7 +1021,7 @@ class RGWAsyncMetaRemoveEntry : public RGWAsyncRadosRequest { RGWRados *store; string raw_key; protected: - int _send_request() { + int _send_request() override { int ret = store->meta_mgr->remove(raw_key); if (ret < 0) { ldout(store->ctx(), 0) << "ERROR: can't remove key: " << raw_key << " ret=" << ret << dendl; @@ -1054,14 +1054,14 @@ public: } } - int send_request() { + int send_request() override { req = new RGWAsyncMetaRemoveEntry(this, stack->create_completion_notifier(), sync_env->store, raw_key); sync_env->async_rados->queue(req); return 0; } - int request_complete() { + int request_complete() override { int r = req->get_ret_status(); if (r == -ENOENT) { r = 0; @@ -1087,7 +1087,7 @@ public: marker_oid(_marker_oid), sync_marker(_marker) {} - RGWCoroutine *store_marker(const string& new_marker, uint64_t index_pos, const real_time& timestamp) { + RGWCoroutine *store_marker(const string& new_marker, uint64_t index_pos, const real_time& timestamp) override { sync_marker.marker = new_marker; if (index_pos > 0) { sync_marker.pos = index_pos; @@ -1220,7 +1220,7 @@ public: } } - int operate(); + int operate() override; int state_init(); int state_read_shard_status(); @@ -1305,7 +1305,7 @@ public: marker_tracker = mt; } - int operate() { + int operate() override { int r; while (true) { switch (sync_marker.state) { @@ -1654,12 +1654,12 @@ public: pool(_pool), period(period), mdlog(mdlog), shard_id(_shard_id), sync_marker(_marker), period_marker(std::move(period_marker)) {} - RGWCoroutine *alloc_cr() { + RGWCoroutine *alloc_cr() override { return new RGWMetaSyncShardCR(sync_env, pool, period, mdlog, shard_id, sync_marker, period_marker, backoff_ptr()); } - RGWCoroutine *alloc_finisher_cr() { + RGWCoroutine *alloc_finisher_cr() override { RGWRados *store = sync_env->store; return new RGWSimpleRadosReadCR(sync_env->async_rados, store, pool, sync_env->shard_obj_name(shard_id), &sync_marker); @@ -1691,7 +1691,7 @@ public: pool(sync_env->store->get_zone_params().log_pool), cursor(cursor), sync_status(_sync_status) {} - int operate() { + int operate() override { reenter(this) { // loop through one period at a time for (;;) { diff --git a/src/rgw/rgw_user.cc b/src/rgw/rgw_user.cc index ef490a8923f..7ee8eb7813c 100644 --- a/src/rgw/rgw_user.cc +++ b/src/rgw/rgw_user.cc @@ -2616,16 +2616,16 @@ public: mtime = m; } - void dump(Formatter *f) const { + void dump(Formatter *f) const override { uci.dump(f); } }; class RGWUserMetadataHandler : public RGWMetadataHandler { public: - string get_type() { return "user"; } + string get_type() override { return "user"; } - int get(RGWRados *store, string& entry, RGWMetadataObject **obj) { + int get(RGWRados *store, string& entry, RGWMetadataObject **obj) override { RGWUserCompleteInfo uci; RGWObjVersionTracker objv_tracker; real_time mtime; @@ -2645,7 +2645,7 @@ public: } int put(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker, - real_time mtime, JSONObj *obj, sync_type_t sync_mode) { + real_time mtime, JSONObj *obj, sync_type_t sync_mode) override { RGWUserCompleteInfo uci; try { @@ -2687,7 +2687,7 @@ public: RGWListRawObjsCtx ctx; }; - int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) { + int remove(RGWRados *store, string& entry, RGWObjVersionTracker& objv_tracker) override { RGWUserInfo info; rgw_user uid(entry); @@ -2699,12 +2699,12 @@ public: return rgw_delete_user(store, info, objv_tracker); } - void get_pool_and_oid(RGWRados *store, const string& key, rgw_bucket& bucket, string& oid) { + void get_pool_and_oid(RGWRados *store, const string& key, rgw_bucket& bucket, string& oid) override { oid = key; bucket = store->get_zone_params().user_uid_pool; } - int list_keys_init(RGWRados *store, void **phandle) + int list_keys_init(RGWRados *store, void **phandle) override { list_keys_info *info = new list_keys_info; @@ -2715,7 +2715,7 @@ public: return 0; } - int list_keys_next(void *handle, int max, list& keys, bool *truncated) { + int list_keys_next(void *handle, int max, list& keys, bool *truncated) override { list_keys_info *info = static_cast(handle); string no_filter; @@ -2749,7 +2749,7 @@ public: return 0; } - void list_keys_complete(void *handle) { + void list_keys_complete(void *handle) override { list_keys_info *info = static_cast(handle); delete info; } -- 2.39.5