From 3b247475a2c35526c129535021adfa621ecb5327 Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Wed, 22 Feb 2017 17:46:46 +0800 Subject: rgw/cleanup: add override in headers Signed-off-by: liuchang0812 --- src/rgw/rgw_acl_s3.cc | 8 +- src/rgw/rgw_acl_s3.h | 26 +- src/rgw/rgw_acl_swift.h | 4 +- src/rgw/rgw_asio_client.h | 2 +- src/rgw/rgw_asio_frontend.h | 2 +- src/rgw/rgw_auth.h | 2 +- src/rgw/rgw_bucket.h | 6 +- src/rgw/rgw_cache.h | 22 +- src/rgw/rgw_civetweb.h | 2 +- src/rgw/rgw_client_io.h | 4 +- src/rgw/rgw_compression.h | 10 +- src/rgw/rgw_coroutine.h | 16 +- src/rgw/rgw_cors_s3.cc | 12 +- src/rgw/rgw_cors_s3.h | 10 +- src/rgw/rgw_cr_rados.h | 156 +++++----- src/rgw/rgw_cr_rest.h | 24 +- src/rgw/rgw_data_sync.cc | 12 +- src/rgw/rgw_file.h | 172 +++++------ src/rgw/rgw_formats.h | 44 +-- src/rgw/rgw_frontend.h | 14 +- src/rgw/rgw_gc.h | 2 +- src/rgw/rgw_http_client.h | 8 +- src/rgw/rgw_keystone.h | 6 +- src/rgw/rgw_lc.h | 2 +- src/rgw/rgw_lc_s3.h | 28 +- src/rgw/rgw_lib.h | 12 +- src/rgw/rgw_lib_frontend.h | 8 +- src/rgw/rgw_log.h | 4 +- src/rgw/rgw_metadata.h | 2 +- src/rgw/rgw_multi.h | 16 +- src/rgw/rgw_multi_del.h | 18 +- src/rgw/rgw_object_expirer_core.h | 2 +- src/rgw/rgw_op.cc | 2 +- src/rgw/rgw_op.h | 612 +++++++++++++++++++------------------- src/rgw/rgw_period_pusher.h | 2 +- src/rgw/rgw_process.h | 20 +- src/rgw/rgw_quota.cc | 2 +- src/rgw/rgw_rados.cc | 4 +- src/rgw/rgw_rados.h | 70 ++--- src/rgw/rgw_realm_reloader.h | 2 +- src/rgw/rgw_realm_watcher.h | 2 +- src/rgw/rgw_request.h | 2 +- src/rgw/rgw_rest.h | 108 +++---- src/rgw/rgw_rest_admin.h | 2 +- src/rgw/rgw_rest_bucket.h | 14 +- src/rgw/rgw_rest_client.h | 18 +- src/rgw/rgw_rest_config.h | 18 +- src/rgw/rgw_rest_conn.h | 2 +- src/rgw/rgw_rest_log.h | 180 +++++------ src/rgw/rgw_rest_metadata.h | 66 ++-- src/rgw/rgw_rest_opstate.h | 48 +-- src/rgw/rgw_rest_replica_log.h | 68 ++--- src/rgw/rgw_rest_role.h | 10 +- src/rgw/rgw_rest_s3.cc | 10 +- src/rgw/rgw_rest_s3.h | 268 ++++++++--------- src/rgw/rgw_rest_s3website.h | 40 +-- src/rgw/rgw_rest_swift.h | 148 ++++----- src/rgw/rgw_rest_usage.h | 10 +- src/rgw/rgw_rest_user.h | 14 +- src/rgw/rgw_swift_auth.h | 34 +-- src/rgw/rgw_sync.cc | 14 +- src/rgw/rgw_sync.h | 10 +- src/rgw/rgw_sync_module.h | 4 +- src/rgw/rgw_sync_module_es.cc | 4 +- src/rgw/rgw_sync_module_log.cc | 2 +- src/rgw/rgw_xml.h | 6 +- 66 files changed, 1236 insertions(+), 1236 deletions(-) (limited to 'src/rgw') diff --git a/src/rgw/rgw_acl_s3.cc b/src/rgw/rgw_acl_s3.cc index 64da1a870b8..0eb3a78a0e2 100644 --- a/src/rgw/rgw_acl_s3.cc +++ b/src/rgw/rgw_acl_s3.cc @@ -97,7 +97,7 @@ class ACLID_S3 : public XMLObj { public: ACLID_S3() {} - ~ACLID_S3() {} + ~ACLID_S3() override {} string& to_str() { return data; } }; @@ -105,21 +105,21 @@ class ACLURI_S3 : public XMLObj { public: ACLURI_S3() {} - ~ACLURI_S3() {} + ~ACLURI_S3() override {} }; class ACLEmail_S3 : public XMLObj { public: ACLEmail_S3() {} - ~ACLEmail_S3() {} + ~ACLEmail_S3() override {} }; class ACLDisplayName_S3 : public XMLObj { public: ACLDisplayName_S3() {} - ~ACLDisplayName_S3() {} + ~ACLDisplayName_S3() override {} }; bool ACLOwner_S3::xml_end(const char *el) { diff --git a/src/rgw/rgw_acl_s3.h b/src/rgw/rgw_acl_s3.h index 209a17bad46..3a52735e091 100644 --- a/src/rgw/rgw_acl_s3.h +++ b/src/rgw/rgw_acl_s3.h @@ -22,9 +22,9 @@ class ACLPermission_S3 : public ACLPermission, public XMLObj { public: ACLPermission_S3() {} - ~ACLPermission_S3() {} + ~ACLPermission_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(ostream& out); }; @@ -32,7 +32,7 @@ class ACLGrantee_S3 : public ACLGrantee, public XMLObj { public: ACLGrantee_S3() {} - ~ACLGrantee_S3() {} + ~ACLGrantee_S3() override {} bool xml_start(const char *el, const char **attr); }; @@ -42,10 +42,10 @@ class ACLGrant_S3 : public ACLGrant, public XMLObj { public: ACLGrant_S3() {} - ~ACLGrant_S3() {} + ~ACLGrant_S3() override {} void to_xml(CephContext *cct, ostream& out); - bool xml_end(const char *el); + bool xml_end(const char *el) override; bool xml_start(const char *el, const char **attr); static ACLGroupTypeEnum uri_to_group(string& uri); @@ -56,9 +56,9 @@ class RGWAccessControlList_S3 : public RGWAccessControlList, public XMLObj { public: explicit RGWAccessControlList_S3(CephContext *_cct) : RGWAccessControlList(_cct) {} - ~RGWAccessControlList_S3() {} + ~RGWAccessControlList_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(ostream& out); int create_canned(ACLOwner& owner, ACLOwner& bucket_owner, const string& canned_acl); @@ -69,9 +69,9 @@ class ACLOwner_S3 : public ACLOwner, public XMLObj { public: ACLOwner_S3() {} - ~ACLOwner_S3() {} + ~ACLOwner_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(ostream& out); }; @@ -81,13 +81,13 @@ class RGWAccessControlPolicy_S3 : public RGWAccessControlPolicy, public XMLObj { public: explicit RGWAccessControlPolicy_S3(CephContext *_cct) : RGWAccessControlPolicy(_cct) {} - ~RGWAccessControlPolicy_S3() {} + ~RGWAccessControlPolicy_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(ostream& out); int rebuild(RGWRados *store, ACLOwner *owner, RGWAccessControlPolicy& dest); - bool compare_group_name(string& id, ACLGroupTypeEnum group); + bool compare_group_name(string& id, ACLGroupTypeEnum group) override; virtual int create_canned(ACLOwner& _owner, ACLOwner& bucket_owner, string canned_acl) { RGWAccessControlList_S3& _acl = static_cast(acl); @@ -106,7 +106,7 @@ class RGWACLXMLParser_S3 : public RGWXMLParser { CephContext *cct; - XMLObj *alloc_obj(const char *el); + XMLObj *alloc_obj(const char *el) override; public: explicit RGWACLXMLParser_S3(CephContext *_cct) : cct(_cct) {} }; diff --git a/src/rgw/rgw_acl_swift.h b/src/rgw/rgw_acl_swift.h index e4ecd058283..b74a85ecfe1 100644 --- a/src/rgw/rgw_acl_swift.h +++ b/src/rgw/rgw_acl_swift.h @@ -21,7 +21,7 @@ public: explicit RGWAccessControlPolicy_SWIFT(CephContext* const cct) : RGWAccessControlPolicy(cct) { } - ~RGWAccessControlPolicy_SWIFT() = default; + ~RGWAccessControlPolicy_SWIFT() override = default; int create(RGWRados *store, const rgw_user& id, @@ -37,7 +37,7 @@ public: RGWAccessControlPolicy_SWIFTAcct(CephContext * const cct) : RGWAccessControlPolicy(cct) { } - ~RGWAccessControlPolicy_SWIFTAcct() {} + ~RGWAccessControlPolicy_SWIFTAcct() override {} void add_grants(RGWRados *store, const std::vector& uids, diff --git a/src/rgw/rgw_asio_client.h b/src/rgw/rgw_asio_client.h index cf65fb90f70..c87fd5f720b 100644 --- a/src/rgw/rgw_asio_client.h +++ b/src/rgw/rgw_asio_client.h @@ -46,7 +46,7 @@ class RGWAsioClientIO : public rgw::io::RestfulClient, public: RGWAsioClientIO(tcp::socket&& socket, request_type&& request); - ~RGWAsioClientIO(); + ~RGWAsioClientIO() override; void init_env(CephContext *cct) override; size_t complete_request() override; diff --git a/src/rgw/rgw_asio_frontend.h b/src/rgw/rgw_asio_frontend.h index c429e19db5c..1ffda891c25 100644 --- a/src/rgw/rgw_asio_frontend.h +++ b/src/rgw/rgw_asio_frontend.h @@ -12,7 +12,7 @@ class RGWAsioFrontend : public RGWFrontend { std::unique_ptr impl; public: RGWAsioFrontend(const RGWProcessEnv& env); - ~RGWAsioFrontend(); + ~RGWAsioFrontend() override; int init() override; int run() override; diff --git a/src/rgw/rgw_auth.h b/src/rgw/rgw_auth.h index 79d5263257a..52962b433fb 100644 --- a/src/rgw/rgw_auth.h +++ b/src/rgw/rgw_auth.h @@ -86,7 +86,7 @@ public: typedef std::unique_ptr aplptr_t; RGWAuthApplier(CephContext * const cct) : cct(cct) {} - virtual ~RGWAuthApplier() {}; + ~RGWAuthApplier() override {}; /* Fill provided RGWUserInfo with information about the account that * RGWOp will operate on. Errors are handled solely through exceptions. diff --git a/src/rgw/rgw_bucket.h b/src/rgw/rgw_bucket.h index 5497a0ddff4..ebc419beb14 100644 --- a/src/rgw/rgw_bucket.h +++ b/src/rgw/rgw_bucket.h @@ -74,7 +74,7 @@ public: mtime = m; } - void dump(Formatter *f) const { + void dump(Formatter *f) const override { ep.dump(f); } }; @@ -88,7 +88,7 @@ public: mtime = m; } - void dump(Formatter *f) const { + void dump(Formatter *f) const override { info.dump(f); } @@ -433,7 +433,7 @@ class RGWDataChangesLog { public: ChangesRenewThread(CephContext *_cct, RGWDataChangesLog *_log) : cct(_cct), log(_log), lock("ChangesRenewThread::lock") {} - void *entry(); + void *entry() override; void stop(); }; diff --git a/src/rgw/rgw_cache.h b/src/rgw/rgw_cache.h index 583bdc8c76c..05ae94adf94 100644 --- a/src/rgw/rgw_cache.h +++ b/src/rgw/rgw_cache.h @@ -194,7 +194,7 @@ class RGWCache : public T return normal_name(obj.pool, obj.oid); } - int init_rados() { + int init_rados() override { int ret; cache.set_ctx(T::cct); ret = T::init_rados(); @@ -204,7 +204,7 @@ class RGWCache : public T return 0; } - bool need_watch_notify() { + bool need_watch_notify() override { return true; } @@ -212,15 +212,15 @@ class RGWCache : public T int watch_cb(uint64_t notify_id, uint64_t cookie, uint64_t notifier_id, - bufferlist& bl); + bufferlist& bl) override; - void set_cache_enabled(bool state) { + void set_cache_enabled(bool state) override { cache.set_enabled(state); } public: RGWCache() {} - void register_chained_cache(RGWChainedCache *cc) { + void register_chained_cache(RGWChainedCache *cc) override { cache.chain_cache(cc); } @@ -232,21 +232,21 @@ public: map& attrs, int flags, bufferlist& data, RGWObjVersionTracker *objv_tracker, - real_time set_mtime); - int put_system_obj_data(void *ctx, rgw_raw_obj& obj, bufferlist& bl, off_t ofs, bool exclusive); + real_time set_mtime) override; + int put_system_obj_data(void *ctx, rgw_raw_obj& obj, bufferlist& bl, off_t ofs, bool exclusive) override; int get_system_obj(RGWObjectCtx& obj_ctx, RGWRados::SystemObject::Read::GetObjState& read_state, RGWObjVersionTracker *objv_tracker, rgw_raw_obj& obj, bufferlist& bl, off_t ofs, off_t end, map *attrs, - rgw_cache_entry_info *cache_info); + rgw_cache_entry_info *cache_info) override; int raw_obj_stat(rgw_raw_obj& obj, uint64_t *psize, real_time *pmtime, uint64_t *epoch, map *attrs, - bufferlist *first_chunk, RGWObjVersionTracker *objv_tracker); + bufferlist *first_chunk, RGWObjVersionTracker *objv_tracker) override; - int delete_system_obj(rgw_raw_obj& obj, RGWObjVersionTracker *objv_tracker); + int delete_system_obj(rgw_raw_obj& obj, RGWObjVersionTracker *objv_tracker) override; - bool chain_cache_entry(list& cache_info_entries, RGWChainedCache::Entry *chained_entry) { + bool chain_cache_entry(list& cache_info_entries, RGWChainedCache::Entry *chained_entry) override { return cache.chain_cache_entry(cache_info_entries, chained_entry); } }; diff --git a/src/rgw/rgw_civetweb.h b/src/rgw/rgw_civetweb.h index 2be7c2ed143..0160c03a42d 100644 --- a/src/rgw/rgw_civetweb.h +++ b/src/rgw/rgw_civetweb.h @@ -27,7 +27,7 @@ class RGWCivetWeb : public rgw::io::RestfulClient, size_t dump_date_header(); public: - void init_env(CephContext *cct); + void init_env(CephContext *cct) override; size_t send_status(int status, const char *status_name) override; size_t send_100_continue() override; diff --git a/src/rgw/rgw_client_io.h b/src/rgw/rgw_client_io.h index b468c7f9c35..474a1695067 100644 --- a/src/rgw/rgw_client_io.h +++ b/src/rgw/rgw_client_io.h @@ -322,7 +322,7 @@ class RGWRestfulIO : public rgw::io::AccountingFilter { SHA256 *sha256_hash; public: - virtual ~RGWRestfulIO() {} + ~RGWRestfulIO() override {} RGWRestfulIO(rgw::io::RestfulClient* engine) : AccountingFilter(std::move(engine)), @@ -374,7 +374,7 @@ public: setg(nullptr, nullptr, nullptr); } - std::streambuf::int_type underflow() { + std::streambuf::int_type underflow() override { if (gptr() < egptr()) { return traits_type::to_int_type(*gptr()); } diff --git a/src/rgw/rgw_compression.h b/src/rgw/rgw_compression.h index 214e596fd6a..6833dd77501 100644 --- a/src/rgw/rgw_compression.h +++ b/src/rgw/rgw_compression.h @@ -25,10 +25,10 @@ public: RGWCompressionInfo* cs_info_, bool partial_content_, RGWGetDataCB* next); - virtual ~RGWGetObj_Decompress() {} + ~RGWGetObj_Decompress() override {} - virtual int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) override; - virtual void fixup_range(off_t& ofs, off_t& end) override; + int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) override; + void fixup_range(off_t& ofs, off_t& end) override; }; @@ -42,8 +42,8 @@ public: RGWPutObj_Compress(CephContext* cct_, CompressorRef compressor, RGWPutObjDataProcessor* next) : RGWPutObj_Filter(next), cct(cct_), compressor(compressor) {} - virtual ~RGWPutObj_Compress(){} - virtual int handle_data(bufferlist& bl, off_t ofs, void **phandle, rgw_raw_obj *pobj, bool *again) override; + ~RGWPutObj_Compress() override{} + int handle_data(bufferlist& bl, off_t ofs, void **phandle, rgw_raw_obj *pobj, bool *again) override; bool is_compressed() { return compressed; } vector& get_compression_blocks() { return blocks; } diff --git a/src/rgw/rgw_coroutine.h b/src/rgw/rgw_coroutine.h index 124a2d3c60e..821ff55889a 100644 --- a/src/rgw/rgw_coroutine.h +++ b/src/rgw/rgw_coroutine.h @@ -50,7 +50,7 @@ protected: void _complete(RGWAioCompletionNotifier *cn, void *user_info); public: RGWCompletionManager(CephContext *_cct); - ~RGWCompletionManager(); + ~RGWCompletionManager() override; void complete(RGWAioCompletionNotifier *cn, void *user_info); int get_next(void **user_info); @@ -78,7 +78,7 @@ class RGWAioCompletionNotifier : public RefCountedObject { public: RGWAioCompletionNotifier(RGWCompletionManager *_mgr, void *_user_data); - ~RGWAioCompletionNotifier() { + ~RGWAioCompletionNotifier() override { c->release(); lock.Lock(); bool need_unregister = registered; @@ -235,7 +235,7 @@ protected: public: RGWCoroutine(CephContext *_cct) : status(_cct), _yield_ret(false), cct(_cct), stack(NULL), retcode(0), state(RGWCoroutine_Run) {} - virtual ~RGWCoroutine(); + ~RGWCoroutine() override; virtual int operate() = 0; @@ -371,7 +371,7 @@ protected: bool collect_next(RGWCoroutine *op, int *ret, RGWCoroutinesStack **collected_stack); /* returns true if found a stack to collect */ public: RGWCoroutinesStack(CephContext *_cct, RGWCoroutinesManager *_ops_mgr, RGWCoroutine *start = NULL); - ~RGWCoroutinesStack(); + ~RGWCoroutinesStack() override; int operate(RGWCoroutinesEnv *env); @@ -492,14 +492,14 @@ class RGWCoroutinesManagerRegistry : public RefCountedObject, public AdminSocket public: RGWCoroutinesManagerRegistry(CephContext *_cct) : cct(_cct), lock("RGWCoroutinesRegistry::lock") {} - ~RGWCoroutinesManagerRegistry(); + ~RGWCoroutinesManagerRegistry() override; void add(RGWCoroutinesManager *mgr); void remove(RGWCoroutinesManager *mgr); int hook_to_admin_command(const string& command); bool call(std::string command, cmdmap_t& cmdmap, std::string format, - bufferlist& out); + bufferlist& out) override; void dump(Formatter *f) const; }; @@ -562,7 +562,7 @@ public: class RGWSimpleCoroutine : public RGWCoroutine { bool called_cleanup; - int operate(); + int operate() override; int state_init(); int state_send_request(); @@ -573,7 +573,7 @@ class RGWSimpleCoroutine : public RGWCoroutine { public: RGWSimpleCoroutine(CephContext *_cct) : RGWCoroutine(_cct), called_cleanup(false) {} - ~RGWSimpleCoroutine(); + ~RGWSimpleCoroutine() override; virtual int init() { return 0; } virtual int send_request() = 0; diff --git a/src/rgw/rgw_cors_s3.cc b/src/rgw/rgw_cors_s3.cc index 162217909e2..e2ecdbc7191 100644 --- a/src/rgw/rgw_cors_s3.cc +++ b/src/rgw/rgw_cors_s3.cc @@ -184,37 +184,37 @@ bool RGWCORSConfiguration_S3::xml_end(const char *el) { class CORSRuleID_S3 : public XMLObj { public: CORSRuleID_S3() {} - ~CORSRuleID_S3() {} + ~CORSRuleID_S3() override {} }; class CORSRuleAllowedOrigin_S3 : public XMLObj { public: CORSRuleAllowedOrigin_S3() {} - ~CORSRuleAllowedOrigin_S3() {} + ~CORSRuleAllowedOrigin_S3() override {} }; class CORSRuleAllowedMethod_S3 : public XMLObj { public: CORSRuleAllowedMethod_S3() {} - ~CORSRuleAllowedMethod_S3() {} + ~CORSRuleAllowedMethod_S3() override {} }; class CORSRuleAllowedHeader_S3 : public XMLObj { public: CORSRuleAllowedHeader_S3() {} - ~CORSRuleAllowedHeader_S3() {} + ~CORSRuleAllowedHeader_S3() override {} }; class CORSRuleMaxAgeSeconds_S3 : public XMLObj { public: CORSRuleMaxAgeSeconds_S3() {} - ~CORSRuleMaxAgeSeconds_S3() {} + ~CORSRuleMaxAgeSeconds_S3() override {} }; class CORSRuleExposeHeader_S3 : public XMLObj { public: CORSRuleExposeHeader_S3() {} - ~CORSRuleExposeHeader_S3() {} + ~CORSRuleExposeHeader_S3() override {} }; XMLObj *RGWCORSXMLParser_S3::alloc_obj(const char *el) { diff --git a/src/rgw/rgw_cors_s3.h b/src/rgw/rgw_cors_s3.h index 818d02ffb47..cad423c10a2 100644 --- a/src/rgw/rgw_cors_s3.h +++ b/src/rgw/rgw_cors_s3.h @@ -31,9 +31,9 @@ class RGWCORSRule_S3 : public RGWCORSRule, public XMLObj { public: RGWCORSRule_S3() {} - ~RGWCORSRule_S3() {} + ~RGWCORSRule_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(XMLFormatter& f); }; @@ -41,9 +41,9 @@ class RGWCORSConfiguration_S3 : public RGWCORSConfiguration, public XMLObj { public: RGWCORSConfiguration_S3() {} - ~RGWCORSConfiguration_S3() {} + ~RGWCORSConfiguration_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(ostream& out); }; @@ -51,7 +51,7 @@ class RGWCORSXMLParser_S3 : public RGWXMLParser { CephContext *cct; - XMLObj *alloc_obj(const char *el); + XMLObj *alloc_obj(const char *el) override; public: explicit RGWCORSXMLParser_S3(CephContext *_cct) : cct(_cct) {} }; diff --git a/src/rgw/rgw_cr_rados.h b/src/rgw/rgw_cr_rados.h index b1e1a1fcdf9..8496201e0cd 100644 --- a/src/rgw/rgw_cr_rados.h +++ b/src/rgw/rgw_cr_rados.h @@ -20,7 +20,7 @@ public: RGWAsyncRadosRequest(RGWCoroutine *_caller, RGWAioCompletionNotifier *_cn) : caller(_caller), notifier(_cn), retcode(0), lock("RGWAsyncRadosRequest::lock") { } - virtual ~RGWAsyncRadosRequest() { + ~RGWAsyncRadosRequest() override { if (notifier) { notifier->put(); } @@ -68,16 +68,16 @@ protected: RGWWQ(RGWAsyncRadosProcessor *p, time_t timeout, time_t suicide_timeout, ThreadPool *tp) : ThreadPool::WorkQueue("RGWWQ", timeout, suicide_timeout, tp), processor(p) {} - bool _enqueue(RGWAsyncRadosRequest *req); - void _dequeue(RGWAsyncRadosRequest *req) { + bool _enqueue(RGWAsyncRadosRequest *req) override; + void _dequeue(RGWAsyncRadosRequest *req) override { ceph_abort(); } - bool _empty(); - RGWAsyncRadosRequest *_dequeue(); + bool _empty() override; + RGWAsyncRadosRequest *_dequeue() override; using ThreadPool::WorkQueue::_process; - void _process(RGWAsyncRadosRequest *req, ThreadPool::TPHandle& handle); + void _process(RGWAsyncRadosRequest *req, ThreadPool::TPHandle& handle) override; void _dump_queue(); - void _clear() { + void _clear() override { assert(processor->m_req_queue.empty()); } } req_wq; @@ -107,7 +107,7 @@ class RGWAsyncGetSystemObj : public RGWAsyncRadosRequest { off_t ofs; off_t end; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncGetSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, RGWObjectCtx *_obj_ctx, RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj, @@ -122,7 +122,7 @@ class RGWAsyncPutSystemObj : public RGWAsyncRadosRequest { bufferlist bl; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncPutSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, const rgw_raw_obj& _obj, bool _exclusive, @@ -136,7 +136,7 @@ class RGWAsyncPutSystemObjAttrs : public RGWAsyncRadosRequest { map *attrs; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncPutSystemObjAttrs(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj, @@ -151,7 +151,7 @@ class RGWAsyncLockSystemObj : public RGWAsyncRadosRequest { uint32_t duration_secs; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncLockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj, @@ -165,7 +165,7 @@ class RGWAsyncUnlockSystemObj : public RGWAsyncRadosRequest { string cookie; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncUnlockSystemObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, RGWObjVersionTracker *_objv_tracker, const rgw_raw_obj& _obj, @@ -197,19 +197,19 @@ public: : RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store), obj_ctx(store), obj(_obj), result(_result), empty_on_enoent(empty_on_enoent) {} - ~RGWSimpleRadosReadCR() { + ~RGWSimpleRadosReadCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { req->finish(); req = NULL; } } - int send_request(); - int request_complete(); + int send_request() override; + int request_complete() override; virtual int handle_data(T& data) { return 0; @@ -281,19 +281,19 @@ public: obj(_obj), pattrs(_pattrs), req(NULL) { } - ~RGWSimpleRadosReadAttrsCR() { + ~RGWSimpleRadosReadAttrsCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { req->finish(); req = NULL; } } - int send_request(); - int request_complete(); + int send_request() override; + int request_complete() override; }; template @@ -317,25 +317,25 @@ public: ::encode(_data, bl); } - ~RGWSimpleRadosWriteCR() { + ~RGWSimpleRadosWriteCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { req->finish(); req = NULL; } } - int send_request() { + int send_request() override { req = new RGWAsyncPutSystemObj(this, stack->create_completion_notifier(), store, obj, false, bl); async_rados->queue(req); return 0; } - int request_complete() { + int request_complete() override { return req->get_ret_status(); } }; @@ -359,25 +359,25 @@ public: obj(_obj), attrs(_attrs), req(NULL) { } - ~RGWSimpleRadosWriteAttrsCR() { + ~RGWSimpleRadosWriteAttrsCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { req->finish(); req = NULL; } } - int send_request() { + int send_request() override { req = new RGWAsyncPutSystemObjAttrs(this, stack->create_completion_notifier(), store, NULL, obj, &attrs); async_rados->queue(req); return 0; } - int request_complete() { + int request_complete() override { return req->get_ret_status(); } }; @@ -397,10 +397,10 @@ public: const rgw_raw_obj& _obj, map& _entries); - ~RGWRadosSetOmapKeysCR(); + ~RGWRadosSetOmapKeysCR() override; - int send_request(); - int request_complete(); + int send_request() override; + int request_complete() override; }; class RGWRadosGetOmapKeysCR : public RGWSimpleCoroutine { @@ -423,11 +423,11 @@ public: const string& _marker, map *_entries, int _max_entries); - ~RGWRadosGetOmapKeysCR(); + ~RGWRadosGetOmapKeysCR() override; - int send_request(); + int send_request() override; - int request_complete() { + int request_complete() override { return rval; } }; @@ -453,11 +453,11 @@ public: const rgw_raw_obj& _obj, const set& _keys); - ~RGWRadosRemoveOmapKeysCR(); + ~RGWRadosRemoveOmapKeysCR() override; - int send_request(); + int send_request() override; - int request_complete() { + int request_complete() override { return rval; } }; @@ -479,13 +479,13 @@ public: const string& _lock_name, const string& _cookie, uint32_t _duration); - ~RGWSimpleRadosLockCR() { + ~RGWSimpleRadosLockCR() override { request_cleanup(); } - void request_cleanup(); + void request_cleanup() override; - int send_request(); - int request_complete(); + int send_request() override; + int request_complete() override; static std::string gen_random_cookie(CephContext* cct) { #define COOKIE_LEN 16 @@ -510,13 +510,13 @@ public: const rgw_raw_obj& _obj, const string& _lock_name, const string& _cookie); - ~RGWSimpleRadosUnlockCR() { + ~RGWSimpleRadosUnlockCR() override { request_cleanup(); } - void request_cleanup(); + void request_cleanup() override; - int send_request(); - int request_complete(); + int send_request() override; + int request_complete() override; }; #define OMAP_APPEND_MAX_ENTRIES_DEFAULT 100 @@ -540,7 +540,7 @@ public: RGWOmapAppend(RGWAsyncRadosProcessor *_async_rados, RGWRados *_store, const rgw_raw_obj& _obj, uint64_t _window_size = OMAP_APPEND_MAX_ENTRIES_DEFAULT); - int operate(); + int operate() override; void flush_pending(); bool append(const string& s); bool finish(); @@ -560,7 +560,7 @@ class RGWAsyncWait : public RGWAsyncRadosRequest { Cond *cond; utime_t interval; protected: - int _send_request() { + int _send_request() override { Mutex::Locker l(*lock); return cond->WaitInterval(*lock, interval); } @@ -591,11 +591,11 @@ public: int _secs) : RGWSimpleCoroutine(_cct), cct(_cct), async_rados(_async_rados), lock(_lock), cond(_cond), secs(_secs), req(NULL) { } - ~RGWWaitCR() { + ~RGWWaitCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { wakeup(); req->finish(); @@ -603,13 +603,13 @@ public: } } - int send_request() { + int send_request() override { req = new RGWAsyncWait(this, stack->create_completion_notifier(), cct, lock, cond, secs); async_rados->queue(req); return 0; } - int request_complete() { + int request_complete() override { return req->get_ret_status(); } @@ -669,7 +669,7 @@ class RGWAsyncGetBucketInstanceInfo : public RGWAsyncRadosRequest { RGWBucketInfo *bucket_info; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncGetBucketInstanceInfo(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, const rgw_bucket& bucket, @@ -691,22 +691,22 @@ public: const rgw_bucket& bucket, RGWBucketInfo *_bucket_info) : RGWSimpleCoroutine(_store->ctx()), async_rados(_async_rados), store(_store), bucket(bucket), bucket_info(_bucket_info), req(NULL) {} - ~RGWGetBucketInstanceInfoCR() { + ~RGWGetBucketInstanceInfoCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { req->finish(); req = NULL; } } - int send_request() { + int send_request() override { req = new RGWAsyncGetBucketInstanceInfo(this, stack->create_completion_notifier(), store, bucket, bucket_info); async_rados->queue(req); return 0; } - int request_complete() { + int request_complete() override { return req->get_ret_status(); } }; @@ -725,7 +725,7 @@ class RGWAsyncFetchRemoteObj : public RGWAsyncRadosRequest { bool copy_if_newer; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncFetchRemoteObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, const string& _source_zone, @@ -772,25 +772,25 @@ public: copy_if_newer(_if_newer), req(NULL) {} - ~RGWFetchRemoteObjCR() { + ~RGWFetchRemoteObjCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { req->finish(); req = NULL; } } - int send_request() { + int send_request() override { req = new RGWAsyncFetchRemoteObj(this, stack->create_completion_notifier(), store, source_zone, bucket_info, key, versioned_epoch, copy_if_newer); async_rados->queue(req); return 0; } - int request_complete() { + int request_complete() override { return req->get_ret_status(); } }; @@ -808,7 +808,7 @@ class RGWAsyncStatRemoteObj : public RGWAsyncRadosRequest { map *pattrs; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncStatRemoteObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, const string& _source_zone, @@ -859,25 +859,25 @@ public: req(NULL) {} - ~RGWStatRemoteObjCR() { + ~RGWStatRemoteObjCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { req->finish(); req = NULL; } } - int send_request() { + int send_request() override { req = new RGWAsyncStatRemoteObj(this, stack->create_completion_notifier(), store, source_zone, bucket_info, key, pmtime, psize, pattrs); async_rados->queue(req); return 0; } - int request_complete() { + int request_complete() override { return req->get_ret_status(); } }; @@ -899,7 +899,7 @@ class RGWAsyncRemoveObj : public RGWAsyncRadosRequest { ceph::real_time timestamp; protected: - int _send_request(); + int _send_request() override; public: RGWAsyncRemoveObj(RGWCoroutine *caller, RGWAioCompletionNotifier *cn, RGWRados *_store, const string& _source_zone, @@ -978,18 +978,18 @@ public: owner_display_name = *_owner_display_name; } } - ~RGWRemoveObjCR() { + ~RGWRemoveObjCR() override { request_cleanup(); } - void request_cleanup() { + void request_cleanup() override { if (req) { req->finish(); req = NULL; } } - int send_request() { + int send_request() override { req = new RGWAsyncRemoveObj(this, stack->create_completion_notifier(), store, source_zone, bucket_info, key, owner, owner_display_name, versioned, versioned_epoch, delete_marker, del_if_older, timestamp); @@ -997,7 +997,7 @@ public: return 0; } - int request_complete() { + int request_complete() override { return req->get_ret_status(); } }; @@ -1031,7 +1031,7 @@ public: interval(_interval), lock("RGWContinuousLeaseCR"), caller(_caller) {} - int operate(); + int operate() override; bool is_locked() { Mutex::Locker l(lock); @@ -1064,10 +1064,10 @@ class RGWRadosTimelogAddCR : public RGWSimpleCoroutine { public: RGWRadosTimelogAddCR(RGWRados *_store, const string& _oid, const cls_log_entry& entry); - ~RGWRadosTimelogAddCR(); + ~RGWRadosTimelogAddCR() override; - int send_request(); - int request_complete(); + int send_request() override; + int request_complete() override; }; class RGWRadosTimelogTrimCR : public RGWSimpleCoroutine { @@ -1085,7 +1085,7 @@ class RGWRadosTimelogTrimCR : public RGWSimpleCoroutine { const real_time& start_time, const real_time& end_time, const std::string& from_marker, const std::string& to_marker); - ~RGWRadosTimelogTrimCR(); + ~RGWRadosTimelogTrimCR() override; int send_request() override; int request_complete() override; @@ -1125,10 +1125,10 @@ class RGWStatObjCR : public RGWSimpleCoroutine { const RGWBucketInfo& _bucket_info, const rgw_obj& obj, uint64_t *psize = nullptr, real_time* pmtime = nullptr, uint64_t *pepoch = nullptr, RGWObjVersionTracker *objv_tracker = nullptr); - ~RGWStatObjCR() { + ~RGWStatObjCR() override { request_cleanup(); } - void request_cleanup(); + void request_cleanup() override; int send_request() override; int request_complete() override; diff --git a/src/rgw/rgw_cr_rest.h b/src/rgw/rgw_cr_rest.h index d30c4816ac0..f1897edb857 100644 --- a/src/rgw/rgw_cr_rest.h +++ b/src/rgw/rgw_cr_rest.h @@ -25,11 +25,11 @@ public: path(_path), params(make_param_list(params)), result(_result) {} - ~RGWReadRESTResourceCR() { + ~RGWReadRESTResourceCR() override { request_cleanup(); } - int send_request() { + int send_request() override { auto op = boost::intrusive_ptr( new RGWRESTReadResource(conn, path, params, NULL, http_manager)); @@ -46,7 +46,7 @@ public: return 0; } - int request_complete() { + int request_complete() override { int ret = http_op->wait(result); auto op = std::move(http_op); // release ref on return if (ret < 0) { @@ -59,7 +59,7 @@ public: return 0; } - void request_cleanup() { + void request_cleanup() override { if (http_op) { http_op->put(); http_op = NULL; @@ -89,11 +89,11 @@ public: input(_input) {} - ~RGWSendRESTResourceCR() { + ~RGWSendRESTResourceCR() override { request_cleanup(); } - int send_request() { + int send_request() override { auto op = boost::intrusive_ptr( new RGWRESTSendResource(conn, method, path, params, NULL, http_manager)); @@ -116,7 +116,7 @@ public: return 0; } - int request_complete() { + int request_complete() override { int ret; if (result) { ret = http_op->wait(result); @@ -137,7 +137,7 @@ public: return 0; } - void request_cleanup() { + void request_cleanup() override { if (http_op) { http_op->put(); http_op = NULL; @@ -186,11 +186,11 @@ public: path(_path), params(make_param_list(_params)) {} - ~RGWDeleteRESTResourceCR() { + ~RGWDeleteRESTResourceCR() override { request_cleanup(); } - int send_request() { + int send_request() override { auto op = boost::intrusive_ptr( new RGWRESTDeleteResource(conn, path, params, nullptr, http_manager)); @@ -208,7 +208,7 @@ public: return 0; } - int request_complete() { + int request_complete() override { int ret; bufferlist bl; ret = http_op->wait_bl(&bl); @@ -225,7 +225,7 @@ public: return 0; } - void request_cleanup() { + void request_cleanup() override { if (http_op) { http_op->put(); http_op = NULL; diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 732fa8114d7..b81435a2ca1 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -207,7 +207,7 @@ public: shard_info(_shard_info) { } - ~RGWReadRemoteDataLogShardInfoCR() { + ~RGWReadRemoteDataLogShardInfoCR() override { if (http_op) { http_op->put(); } @@ -286,7 +286,7 @@ public: entries(_entries), truncated(_truncated) { } - ~RGWReadRemoteDataLogShardCR() { + ~RGWReadRemoteDataLogShardCR() override { if (http_op) { http_op->put(); } @@ -738,7 +738,7 @@ public: path = "/admin/metadata/bucket.instance"; num_shards = sync_status->sync_info.num_shards; } - ~RGWListBucketIndexesCR() { + ~RGWListBucketIndexesCR() override { delete entries_index; } @@ -925,7 +925,7 @@ public: status_oid(RGWBucketSyncStatusManager::status_oid(sync_env->source_zone, bs)) { logger.init(sync_env, "Bucket", bs.get_key()); } - ~RGWRunBucketSyncCoroutine() { + ~RGWRunBucketSyncCoroutine() override { if (lease_cr) { lease_cr->abort(); } @@ -1109,7 +1109,7 @@ public: logger.init(sync_env, "DataShard", status_oid); } - ~RGWDataSyncShardCR() { + ~RGWDataSyncShardCR() override { delete marker_tracker; if (lease_cr) { lease_cr->abort(); @@ -1436,7 +1436,7 @@ public: reset_backoff(_reset_backoff), logger(sync_env, "Data", "all") { } - ~RGWDataSyncCR() { + ~RGWDataSyncCR() override { for (auto iter : shard_crs) { iter.second->put(); } diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index d5d1626f3d1..8c590c1ec92 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -592,7 +592,7 @@ namespace rgw { void invalidate(); - virtual bool reclaim(); + bool reclaim() override; typedef cohort::lru::LRU FhLRU; @@ -642,7 +642,7 @@ namespace rgw { typedef cohort::lru::TreeX FHCache; - virtual ~RGWFileHandle(); + ~RGWFileHandle() override; friend std::ostream& operator<<(std::ostream &os, RGWFileHandle const &rgw_fh); @@ -664,14 +664,14 @@ namespace rgw { : fs(fs), fs_inst(fs_inst), parent(parent), fhk(fhk), name(name), flags(flags) {} - void recycle (cohort::lru::Object* o) { + void recycle (cohort::lru::Object* o) override { /* re-use an existing object */ o->~Object(); // call lru::Object virtual dtor // placement new! new (o) RGWFileHandle(fs, fs_inst, parent, fhk, name, flags); } - cohort::lru::Object* alloc() { + cohort::lru::Object* alloc() override { return new RGWFileHandle(fs, fs_inst, parent, fhk, name, flags); } }; /* Factory */ @@ -1134,9 +1134,9 @@ public: op = this; } - virtual bool only_bucket() { return false; } + bool only_bucket() override { return false; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1147,7 +1147,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "GET"; s->op = OP_GET; @@ -1165,16 +1165,16 @@ public: return 0; } - int get_params() { + int get_params() override { limit = -1; /* no limit */ return 0; } - virtual void send_response_begin(bool has_buckets) { + void send_response_begin(bool has_buckets) override { sent_data = true; } - virtual void send_response_data(RGWUserBuckets& buckets) { + void send_response_data(RGWUserBuckets& buckets) override { if (!sent_data) return; map& m = buckets.get_buckets(); @@ -1187,7 +1187,7 @@ public: } } /* send_response_data */ - virtual void send_response_end() { + void send_response_end() override { // do nothing } @@ -1238,9 +1238,9 @@ public: op = this; } - virtual bool only_bucket() { return false; } + bool only_bucket() override { return false; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1251,7 +1251,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "GET"; s->op = OP_GET; @@ -1289,12 +1289,12 @@ public: return 0; } - virtual int get_params() { + int get_params() override { max = default_max; return 0; } - virtual void send_response() { + void send_response() override { struct req_state* s = get_state(); for (const auto& iter : objs) { @@ -1388,14 +1388,14 @@ public: op = this; } - virtual bool only_bucket() { return false; } + bool only_bucket() override { return false; } - virtual int read_permissions(RGWOp* op_obj) { + int read_permissions(RGWOp* op_obj) override { /* we ARE a 'create bucket' request (cf. rgw_rest.cc, ll. 1305-6) */ return 0; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1406,7 +1406,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "PUT"; @@ -1425,7 +1425,7 @@ public: return 0; } - virtual int get_params() { + int get_params() override { struct req_state* s = get_state(); RGWAccessControlPolicy_S3 s3policy(s->cct); /* we don't have (any) headers, so just create canned ACLs */ @@ -1434,7 +1434,7 @@ public: return ret; } - virtual void send_response() { + void send_response() override { /* TODO: something (maybe) */ } }; /* RGWCreateBucketRequest */ @@ -1455,9 +1455,9 @@ public: op = this; } - virtual bool only_bucket() { return true; } + bool only_bucket() override { return true; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1468,7 +1468,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "DELETE"; @@ -1487,7 +1487,7 @@ public: return 0; } - virtual void send_response() {} + void send_response() override {} }; /* RGWDeleteBucketRequest */ @@ -1511,9 +1511,9 @@ public: op = this; } - virtual bool only_bucket() { return true; } + bool only_bucket() override { return true; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1528,7 +1528,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "PUT"; @@ -1551,7 +1551,7 @@ public: return 0; } - virtual int get_params() { + int get_params() override { struct req_state* s = get_state(); RGWAccessControlPolicy_S3 s3policy(s->cct); /* we don't have (any) headers, so just create canned ACLs */ @@ -1560,7 +1560,7 @@ public: return ret; } - virtual int get_data(buffer::list& _bl) { + int get_data(buffer::list& _bl) override { /* XXX for now, use sharing semantics */ _bl.claim(bl); uint32_t len = _bl.length(); @@ -1568,9 +1568,9 @@ public: return len; } - virtual void send_response() {} + void send_response() override {} - virtual int verify_params() { + int verify_params() override { if (bl.length() > cct->_conf->rgw_max_put_size) return -ERR_TOO_LARGE; return 0; @@ -1607,9 +1607,9 @@ public: RGWGetObj::end = off + len; } - virtual bool only_bucket() { return false; } + bool only_bucket() override { return false; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1620,7 +1620,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "GET"; @@ -1640,12 +1640,12 @@ public: return 0; } - virtual int get_params() { + int get_params() override { return 0; } - virtual int send_response_data(ceph::buffer::list& bl, off_t bl_off, - off_t bl_len) { + int send_response_data(ceph::buffer::list& bl, off_t bl_off, + off_t bl_len) override { size_t bytes; for (auto& bp : bl.buffers()) { /* if for some reason bl_off indicates the start-of-data is not at @@ -1667,7 +1667,7 @@ public: return 0; } - virtual int send_response_data_error() { + int send_response_data_error() override { /* S3 implementation just sends nothing--there is no side effect * to simulate here */ return 0; @@ -1692,9 +1692,9 @@ public: op = this; } - virtual bool only_bucket() { return true; } + bool only_bucket() override { return true; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1705,7 +1705,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "DELETE"; @@ -1725,7 +1725,7 @@ public: return 0; } - virtual void send_response() {} + void send_response() override {} }; /* RGWDeleteObjRequest */ @@ -1755,8 +1755,8 @@ public: RGWGetObj::end = UINT64_MAX; } - virtual const string name() { return "stat_obj"; } - virtual RGWOpType get_type() { return RGW_OP_STAT_OBJ; } + const string name() override { return "stat_obj"; } + RGWOpType get_type() override { return RGW_OP_STAT_OBJ; } real_time get_mtime() const { return lastmod; @@ -1773,9 +1773,9 @@ public: return (iter != attrs.end()) ? &(iter->second) : nullptr; } - virtual bool only_bucket() { return false; } + bool only_bucket() override { return false; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1786,7 +1786,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "GET"; @@ -1805,23 +1805,23 @@ public: return 0; } - virtual int get_params() { + int get_params() override { return 0; } - virtual int send_response_data(ceph::buffer::list& _bl, off_t s_off, - off_t e_off) { + int send_response_data(ceph::buffer::list& _bl, off_t s_off, + off_t e_off) override { /* NOP */ /* XXX save attrs? */ return 0; } - virtual int send_response_data_error() { + int send_response_data_error() override { /* NOP */ return 0; } - virtual void execute() { + void execute() override { RGWGetObj::execute(); _size = get_state()->obj_size; } @@ -1851,9 +1851,9 @@ public: return bucket.creation_time; } - virtual bool only_bucket() { return false; } + bool only_bucket() override { return false; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1864,7 +1864,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "GET"; @@ -1887,7 +1887,7 @@ public: return 0; } - virtual void send_response() { + void send_response() override { bucket.creation_time = get_state()->bucket_info.creation_time; std::swap(attrs, get_state()->bucket_attrs); } @@ -1916,9 +1916,9 @@ public: op = this; } - virtual bool only_bucket() { return false; } + bool only_bucket() override { return false; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -1929,7 +1929,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "GET"; @@ -1955,12 +1955,12 @@ public: return 0; } - virtual int get_params() { + int get_params() override { max = default_max; return 0; } - virtual void send_response() { + void send_response() override { struct req_state* s = get_state(); // try objects for (const auto& iter : objs) { @@ -2032,9 +2032,9 @@ public: op = this; } - virtual bool only_bucket() { return true; } + bool only_bucket() override { return true; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -2045,7 +2045,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "PUT"; @@ -2065,8 +2065,8 @@ public: return 0; } - virtual RGWPutObjProcessor *select_processor(RGWObjectCtx& obj_ctx, - bool *is_multipart) { + RGWPutObjProcessor *select_processor(RGWObjectCtx& obj_ctx, + bool *is_multipart) override { struct req_state* s = get_state(); uint64_t part_size = s->cct->_conf->rgw_obj_stripe_size; RGWPutObjProcessor_Atomic *processor = @@ -2078,7 +2078,7 @@ public: return processor; } - virtual int get_params() { + int get_params() override { struct req_state* s = get_state(); RGWAccessControlPolicy_S3 s3policy(s->cct); /* we don't have (any) headers, so just create canned ACLs */ @@ -2087,7 +2087,7 @@ public: return ret; } - virtual int get_data(buffer::list& _bl) { + int get_data(buffer::list& _bl) override { /* XXX for now, use sharing semantics */ uint32_t len = data.length(); _bl.claim(data); @@ -2104,13 +2104,13 @@ public: ofs = off; /* consumed in exec_continue() */ } - virtual int exec_start(); - virtual int exec_continue(); - virtual int exec_finish(); + int exec_start() override; + int exec_continue() override; + int exec_finish() override; - virtual void send_response() {} + void send_response() override {} - virtual int verify_params() { + int verify_params() override { return 0; } }; /* RGWWriteRequest */ @@ -2139,9 +2139,9 @@ public: attrs_mod = RGWRados::ATTRSMOD_MERGE; } - virtual bool only_bucket() { return true; } + bool only_bucket() override { return true; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -2153,7 +2153,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "PUT"; // XXX check @@ -2194,7 +2194,7 @@ public: return 0; } - virtual int get_params() { + int get_params() override { struct req_state* s = get_state(); RGWAccessControlPolicy_S3 s3policy(s->cct); /* we don't have (any) headers, so just create canned ACLs */ @@ -2203,8 +2203,8 @@ public: return ret; } - virtual void send_response() {} - virtual void send_partial_response(off_t ofs) {} + void send_response() override {} + void send_partial_response(off_t ofs) override {} }; /* RGWCopyObjRequest */ @@ -2221,9 +2221,9 @@ public: op = this; } - virtual bool only_bucket() { return false; } + bool only_bucket() override { return false; } - virtual int op_init() { + int op_init() override { // assign store, s, and dialect_handler RGWObjectCtx* rados_ctx = static_cast(get_state()->obj_ctx); @@ -2234,7 +2234,7 @@ public: return 0; } - virtual int header_init() { + int header_init() override { struct req_state* s = get_state(); s->info.method = "PUT"; @@ -2254,11 +2254,11 @@ public: return 0; } - virtual int get_params() { + int get_params() override { return 0; } - virtual void send_response() {} + void send_response() override {} }; /* RGWSetAttrsRequest */ diff --git a/src/rgw/rgw_formats.h b/src/rgw/rgw_formats.h index 13e4cd83a47..6c7d006282b 100644 --- a/src/rgw/rgw_formats.h +++ b/src/rgw/rgw_formats.h @@ -24,27 +24,27 @@ class RGWFormatter_Plain : public Formatter { void reset_buf(); public: explicit RGWFormatter_Plain(bool use_kv = false); - virtual ~RGWFormatter_Plain(); - - virtual void set_status(int status, const char* status_name) {}; - virtual void output_header() {}; - virtual void output_footer() {}; - virtual void flush(ostream& os); - virtual void reset(); - - virtual void open_array_section(const char *name); - virtual void open_array_section_in_ns(const char *name, const char *ns); - virtual void open_object_section(const char *name); - virtual void open_object_section_in_ns(const char *name, const char *ns); - virtual void close_section(); - virtual void dump_unsigned(const char *name, uint64_t u); - virtual void dump_int(const char *name, int64_t u); - virtual void dump_float(const char *name, double d); - virtual void dump_string(const char *name, const std::string& s); - virtual std::ostream& dump_stream(const char *name); - virtual void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap); - virtual int get_len() const; - virtual void write_raw_data(const char *data); + ~RGWFormatter_Plain() override; + + void set_status(int status, const char* status_name) override {}; + void output_header() override {}; + void output_footer() override {}; + void flush(ostream& os) override; + void reset() override; + + void open_array_section(const char *name) override; + void open_array_section_in_ns(const char *name, const char *ns) override; + void open_object_section(const char *name) override; + void open_object_section_in_ns(const char *name, const char *ns) override; + void close_section() override; + void dump_unsigned(const char *name, uint64_t u) override; + void dump_int(const char *name, int64_t u) override; + void dump_float(const char *name, double d) override; + void dump_string(const char *name, const std::string& s) override; + std::ostream& dump_stream(const char *name) override; + void dump_format_va(const char *name, const char *ns, bool quoted, const char *fmt, va_list ap) override; + int get_len() const override; + void write_raw_data(const char *data) override; private: void write_data(const char *fmt, ...); @@ -117,7 +117,7 @@ public: class RGWStreamFlusher : public RGWFormatterFlusher { ostream& os; protected: - virtual void do_flush() { + void do_flush() override { formatter->flush(os); } public: diff --git a/src/rgw/rgw_frontend.h b/src/rgw/rgw_frontend.h index f42629a08cc..c496d4fe1bd 100644 --- a/src/rgw/rgw_frontend.h +++ b/src/rgw/rgw_frontend.h @@ -148,21 +148,21 @@ public: : conf(_conf), pprocess(nullptr), env(pe), thread(nullptr) { } - ~RGWProcessFrontend() { + ~RGWProcessFrontend() override { delete thread; delete pprocess; } - int run() { + int run() override { assert(pprocess); /* should have initialized by init() */ thread = new RGWProcessControlThread(pprocess); thread->create("rgw_frontend"); return 0; } - void stop(); + void stop() override; - void join() { + void join() override { thread->join(); } @@ -181,7 +181,7 @@ public: RGWFCGXFrontend(RGWProcessEnv& pe, RGWFrontendConfig* _conf) : RGWProcessFrontend(pe, _conf) {} - int init() { + int init() override { pprocess = new RGWFCGXProcess(g_ceph_context, &env, g_conf->rgw_thread_pool_size, conf); return 0; @@ -193,7 +193,7 @@ public: RGWLoadGenFrontend(RGWProcessEnv& pe, RGWFrontendConfig *_conf) : RGWProcessFrontend(pe, _conf) {} - int init() { + int init() override { int num_threads; conf->get_val("num_threads", g_conf->rgw_thread_pool_size, &num_threads); RGWLoadGenProcess *pp = new RGWLoadGenProcess(g_ceph_context, &env, @@ -246,7 +246,7 @@ class RGWFrontendPauser : public RGWRealmReloader::Pauser { if (pauser) pauser->pause(); } - void resume(RGWRados *store) { + void resume(RGWRados *store) override { for (auto frontend : frontends) frontend->unpause_with_new_config(store); if (pauser) diff --git a/src/rgw/rgw_gc.h b/src/rgw/rgw_gc.h index 643a81cc6e8..ca48a6e75e5 100644 --- a/src/rgw/rgw_gc.h +++ b/src/rgw/rgw_gc.h @@ -32,7 +32,7 @@ class RGWGC { public: GCWorker(CephContext *_cct, RGWGC *_gc) : cct(_cct), gc(_gc), lock("GCWorker") {} - void *entry(); + void *entry() override; void stop(); }; diff --git a/src/rgw/rgw_http_client.h b/src/rgw/rgw_http_client.h index 683db7ba0d5..4266b7b50ba 100644 --- a/src/rgw/rgw_http_client.h +++ b/src/rgw/rgw_http_client.h @@ -156,13 +156,13 @@ public: } protected: - virtual int receive_header(void *ptr, size_t len) override; + int receive_header(void *ptr, size_t len) override; - virtual int receive_data(void *ptr, size_t len) override { + int receive_data(void *ptr, size_t len) override { return 0; } - virtual int send_data(void *ptr, size_t len) override { + int send_data(void *ptr, size_t len) override { return 0; } @@ -247,7 +247,7 @@ class RGWHTTPManager { public: ReqsThread(RGWHTTPManager *_m) : manager(_m) {} - void *entry(); + void *entry() override; }; ReqsThread *reqs_thread; diff --git a/src/rgw/rgw_keystone.h b/src/rgw/rgw_keystone.h index f81d32777ce..2fb0346c51e 100644 --- a/src/rgw/rgw_keystone.h +++ b/src/rgw/rgw_keystone.h @@ -155,7 +155,7 @@ class RGWKeystoneTokenCache { cache(cache), lock("RGWKeystoneTokenCache::RevokeThread") { } - void *entry(); + void *entry() override; void stop(); int check_revoked(); } revocator; @@ -217,7 +217,7 @@ public: KeystoneAdminTokenRequestVer2(CephContext * const _cct) : cct(_cct) { } - void dump(Formatter *f) const; + void dump(Formatter *f) const override; }; class KeystoneAdminTokenRequestVer3 : public KeystoneAdminTokenRequest { @@ -227,7 +227,7 @@ public: KeystoneAdminTokenRequestVer3(CephContext * const _cct) : cct(_cct) { } - void dump(Formatter *f) const; + void dump(Formatter *f) const override; }; #endif diff --git a/src/rgw/rgw_lc.h b/src/rgw/rgw_lc.h index ac79f7f3237..37956f474b0 100644 --- a/src/rgw/rgw_lc.h +++ b/src/rgw/rgw_lc.h @@ -223,7 +223,7 @@ class RGWLC { public: LCWorker(CephContext *_cct, RGWLC *_lc) : cct(_cct), lc(_lc), lock("LCWorker") {} - void *entry(); + void *entry() override; void stop(); bool should_work(utime_t& now); int schedule_next_start_time(utime_t& start, utime_t& now); diff --git a/src/rgw/rgw_lc_s3.h b/src/rgw/rgw_lc_s3.h index 22f0e4555ba..f04e5b88e13 100644 --- a/src/rgw/rgw_lc_s3.h +++ b/src/rgw/rgw_lc_s3.h @@ -20,7 +20,7 @@ class LCID_S3 : public XMLObj { public: LCID_S3() {} - ~LCID_S3() {} + ~LCID_S3() override {} string& to_str() { return data; } }; @@ -28,7 +28,7 @@ class LCPrefix_S3 : public XMLObj { public: LCPrefix_S3() {} - ~LCPrefix_S3() {} + ~LCPrefix_S3() override {} string& to_str() { return data; } }; @@ -36,7 +36,7 @@ class LCStatus_S3 : public XMLObj { public: LCStatus_S3() {} - ~LCStatus_S3() {} + ~LCStatus_S3() override {} string& to_str() { return data; } }; @@ -44,7 +44,7 @@ class LCDays_S3 : public XMLObj { public: LCDays_S3() {} - ~LCDays_S3() {} + ~LCDays_S3() override {} string& to_str() { return data; } }; @@ -52,7 +52,7 @@ class LCNoncurDays_S3 : public XMLObj { public: LCNoncurDays_S3() {} - ~LCNoncurDays_S3() {} + ~LCNoncurDays_S3() override {} string& to_str() { return data; } @@ -62,9 +62,9 @@ class LCExpiration_S3 : public LCExpiration, public XMLObj { public: LCExpiration_S3() {} - ~LCExpiration_S3() {} + ~LCExpiration_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(ostream& out) { out << "" << "" << days << ""<< ""; } @@ -79,9 +79,9 @@ class LCNoncurExpiration_S3 : public LCExpiration, public XMLObj { public: LCNoncurExpiration_S3() {} - ~LCNoncurExpiration_S3() {} + ~LCNoncurExpiration_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(ostream& out) { out << "" << "" << days << ""<< ""; } @@ -96,10 +96,10 @@ class LCRule_S3 : public LCRule, public XMLObj { public: LCRule_S3() {} - ~LCRule_S3() {} + ~LCRule_S3() override {} void to_xml(CephContext *cct, ostream& out); - bool xml_end(const char *el); + bool xml_end(const char *el) override; bool xml_start(const char *el, const char **attr); void dump_xml(Formatter *f) const { f->open_object_section("Rule"); @@ -122,7 +122,7 @@ class RGWLCXMLParser_S3 : public RGWXMLParser { CephContext *cct; - XMLObj *alloc_obj(const char *el); + XMLObj *alloc_obj(const char *el) override; public: RGWLCXMLParser_S3(CephContext *_cct) : cct(_cct) {} }; @@ -132,9 +132,9 @@ class RGWLifecycleConfiguration_S3 : public RGWLifecycleConfiguration, public XM public: RGWLifecycleConfiguration_S3(CephContext *_cct) : RGWLifecycleConfiguration(_cct) {} RGWLifecycleConfiguration_S3() : RGWLifecycleConfiguration(NULL) {} - ~RGWLifecycleConfiguration_S3() {} + ~RGWLifecycleConfiguration_S3() override {} - bool xml_end(const char *el); + bool xml_end(const char *el) override; void to_xml(ostream& out) { out << ""; diff --git a/src/rgw/rgw_lib.h b/src/rgw/rgw_lib.h index 0353d36c0c5..ce916a12c7d 100644 --- a/src/rgw/rgw_lib.h +++ b/src/rgw/rgw_lib.h @@ -63,7 +63,7 @@ namespace rgw { RGWLibIO(const RGWUserInfo &_user_info) : user_info(_user_info) {} - virtual void init_env(CephContext *cct) override {} + void init_env(CephContext *cct) override {} const RGWUserInfo& get_user() { return user_info; @@ -104,7 +104,7 @@ namespace rgw { class RGWRESTMgr_Lib : public RGWRESTMgr { public: RGWRESTMgr_Lib() {} - virtual ~RGWRESTMgr_Lib() {} + ~RGWRESTMgr_Lib() override {} }; /* RGWRESTMgr_Lib */ /* XXX */ @@ -112,10 +112,10 @@ namespace rgw { friend class RGWRESTMgr_Lib; public: - virtual int authorize(); + int authorize() override; RGWHandler_Lib() {} - virtual ~RGWHandler_Lib() {} + ~RGWHandler_Lib() override {} static int init_from_header(struct req_state *s); }; /* RGWHandler_Lib */ @@ -134,7 +134,7 @@ namespace rgw { RGWUserInfo* get_user() { return user; } - virtual int postauth_init() { return 0; } + int postauth_init() override { return 0; } /* descendant equivalent of *REST*::init_from_header(...): * prepare request for execute()--should mean, fixup URI-alikes @@ -175,7 +175,7 @@ namespace rgw { virtual bool only_bucket() = 0; - virtual int read_permissions(RGWOp *op); + int read_permissions(RGWOp *op) override; }; /* RGWLibRequest */ diff --git a/src/rgw/rgw_lib_frontend.h b/src/rgw/rgw_lib_frontend.h index 65ccda96d01..0300faaefb9 100644 --- a/src/rgw/rgw_lib_frontend.h +++ b/src/rgw/rgw_lib_frontend.h @@ -30,7 +30,7 @@ namespace rgw { RGWFrontendConfig* _conf) : RGWProcess(cct, pe, num_threads, _conf), gen(0), shutdown(false) {} - void run(); + void run() override; void checkpoint(); void stop() { @@ -66,7 +66,7 @@ namespace rgw { } /* enqueue_req */ /* "regular" requests */ - void handle_request(RGWRequest* req); // async handler, deletes req + void handle_request(RGWRequest* req) override; // async handler, deletes req int process_request(RGWLibRequest* req); int process_request(RGWLibRequest* req, RGWLibIO* io); void set_access_key(RGWAccessKey& key) { access_key = key; } @@ -81,9 +81,9 @@ namespace rgw { RGWLibFrontend(RGWProcessEnv& pe, RGWFrontendConfig *_conf) : RGWProcessFrontend(pe, _conf) {} - int init(); + int init() override; - virtual void stop() { + void stop() override { RGWProcessFrontend::stop(); get_process()->stop(); } diff --git a/src/rgw/rgw_log.h b/src/rgw/rgw_log.h index 4a81fefd840..5e612b7ca22 100644 --- a/src/rgw/rgw_log.h +++ b/src/rgw/rgw_log.h @@ -123,11 +123,11 @@ class OpsLogSocket : public OutputDataSocket { void formatter_to_bl(bufferlist& bl); protected: - void init_connection(bufferlist& bl); + void init_connection(bufferlist& bl) override; public: OpsLogSocket(CephContext *cct, uint64_t _backlog); - ~OpsLogSocket(); + ~OpsLogSocket() override; void log(struct rgw_log_entry& entry); }; diff --git a/src/rgw/rgw_metadata.h b/src/rgw/rgw_metadata.h index cd1150e6e66..8b7526399a8 100644 --- a/src/rgw/rgw_metadata.h +++ b/src/rgw/rgw_metadata.h @@ -164,7 +164,7 @@ class RGWMetadataLogInfoCompletion : public RefCountedObject { boost::optional callback; //< cleared on cancel public: RGWMetadataLogInfoCompletion(info_callback_t callback); - virtual ~RGWMetadataLogInfoCompletion(); + ~RGWMetadataLogInfoCompletion() override; librados::IoCtx& get_io_ctx() { return io_ctx; } cls_log_header& get_header() { return header; } diff --git a/src/rgw/rgw_multi.h b/src/rgw/rgw_multi.h index 5dc14cc52a1..3512f18e7b1 100644 --- a/src/rgw/rgw_multi.h +++ b/src/rgw/rgw_multi.h @@ -11,8 +11,8 @@ class RGWMultiCompleteUpload : public XMLObj { public: RGWMultiCompleteUpload() {} - ~RGWMultiCompleteUpload() {} - bool xml_end(const char *el); + ~RGWMultiCompleteUpload() override {} + bool xml_end(const char *el) override; std::map parts; }; @@ -23,8 +23,8 @@ class RGWMultiPart : public XMLObj int num; public: RGWMultiPart() : num(0) {} - ~RGWMultiPart() {} - bool xml_end(const char *el); + ~RGWMultiPart() override {} + bool xml_end(const char *el) override; string& get_etag() { return etag; } int get_num() { return num; } @@ -34,22 +34,22 @@ class RGWMultiPartNumber : public XMLObj { public: RGWMultiPartNumber() {} - ~RGWMultiPartNumber() {} + ~RGWMultiPartNumber() override {} }; class RGWMultiETag : public XMLObj { public: RGWMultiETag() {} - ~RGWMultiETag() {} + ~RGWMultiETag() override {} }; class RGWMultiXMLParser : public RGWXMLParser { - XMLObj *alloc_obj(const char *el); + XMLObj *alloc_obj(const char *el) override; public: RGWMultiXMLParser() {} - ~RGWMultiXMLParser() {} + ~RGWMultiXMLParser() override {} }; #endif diff --git a/src/rgw/rgw_multi_del.h b/src/rgw/rgw_multi_del.h index 86fed5acb0b..1ac8e491ff6 100644 --- a/src/rgw/rgw_multi_del.h +++ b/src/rgw/rgw_multi_del.h @@ -12,8 +12,8 @@ class RGWMultiDelDelete : public XMLObj { public: RGWMultiDelDelete() :quiet(false) {} - ~RGWMultiDelDelete() {} - bool xml_end(const char *el); + ~RGWMultiDelDelete() override {} + bool xml_end(const char *el) override; std::vector objects; bool quiet; @@ -24,7 +24,7 @@ class RGWMultiDelQuiet : public XMLObj { public: RGWMultiDelQuiet() {} - ~RGWMultiDelQuiet() {} + ~RGWMultiDelQuiet() override {} }; class RGWMultiDelObject : public XMLObj @@ -33,8 +33,8 @@ class RGWMultiDelObject : public XMLObj string version_id; public: RGWMultiDelObject() {} - ~RGWMultiDelObject() {} - bool xml_end(const char *el); + ~RGWMultiDelObject() override {} + bool xml_end(const char *el) override; const string& get_key() { return key; } const string& get_version_id() { return version_id; } @@ -44,22 +44,22 @@ class RGWMultiDelKey : public XMLObj { public: RGWMultiDelKey() {} - ~RGWMultiDelKey() {} + ~RGWMultiDelKey() override {} }; class RGWMultiDelVersionId : public XMLObj { public: RGWMultiDelVersionId() {} - ~RGWMultiDelVersionId() {} + ~RGWMultiDelVersionId() override {} }; class RGWMultiDelXMLParser : public RGWXMLParser { - XMLObj *alloc_obj(const char *el); + XMLObj *alloc_obj(const char *el) override; public: RGWMultiDelXMLParser() {} - ~RGWMultiDelXMLParser() {} + ~RGWMultiDelXMLParser() override {} }; diff --git a/src/rgw/rgw_object_expirer_core.h b/src/rgw/rgw_object_expirer_core.h index f8170f38fed..83f0dd30754 100644 --- a/src/rgw/rgw_object_expirer_core.h +++ b/src/rgw/rgw_object_expirer_core.h @@ -60,7 +60,7 @@ protected: lock("OEWorker") { } - void *entry(); + void *entry() override; void stop(); }; diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 50e35c846a9..719437a638a 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -2785,7 +2785,7 @@ class RGWPutObj_CB : public RGWGetDataCB RGWPutObj *op; public: RGWPutObj_CB(RGWPutObj *_op) : op(_op) {} - ~RGWPutObj_CB() {} + ~RGWPutObj_CB() override {} 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_op.h b/src/rgw/rgw_op.h index 0d2ef7844a2..4d7c5af0b15 100644 --- a/src/rgw/rgw_op.h +++ b/src/rgw/rgw_op.h @@ -173,14 +173,14 @@ public: cur_ofs = 0; } - bool prefetch_data(); + bool prefetch_data() override; void set_get_data(bool get_data) { this->get_data = get_data; } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; int read_user_manifest_part(rgw_bucket& bucket, const rgw_bucket_dir_entry& ent, RGWAccessControlPolicy *bucket_policy, @@ -195,9 +195,9 @@ public: virtual int send_response_data_error() = 0; virtual int send_response_data(bufferlist& bl, off_t ofs, off_t len) = 0; - virtual const string name() { return "get_obj"; } - virtual RGWOpType get_type() { return RGW_OP_GET_OBJ; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + const string name() override { return "get_obj"; } + RGWOpType get_type() override { return RGW_OP_GET_OBJ; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } virtual bool need_object_expiration() { return false; } }; @@ -206,9 +206,9 @@ class RGWGetObj_CB : public RGWGetDataCB RGWGetObj *op; public: explicit RGWGetObj_CB(RGWGetObj *_op) : op(_op) {} - virtual ~RGWGetObj_CB() {} + ~RGWGetObj_CB() override {} - 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); } }; @@ -219,26 +219,26 @@ protected: RGWGetDataCB* next; public: RGWGetObj_Filter(RGWGetDataCB* next): next(next) {} - virtual ~RGWGetObj_Filter() {} + ~RGWGetObj_Filter() override {} /** * Passes data through filter. * Filter can modify content of bl. * When bl_len == 0 , it means 'flush */ - virtual int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) override { + int handle_data(bufferlist& bl, off_t bl_ofs, off_t bl_len) override { return next->handle_data(bl, bl_ofs, bl_len); } /** * Flushes any cached data. Used by RGWGetObjFilter. * Return logic same as handle_data. */ - virtual int flush() override { + int flush() override { return next->flush(); } /** * Allows filter to extend range required for successful filtering */ - virtual void fixup_range(off_t& ofs, off_t& end) override { + void fixup_range(off_t& ofs, off_t& end) override { next->fixup_range(ofs, end); } }; @@ -302,17 +302,17 @@ public: : deleter(nullptr) { } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_data(std::list& items, bool * is_truncated) = 0; - virtual void send_response() = 0; + void send_response() override = 0; - virtual const string name() { return "bulk_delete"; } - virtual RGWOpType get_type() { return RGW_OP_BULK_DELETE; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_DELETE; } + const string name() override { return "bulk_delete"; } + RGWOpType get_type() override { return RGW_OP_BULK_DELETE; } + uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; } }; inline ostream& operator<<(ostream& out, const RGWBulkDelete::acct_path_t &o) { @@ -349,21 +349,21 @@ public: is_truncated = false; } - int verify_permission(); - void execute(); + int verify_permission() override; + void execute() override; virtual int get_params() = 0; virtual void send_response_begin(bool has_buckets) = 0; virtual void send_response_data(RGWUserBuckets& buckets) = 0; virtual void send_response_end() = 0; - virtual void send_response() {} + void send_response() override {} virtual bool should_get_stats() { return false; } virtual bool supports_account_metadata() { return false; } - virtual const string name() { return "list_buckets"; } - virtual RGWOpType get_type() { return RGW_OP_LIST_BUCKETS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + const string name() override { return "list_buckets"; } + RGWOpType get_type() override { return RGW_OP_LIST_BUCKETS; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWGetUsage : public RGWOp { @@ -381,16 +381,16 @@ public: RGWGetUsage() : sent_data(false), show_log_entries(true), show_log_sum(true){ } - int verify_permission(); - void execute(); + int verify_permission() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() {} + void send_response() override {} virtual bool should_get_stats() { return false; } - virtual const string name() { return "get_usage"; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + const string name() override { return "get_usage"; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWStatAccount : public RGWOp { @@ -408,13 +408,13 @@ public: buckets_size_rounded = 0; } - int verify_permission(); - virtual void execute(); + int verify_permission() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "stat_account"; } - virtual RGWOpType get_type() { return RGW_OP_STAT_ACCOUNT; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "stat_account"; } + RGWOpType get_type() override { return RGW_OP_STAT_ACCOUNT; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWListBucket : public RGWOp { @@ -442,40 +442,40 @@ protected: public: RGWListBucket() : list_versions(false), max(0), default_max(0), is_truncated(false), shard_id(-1) {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "list_bucket"; } - virtual RGWOpType get_type() { return RGW_OP_LIST_BUCKET; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "list_bucket"; } + RGWOpType get_type() override { return RGW_OP_LIST_BUCKET; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } virtual bool need_container_stats() { return false; } }; class RGWGetBucketLogging : public RGWOp { public: RGWGetBucketLogging() {} - int verify_permission(); - void execute() { } + int verify_permission() override; + void execute() override { } - virtual void send_response() = 0; - virtual const string name() { return "get_bucket_logging"; } - virtual RGWOpType get_type() { return RGW_OP_GET_BUCKET_LOGGING; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "get_bucket_logging"; } + RGWOpType get_type() override { return RGW_OP_GET_BUCKET_LOGGING; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWGetBucketLocation : public RGWOp { public: RGWGetBucketLocation() {} - ~RGWGetBucketLocation() {} - int verify_permission(); - void execute() { } + ~RGWGetBucketLocation() override {} + int verify_permission() override; + void execute() override { } - virtual void send_response() = 0; - virtual const string name() { return "get_bucket_location"; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "get_bucket_location"; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWGetBucketVersioning : public RGWOp { @@ -485,14 +485,14 @@ protected: public: RGWGetBucketVersioning() : versioned(false), versioning_enabled(false) {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "get_bucket_versioning"; } - virtual RGWOpType get_type() { return RGW_OP_GET_BUCKET_VERSIONING; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "get_bucket_versioning"; } + RGWOpType get_type() override { return RGW_OP_GET_BUCKET_VERSIONING; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWSetBucketVersioning : public RGWOp { @@ -502,30 +502,30 @@ protected: public: RGWSetBucketVersioning() : enable_versioning(false) {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() { return 0; } - virtual void send_response() = 0; - virtual const string name() { return "set_bucket_versioning"; } - virtual RGWOpType get_type() { return RGW_OP_SET_BUCKET_VERSIONING; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "set_bucket_versioning"; } + RGWOpType get_type() override { return RGW_OP_SET_BUCKET_VERSIONING; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWGetBucketWebsite : public RGWOp { public: RGWGetBucketWebsite() {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "get_bucket_website"; } - virtual RGWOpType get_type() { return RGW_OP_GET_BUCKET_WEBSITE; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "get_bucket_website"; } + RGWOpType get_type() override { return RGW_OP_GET_BUCKET_WEBSITE; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWSetBucketWebsite : public RGWOp { @@ -534,30 +534,30 @@ protected: public: RGWSetBucketWebsite() {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() { return 0; } - virtual void send_response() = 0; - virtual const string name() { return "set_bucket_website"; } - virtual RGWOpType get_type() { return RGW_OP_SET_BUCKET_WEBSITE; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "set_bucket_website"; } + RGWOpType get_type() override { return RGW_OP_SET_BUCKET_WEBSITE; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWDeleteBucketWebsite : public RGWOp { public: RGWDeleteBucketWebsite() {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "delete_bucket_website"; } - virtual RGWOpType get_type() { return RGW_OP_SET_BUCKET_WEBSITE; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "delete_bucket_website"; } + RGWOpType get_type() override { return RGW_OP_SET_BUCKET_WEBSITE; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWStatBucket : public RGWOp { @@ -566,16 +566,16 @@ protected: public: RGWStatBucket() {} - ~RGWStatBucket() {} + ~RGWStatBucket() override {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "stat_bucket"; } - virtual RGWOpType get_type() { return RGW_OP_STAT_BUCKET; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "stat_bucket"; } + RGWOpType get_type() override { return RGW_OP_STAT_BUCKET; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWCreateBucket : public RGWOp { @@ -602,18 +602,18 @@ public: attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */ } - int verify_permission(); - void pre_exec(); - void execute(); - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + int verify_permission() override; + void pre_exec() override; + void execute() override; + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } virtual int get_params() { return 0; } - virtual void send_response() = 0; - virtual const string name() { return "create_bucket"; } - virtual RGWOpType get_type() { return RGW_OP_CREATE_BUCKET; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "create_bucket"; } + RGWOpType get_type() override { return RGW_OP_CREATE_BUCKET; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWDeleteBucket : public RGWOp { @@ -623,14 +623,14 @@ protected: public: RGWDeleteBucket() {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "delete_bucket"; } - virtual RGWOpType get_type() { return RGW_OP_DELETE_BUCKET; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_DELETE; } + void send_response() override = 0; + const string name() override { return "delete_bucket"; } + RGWOpType get_type() override { return RGW_OP_DELETE_BUCKET; } + uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; } }; struct rgw_slo_entry { @@ -737,11 +737,11 @@ public: slo_info(NULL), olh_epoch(0) {} - ~RGWPutObj() { + ~RGWPutObj() override { delete slo_info; } - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } @@ -753,19 +753,19 @@ public: virtual RGWPutObjProcessor *select_processor(RGWObjectCtx& obj_ctx, bool *is_multipart); void dispose_processor(RGWPutObjDataProcessor *processor); - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; int get_data_cb(bufferlist& bl, off_t bl_ofs, off_t bl_len); int get_data(const off_t fst, const off_t lst, bufferlist& bl); virtual int get_params() = 0; virtual int get_data(bufferlist& bl) = 0; - virtual void send_response() = 0; - virtual const string name() { return "put_obj"; } - virtual RGWOpType get_type() { return RGW_OP_PUT_OBJ; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "put_obj"; } + RGWOpType get_type() override { return RGW_OP_PUT_OBJ; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWPutObj_Filter : public RGWPutObjDataProcessor @@ -775,11 +775,11 @@ protected: public: RGWPutObj_Filter(RGWPutObjDataProcessor* next) : next(next){} - virtual ~RGWPutObj_Filter() {} - virtual int handle_data(bufferlist& bl, off_t ofs, void **phandle, rgw_raw_obj *pobj, bool *again) override { + ~RGWPutObj_Filter() override {} + int handle_data(bufferlist& bl, off_t ofs, void **phandle, rgw_raw_obj *pobj, bool *again) override { return next->handle_data(bl, ofs, phandle, pobj, again); } - virtual int throttle_data(void *handle, const rgw_raw_obj& obj, uint64_t size, bool need_to_wait) override { + int throttle_data(void *handle, const rgw_raw_obj& obj, uint64_t size, bool need_to_wait) override { return next->throttle_data(handle, obj, size, need_to_wait); } }; /* RGWPutObj_Filter */ @@ -814,21 +814,21 @@ public: attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */ } - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; virtual int get_data(bufferlist& bl) = 0; - virtual void send_response() = 0; - virtual const string name() { return "post_obj"; } - virtual RGWOpType get_type() { return RGW_OP_POST_OBJ; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "post_obj"; } + RGWOpType get_type() override { return RGW_OP_POST_OBJ; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWPutMetadataAccount : public RGWOp { @@ -850,23 +850,23 @@ public: has_policy(false) { } - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } - int init_processing(); - int verify_permission(); - void pre_exec() { } - void execute(); + int init_processing() override; + int verify_permission() override; + void pre_exec() override { } + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; + void send_response() override = 0; virtual void filter_out_temp_url(map& add_attrs, const set& rmattr_names, map& temp_url_keys); - virtual const string name() { return "put_account_metadata"; } - virtual RGWOpType get_type() { return RGW_OP_PUT_METADATA_ACCOUNT; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + const string name() override { return "put_account_metadata"; } + RGWOpType get_type() override { return RGW_OP_PUT_METADATA_ACCOUNT; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWPutMetadataBucket : public RGWOp { @@ -888,20 +888,20 @@ public: attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */ } - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "put_bucket_metadata"; } - virtual RGWOpType get_type() { return RGW_OP_PUT_METADATA_BUCKET; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "put_bucket_metadata"; } + RGWOpType get_type() override { return RGW_OP_PUT_METADATA_BUCKET; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWPutMetadataObject : public RGWOp { @@ -916,19 +916,19 @@ public: : dlo_manifest(NULL) {} - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "put_obj_metadata"; } - virtual RGWOpType get_type() { return RGW_OP_PUT_METADATA_OBJECT; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "put_obj_metadata"; } + RGWOpType get_type() override { return RGW_OP_PUT_METADATA_OBJECT; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } virtual bool need_object_expiration() { return false; } }; @@ -949,16 +949,16 @@ public: deleter(nullptr) { } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; int handle_slo_manifest(bufferlist& bl); virtual int get_params() { return 0; } - virtual void send_response() = 0; - virtual const string name() { return "delete_obj"; } - virtual RGWOpType get_type() { return RGW_OP_DELETE_OBJ; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_DELETE; } + void send_response() override = 0; + const string name() override { return "delete_obj"; } + RGWOpType get_type() override { return RGW_OP_DELETE_OBJ; } + uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; } virtual bool need_object_expiration() { return false; } }; @@ -1028,22 +1028,22 @@ public: attrs.emplace(std::move(key), std::move(bl)); } - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); dest_policy.set_ctx(s->cct); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; void progress_cb(off_t ofs); virtual int init_dest_policy() { return 0; } virtual int get_params() = 0; virtual void send_partial_response(off_t ofs) {} - virtual void send_response() = 0; - virtual const string name() { return "copy_obj"; } - virtual RGWOpType get_type() { return RGW_OP_COPY_OBJ; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "copy_obj"; } + RGWOpType get_type() override { return RGW_OP_COPY_OBJ; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWGetACLs : public RGWOp { @@ -1053,14 +1053,14 @@ protected: public: RGWGetACLs() {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "get_acls"; } - virtual RGWOpType get_type() { return RGW_OP_GET_ACLS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "get_acls"; } + RGWOpType get_type() override { return RGW_OP_GET_ACLS; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWPutACLs : public RGWOp { @@ -1074,20 +1074,20 @@ public: len = 0; data = NULL; } - virtual ~RGWPutACLs() { + ~RGWPutACLs() override { free(data); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_policy_from_state(RGWRados *store, struct req_state *s, stringstream& ss) { return 0; } virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "put_acls"; } - virtual RGWOpType get_type() { return RGW_OP_PUT_ACLS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "put_acls"; } + RGWOpType get_type() override { return RGW_OP_PUT_ACLS; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWGetLC : public RGWOp { @@ -1095,15 +1095,15 @@ protected: public: RGWGetLC() { } - virtual ~RGWGetLC() { } + ~RGWGetLC() override { } - int verify_permission(); - void pre_exec(); - virtual void execute() = 0; + int verify_permission() override; + void pre_exec() override; + void execute() override = 0; - virtual void send_response() = 0; - virtual const string name() { return "get_lifecycle"; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "get_lifecycle"; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWPutLC : public RGWOp { @@ -1117,11 +1117,11 @@ public: len = 0; data = NULL; } - virtual ~RGWPutLC() { + ~RGWPutLC() override { free(data); } - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *dialect_handler) { + void init(RGWRados *store, struct req_state *s, RGWHandler *dialect_handler) override { #define COOKIE_LEN 16 char buf[COOKIE_LEN + 1]; @@ -1130,15 +1130,15 @@ public: cookie = buf; } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; // virtual int get_policy_from_state(RGWRados *store, struct req_state *s, stringstream& ss) { return 0; } virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "put_lifecycle"; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "put_lifecycle"; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWDeleteLC : public RGWOp { @@ -1151,17 +1151,17 @@ public: len = 0; data = NULL; } - virtual ~RGWDeleteLC() { + ~RGWDeleteLC() override { free(data); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "delete_lifecycle"; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "delete_lifecycle"; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWGetCORS : public RGWOp { @@ -1170,13 +1170,13 @@ protected: public: RGWGetCORS() {} - int verify_permission(); - void execute(); + int verify_permission() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "get_cors"; } - virtual RGWOpType get_type() { return RGW_OP_GET_CORS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "get_cors"; } + RGWOpType get_type() override { return RGW_OP_GET_CORS; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWPutCORS : public RGWOp { @@ -1185,16 +1185,16 @@ protected: public: RGWPutCORS() {} - virtual ~RGWPutCORS() {} + ~RGWPutCORS() override {} - int verify_permission(); - void execute(); + int verify_permission() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "put_cors"; } - virtual RGWOpType get_type() { return RGW_OP_PUT_CORS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "put_cors"; } + RGWOpType get_type() override { return RGW_OP_PUT_CORS; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWDeleteCORS : public RGWOp { @@ -1203,13 +1203,13 @@ protected: public: RGWDeleteCORS() {} - int verify_permission(); - void execute(); + int verify_permission() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "delete_cors"; } - virtual RGWOpType get_type() { return RGW_OP_DELETE_CORS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "delete_cors"; } + RGWOpType get_type() override { return RGW_OP_DELETE_CORS; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWOptionsCORS : public RGWOp { @@ -1222,14 +1222,14 @@ public: req_hdrs(NULL), req_meth(NULL) { } - int verify_permission() {return 0;} + int verify_permission() override {return 0;} int validate_cors_request(RGWCORSConfiguration *cc); - void execute(); + void execute() override; void get_response_params(string& allowed_hdrs, string& exp_hdrs, unsigned *max_age); - virtual void send_response() = 0; - virtual const string name() { return "options_cors"; } - virtual RGWOpType get_type() { return RGW_OP_OPTIONS_CORS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "options_cors"; } + RGWOpType get_type() override { return RGW_OP_OPTIONS_CORS; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWGetRequestPayment : public RGWOp { @@ -1239,14 +1239,14 @@ protected: public: RGWGetRequestPayment() : requester_pays(0) {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "get_request_payment"; } - virtual RGWOpType get_type() { return RGW_OP_GET_REQUEST_PAYMENT; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "get_request_payment"; } + RGWOpType get_type() override { return RGW_OP_GET_REQUEST_PAYMENT; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWSetRequestPayment : public RGWOp { @@ -1255,16 +1255,16 @@ protected: public: RGWSetRequestPayment() : requester_pays(false) {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() { return 0; } - virtual void send_response() = 0; - virtual const string name() { return "set_request_payment"; } - virtual RGWOpType get_type() { return RGW_OP_SET_REQUEST_PAYMENT; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "set_request_payment"; } + RGWOpType get_type() override { return RGW_OP_SET_REQUEST_PAYMENT; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWInitMultipart : public RGWOp { @@ -1275,19 +1275,19 @@ protected: public: RGWInitMultipart() {} - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy.set_ctx(s->cct); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "init_multipart"; } - virtual RGWOpType get_type() { return RGW_OP_INIT_MULTIPART; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "init_multipart"; } + RGWOpType get_type() override { return RGW_OP_INIT_MULTIPART; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWCompleteMultipart : public RGWOp { @@ -1302,33 +1302,33 @@ public: data = NULL; len = 0; } - virtual ~RGWCompleteMultipart() { + ~RGWCompleteMultipart() override { free(data); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "complete_multipart"; } - virtual RGWOpType get_type() { return RGW_OP_COMPLETE_MULTIPART; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "complete_multipart"; } + RGWOpType get_type() override { return RGW_OP_COMPLETE_MULTIPART; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWAbortMultipart : public RGWOp { public: RGWAbortMultipart() {} - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; - virtual void send_response() = 0; - virtual const string name() { return "abort_multipart"; } - virtual RGWOpType get_type() { return RGW_OP_ABORT_MULTIPART; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_DELETE; } + void send_response() override = 0; + const string name() override { return "abort_multipart"; } + RGWOpType get_type() override { return RGW_OP_ABORT_MULTIPART; } + uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; } }; class RGWListMultipart : public RGWOp { @@ -1347,19 +1347,19 @@ public: truncated = false; } - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); policy = RGWAccessControlPolicy(s->cct); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "list_multipart"; } - virtual RGWOpType get_type() { return RGW_OP_LIST_MULTIPART; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "list_multipart"; } + RGWOpType get_type() override { return RGW_OP_LIST_MULTIPART; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; #define MP_META_SUFFIX ".meta" @@ -1452,27 +1452,27 @@ public: default_max = 0; } - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWOp::init(store, s, h); max_uploads = default_max; } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "list_bucket_multiparts"; } - virtual RGWOpType get_type() { return RGW_OP_LIST_BUCKET_MULTIPARTS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_READ; } + void send_response() override = 0; + const string name() override { return "list_bucket_multiparts"; } + RGWOpType get_type() override { return RGW_OP_LIST_BUCKET_MULTIPARTS; } + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWGetCrossDomainPolicy : public RGWOp { public: RGWGetCrossDomainPolicy() = default; - ~RGWGetCrossDomainPolicy() = default; + ~RGWGetCrossDomainPolicy() override = default; int verify_permission() override { return 0; @@ -1499,7 +1499,7 @@ public: class RGWGetHealthCheck : public RGWOp { public: RGWGetHealthCheck() = default; - ~RGWGetHealthCheck() = default; + ~RGWGetHealthCheck() override = default; int verify_permission() override { return 0; @@ -1538,9 +1538,9 @@ public: quiet = false; status_dumped = false; } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; virtual void send_status() = 0; @@ -1548,15 +1548,15 @@ public: virtual void send_partial_response(rgw_obj_key& key, bool delete_marker, const string& marker_version_id, int ret) = 0; virtual void end_response() = 0; - virtual const string name() { return "multi_object_delete"; } - virtual RGWOpType get_type() { return RGW_OP_DELETE_MULTI_OBJ; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_DELETE; } + const string name() override { return "multi_object_delete"; } + RGWOpType get_type() override { return RGW_OP_DELETE_MULTI_OBJ; } + uint32_t op_mask() override { return RGW_OP_TYPE_DELETE; } }; class RGWInfo: public RGWOp { public: RGWInfo() = default; - ~RGWInfo() = default; + ~RGWInfo() override = default; int verify_permission() override { return 0; } const string name() override { return "get info"; } @@ -1749,21 +1749,21 @@ protected: public: RGWSetAttrs() {} - virtual ~RGWSetAttrs() {} + ~RGWSetAttrs() override {} void emplace_attr(std::string&& key, buffer::list&& bl) { attrs.emplace(std::move(key), std::move(bl)); } - int verify_permission(); - void pre_exec(); - void execute(); + int verify_permission() override; + void pre_exec() override; + void execute() override; virtual int get_params() = 0; - virtual void send_response() = 0; - virtual const string name() { return "set_attrs"; } - virtual RGWOpType get_type() { return RGW_OP_SET_ATTRS; } - virtual uint32_t op_mask() { return RGW_OP_TYPE_WRITE; } + void send_response() override = 0; + const string name() override { return "set_attrs"; } + RGWOpType get_type() override { return RGW_OP_SET_ATTRS; } + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWGetObjLayout : public RGWOp { diff --git a/src/rgw/rgw_period_pusher.h b/src/rgw/rgw_period_pusher.h index ccba89783de..7146bef42af 100644 --- a/src/rgw/rgw_period_pusher.h +++ b/src/rgw/rgw_period_pusher.h @@ -24,7 +24,7 @@ class RGWPeriodPusher final : public RGWRealmWatcher::Watcher, public RGWRealmReloader::Pauser { public: RGWPeriodPusher(RGWRados* store); - ~RGWPeriodPusher(); + ~RGWPeriodPusher() override; /// respond to realm notifications by pushing new periods to other zones void handle_notify(RGWRealmNotify type, bufferlist::iterator& p) override; diff --git a/src/rgw/rgw_process.h b/src/rgw/rgw_process.h index 6c59c9c762a..bd3c46261f6 100644 --- a/src/rgw/rgw_process.h +++ b/src/rgw/rgw_process.h @@ -54,7 +54,7 @@ protected: : ThreadPool::WorkQueue("RGWWQ", timeout, suicide_timeout, tp), process(p) {} - bool _enqueue(RGWRequest* req) { + bool _enqueue(RGWRequest* req) override { process->m_req_queue.push_back(req); perfcounter->inc(l_rgw_qlen); dout(20) << "enqueued request req=" << hex << req << dec << dendl; @@ -62,15 +62,15 @@ protected: return true; } - void _dequeue(RGWRequest* req) { + void _dequeue(RGWRequest* req) override { ceph_abort(); } - bool _empty() { + bool _empty() override { return process->m_req_queue.empty(); } - RGWRequest* _dequeue() { + RGWRequest* _dequeue() override { if (process->m_req_queue.empty()) return NULL; RGWRequest *req = process->m_req_queue.front(); @@ -92,7 +92,7 @@ protected: void _dump_queue(); - void _clear() { + void _clear() override { assert(process->m_req_queue.empty()); } } req_wq; @@ -151,8 +151,8 @@ public: max_connections(num_threads + (num_threads >> 3)) { } - void run(); - void handle_request(RGWRequest* req); + void run() override; + void handle_request(RGWRequest* req) override; }; class RGWProcessControlThread : public Thread { @@ -160,7 +160,7 @@ class RGWProcessControlThread : public Thread { public: RGWProcessControlThread(RGWProcess *_pprocess) : pprocess(_pprocess) {} - void *entry() { + void *entry() override { pprocess->run(); return NULL; } @@ -172,9 +172,9 @@ public: RGWLoadGenProcess(CephContext* cct, RGWProcessEnv* pe, int num_threads, RGWFrontendConfig* _conf) : RGWProcess(cct, pe, num_threads, _conf) {} - void run(); + void run() override; void checkpoint(); - void handle_request(RGWRequest* req); + void handle_request(RGWRequest* req) override; void gen_request(const string& method, const string& resource, int content_length, atomic_t* fail_flag); diff --git a/src/rgw/rgw_quota.cc b/src/rgw/rgw_quota.cc index e375b70fbc9..fabb2c3b3be 100644 --- a/src/rgw/rgw_quota.cc +++ b/src/rgw/rgw_quota.cc @@ -553,7 +553,7 @@ public: user_sync_thread = NULL; } } - ~RGWUserStatsCache() { + ~RGWUserStatsCache() override { stop(); } diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index af00d1980ce..277ee2b6171 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3033,7 +3033,7 @@ class RGWSyncProcessorThread : public RGWRadosThread { public: RGWSyncProcessorThread(RGWRados *_store, const string& thread_name = "radosgw") : RGWRadosThread(_store, thread_name) {} RGWSyncProcessorThread(RGWRados *_store) : RGWRadosThread(_store) {} - ~RGWSyncProcessorThread() {} + ~RGWSyncProcessorThread() override {} int init() override = 0 ; int process() override = 0; }; @@ -9677,7 +9677,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) {} - ~get_obj_data() { } + ~get_obj_data() override { } void set_cancelled(int r) { cancelled.set(1); err_code.set(r); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 24dbffff425..1d07470602a 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -1156,23 +1156,23 @@ struct RGWZoneParams : RGWSystemMetaObj { : RGWSystemMetaObj(id, name), realm_id(_realm_id) {} rgw_pool get_pool(CephContext *cct); - const string get_default_oid(bool old_format = false); - const string& get_names_oid_prefix(); - const string& get_info_oid_prefix(bool old_format = false); - const string& get_predefined_name(CephContext *cct); + const string get_default_oid(bool old_format = false) override; + const string& get_names_oid_prefix() override; + const string& get_info_oid_prefix(bool old_format = false) override; + const string& get_predefined_name(CephContext *cct) override; int init(CephContext *_cct, RGWRados *_store, bool setup_obj = true, bool old_format = false); using RGWSystemMetaObj::init; - int read_default_id(string& default_id, bool old_format = false); + int read_default_id(string& default_id, bool old_format = false) override; int set_as_default(bool exclusive = false) override; int create_default(bool old_format = false); - int create(bool exclusive = true); + int create(bool exclusive = true) override; int fix_pool_names(); const string& get_compression_type(const string& placement_rule) const; - void encode(bufferlist& bl) const { + void encode(bufferlist& bl) const override { ENCODE_START(9, 1, bl); ::encode(domain_root, bl); ::encode(control_pool, bl); @@ -1195,7 +1195,7 @@ struct RGWZoneParams : RGWSystemMetaObj { ENCODE_FINISH(bl); } - void decode(bufferlist::iterator& bl) { + void decode(bufferlist::iterator& bl) override { DECODE_START(9, bl); ::decode(domain_root, bl); ::decode(control_pool, bl); @@ -1473,7 +1473,7 @@ struct RGWZoneGroup : public RGWSystemMetaObj { } void post_process_params(); - void encode(bufferlist& bl) const { + void encode(bufferlist& bl) const override { ENCODE_START(4, 1, bl); ::encode(name, bl); ::encode(api_name, bl); @@ -1490,7 +1490,7 @@ struct RGWZoneGroup : public RGWSystemMetaObj { ENCODE_FINISH(bl); } - void decode(bufferlist::iterator& bl) { + void decode(bufferlist::iterator& bl) override { DECODE_START(4, bl); ::decode(name, bl); ::decode(api_name, bl); @@ -1515,7 +1515,7 @@ struct RGWZoneGroup : public RGWSystemMetaObj { DECODE_FINISH(bl); } - int read_default_id(string& default_id, bool old_format = false); + int read_default_id(string& default_id, bool old_format = false) override; int set_as_default(bool exclusive = false) override; int create_default(bool old_format = false); int equals(const string& other_zonegroup) const; @@ -1525,10 +1525,10 @@ struct RGWZoneGroup : public RGWSystemMetaObj { int remove_zone(const std::string& zone_id); int rename_zone(const RGWZoneParams& zone_params); rgw_pool get_pool(CephContext *cct); - const string get_default_oid(bool old_region_format = false); - const string& get_info_oid_prefix(bool old_region_format = false); - const string& get_names_oid_prefix(); - const string& get_predefined_name(CephContext *cct); + const string get_default_oid(bool old_region_format = false) override; + const string& get_info_oid_prefix(bool old_region_format = false) override; + const string& get_names_oid_prefix() override; + const string& get_predefined_name(CephContext *cct) override; void dump(Formatter *f) const; void decode_json(JSONObj *obj); @@ -1677,7 +1677,7 @@ public: RGWRealm(CephContext *_cct, RGWRados *_store): RGWSystemMetaObj(_cct, _store) {} RGWRealm(const string& _name, CephContext *_cct, RGWRados *_store): RGWSystemMetaObj(_name, _cct, _store){} - void encode(bufferlist& bl) const { + void encode(bufferlist& bl) const override { ENCODE_START(1, 1, bl); RGWSystemMetaObj::encode(bl); ::encode(current_period, bl); @@ -1685,7 +1685,7 @@ public: ENCODE_FINISH(bl); } - void decode(bufferlist::iterator& bl) { + void decode(bufferlist::iterator& bl) override { DECODE_START(1, bl); RGWSystemMetaObj::decode(bl); ::decode(current_period, bl); @@ -1693,13 +1693,13 @@ public: DECODE_FINISH(bl); } - int create(bool exclusive = true); + int create(bool exclusive = true) override; int delete_obj(); rgw_pool get_pool(CephContext *cct); - const string get_default_oid(bool old_format = false); - const string& get_names_oid_prefix(); - const string& get_info_oid_prefix(bool old_format = false); - const string& get_predefined_name(CephContext *cct); + const string get_default_oid(bool old_format = false) override; + const string& get_names_oid_prefix() override; + const string& get_info_oid_prefix(bool old_format = false) override; + const string& get_predefined_name(CephContext *cct) override; using RGWSystemMetaObj::read_id; // expose as public for radosgw-admin @@ -1958,7 +1958,7 @@ public: class RGWOpState : public RGWStateLog { protected: - bool dump_entry_internal(const cls_statelog_entry& entry, Formatter *f); + bool dump_entry_internal(const cls_statelog_entry& entry, Formatter *f) override; public: enum OpState { @@ -2002,7 +2002,7 @@ protected: map *stats; public: explicit RGWGetBucketStats_CB(rgw_bucket& _bucket) : bucket(_bucket), stats(NULL) {} - virtual ~RGWGetBucketStats_CB() {} + ~RGWGetBucketStats_CB() override {} virtual void handle_response(int r) = 0; virtual void set_response(map *_stats) { stats = _stats; @@ -2015,7 +2015,7 @@ protected: RGWStorageStats stats; public: explicit RGWGetUserStats_CB(const rgw_user& _user) : user(_user) {} - virtual ~RGWGetUserStats_CB() {} + ~RGWGetUserStats_CB() override {} virtual void handle_response(int r) = 0; virtual void set_response(RGWStorageStats& _stats) { stats = _stats; @@ -3593,18 +3593,18 @@ public: return store->chain_cache_entry(cache_info_entries, &chain_entry); } - void chain_cb(const string& key, void *data) { + void chain_cb(const string& key, void *data) override { T *entry = static_cast(data); RWLock::WLocker wl(lock); entries[key] = *entry; } - void invalidate(const string& key) { + void invalidate(const string& key) override { RWLock::WLocker wl(lock); entries.erase(key); } - void invalidate_all() { + void invalidate_all() override { RWLock::WLocker wl(lock); entries.clear(); } @@ -3644,7 +3644,7 @@ public: is_complete(false), bucket_info(_bi), canceled(false) {} - virtual ~RGWPutObjProcessor() {} + ~RGWPutObjProcessor() override {} virtual int prepare(RGWRados *_store, string *oid_rand) { store = _store; return 0; @@ -3694,11 +3694,11 @@ protected: int handle_obj_data(rgw_raw_obj& obj, bufferlist& bl, off_t ofs, off_t abs_ofs, void **phandle, bool exclusive); public: - int prepare(RGWRados *store, string *oid_rand); - int throttle_data(void *handle, const rgw_raw_obj& obj, uint64_t size, bool need_to_wait); + int prepare(RGWRados *store, string *oid_rand) override; + int throttle_data(void *handle, const rgw_raw_obj& obj, uint64_t size, bool need_to_wait) override; RGWPutObjProcessor_Aio(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info) : RGWPutObjProcessor(obj_ctx, bucket_info) {} - virtual ~RGWPutObjProcessor_Aio(); + ~RGWPutObjProcessor_Aio() override; }; /* RGWPutObjProcessor_Aio */ class RGWPutObjProcessor_Atomic : public RGWPutObjProcessor_Aio @@ -3740,7 +3740,7 @@ protected: int prepare_init(RGWRados *store, string *oid_rand); public: - ~RGWPutObjProcessor_Atomic() {} + ~RGWPutObjProcessor_Atomic() override {} RGWPutObjProcessor_Atomic(RGWObjectCtx& obj_ctx, RGWBucketInfo& bucket_info, rgw_bucket& _b, const string& _o, uint64_t _p, const string& _t, bool versioned) : RGWPutObjProcessor_Aio(obj_ctx, bucket_info), @@ -3755,9 +3755,9 @@ public: bucket(_b), obj_str(_o), unique_tag(_t) {} - int prepare(RGWRados *store, string *oid_rand); + int prepare(RGWRados *store, string *oid_rand) override; virtual bool immutable_head() { return false; } - virtual int handle_data(bufferlist& bl, off_t ofs, void **phandle, rgw_raw_obj *pobj, bool *again); + int handle_data(bufferlist& bl, off_t ofs, void **phandle, rgw_raw_obj *pobj, bool *again) override; void set_olh_epoch(uint64_t epoch) { olh_epoch = epoch; diff --git a/src/rgw/rgw_realm_reloader.h b/src/rgw/rgw_realm_reloader.h index 3e60cd49d1f..3de54b1aabc 100644 --- a/src/rgw/rgw_realm_reloader.h +++ b/src/rgw/rgw_realm_reloader.h @@ -34,7 +34,7 @@ class RGWRealmReloader : public RGWRealmWatcher::Watcher { }; RGWRealmReloader(RGWRados*& store, Pauser* frontends); - ~RGWRealmReloader(); + ~RGWRealmReloader() override; /// respond to realm notifications by scheduling a reload() void handle_notify(RGWRealmNotify type, bufferlist::iterator& p) override; diff --git a/src/rgw/rgw_realm_watcher.h b/src/rgw/rgw_realm_watcher.h index b43501e3cf3..5c1240bbb4f 100644 --- a/src/rgw/rgw_realm_watcher.h +++ b/src/rgw/rgw_realm_watcher.h @@ -37,7 +37,7 @@ class RGWRealmWatcher : public librados::WatchCtx2 { }; RGWRealmWatcher(CephContext* cct, RGWRealm& realm); - ~RGWRealmWatcher(); + ~RGWRealmWatcher() override; /// register a watcher for the given notification type void add_watcher(RGWRealmNotify type, Watcher& watcher); diff --git a/src/rgw/rgw_request.h b/src/rgw/rgw_request.h index 08b3717decd..d9fc69bee1c 100644 --- a/src/rgw/rgw_request.h +++ b/src/rgw/rgw_request.h @@ -45,7 +45,7 @@ struct RGWFCGXRequest : public RGWRequest { qr->dequeue(&fcgx); } - ~RGWFCGXRequest() { + ~RGWFCGXRequest() override { FCGX_Finish_r(fcgx); qr->enqueue(fcgx); } diff --git a/src/rgw/rgw_rest.h b/src/rgw/rgw_rest.h index 7d616b3ecb2..6e0a87ea4cb 100644 --- a/src/rgw/rgw_rest.h +++ b/src/rgw/rgw_rest.h @@ -132,8 +132,8 @@ class RGWRESTFlusher : public RGWFormatterFlusher { struct req_state *s; RGWOp *op; protected: - virtual void do_flush(); - virtual void do_start(int ret); + void do_flush() override; + void do_start(int ret) override; public: RGWRESTFlusher(struct req_state *_s, RGWOp *_op) : RGWFormatterFlusher(_s->formatter), s(_s), op(_op) {} @@ -153,65 +153,65 @@ protected: public: RGWGetObj_ObjStore() : sent_header(false) {} - virtual void init(RGWRados *store, struct req_state *s, RGWHandler *h) { + void init(RGWRados *store, struct req_state *s, RGWHandler *h) override { RGWGetObj::init(store, s, h); sent_header = false; } - int get_params(); + int get_params() override; }; class RGWListBuckets_ObjStore : public RGWListBuckets { public: RGWListBuckets_ObjStore() {} - ~RGWListBuckets_ObjStore() {} + ~RGWListBuckets_ObjStore() override {} }; class RGWGetUsage_ObjStore : public RGWGetUsage { public: RGWGetUsage_ObjStore() {} - ~RGWGetUsage_ObjStore() {} + ~RGWGetUsage_ObjStore() override {} }; class RGWListBucket_ObjStore : public RGWListBucket { public: RGWListBucket_ObjStore() {} - ~RGWListBucket_ObjStore() {} + ~RGWListBucket_ObjStore() override {} }; class RGWStatAccount_ObjStore : public RGWStatAccount { public: RGWStatAccount_ObjStore() {} - ~RGWStatAccount_ObjStore() {} + ~RGWStatAccount_ObjStore() override {} }; class RGWStatBucket_ObjStore : public RGWStatBucket { public: RGWStatBucket_ObjStore() {} - ~RGWStatBucket_ObjStore() {} + ~RGWStatBucket_ObjStore() override {} }; class RGWCreateBucket_ObjStore : public RGWCreateBucket { public: RGWCreateBucket_ObjStore() {} - ~RGWCreateBucket_ObjStore() {} + ~RGWCreateBucket_ObjStore() override {} }; class RGWDeleteBucket_ObjStore : public RGWDeleteBucket { public: RGWDeleteBucket_ObjStore() {} - ~RGWDeleteBucket_ObjStore() {} + ~RGWDeleteBucket_ObjStore() override {} }; class RGWPutObj_ObjStore : public RGWPutObj { public: RGWPutObj_ObjStore() {} - ~RGWPutObj_ObjStore() {} + ~RGWPutObj_ObjStore() override {} - virtual int verify_params(); - virtual int get_params(); - virtual int get_data(bufferlist& bl); + int verify_params() override; + int get_params() override; + int get_data(bufferlist& bl) override; int get_padding_last_aws4_chunk_encoded(bufferlist &bl, uint64_t chunk_size); }; @@ -220,169 +220,169 @@ class RGWPostObj_ObjStore : public RGWPostObj { public: RGWPostObj_ObjStore() {} - ~RGWPostObj_ObjStore() {} + ~RGWPostObj_ObjStore() override {} - virtual int verify_params(); + int verify_params() override; }; class RGWPutMetadataAccount_ObjStore : public RGWPutMetadataAccount { public: RGWPutMetadataAccount_ObjStore() {} - ~RGWPutMetadataAccount_ObjStore() {} + ~RGWPutMetadataAccount_ObjStore() override {} }; class RGWPutMetadataBucket_ObjStore : public RGWPutMetadataBucket { public: RGWPutMetadataBucket_ObjStore() {} - ~RGWPutMetadataBucket_ObjStore() {} + ~RGWPutMetadataBucket_ObjStore() override {} }; class RGWPutMetadataObject_ObjStore : public RGWPutMetadataObject { public: RGWPutMetadataObject_ObjStore() {} - ~RGWPutMetadataObject_ObjStore() {} + ~RGWPutMetadataObject_ObjStore() override {} }; class RGWDeleteObj_ObjStore : public RGWDeleteObj { public: RGWDeleteObj_ObjStore() {} - ~RGWDeleteObj_ObjStore() {} + ~RGWDeleteObj_ObjStore() override {} }; class RGWGetCrossDomainPolicy_ObjStore : public RGWGetCrossDomainPolicy { public: RGWGetCrossDomainPolicy_ObjStore() = default; - ~RGWGetCrossDomainPolicy_ObjStore() = default; + ~RGWGetCrossDomainPolicy_ObjStore() override = default; }; class RGWGetHealthCheck_ObjStore : public RGWGetHealthCheck { public: RGWGetHealthCheck_ObjStore() = default; - ~RGWGetHealthCheck_ObjStore() = default; + ~RGWGetHealthCheck_ObjStore() override = default; }; class RGWCopyObj_ObjStore : public RGWCopyObj { public: RGWCopyObj_ObjStore() {} - ~RGWCopyObj_ObjStore() {} + ~RGWCopyObj_ObjStore() override {} }; class RGWGetACLs_ObjStore : public RGWGetACLs { public: RGWGetACLs_ObjStore() {} - ~RGWGetACLs_ObjStore() {} + ~RGWGetACLs_ObjStore() override {} }; class RGWPutACLs_ObjStore : public RGWPutACLs { public: RGWPutACLs_ObjStore() {} - ~RGWPutACLs_ObjStore() {} + ~RGWPutACLs_ObjStore() override {} - virtual int get_params(); + int get_params() override; }; class RGWGetLC_ObjStore : public RGWGetLC { public: RGWGetLC_ObjStore() {} - ~RGWGetLC_ObjStore() {} + ~RGWGetLC_ObjStore() override {} }; class RGWPutLC_ObjStore : public RGWPutLC { public: RGWPutLC_ObjStore() {} - ~RGWPutLC_ObjStore() {} + ~RGWPutLC_ObjStore() override {} - int get_params(); + int get_params() override; }; class RGWDeleteLC_ObjStore : public RGWDeleteLC { public: RGWDeleteLC_ObjStore() {} - ~RGWDeleteLC_ObjStore() {} + ~RGWDeleteLC_ObjStore() override {} }; class RGWGetCORS_ObjStore : public RGWGetCORS { public: RGWGetCORS_ObjStore() {} - ~RGWGetCORS_ObjStore() {} + ~RGWGetCORS_ObjStore() override {} }; class RGWPutCORS_ObjStore : public RGWPutCORS { public: RGWPutCORS_ObjStore() {} - ~RGWPutCORS_ObjStore() {} + ~RGWPutCORS_ObjStore() override {} }; class RGWDeleteCORS_ObjStore : public RGWDeleteCORS { public: RGWDeleteCORS_ObjStore() {} - ~RGWDeleteCORS_ObjStore() {} + ~RGWDeleteCORS_ObjStore() override {} }; class RGWOptionsCORS_ObjStore : public RGWOptionsCORS { public: RGWOptionsCORS_ObjStore() {} - ~RGWOptionsCORS_ObjStore() {} + ~RGWOptionsCORS_ObjStore() override {} }; class RGWInitMultipart_ObjStore : public RGWInitMultipart { public: RGWInitMultipart_ObjStore() {} - ~RGWInitMultipart_ObjStore() {} + ~RGWInitMultipart_ObjStore() override {} }; class RGWCompleteMultipart_ObjStore : public RGWCompleteMultipart { public: RGWCompleteMultipart_ObjStore() {} - ~RGWCompleteMultipart_ObjStore() {} + ~RGWCompleteMultipart_ObjStore() override {} - virtual int get_params(); + int get_params() override; }; class RGWAbortMultipart_ObjStore : public RGWAbortMultipart { public: RGWAbortMultipart_ObjStore() {} - ~RGWAbortMultipart_ObjStore() {} + ~RGWAbortMultipart_ObjStore() override {} }; class RGWListMultipart_ObjStore : public RGWListMultipart { public: RGWListMultipart_ObjStore() {} - ~RGWListMultipart_ObjStore() {} + ~RGWListMultipart_ObjStore() override {} - int get_params(); + int get_params() override; }; class RGWListBucketMultiparts_ObjStore : public RGWListBucketMultiparts { public: RGWListBucketMultiparts_ObjStore() {} - ~RGWListBucketMultiparts_ObjStore() {} + ~RGWListBucketMultiparts_ObjStore() override {} - int get_params(); + int get_params() override; }; class RGWBulkDelete_ObjStore : public RGWBulkDelete { public: RGWBulkDelete_ObjStore() {} - ~RGWBulkDelete_ObjStore() {} + ~RGWBulkDelete_ObjStore() override {} }; class RGWDeleteMultiObj_ObjStore : public RGWDeleteMultiObj { public: RGWDeleteMultiObj_ObjStore() {} - ~RGWDeleteMultiObj_ObjStore() {} + ~RGWDeleteMultiObj_ObjStore() override {} - virtual int get_params(); + int get_params() override; }; class RGWInfo_ObjStore : public RGWInfo { public: RGWInfo_ObjStore() = default; - ~RGWInfo_ObjStore() = default; + ~RGWInfo_ObjStore() override = default; }; class RGWRESTOp : public RGWOp { @@ -391,15 +391,15 @@ protected: RGWRESTFlusher flusher; public: RGWRESTOp() : http_ret(0) {} - virtual void init(RGWRados *store, struct req_state *s, - RGWHandler *dialect_handler) { + void init(RGWRados *store, struct req_state *s, + RGWHandler *dialect_handler) override { RGWOp::init(store, s, dialect_handler); flusher.init(s, this); } - virtual void send_response(); + void send_response() override; virtual int check_caps(RGWUserCaps& caps) { return -EPERM; } /* should to be implemented! */ - virtual int verify_permission(); + int verify_permission() override; }; class RGWHandler_REST : public RGWHandler { @@ -421,14 +421,14 @@ public: static constexpr int MAX_OBJ_NAME_LEN = 1024; RGWHandler_REST() {} - virtual ~RGWHandler_REST() {} + ~RGWHandler_REST() override {} static int validate_tenant_name(const string& bucket); static int validate_bucket_name(const string& bucket); static int validate_object_name(const string& object); - int init_permissions(RGWOp* op); - int read_permissions(RGWOp* op); + int init_permissions(RGWOp* op) override; + int read_permissions(RGWOp* op) override; virtual RGWOp* get_op(RGWRados* store); virtual void put_op(RGWOp* op); diff --git a/src/rgw/rgw_rest_admin.h b/src/rgw/rgw_rest_admin.h index 7f86b246f60..d23dd9d395d 100644 --- a/src/rgw/rgw_rest_admin.h +++ b/src/rgw/rgw_rest_admin.h @@ -8,7 +8,7 @@ class RGWRESTMgr_Admin : public RGWRESTMgr { public: RGWRESTMgr_Admin() {} - virtual ~RGWRESTMgr_Admin() {} + ~RGWRESTMgr_Admin() override {} }; diff --git a/src/rgw/rgw_rest_bucket.h b/src/rgw/rgw_rest_bucket.h index 547bc9e7a9b..108151500ba 100644 --- a/src/rgw/rgw_rest_bucket.h +++ b/src/rgw/rgw_rest_bucket.h @@ -10,15 +10,15 @@ class RGWHandler_Bucket : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get(); - RGWOp *op_put(); - RGWOp *op_post(); - RGWOp *op_delete(); + RGWOp *op_get() override; + RGWOp *op_put() override; + RGWOp *op_post() override; + RGWOp *op_delete() override; public: RGWHandler_Bucket() {} - virtual ~RGWHandler_Bucket() {} + ~RGWHandler_Bucket() override {} - int read_permissions(RGWOp*) { + int read_permissions(RGWOp*) override { return 0; } }; @@ -26,7 +26,7 @@ public: class RGWRESTMgr_Bucket : public RGWRESTMgr { public: RGWRESTMgr_Bucket() = default; - virtual ~RGWRESTMgr_Bucket() = default; + ~RGWRESTMgr_Bucket() override = default; RGWHandler_REST* get_handler(struct req_state*, const std::string&) override { diff --git a/src/rgw/rgw_rest_client.h b/src/rgw/rgw_rest_client.h index 709e83b8cc9..e09bb2fd57b 100644 --- a/src/rgw/rgw_rest_client.h +++ b/src/rgw/rgw_rest_client.h @@ -47,9 +47,9 @@ public: params = *_params; } - int receive_header(void *ptr, size_t len); - virtual int receive_data(void *ptr, size_t len); - virtual int send_data(void *ptr, size_t len); + int receive_header(void *ptr, size_t len) override; + int receive_data(void *ptr, size_t len) override; + int send_data(void *ptr, size_t len) override; bufferlist& get_response() { return response; } @@ -70,12 +70,12 @@ class RGWRESTStreamWriteRequest : public RGWRESTSimpleRequest { RGWHTTPManager http_manager; public: int add_output_data(bufferlist& bl); - int send_data(void *ptr, size_t len); + int send_data(void *ptr, size_t len) override; RGWRESTStreamWriteRequest(CephContext *_cct, const string& _url, param_vec_t *_headers, param_vec_t *_params) : RGWRESTSimpleRequest(_cct, _url, _headers, _params), lock("RGWRESTStreamWriteRequest"), cb(NULL), http_manager(_cct) {} - ~RGWRESTStreamWriteRequest(); + ~RGWRESTStreamWriteRequest() override; int put_obj_init(RGWAccessKey& key, rgw_obj& obj, uint64_t obj_size, map& attrs); int complete(string& etag, real_time *mtime); @@ -93,17 +93,17 @@ class RGWRESTStreamRWRequest : public RGWRESTSimpleRequest { const char *method; uint64_t write_ofs; protected: - int handle_header(const string& name, const string& val); + int handle_header(const string& name, const string& val) override; public: - int send_data(void *ptr, size_t len); - int receive_data(void *ptr, size_t len); + int send_data(void *ptr, size_t len) override; + int receive_data(void *ptr, size_t len) override; RGWRESTStreamRWRequest(CephContext *_cct, const char *_method, const string& _url, RGWGetDataCB *_cb, param_vec_t *_headers, param_vec_t *_params) : RGWRESTSimpleRequest(_cct, _url, _headers, _params), lock("RGWRESTStreamReadRequest"), cb(_cb), chunk_ofs(0), ofs(0), http_manager(_cct), method(_method), write_ofs(0) { } - virtual ~RGWRESTStreamRWRequest() {} + ~RGWRESTStreamRWRequest() override {} int get_obj(RGWAccessKey& key, map& extra_headers, rgw_obj& obj); int get_resource(RGWAccessKey& key, map& extra_headers, const string& resource, RGWHTTPManager *mgr = NULL); int complete(string& etag, real_time *mtime, uint64_t *psize, map& attrs); diff --git a/src/rgw/rgw_rest_config.h b/src/rgw/rgw_rest_config.h index 8835c1a821f..a324334a995 100644 --- a/src/rgw/rgw_rest_config.h +++ b/src/rgw/rgw_rest_config.h @@ -20,14 +20,14 @@ class RGWOp_ZoneGroupMap_Get : public RGWRESTOp { bool old_format; public: RGWOp_ZoneGroupMap_Get(bool _old_format):old_format(_old_format) {} - ~RGWOp_ZoneGroupMap_Get() {} + ~RGWOp_ZoneGroupMap_Get() override {} - int verify_permission() { + int verify_permission() override { return 0; } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { if (old_format) { return "get_region_map"; } else { @@ -56,21 +56,21 @@ public: class RGWHandler_Config : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get(); + RGWOp *op_get() override; - int read_permissions(RGWOp*) { + int read_permissions(RGWOp*) override { return 0; } public: RGWHandler_Config() : RGWHandler_Auth_S3() {} - virtual ~RGWHandler_Config() {} + ~RGWHandler_Config() override {} }; class RGWRESTMgr_Config : public RGWRESTMgr { public: RGWRESTMgr_Config() = default; - virtual ~RGWRESTMgr_Config() = default; + ~RGWRESTMgr_Config() override = default; RGWHandler_REST* get_handler(struct req_state*, const std::string&) override { diff --git a/src/rgw/rgw_rest_conn.h b/src/rgw/rgw_rest_conn.h index f312efdaf43..38d1d336421 100644 --- a/src/rgw/rgw_rest_conn.h +++ b/src/rgw/rgw_rest_conn.h @@ -132,7 +132,7 @@ class RGWStreamIntoBufferlist : public RGWGetDataCB { bufferlist& bl; public: RGWStreamIntoBufferlist(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_log.h b/src/rgw/rgw_rest_log.h index cf972a02d4d..8c6cf5251d1 100644 --- a/src/rgw/rgw_rest_log.h +++ b/src/rgw/rgw_rest_log.h @@ -21,19 +21,19 @@ class RGWOp_BILog_List : public RGWRESTOp { bool sent_header; public: RGWOp_BILog_List() : sent_header(false) {} - ~RGWOp_BILog_List() {} + ~RGWOp_BILog_List() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("bilog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - virtual void send_response(); + void send_response() override; virtual void send_response(list& entries, string& marker); virtual void send_response_end(); - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "list_bucket_index_log"; } }; @@ -44,17 +44,17 @@ class RGWOp_BILog_Info : public RGWRESTOp { string max_marker; public: RGWOp_BILog_Info() : bucket_ver(), master_ver() {} - ~RGWOp_BILog_Info() {} + ~RGWOp_BILog_Info() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("bilog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - virtual void send_response(); - void execute(); - virtual const string name() { + void send_response() override; + void execute() override; + const string name() override { return "bucket_index_log_info"; } }; @@ -62,13 +62,13 @@ public: class RGWOp_BILog_Delete : public RGWRESTOp { public: RGWOp_BILog_Delete() {} - ~RGWOp_BILog_Delete() {} + ~RGWOp_BILog_Delete() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("bilog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "trim_bucket_index_log"; } }; @@ -79,17 +79,17 @@ class RGWOp_MDLog_List : public RGWRESTOp { bool truncated; public: RGWOp_MDLog_List() : truncated(false) {} - ~RGWOp_MDLog_List() {} + ~RGWOp_MDLog_List() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("mdlog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { return "list_metadata_log"; } }; @@ -99,17 +99,17 @@ class RGWOp_MDLog_Info : public RGWRESTOp { RGWPeriodHistory::Cursor period; public: RGWOp_MDLog_Info() : num_objects(0) {} - ~RGWOp_MDLog_Info() {} + ~RGWOp_MDLog_Info() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("mdlog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { return "get_metadata_log_info"; } }; @@ -118,17 +118,17 @@ class RGWOp_MDLog_ShardInfo : public RGWRESTOp { RGWMetadataLogInfo info; public: RGWOp_MDLog_ShardInfo() {} - ~RGWOp_MDLog_ShardInfo() {} + ~RGWOp_MDLog_ShardInfo() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("mdlog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { return "get_metadata_log_shard_info"; } }; @@ -136,13 +136,13 @@ public: class RGWOp_MDLog_Lock : public RGWRESTOp { public: RGWOp_MDLog_Lock() {} - ~RGWOp_MDLog_Lock() {} + ~RGWOp_MDLog_Lock() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("mdlog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "lock_mdlog_object"; } }; @@ -150,13 +150,13 @@ public: class RGWOp_MDLog_Unlock : public RGWRESTOp { public: RGWOp_MDLog_Unlock() {} - ~RGWOp_MDLog_Unlock() {} + ~RGWOp_MDLog_Unlock() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("mdlog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "unlock_mdlog_object"; } }; @@ -164,13 +164,13 @@ public: class RGWOp_MDLog_Notify : public RGWRESTOp { public: RGWOp_MDLog_Notify() {} - ~RGWOp_MDLog_Notify() {} + ~RGWOp_MDLog_Notify() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("mdlog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "mdlog_notify"; } }; @@ -178,13 +178,13 @@ public: class RGWOp_MDLog_Delete : public RGWRESTOp { public: RGWOp_MDLog_Delete() {} - ~RGWOp_MDLog_Delete() {} + ~RGWOp_MDLog_Delete() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("mdlog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "trim_metadata_log"; } }; @@ -196,17 +196,17 @@ class RGWOp_DATALog_List : public RGWRESTOp { bool extra_info; public: RGWOp_DATALog_List() : truncated(false), extra_info(false) {} - ~RGWOp_DATALog_List() {} + ~RGWOp_DATALog_List() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("datalog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { return "list_data_changes_log"; } }; @@ -215,17 +215,17 @@ class RGWOp_DATALog_Info : public RGWRESTOp { unsigned num_objects; public: RGWOp_DATALog_Info() : num_objects(0) {} - ~RGWOp_DATALog_Info() {} + ~RGWOp_DATALog_Info() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("datalog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { return "get_data_changes_log_info"; } }; @@ -234,17 +234,17 @@ class RGWOp_DATALog_ShardInfo : public RGWRESTOp { RGWDataChangesLogInfo info; public: RGWOp_DATALog_ShardInfo() {} - ~RGWOp_DATALog_ShardInfo() {} + ~RGWOp_DATALog_ShardInfo() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("datalog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { return "get_data_changes_log_shard_info"; } }; @@ -252,13 +252,13 @@ public: class RGWOp_DATALog_Lock : public RGWRESTOp { public: RGWOp_DATALog_Lock() {} - ~RGWOp_DATALog_Lock() {} + ~RGWOp_DATALog_Lock() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("datalog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "lock_datalog_object"; } }; @@ -266,13 +266,13 @@ public: class RGWOp_DATALog_Unlock : public RGWRESTOp { public: RGWOp_DATALog_Unlock() {} - ~RGWOp_DATALog_Unlock() {} + ~RGWOp_DATALog_Unlock() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("datalog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "unlock_datalog_object"; } }; @@ -280,13 +280,13 @@ public: class RGWOp_DATALog_Notify : public RGWRESTOp { public: RGWOp_DATALog_Notify() {} - ~RGWOp_DATALog_Notify() {} + ~RGWOp_DATALog_Notify() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("datalog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "datalog_notify"; } }; @@ -294,35 +294,35 @@ public: class RGWOp_DATALog_Delete : public RGWRESTOp { public: RGWOp_DATALog_Delete() {} - ~RGWOp_DATALog_Delete() {} + ~RGWOp_DATALog_Delete() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("datalog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "trim_data_changes_log"; } }; class RGWHandler_Log : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get(); - RGWOp *op_delete(); - RGWOp *op_post(); + RGWOp *op_get() override; + RGWOp *op_delete() override; + RGWOp *op_post() override; - int read_permissions(RGWOp*) { + int read_permissions(RGWOp*) override { return 0; } public: RGWHandler_Log() : RGWHandler_Auth_S3() {} - virtual ~RGWHandler_Log() {} + ~RGWHandler_Log() override {} }; class RGWRESTMgr_Log : public RGWRESTMgr { public: RGWRESTMgr_Log() = default; - virtual ~RGWRESTMgr_Log() = default; + ~RGWRESTMgr_Log() override = default; RGWHandler_REST* get_handler(struct req_state* const, const std::string& frontend_prefixs) override { diff --git a/src/rgw/rgw_rest_metadata.h b/src/rgw/rgw_rest_metadata.h index d0272f4b2b7..ccd4b903637 100644 --- a/src/rgw/rgw_rest_metadata.h +++ b/src/rgw/rgw_rest_metadata.h @@ -18,25 +18,25 @@ class RGWOp_Metadata_List : public RGWRESTOp { public: RGWOp_Metadata_List() {} - ~RGWOp_Metadata_List() {} + ~RGWOp_Metadata_List() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("metadata", RGW_CAP_READ); } - void execute(); - virtual const string name(); + void execute() override; + const string name() override; }; class RGWOp_Metadata_Get : public RGWRESTOp { public: RGWOp_Metadata_Get() {} - ~RGWOp_Metadata_Get() {} + ~RGWOp_Metadata_Get() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("metadata", RGW_CAP_READ); } - void execute(); - virtual const string name(); + void execute() override; + const string name() override; }; class RGWOp_Metadata_Put : public RGWRESTOp { @@ -45,39 +45,39 @@ class RGWOp_Metadata_Put : public RGWRESTOp { obj_version ondisk_version; public: RGWOp_Metadata_Put() {} - ~RGWOp_Metadata_Put() {} + ~RGWOp_Metadata_Put() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("metadata", RGW_CAP_WRITE); } - void execute(); - void send_response(); - virtual const string name() { return "set_metadata"; } - RGWOpType get_type() { return RGW_OP_ADMIN_SET_METADATA; } + void execute() override; + void send_response() override; + const string name() override { return "set_metadata"; } + RGWOpType get_type() override { return RGW_OP_ADMIN_SET_METADATA; } }; class RGWOp_Metadata_Delete : public RGWRESTOp { public: RGWOp_Metadata_Delete() {} - ~RGWOp_Metadata_Delete() {} + ~RGWOp_Metadata_Delete() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("metadata", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { return "remove_metadata"; } + void execute() override; + const string name() override { return "remove_metadata"; } }; class RGWOp_Metadata_Lock : public RGWRESTOp { public: RGWOp_Metadata_Lock() {} - ~RGWOp_Metadata_Lock() {} + ~RGWOp_Metadata_Lock() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("metadata", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "lock_metadata_object"; } }; @@ -85,36 +85,36 @@ public: class RGWOp_Metadata_Unlock : public RGWRESTOp { public: RGWOp_Metadata_Unlock() {} - ~RGWOp_Metadata_Unlock() {} + ~RGWOp_Metadata_Unlock() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("metadata", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "unlock_metadata_object"; } }; class RGWHandler_Metadata : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get(); - RGWOp *op_put(); - RGWOp *op_delete(); - RGWOp *op_post(); + RGWOp *op_get() override; + RGWOp *op_put() override; + RGWOp *op_delete() override; + RGWOp *op_post() override; - int read_permissions(RGWOp*) { + int read_permissions(RGWOp*) override { return 0; } public: RGWHandler_Metadata() : RGWHandler_Auth_S3() {} - virtual ~RGWHandler_Metadata() {} + ~RGWHandler_Metadata() override {} }; class RGWRESTMgr_Metadata : public RGWRESTMgr { public: RGWRESTMgr_Metadata() = default; - virtual ~RGWRESTMgr_Metadata() = default; + ~RGWRESTMgr_Metadata() override = default; RGWHandler_REST* get_handler(struct req_state* const s, const std::string& frontend_prefix) override { diff --git a/src/rgw/rgw_rest_opstate.h b/src/rgw/rgw_rest_opstate.h index 632ef26c2e1..8439f5ebbd2 100644 --- a/src/rgw/rgw_rest_opstate.h +++ b/src/rgw/rgw_rest_opstate.h @@ -19,19 +19,19 @@ class RGWOp_Opstate_List : public RGWRESTOp { bool sent_header; public: RGWOp_Opstate_List() : sent_header(false) {} - ~RGWOp_Opstate_List() {} + ~RGWOp_Opstate_List() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("opstate", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); + void execute() override; + void send_response() override; virtual void send_response(list entries); virtual void send_response_end(); - virtual const string name() { + const string name() override { return "opstate_list"; } }; @@ -39,13 +39,13 @@ public: class RGWOp_Opstate_Set : public RGWRESTOp { public: RGWOp_Opstate_Set() {} - ~RGWOp_Opstate_Set() {} + ~RGWOp_Opstate_Set() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("opstate", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "set_opstate"; } }; @@ -53,13 +53,13 @@ public: class RGWOp_Opstate_Renew : public RGWRESTOp { public: RGWOp_Opstate_Renew() {} - ~RGWOp_Opstate_Renew() {} + ~RGWOp_Opstate_Renew() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("opstate", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "renew_opstate"; } }; @@ -67,39 +67,39 @@ public: class RGWOp_Opstate_Delete : public RGWRESTOp { public: RGWOp_Opstate_Delete() {} - ~RGWOp_Opstate_Delete() {} + ~RGWOp_Opstate_Delete() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("opstate", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "delete_opstate"; } }; class RGWHandler_Opstate : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get() { + RGWOp *op_get() override { return new RGWOp_Opstate_List; } - RGWOp *op_delete() { + RGWOp *op_delete() override { return new RGWOp_Opstate_Delete; } - RGWOp *op_post(); + RGWOp *op_post() override; - int read_permissions(RGWOp*) { + int read_permissions(RGWOp*) override { return 0; } public: RGWHandler_Opstate() : RGWHandler_Auth_S3() {} - virtual ~RGWHandler_Opstate() {} + ~RGWHandler_Opstate() override {} }; class RGWRESTMgr_Opstate : public RGWRESTMgr { public: RGWRESTMgr_Opstate() = default; - virtual ~RGWRESTMgr_Opstate() = default; + ~RGWRESTMgr_Opstate() override = default; RGWHandler_REST* get_handler(struct req_state*, const std::string&) override { diff --git a/src/rgw/rgw_rest_replica_log.h b/src/rgw/rgw_rest_replica_log.h index a264cb7986e..aad920c4fd9 100644 --- a/src/rgw/rgw_rest_replica_log.h +++ b/src/rgw/rgw_rest_replica_log.h @@ -23,17 +23,17 @@ class RGWOp_OBJLog_GetBounds : public RGWRESTOp { public: RGWOp_OBJLog_GetBounds(const char *_prefix, const char *type) : prefix(_prefix), obj_type(type){} - ~RGWOp_OBJLog_GetBounds() {} + ~RGWOp_OBJLog_GetBounds() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap(obj_type.c_str(), RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { string s = "replica"; s.append(obj_type); s.append("_getbounds"); @@ -47,13 +47,13 @@ class RGWOp_OBJLog_SetBounds : public RGWRESTOp { public: RGWOp_OBJLog_SetBounds(const char *_prefix, const char *type) : prefix(_prefix), obj_type(type){} - ~RGWOp_OBJLog_SetBounds() {} + ~RGWOp_OBJLog_SetBounds() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap(obj_type.c_str(), RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { string s = "replica"; s.append(obj_type); s.append("_updatebounds"); @@ -67,13 +67,13 @@ class RGWOp_OBJLog_DeleteBounds : public RGWRESTOp { public: RGWOp_OBJLog_DeleteBounds(const char *_prefix, const char *type) : prefix(_prefix), obj_type(type){} - ~RGWOp_OBJLog_DeleteBounds() {} + ~RGWOp_OBJLog_DeleteBounds() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap(obj_type.c_str(), RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { string s = "replica"; s.append(obj_type); s.append("_deletebound"); @@ -85,17 +85,17 @@ class RGWOp_BILog_GetBounds : public RGWRESTOp { RGWReplicaBounds bounds; public: RGWOp_BILog_GetBounds() {} - ~RGWOp_BILog_GetBounds() {} + ~RGWOp_BILog_GetBounds() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("bilog", RGW_CAP_READ); } - int verify_permission() { + int verify_permission() override { return check_caps(s->user->caps); } - void execute(); - virtual void send_response(); - virtual const string name() { + void execute() override; + void send_response() override; + const string name() override { return "replicabilog_getbounds"; } }; @@ -103,13 +103,13 @@ public: class RGWOp_BILog_SetBounds : public RGWRESTOp { public: RGWOp_BILog_SetBounds() {} - ~RGWOp_BILog_SetBounds() {} + ~RGWOp_BILog_SetBounds() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("bilog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "replicabilog_updatebounds"; } }; @@ -117,35 +117,35 @@ public: class RGWOp_BILog_DeleteBounds : public RGWRESTOp { public: RGWOp_BILog_DeleteBounds() {} - ~RGWOp_BILog_DeleteBounds() {} + ~RGWOp_BILog_DeleteBounds() override {} - int check_caps(RGWUserCaps& caps) { + int check_caps(RGWUserCaps& caps) override { return caps.check_cap("bilog", RGW_CAP_WRITE); } - void execute(); - virtual const string name() { + void execute() override; + const string name() override { return "replicabilog_deletebound"; } }; class RGWHandler_ReplicaLog : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get(); - RGWOp *op_delete(); - RGWOp *op_post(); + RGWOp *op_get() override; + RGWOp *op_delete() override; + RGWOp *op_post() override; - int read_permissions(RGWOp*) { + int read_permissions(RGWOp*) override { return 0; } public: RGWHandler_ReplicaLog() : RGWHandler_Auth_S3() {} - virtual ~RGWHandler_ReplicaLog() {} + ~RGWHandler_ReplicaLog() override {} }; class RGWRESTMgr_ReplicaLog : public RGWRESTMgr { public: RGWRESTMgr_ReplicaLog() = default; - virtual ~RGWRESTMgr_ReplicaLog() = default; + ~RGWRESTMgr_ReplicaLog() override = default; RGWHandler_REST* get_handler(struct req_state*, const std::string&) override { diff --git a/src/rgw/rgw_rest_role.h b/src/rgw/rgw_rest_role.h index 887eda89162..de3ec97a637 100644 --- a/src/rgw/rgw_rest_role.h +++ b/src/rgw/rgw_rest_role.h @@ -11,21 +11,21 @@ protected: string path_prefix; public: - virtual void send_response() override; + void send_response() override; }; class RGWRoleRead : public RGWRestRole { public: RGWRoleRead() = default; - virtual int verify_permission() override; - virtual uint32_t op_mask() override { return RGW_OP_TYPE_READ; } + int verify_permission() override; + uint32_t op_mask() override { return RGW_OP_TYPE_READ; } }; class RGWRoleWrite : public RGWRestRole { public: RGWRoleWrite() = default; - virtual int verify_permission() override; - virtual uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } + int verify_permission() override; + uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } }; class RGWCreateRole : public RGWRoleWrite { diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 83c267ff3b2..a9175eeefdf 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -706,7 +706,7 @@ class RGWSetBucketVersioningParser : public RGWXMLParser public: RGWSetBucketVersioningParser() {} - ~RGWSetBucketVersioningParser() {} + ~RGWSetBucketVersioningParser() override {} int get_versioning_status(bool *status) { XMLObj *config = find_first("VersioningConfiguration"); @@ -902,7 +902,7 @@ class RGWLocationConstraint : public XMLObj { public: RGWLocationConstraint() {} - ~RGWLocationConstraint() {} + ~RGWLocationConstraint() override {} bool xml_end(const char *el) override { if (!el) return false; @@ -919,7 +919,7 @@ class RGWCreateBucketConfig : public XMLObj { public: RGWCreateBucketConfig() {} - ~RGWCreateBucketConfig() {} + ~RGWCreateBucketConfig() override {} }; class RGWCreateBucketParser : public RGWXMLParser @@ -930,7 +930,7 @@ class RGWCreateBucketParser : public RGWXMLParser public: RGWCreateBucketParser() {} - ~RGWCreateBucketParser() {} + ~RGWCreateBucketParser() override {} bool get_location_constraint(string& zone_group) { XMLObj *config = find_first("CreateBucketConfiguration"); @@ -2553,7 +2553,7 @@ class RGWSetRequestPaymentParser : public RGWXMLParser public: RGWSetRequestPaymentParser() {} - ~RGWSetRequestPaymentParser() {} + ~RGWSetRequestPaymentParser() override {} int get_request_payment_payer(bool *requester_pays) { XMLObj *config = find_first("RequestPaymentConfiguration"); diff --git a/src/rgw/rgw_rest_s3.h b/src/rgw/rgw_rest_s3.h index a5a17686dd8..c89e7c32980 100644 --- a/src/rgw/rgw_rest_s3.h +++ b/src/rgw/rgw_rest_s3.h @@ -35,34 +35,34 @@ protected: int custom_http_ret = 0; public: RGWGetObj_ObjStore_S3() {} - ~RGWGetObj_ObjStore_S3() {} + ~RGWGetObj_ObjStore_S3() override {} - int send_response_data_error(); - int send_response_data(bufferlist& bl, off_t ofs, off_t len); + int send_response_data_error() override; + int send_response_data(bufferlist& bl, off_t ofs, off_t len) override; void set_custom_http_response(int http_ret) { custom_http_ret = http_ret; } }; class RGWListBuckets_ObjStore_S3 : public RGWListBuckets_ObjStore { public: RGWListBuckets_ObjStore_S3() {} - ~RGWListBuckets_ObjStore_S3() {} + ~RGWListBuckets_ObjStore_S3() override {} - int get_params() { + int get_params() override { limit = -1; /* no limit */ return 0; } - virtual void send_response_begin(bool has_buckets); - virtual void send_response_data(RGWUserBuckets& buckets); - virtual void send_response_end(); + void send_response_begin(bool has_buckets) override; + void send_response_data(RGWUserBuckets& buckets) override; + void send_response_end() override; }; class RGWGetUsage_ObjStore_S3 : public RGWGetUsage_ObjStore { public: RGWGetUsage_ObjStore_S3() {} - ~RGWGetUsage_ObjStore_S3() {} + ~RGWGetUsage_ObjStore_S3() override {} - int get_params() ; - virtual void send_response(); + int get_params() override ; + void send_response() override; }; class RGWListBucket_ObjStore_S3 : public RGWListBucket_ObjStore { @@ -71,104 +71,104 @@ public: RGWListBucket_ObjStore_S3() : objs_container(false) { default_max = 1000; } - ~RGWListBucket_ObjStore_S3() {} + ~RGWListBucket_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; void send_versioned_response(); }; class RGWGetBucketLogging_ObjStore_S3 : public RGWGetBucketLogging { public: RGWGetBucketLogging_ObjStore_S3() {} - ~RGWGetBucketLogging_ObjStore_S3() {} + ~RGWGetBucketLogging_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWGetBucketLocation_ObjStore_S3 : public RGWGetBucketLocation { public: RGWGetBucketLocation_ObjStore_S3() {} - ~RGWGetBucketLocation_ObjStore_S3() {} + ~RGWGetBucketLocation_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWGetBucketVersioning_ObjStore_S3 : public RGWGetBucketVersioning { public: RGWGetBucketVersioning_ObjStore_S3() {} - ~RGWGetBucketVersioning_ObjStore_S3() {} + ~RGWGetBucketVersioning_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWSetBucketVersioning_ObjStore_S3 : public RGWSetBucketVersioning { public: RGWSetBucketVersioning_ObjStore_S3() {} - ~RGWSetBucketVersioning_ObjStore_S3() {} + ~RGWSetBucketVersioning_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWGetBucketWebsite_ObjStore_S3 : public RGWGetBucketWebsite { public: RGWGetBucketWebsite_ObjStore_S3() {} - ~RGWGetBucketWebsite_ObjStore_S3() {} + ~RGWGetBucketWebsite_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWSetBucketWebsite_ObjStore_S3 : public RGWSetBucketWebsite { public: RGWSetBucketWebsite_ObjStore_S3() {} - ~RGWSetBucketWebsite_ObjStore_S3() {} + ~RGWSetBucketWebsite_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWDeleteBucketWebsite_ObjStore_S3 : public RGWDeleteBucketWebsite { public: RGWDeleteBucketWebsite_ObjStore_S3() {} - ~RGWDeleteBucketWebsite_ObjStore_S3() {} + ~RGWDeleteBucketWebsite_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWStatBucket_ObjStore_S3 : public RGWStatBucket_ObjStore { public: RGWStatBucket_ObjStore_S3() {} - ~RGWStatBucket_ObjStore_S3() {} + ~RGWStatBucket_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWCreateBucket_ObjStore_S3 : public RGWCreateBucket_ObjStore { public: RGWCreateBucket_ObjStore_S3() {} - ~RGWCreateBucket_ObjStore_S3() {} + ~RGWCreateBucket_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWDeleteBucket_ObjStore_S3 : public RGWDeleteBucket_ObjStore { public: RGWDeleteBucket_ObjStore_S3() {} - ~RGWDeleteBucket_ObjStore_S3() {} + ~RGWDeleteBucket_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWPutObj_ObjStore_S3 : public RGWPutObj_ObjStore { public: RGWPutObj_ObjStore_S3() {} - ~RGWPutObj_ObjStore_S3() {} + ~RGWPutObj_ObjStore_S3() override {} - int get_params(); - int get_data(bufferlist& bl); - void send_response(); + int get_params() override; + int get_data(bufferlist& bl) override; + void send_response() override; int validate_aws4_single_chunk(char *chunk_str, char *chunk_data_str, @@ -217,51 +217,51 @@ class RGWPostObj_ObjStore_S3 : public RGWPostObj_ObjStore { void rebuild_key(string& key); public: RGWPostObj_ObjStore_S3() {} - ~RGWPostObj_ObjStore_S3() {} + ~RGWPostObj_ObjStore_S3() override {} - int get_params(); + int get_params() override; int complete_get_params(); - void send_response(); - int get_data(bufferlist& bl); + void send_response() override; + int get_data(bufferlist& bl) override; }; class RGWDeleteObj_ObjStore_S3 : public RGWDeleteObj_ObjStore { public: RGWDeleteObj_ObjStore_S3() {} - ~RGWDeleteObj_ObjStore_S3() {} + ~RGWDeleteObj_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWCopyObj_ObjStore_S3 : public RGWCopyObj_ObjStore { bool sent_header; public: RGWCopyObj_ObjStore_S3() : sent_header(false) {} - ~RGWCopyObj_ObjStore_S3() {} + ~RGWCopyObj_ObjStore_S3() override {} - int init_dest_policy(); - int get_params(); - void send_partial_response(off_t ofs); - void send_response(); + int init_dest_policy() override; + int get_params() override; + void send_partial_response(off_t ofs) override; + void send_response() override; }; class RGWGetACLs_ObjStore_S3 : public RGWGetACLs_ObjStore { public: RGWGetACLs_ObjStore_S3() {} - ~RGWGetACLs_ObjStore_S3() {} + ~RGWGetACLs_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWPutACLs_ObjStore_S3 : public RGWPutACLs_ObjStore { public: RGWPutACLs_ObjStore_S3() {} - ~RGWPutACLs_ObjStore_S3() {} + ~RGWPutACLs_ObjStore_S3() override {} - int get_policy_from_state(RGWRados *store, struct req_state *s, stringstream& ss); - void send_response(); - int get_params(); + int get_policy_from_state(RGWRados *store, struct req_state *s, stringstream& ss) override; + void send_response() override; + int get_params() override; }; class RGWGetLC_ObjStore_S3 : public RGWGetLC_ObjStore { @@ -269,110 +269,110 @@ protected: RGWLifecycleConfiguration_S3 config; public: RGWGetLC_ObjStore_S3() {} - ~RGWGetLC_ObjStore_S3() {} - virtual void execute(); + ~RGWGetLC_ObjStore_S3() override {} + void execute() override; - void send_response(); + void send_response() override; }; class RGWPutLC_ObjStore_S3 : public RGWPutLC_ObjStore { public: RGWPutLC_ObjStore_S3() {} - ~RGWPutLC_ObjStore_S3() {} + ~RGWPutLC_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWDeleteLC_ObjStore_S3 : public RGWDeleteLC_ObjStore { public: RGWDeleteLC_ObjStore_S3() {} - ~RGWDeleteLC_ObjStore_S3() {} + ~RGWDeleteLC_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWGetCORS_ObjStore_S3 : public RGWGetCORS_ObjStore { public: RGWGetCORS_ObjStore_S3() {} - ~RGWGetCORS_ObjStore_S3() {} + ~RGWGetCORS_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWPutCORS_ObjStore_S3 : public RGWPutCORS_ObjStore { public: RGWPutCORS_ObjStore_S3() {} - ~RGWPutCORS_ObjStore_S3() {} + ~RGWPutCORS_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWDeleteCORS_ObjStore_S3 : public RGWDeleteCORS_ObjStore { public: RGWDeleteCORS_ObjStore_S3() {} - ~RGWDeleteCORS_ObjStore_S3() {} + ~RGWDeleteCORS_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWOptionsCORS_ObjStore_S3 : public RGWOptionsCORS_ObjStore { public: RGWOptionsCORS_ObjStore_S3() {} - ~RGWOptionsCORS_ObjStore_S3() {} + ~RGWOptionsCORS_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWGetRequestPayment_ObjStore_S3 : public RGWGetRequestPayment { public: RGWGetRequestPayment_ObjStore_S3() {} - ~RGWGetRequestPayment_ObjStore_S3() {} + ~RGWGetRequestPayment_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWSetRequestPayment_ObjStore_S3 : public RGWSetRequestPayment { public: RGWSetRequestPayment_ObjStore_S3() {} - ~RGWSetRequestPayment_ObjStore_S3() {} + ~RGWSetRequestPayment_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWInitMultipart_ObjStore_S3 : public RGWInitMultipart_ObjStore { public: RGWInitMultipart_ObjStore_S3() {} - ~RGWInitMultipart_ObjStore_S3() {} + ~RGWInitMultipart_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWCompleteMultipart_ObjStore_S3 : public RGWCompleteMultipart_ObjStore { public: RGWCompleteMultipart_ObjStore_S3() {} - ~RGWCompleteMultipart_ObjStore_S3() {} + ~RGWCompleteMultipart_ObjStore_S3() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWAbortMultipart_ObjStore_S3 : public RGWAbortMultipart_ObjStore { public: RGWAbortMultipart_ObjStore_S3() {} - ~RGWAbortMultipart_ObjStore_S3() {} + ~RGWAbortMultipart_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWListMultipart_ObjStore_S3 : public RGWListMultipart_ObjStore { public: RGWListMultipart_ObjStore_S3() {} - ~RGWListMultipart_ObjStore_S3() {} + ~RGWListMultipart_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWListBucketMultiparts_ObjStore_S3 : public RGWListBucketMultiparts_ObjStore { @@ -380,22 +380,22 @@ public: RGWListBucketMultiparts_ObjStore_S3() { default_max = 1000; } - ~RGWListBucketMultiparts_ObjStore_S3() {} + ~RGWListBucketMultiparts_ObjStore_S3() override {} - void send_response(); + void send_response() override; }; class RGWDeleteMultiObj_ObjStore_S3 : public RGWDeleteMultiObj_ObjStore { public: RGWDeleteMultiObj_ObjStore_S3() {} - ~RGWDeleteMultiObj_ObjStore_S3() {} + ~RGWDeleteMultiObj_ObjStore_S3() override {} - int get_params(); - void send_status(); - void begin_response(); + int get_params() override; + void send_status() override; + void begin_response() override; void send_partial_response(rgw_obj_key& key, bool delete_marker, - const string& marker_version_id, int ret); - void end_response(); + const string& marker_version_id, int ret) override; + void end_response() override; }; class RGWGetObjLayout_ObjStore_S3 : public RGWGetObjLayout { @@ -430,15 +430,15 @@ public: get_str_vec(cct->_conf->rgw_keystone_accepted_roles, accepted_roles); } - int receive_header(void *ptr, size_t len) { + int receive_header(void *ptr, size_t len) override { return 0; } - int receive_data(void *ptr, size_t len) { + int receive_data(void *ptr, size_t len) override { rx_buffer.append((char *)ptr, len); return 0; } - int send_data(void *ptr, size_t len) { + int send_data(void *ptr, size_t len) override { if (!tx_buffer_it.get_remaining()) return 0; // nothing left to send @@ -473,18 +473,18 @@ class RGWHandler_Auth_S3 : public RGWHandler_REST { friend class RGWRESTMgr_S3; public: RGWHandler_Auth_S3() : RGWHandler_REST() {} - virtual ~RGWHandler_Auth_S3() {} + ~RGWHandler_Auth_S3() override {} static int validate_bucket_name(const string& bucket); static int validate_object_name(const string& bucket); - virtual int init(RGWRados *store, - struct req_state *s, - rgw::io::BasicClient *cio); - virtual int authorize() { + int init(RGWRados *store, + struct req_state *s, + rgw::io::BasicClient *cio) override; + int authorize() override { return RGW_Auth_S3::authorize(store, s); } - int postauth_init() { return 0; } + int postauth_init() override { return 0; } }; class RGWHandler_REST_S3 : public RGWHandler_REST { @@ -493,15 +493,15 @@ public: static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format); RGWHandler_REST_S3() : RGWHandler_REST() {} - virtual ~RGWHandler_REST_S3() {} + ~RGWHandler_REST_S3() override {} - virtual int init(RGWRados *store, - struct req_state *s, - rgw::io::BasicClient *cio); - virtual int authorize() { + int init(RGWRados *store, + struct req_state *s, + rgw::io::BasicClient *cio) override; + int authorize() override { return RGW_Auth_S3::authorize(store, s); } - int postauth_init(); + int postauth_init() override; }; class RGWHandler_REST_Service_S3 : public RGWHandler_REST_S3 { @@ -509,12 +509,12 @@ protected: bool is_usage_op() { return s->info.args.exists("usage"); } - RGWOp *op_get(); - RGWOp *op_head(); - RGWOp *op_post(); + RGWOp *op_get() override; + RGWOp *op_head() override; + RGWOp *op_post() override; public: RGWHandler_REST_Service_S3() {} - virtual ~RGWHandler_REST_Service_S3() {} + ~RGWHandler_REST_Service_S3() override {} }; class RGWHandler_REST_Bucket_S3 : public RGWHandler_REST_S3 { @@ -528,7 +528,7 @@ protected: bool is_lc_op() { return s->info.args.exists("lifecycle"); } - bool is_obj_update_op() { + bool is_obj_update_op() override { return is_acl_op() || is_cors_op(); } bool is_request_payment_op() { @@ -536,15 +536,15 @@ protected: } RGWOp *get_obj_op(bool get_data); - RGWOp *op_get(); - RGWOp *op_head(); - RGWOp *op_put(); - RGWOp *op_delete(); - RGWOp *op_post(); - RGWOp *op_options(); + RGWOp *op_get() override; + RGWOp *op_head() override; + RGWOp *op_put() override; + RGWOp *op_delete() override; + RGWOp *op_post() override; + RGWOp *op_options() override; public: RGWHandler_REST_Bucket_S3() {} - virtual ~RGWHandler_REST_Bucket_S3() {} + ~RGWHandler_REST_Bucket_S3() override {} }; class RGWHandler_REST_Obj_S3 : public RGWHandler_REST_S3 { @@ -555,20 +555,20 @@ protected: bool is_cors_op() { return s->info.args.exists("cors"); } - bool is_obj_update_op() { + bool is_obj_update_op() override { return is_acl_op(); } RGWOp *get_obj_op(bool get_data); - RGWOp *op_get(); - RGWOp *op_head(); - RGWOp *op_put(); - RGWOp *op_delete(); - RGWOp *op_post(); - RGWOp *op_options(); + RGWOp *op_get() override; + RGWOp *op_head() override; + RGWOp *op_put() override; + RGWOp *op_delete() override; + RGWOp *op_post() override; + RGWOp *op_options() override; public: RGWHandler_REST_Obj_S3() {} - virtual ~RGWHandler_REST_Obj_S3() {} + ~RGWHandler_REST_Obj_S3() override {} }; class RGWRESTMgr_S3 : public RGWRESTMgr { @@ -579,7 +579,7 @@ public: : enable_s3website(enable_s3website) { } - virtual ~RGWRESTMgr_S3() = default; + ~RGWRESTMgr_S3() override = default; RGWHandler_REST *get_handler(struct req_state* s, const std::string& frontend_prefix) override; diff --git a/src/rgw/rgw_rest_s3website.h b/src/rgw/rgw_rest_s3website.h index 943eabe1392..c248b9f2963 100644 --- a/src/rgw/rgw_rest_s3website.h +++ b/src/rgw/rgw_rest_s3website.h @@ -18,41 +18,41 @@ class RGWHandler_REST_S3Website : public RGWHandler_REST_S3 { protected: - int retarget(RGWOp *op, RGWOp **new_op); + int retarget(RGWOp *op, RGWOp **new_op) override; // TODO: this should be virtual I think, and ensure that it's always // overridden, but that conflates that op_get/op_head are defined in this // class and call this; and don't need to be overridden later. virtual RGWOp *get_obj_op(bool get_data) { return NULL; } - RGWOp *op_get(); - RGWOp *op_head(); + RGWOp *op_get() override; + RGWOp *op_head() override; // Only allowed to use GET+HEAD - RGWOp *op_put() { return NULL; } - RGWOp *op_delete() { return NULL; } - RGWOp *op_post() { return NULL; } - RGWOp *op_copy() { return NULL; } - RGWOp *op_options() { return NULL; } + RGWOp *op_put() override { return NULL; } + RGWOp *op_delete() override { return NULL; } + RGWOp *op_post() override { return NULL; } + RGWOp *op_copy() override { return NULL; } + RGWOp *op_options() override { return NULL; } int serve_errordoc(int http_ret, const string &errordoc_key); public: RGWHandler_REST_S3Website() : RGWHandler_REST_S3() {} - virtual ~RGWHandler_REST_S3Website() {} - virtual int error_handler(int err_no, string *error_content); + ~RGWHandler_REST_S3Website() override {} + int error_handler(int err_no, string *error_content) override; }; class RGWHandler_REST_Service_S3Website : public RGWHandler_REST_S3Website { protected: - virtual RGWOp *get_obj_op(bool get_data); + RGWOp *get_obj_op(bool get_data) override; public: RGWHandler_REST_Service_S3Website() {} - virtual ~RGWHandler_REST_Service_S3Website() {} + ~RGWHandler_REST_Service_S3Website() override {} }; class RGWHandler_REST_Obj_S3Website : public RGWHandler_REST_S3Website { protected: - virtual RGWOp *get_obj_op(bool get_data); + RGWOp *get_obj_op(bool get_data) override; public: RGWHandler_REST_Obj_S3Website() {} - virtual ~RGWHandler_REST_Obj_S3Website() {} + ~RGWHandler_REST_Obj_S3Website() override {} }; /* The cross-inheritance from Obj to Bucket is deliberate! @@ -60,10 +60,10 @@ public: */ class RGWHandler_REST_Bucket_S3Website : public RGWHandler_REST_S3Website { protected: - RGWOp *get_obj_op(bool get_data); + RGWOp *get_obj_op(bool get_data) override; public: RGWHandler_REST_Bucket_S3Website() {} - virtual ~RGWHandler_REST_Bucket_S3Website() {} + ~RGWHandler_REST_Bucket_S3Website() override {} }; // TODO: do we actually need this? @@ -75,12 +75,12 @@ private: public: RGWGetObj_ObjStore_S3Website() : is_errordoc_request(false) {} explicit RGWGetObj_ObjStore_S3Website(bool is_errordoc_request) : is_errordoc_request(false) { this->is_errordoc_request = is_errordoc_request; } - ~RGWGetObj_ObjStore_S3Website() {} - int send_response_data_error(); - int send_response_data(bufferlist& bl, off_t ofs, off_t len); + ~RGWGetObj_ObjStore_S3Website() override {} + int send_response_data_error() override; + int send_response_data(bufferlist& bl, off_t ofs, off_t len) override; // We override RGWGetObj_ObjStore::get_params here, to allow ignoring all // conditional params for error pages. - int get_params() { + int get_params() override { if (is_errordoc_request) { range_str = NULL; if_mod = NULL; diff --git a/src/rgw/rgw_rest_swift.h b/src/rgw/rgw_rest_swift.h index a72f7c0d5d6..f8713be5a17 100644 --- a/src/rgw/rgw_rest_swift.h +++ b/src/rgw/rgw_rest_swift.h @@ -15,18 +15,18 @@ class RGWGetObj_ObjStore_SWIFT : public RGWGetObj_ObjStore { int custom_http_ret = 0; public: RGWGetObj_ObjStore_SWIFT() {} - ~RGWGetObj_ObjStore_SWIFT() {} + ~RGWGetObj_ObjStore_SWIFT() override {} int verify_permission() override; - int get_params(); - int send_response_data_error(); - int send_response_data(bufferlist& bl, off_t ofs, off_t len); + int get_params() override; + int send_response_data_error() override; + int send_response_data(bufferlist& bl, off_t ofs, off_t len) override; void set_custom_http_response(const int http_ret) { custom_http_ret = http_ret; } - bool need_object_expiration() { + bool need_object_expiration() override { return true; } }; @@ -40,15 +40,15 @@ class RGWListBuckets_ObjStore_SWIFT : public RGWListBuckets_ObjStore { } public: RGWListBuckets_ObjStore_SWIFT() : need_stats(true) {} - ~RGWListBuckets_ObjStore_SWIFT() {} + ~RGWListBuckets_ObjStore_SWIFT() override {} - int get_params(); - void send_response_begin(bool has_buckets); - void send_response_data(RGWUserBuckets& buckets); - void send_response_end(); + int get_params() override; + void send_response_begin(bool has_buckets) override; + void send_response_data(RGWUserBuckets& buckets) override; + void send_response_end() override; - bool should_get_stats() { return need_stats; } - bool supports_account_metadata() { return true; } + bool should_get_stats() override { return need_stats; } + bool supports_account_metadata() override { return true; } }; class RGWListBucket_ObjStore_SWIFT : public RGWListBucket_ObjStore { @@ -57,11 +57,11 @@ public: RGWListBucket_ObjStore_SWIFT() { default_max = 10000; } - ~RGWListBucket_ObjStore_SWIFT() {} + ~RGWListBucket_ObjStore_SWIFT() override {} - int get_params(); - void send_response(); - bool need_container_stats() { return true; } + int get_params() override; + void send_response() override; + bool need_container_stats() override { return true; } }; class RGWStatAccount_ObjStore_SWIFT : public RGWStatAccount_ObjStore { @@ -69,18 +69,18 @@ class RGWStatAccount_ObjStore_SWIFT : public RGWStatAccount_ObjStore { public: RGWStatAccount_ObjStore_SWIFT() { } - ~RGWStatAccount_ObjStore_SWIFT() {} + ~RGWStatAccount_ObjStore_SWIFT() override {} - void execute(); - void send_response(); + void execute() override; + void send_response() override; }; class RGWStatBucket_ObjStore_SWIFT : public RGWStatBucket_ObjStore { public: RGWStatBucket_ObjStore_SWIFT() {} - ~RGWStatBucket_ObjStore_SWIFT() {} + ~RGWStatBucket_ObjStore_SWIFT() override {} - void send_response(); + void send_response() override; }; class RGWCreateBucket_ObjStore_SWIFT : public RGWCreateBucket_ObjStore { @@ -88,68 +88,68 @@ protected: bool need_metadata_upload() const override { return true; } public: RGWCreateBucket_ObjStore_SWIFT() {} - ~RGWCreateBucket_ObjStore_SWIFT() {} + ~RGWCreateBucket_ObjStore_SWIFT() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWDeleteBucket_ObjStore_SWIFT : public RGWDeleteBucket_ObjStore { public: RGWDeleteBucket_ObjStore_SWIFT() {} - ~RGWDeleteBucket_ObjStore_SWIFT() {} + ~RGWDeleteBucket_ObjStore_SWIFT() override {} - void send_response(); + void send_response() override; }; class RGWPutObj_ObjStore_SWIFT : public RGWPutObj_ObjStore { string lo_etag; public: RGWPutObj_ObjStore_SWIFT() {} - ~RGWPutObj_ObjStore_SWIFT() {} + ~RGWPutObj_ObjStore_SWIFT() override {} int verify_permission() override; - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWPutMetadataAccount_ObjStore_SWIFT : public RGWPutMetadataAccount_ObjStore { public: RGWPutMetadataAccount_ObjStore_SWIFT() {} - ~RGWPutMetadataAccount_ObjStore_SWIFT() {} + ~RGWPutMetadataAccount_ObjStore_SWIFT() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWPutMetadataBucket_ObjStore_SWIFT : public RGWPutMetadataBucket_ObjStore { public: RGWPutMetadataBucket_ObjStore_SWIFT() {} - ~RGWPutMetadataBucket_ObjStore_SWIFT() {} + ~RGWPutMetadataBucket_ObjStore_SWIFT() override {} - int get_params(); - void send_response(); + int get_params() override; + void send_response() override; }; class RGWPutMetadataObject_ObjStore_SWIFT : public RGWPutMetadataObject_ObjStore { public: RGWPutMetadataObject_ObjStore_SWIFT() {} - ~RGWPutMetadataObject_ObjStore_SWIFT() {} + ~RGWPutMetadataObject_ObjStore_SWIFT() override {} - int get_params(); - void send_response(); - bool need_object_expiration() { return true; } + int get_params() override; + void send_response() override; + bool need_object_expiration() override { return true; } }; class RGWDeleteObj_ObjStore_SWIFT : public RGWDeleteObj_ObjStore { public: RGWDeleteObj_ObjStore_SWIFT() {} - ~RGWDeleteObj_ObjStore_SWIFT() {} + ~RGWDeleteObj_ObjStore_SWIFT() override {} int verify_permission() override; - int get_params(); - bool need_object_expiration() { return true; } - void send_response(); + int get_params() override; + bool need_object_expiration() override { return true; } + void send_response() override; }; class RGWCopyObj_ObjStore_SWIFT : public RGWCopyObj_ObjStore { @@ -158,46 +158,46 @@ protected: void dump_copy_info(); public: RGWCopyObj_ObjStore_SWIFT() : sent_header(false) {} - ~RGWCopyObj_ObjStore_SWIFT() {} + ~RGWCopyObj_ObjStore_SWIFT() override {} - int init_dest_policy(); - int get_params(); - void send_response(); - void send_partial_response(off_t ofs); + int init_dest_policy() override; + int get_params() override; + void send_response() override; + void send_partial_response(off_t ofs) override; }; class RGWGetACLs_ObjStore_SWIFT : public RGWGetACLs_ObjStore { public: RGWGetACLs_ObjStore_SWIFT() {} - ~RGWGetACLs_ObjStore_SWIFT() {} + ~RGWGetACLs_ObjStore_SWIFT() override {} - void send_response() {} + void send_response() override {} }; class RGWPutACLs_ObjStore_SWIFT : public RGWPutACLs_ObjStore { public: RGWPutACLs_ObjStore_SWIFT() : RGWPutACLs_ObjStore() {} - virtual ~RGWPutACLs_ObjStore_SWIFT() {} + ~RGWPutACLs_ObjStore_SWIFT() override {} - void send_response() {} + void send_response() override {} }; class RGWOptionsCORS_ObjStore_SWIFT : public RGWOptionsCORS_ObjStore { public: RGWOptionsCORS_ObjStore_SWIFT() {} - ~RGWOptionsCORS_ObjStore_SWIFT() {} + ~RGWOptionsCORS_ObjStore_SWIFT() override {} - void send_response(); + void send_response() override; }; class RGWBulkDelete_ObjStore_SWIFT : public RGWBulkDelete_ObjStore { public: RGWBulkDelete_ObjStore_SWIFT() {} - ~RGWBulkDelete_ObjStore_SWIFT() {} + ~RGWBulkDelete_ObjStore_SWIFT() override {} int get_data(std::list& items, - bool * is_truncated); - void send_response(); + bool * is_truncated) override; + void send_response() override; }; class RGWInfo_ObjStore_SWIFT : public RGWInfo_ObjStore { @@ -211,7 +211,7 @@ protected: static const vector> swift_info; public: RGWInfo_ObjStore_SWIFT() {} - ~RGWInfo_ObjStore_SWIFT() {} + ~RGWInfo_ObjStore_SWIFT() override {} void execute() override; void send_response() override; @@ -265,11 +265,11 @@ protected: const std::string& frontend_prefix); public: RGWHandler_REST_SWIFT() {} - virtual ~RGWHandler_REST_SWIFT() {} + ~RGWHandler_REST_SWIFT() override {} static int validate_bucket_name(const string& bucket); - int init(RGWRados *store, struct req_state *s, rgw::io::BasicClient *cio); + int init(RGWRados *store, struct req_state *s, rgw::io::BasicClient *cio) override; int authorize() override; int postauth_init() override; @@ -285,7 +285,7 @@ protected: RGWOp *op_delete() override; public: RGWHandler_REST_Service_SWIFT() {} - virtual ~RGWHandler_REST_Service_SWIFT() {} + ~RGWHandler_REST_Service_SWIFT() override {} }; class RGWHandler_REST_Bucket_SWIFT : public RGWHandler_REST_SWIFT { @@ -293,7 +293,7 @@ class RGWHandler_REST_Bucket_SWIFT : public RGWHandler_REST_SWIFT { * initialization (see the init() method). */ boost::optional website_handler; protected: - bool is_obj_update_op() { + bool is_obj_update_op() override { return s->op == OP_POST; } @@ -306,7 +306,7 @@ protected: RGWOp *op_options() override; public: RGWHandler_REST_Bucket_SWIFT() {} - virtual ~RGWHandler_REST_Bucket_SWIFT() {} + ~RGWHandler_REST_Bucket_SWIFT() override {} int error_handler(int err_no, std::string *error_content) override { return website_handler->error_handler(err_no, error_content); @@ -329,7 +329,7 @@ class RGWHandler_REST_Obj_SWIFT : public RGWHandler_REST_SWIFT { * initialization (see the init() method). */ boost::optional website_handler; protected: - bool is_obj_update_op() { + bool is_obj_update_op() override { return s->op == OP_POST; } @@ -344,7 +344,7 @@ protected: public: RGWHandler_REST_Obj_SWIFT() {} - virtual ~RGWHandler_REST_Obj_SWIFT() {} + ~RGWHandler_REST_Obj_SWIFT() override {} int error_handler(int err_no, std::string *error_content) override { return website_handler->error_handler(err_no, error_content); @@ -372,7 +372,7 @@ protected: public: RGWRESTMgr_SWIFT() = default; - virtual ~RGWRESTMgr_SWIFT() = default; + ~RGWRESTMgr_SWIFT() override = default; RGWHandler_REST *get_handler(struct req_state *s, const std::string& frontend_prefix) override; @@ -383,7 +383,7 @@ class RGWGetCrossDomainPolicy_ObjStore_SWIFT : public RGWGetCrossDomainPolicy_ObjStore { public: RGWGetCrossDomainPolicy_ObjStore_SWIFT() = default; - ~RGWGetCrossDomainPolicy_ObjStore_SWIFT() = default; + ~RGWGetCrossDomainPolicy_ObjStore_SWIFT() override = default; void send_response() override; }; @@ -392,7 +392,7 @@ class RGWGetHealthCheck_ObjStore_SWIFT : public RGWGetHealthCheck_ObjStore { public: RGWGetHealthCheck_ObjStore_SWIFT() = default; - ~RGWGetHealthCheck_ObjStore_SWIFT() = default; + ~RGWGetHealthCheck_ObjStore_SWIFT() override = default; void send_response() override; }; @@ -400,7 +400,7 @@ public: class RGWHandler_SWIFT_CrossDomain : public RGWHandler_REST { public: RGWHandler_SWIFT_CrossDomain() = default; - ~RGWHandler_SWIFT_CrossDomain() = default; + ~RGWHandler_SWIFT_CrossDomain() override = default; RGWOp *op_get() override { return new RGWGetCrossDomainPolicy_ObjStore_SWIFT(); @@ -442,7 +442,7 @@ protected: public: RGWRESTMgr_SWIFT_CrossDomain() = default; - ~RGWRESTMgr_SWIFT_CrossDomain() = default; + ~RGWRESTMgr_SWIFT_CrossDomain() override = default; RGWHandler_REST* get_handler(struct req_state* const s, const std::string&) override { @@ -455,7 +455,7 @@ public: class RGWHandler_SWIFT_HealthCheck : public RGWHandler_REST { public: RGWHandler_SWIFT_HealthCheck() = default; - ~RGWHandler_SWIFT_HealthCheck() = default; + ~RGWHandler_SWIFT_HealthCheck() override = default; RGWOp *op_get() override { return new RGWGetHealthCheck_ObjStore_SWIFT(); @@ -497,7 +497,7 @@ protected: public: RGWRESTMgr_SWIFT_HealthCheck() = default; - ~RGWRESTMgr_SWIFT_HealthCheck() = default; + ~RGWRESTMgr_SWIFT_HealthCheck() override = default; RGWHandler_REST* get_handler(struct req_state* const s, const std::string&) override { @@ -510,7 +510,7 @@ public: class RGWHandler_REST_SWIFT_Info : public RGWHandler_REST_SWIFT { public: RGWHandler_REST_SWIFT_Info() = default; - ~RGWHandler_REST_SWIFT_Info() = default; + ~RGWHandler_REST_SWIFT_Info() override = default; RGWOp *op_get() override { return new RGWInfo_ObjStore_SWIFT(); @@ -542,7 +542,7 @@ public: class RGWRESTMgr_SWIFT_Info : public RGWRESTMgr { public: RGWRESTMgr_SWIFT_Info() = default; - virtual ~RGWRESTMgr_SWIFT_Info() = default; + ~RGWRESTMgr_SWIFT_Info() override = default; RGWHandler_REST *get_handler(struct req_state* s, const std::string& frontend_prefix) override; diff --git a/src/rgw/rgw_rest_usage.h b/src/rgw/rgw_rest_usage.h index bc9d532db35..14c37da1cb1 100644 --- a/src/rgw/rgw_rest_usage.h +++ b/src/rgw/rgw_rest_usage.h @@ -10,13 +10,13 @@ class RGWHandler_Usage : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get(); - RGWOp *op_delete(); + RGWOp *op_get() override; + RGWOp *op_delete() override; public: RGWHandler_Usage() {} - virtual ~RGWHandler_Usage() {} + ~RGWHandler_Usage() override {} - int read_permissions(RGWOp*) { + int read_permissions(RGWOp*) override { return 0; } }; @@ -24,7 +24,7 @@ public: class RGWRESTMgr_Usage : public RGWRESTMgr { public: RGWRESTMgr_Usage() = default; - virtual ~RGWRESTMgr_Usage() = default; + ~RGWRESTMgr_Usage() override = default; RGWHandler_REST* get_handler(struct req_state*, const std::string&) override { diff --git a/src/rgw/rgw_rest_user.h b/src/rgw/rgw_rest_user.h index 4074ae60071..4a69ee55939 100644 --- a/src/rgw/rgw_rest_user.h +++ b/src/rgw/rgw_rest_user.h @@ -10,15 +10,15 @@ class RGWHandler_User : public RGWHandler_Auth_S3 { protected: - RGWOp *op_get(); - RGWOp *op_put(); - RGWOp *op_post(); - RGWOp *op_delete(); + RGWOp *op_get() override; + RGWOp *op_put() override; + RGWOp *op_post() override; + RGWOp *op_delete() override; public: RGWHandler_User() {} - virtual ~RGWHandler_User() {} + ~RGWHandler_User() override {} - int read_permissions(RGWOp*) { + int read_permissions(RGWOp*) override { return 0; } }; @@ -26,7 +26,7 @@ public: class RGWRESTMgr_User : public RGWRESTMgr { public: RGWRESTMgr_User() = default; - virtual ~RGWRESTMgr_User() = default; + ~RGWRESTMgr_User() override = default; RGWHandler_REST *get_handler(struct req_state*, const std::string&) override { diff --git a/src/rgw/rgw_swift_auth.h b/src/rgw/rgw_swift_auth.h index 4b1fa17b22b..1619d9bb7c5 100644 --- a/src/rgw/rgw_swift_auth.h +++ b/src/rgw/rgw_swift_auth.h @@ -18,7 +18,7 @@ public: : RGWLocalAuthApplier(cct, user_info, RGWLocalAuthApplier::NO_SUBUSER) { }; - virtual void modify_request_state(req_state * s) const override; /* in/out */ + void modify_request_state(req_state * s) const override; /* in/out */ struct Factory { virtual ~Factory() {} @@ -127,23 +127,23 @@ public: class RGW_SWIFT_Auth_Get : public RGWOp { public: RGW_SWIFT_Auth_Get() {} - ~RGW_SWIFT_Auth_Get() {} + ~RGW_SWIFT_Auth_Get() override {} - int verify_permission() { return 0; } - void execute(); - virtual const string name() { return "swift_auth_get"; } + int verify_permission() override { return 0; } + void execute() override; + const string name() override { return "swift_auth_get"; } }; class RGWHandler_SWIFT_Auth : public RGWHandler_REST { public: RGWHandler_SWIFT_Auth() {} - ~RGWHandler_SWIFT_Auth() {} - RGWOp *op_get(); + ~RGWHandler_SWIFT_Auth() override {} + RGWOp *op_get() override; - int init(RGWRados *store, struct req_state *state, rgw::io::BasicClient *cio); - int authorize(); - int postauth_init() { return 0; } - int read_permissions(RGWOp *op) { return 0; } + int init(RGWRados *store, struct req_state *state, rgw::io::BasicClient *cio) override; + int authorize() override; + int postauth_init() override { return 0; } + int read_permissions(RGWOp *op) override { return 0; } virtual RGWAccessControlPolicy *alloc_policy() { return NULL; } virtual void free_policy(RGWAccessControlPolicy *policy) {} @@ -152,16 +152,16 @@ public: class RGWRESTMgr_SWIFT_Auth : public RGWRESTMgr { public: RGWRESTMgr_SWIFT_Auth() = default; - virtual ~RGWRESTMgr_SWIFT_Auth() = default; + ~RGWRESTMgr_SWIFT_Auth() override = default; - virtual RGWRESTMgr *get_resource_mgr(struct req_state* const s, - const std::string& uri, - std::string* const out_uri) override { + RGWRESTMgr *get_resource_mgr(struct req_state* const s, + const std::string& uri, + std::string* const out_uri) override { return this; } - virtual RGWHandler_REST* get_handler(struct req_state*, - const std::string&) override { + RGWHandler_REST* get_handler(struct req_state*, + const std::string&) override { return new RGWHandler_SWIFT_Auth; } }; diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 28d1d28d56d..be1fa2fdd88 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -421,7 +421,7 @@ public: shard_id(_shard_id), pmarker(_marker), max_entries(_max_entries), entries(_entries), truncated(_truncated) {} - ~RGWReadMDLogEntriesCR() { + ~RGWReadMDLogEntriesCR() override { if (req) { req->finish(); } @@ -599,7 +599,7 @@ public: status(status), shards_info(status.num_shards), lease_cr(nullptr), lease_stack(nullptr) {} - ~RGWInitSyncStatusCoroutine() { + ~RGWInitSyncStatusCoroutine() override { if (lease_cr) { lease_cr->abort(); lease_cr->put(); @@ -755,7 +755,7 @@ public: lost_lock(false), failed(false), markers(_markers) { } - ~RGWFetchAllMetaCR() { + ~RGWFetchAllMetaCR() override { if (lease_cr) { lease_cr->put(); } @@ -1005,7 +1005,7 @@ public: raw_key(_raw_key), bl(_bl), req(NULL) { } - ~RGWMetaStoreEntryCR() { + ~RGWMetaStoreEntryCR() override { if (req) { req->finish(); } @@ -1054,7 +1054,7 @@ public: raw_key(_raw_key), req(NULL) { } - ~RGWMetaRemoveEntryCR() { + ~RGWMetaRemoveEntryCR() override { if (req) { req->finish(); } @@ -1219,7 +1219,7 @@ public: *new_marker = marker; } } - ~RGWCloneMetaLogCoroutine() { + ~RGWCloneMetaLogCoroutine() override { if (http_op) { http_op->put(); } @@ -1301,7 +1301,7 @@ public: *reset_backoff = false; } - ~RGWMetaSyncShardCR() { + ~RGWMetaSyncShardCR() override { delete marker_tracker; if (lease_cr) { lease_cr->abort(); diff --git a/src/rgw/rgw_sync.h b/src/rgw/rgw_sync.h index 3038f4f7108..878c5d8e18b 100644 --- a/src/rgw/rgw_sync.h +++ b/src/rgw/rgw_sync.h @@ -147,7 +147,7 @@ public: reset_backoff(false), exit_on_error(_exit_on_error) { } - virtual ~RGWBackoffControlCR() { + ~RGWBackoffControlCR() override { if (cr) { cr->put(); } @@ -156,7 +156,7 @@ public: virtual RGWCoroutine *alloc_cr() = 0; virtual RGWCoroutine *alloc_finisher_cr() { return NULL; } - int operate(); + int operate() override; }; struct RGWMetaSyncEnv { @@ -206,7 +206,7 @@ public: http_manager(store->ctx(), completion_mgr), status_manager(_sm), error_logger(NULL), meta_sync_cr(NULL) {} - ~RGWRemoteMetaLog(); + ~RGWRemoteMetaLog() override; int init(); void finish(); @@ -436,7 +436,7 @@ public: error_injection = (sync_env->cct->_conf->rgw_sync_meta_inject_err_probability > 0); } - int operate(); + int operate() override; }; class RGWShardCollectCR : public RGWCoroutine { @@ -452,7 +452,7 @@ public: status(0) {} virtual bool spawn_next() = 0; - int operate(); + int operate() override; }; diff --git a/src/rgw/rgw_sync_module.h b/src/rgw/rgw_sync_module.h index 2bae4d2d47c..16e63ed640d 100644 --- a/src/rgw/rgw_sync_module.h +++ b/src/rgw/rgw_sync_module.h @@ -103,7 +103,7 @@ protected: public: RGWStatRemoteObjCBCR(RGWDataSyncEnv *_sync_env, RGWBucketInfo& _bucket_info, rgw_obj_key& _key); - virtual ~RGWStatRemoteObjCBCR() {} + ~RGWStatRemoteObjCBCR() override {} void set_result(ceph::real_time& _mtime, uint64_t _size, @@ -129,7 +129,7 @@ public: RGWCallStatRemoteObjCR(RGWDataSyncEnv *_sync_env, RGWBucketInfo& _bucket_info, rgw_obj_key& _key); - virtual ~RGWCallStatRemoteObjCR() {} + ~RGWCallStatRemoteObjCR() override {} int operate() override; diff --git a/src/rgw/rgw_sync_module_es.cc b/src/rgw/rgw_sync_module_es.cc index afecf7224f5..48f633bd5b8 100644 --- a/src/rgw/rgw_sync_module_es.cc +++ b/src/rgw/rgw_sync_module_es.cc @@ -151,7 +151,7 @@ public: conf(_conf) { } - ~RGWElasticHandleRemoteObjCR() {} + ~RGWElasticHandleRemoteObjCR() override {} RGWStatRemoteObjCBCR *allocate_callback() override { return new RGWElasticHandleRemoteObjCBCR(sync_env, bucket_info, key, conf); @@ -198,7 +198,7 @@ public: conf.id = string("elastic:") + elastic_endpoint; conf.conn = new RGWRESTConn(cct, nullptr, conf.id, { elastic_endpoint }); } - ~RGWElasticDataSyncModule() { + ~RGWElasticDataSyncModule() override { delete conf.conn; } diff --git a/src/rgw/rgw_sync_module_log.cc b/src/rgw/rgw_sync_module_log.cc index 230fde3f01c..180086d6892 100644 --- a/src/rgw/rgw_sync_module_log.cc +++ b/src/rgw/rgw_sync_module_log.cc @@ -27,7 +27,7 @@ public: RGWBucketInfo& _bucket_info, rgw_obj_key& _key) : RGWCallStatRemoteObjCR(_sync_env, _bucket_info, _key) { } - ~RGWLogStatRemoteObjCR() {} + ~RGWLogStatRemoteObjCR() override {} RGWStatRemoteObjCBCR *allocate_callback() override { return new RGWLogStatRemoteObjCBCR(sync_env, bucket_info, key); diff --git a/src/rgw/rgw_xml.h b/src/rgw/rgw_xml.h index 49b1fb86552..2517c7b78e8 100644 --- a/src/rgw/rgw_xml.h +++ b/src/rgw/rgw_xml.h @@ -75,10 +75,10 @@ protected: } public: RGWXMLParser(); - virtual ~RGWXMLParser(); + ~RGWXMLParser() override; bool init(); bool xml_start(const char *el, const char **attr); - bool xml_end(const char *el); + bool xml_end(const char *el) override; void handle_data(const char *s, int len); bool parse(const char *buf, int len, int done); @@ -100,7 +100,7 @@ public: class XMLParser : public RGWXMLParser { public: XMLParser() {} - virtual ~XMLParser() {} + ~XMLParser() override {} } parser; explicit RGWXMLDecoder(bufferlist& bl) { -- cgit v1.2.3