]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: move transfer accounting management from RGWClientIO to RGWStreamIO.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Tue, 26 Jul 2016 09:31:11 +0000 (11:31 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 21 Oct 2016 20:57:17 +0000 (22:57 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_client_io.h
src/rgw/rgw_lib.h

index 13cc6c7487b117d00ae9fb39c8cd498953e6f7c8..98234f65d03c1a05d871953598d9cee9a81d39ef 100644 (file)
 #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 */
 
 
index f418a6d19739fe302b6e6ee5486c6a966f5a0840..1689d67e4dfe324e5207b303c02848d6aeb2241b 100644 (file)
@@ -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 */