From: Radoslaw Zarzynski Date: Tue, 26 Jul 2016 09:31:11 +0000 (+0200) Subject: rgw: move transfer accounting management from RGWClientIO to RGWStreamIO. X-Git-Tag: v11.1.0~454^2~63 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c59907803975b5c80735b6bdb204c65afa59d4fb;p=ceph.git rgw: move transfer accounting management from RGWClientIO to RGWStreamIO. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_client_io.h b/src/rgw/rgw_client_io.h index 13cc6c7487b..98234f65d03 100644 --- a/src/rgw/rgw_client_io.h +++ b/src/rgw/rgw_client_io.h @@ -14,29 +14,21 @@ #include "rgw_common.h" class RGWClientIO { - bool _account; - protected: RGWEnv env; virtual void init_env(CephContext *cct) = 0; - bool account() { return _account; } public: virtual ~RGWClientIO() {} - RGWClientIO() : _account(false) {} void init(CephContext *cct); RGWEnv& get_env() { return env; } - void set_account(bool _accnt) { - _account = _accnt; - } - virtual int complete_request() = 0; /* XXX signature likely changing */ - virtual uint64_t get_bytes_sent() { return 0; } - virtual uint64_t get_bytes_received() { return 0; } + virtual uint64_t get_bytes_sent() = 0; + virtual uint64_t get_bytes_received() = 0; }; /* RGWClient IO */ class RGWStreamIOBase : public RGWClientIO { @@ -59,15 +51,19 @@ public: /* HTTP IO */ class RGWStreamIO : public RGWStreamIOBase { + bool _account; size_t bytes_sent; size_t bytes_received; SHA256 *sha256_hash; + bool account() { return _account; } + public: virtual ~RGWStreamIO() {} RGWStreamIO() - : bytes_sent(0), + : _account(false), + bytes_sent(0), bytes_received(0), sha256_hash(nullptr) { } @@ -77,8 +73,17 @@ public: std::string grab_aws4_sha256_hash(); - uint64_t get_bytes_sent() { return bytes_sent; } - uint64_t get_bytes_received() { return bytes_received; } + void set_account(bool _accnt) { + _account = _accnt; + } + + uint64_t get_bytes_sent() override { + return bytes_sent; + } + + uint64_t get_bytes_received() override { + return bytes_received; + } }; /* RGWStreamIO */ diff --git a/src/rgw/rgw_lib.h b/src/rgw/rgw_lib.h index f418a6d1973..1689d67e4df 100644 --- a/src/rgw/rgw_lib.h +++ b/src/rgw/rgw_lib.h @@ -79,6 +79,14 @@ namespace rgw { return 0; }; + uint64_t get_bytes_sent() override { + return 0; + } + + uint64_t get_bytes_received() override { + return 0; + } + }; /* RGWLibIO */ /* XXX */