summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_http_client.h
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2017-10-26 22:35:02 +0200
committerYehuda Sadeh <yehuda@redhat.com>2018-04-10 17:05:38 +0200
commitcdab9c5cec801de5f07665145620a700af67422b (patch)
tree1c0f29f81d196875d2c0991315e3aa6dfce888a1 /src/rgw/rgw_http_client.h
parentrgw: initial work for integrating streaming read/write with cr (diff)
downloadceph-cdab9c5cec801de5f07665145620a700af67422b.tar.xz
ceph-cdab9c5cec801de5f07665145620a700af67422b.zip
rgw: groundwork for supporting concurrent IOs in single cr
Add io_id field to io operation, allow blocking on a specific IO. Locking changes in RGWCoroutinesManager::run(). Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src/rgw/rgw_http_client.h')
-rw-r--r--src/rgw/rgw_http_client.h43
1 files changed, 31 insertions, 12 deletions
diff --git a/src/rgw/rgw_http_client.h b/src/rgw/rgw_http_client.h
index c43b018e27d..b5a8e32143b 100644
--- a/src/rgw/rgw_http_client.h
+++ b/src/rgw/rgw_http_client.h
@@ -20,7 +20,18 @@ void rgw_http_client_cleanup();
struct rgw_http_req_data;
class RGWHTTPManager;
-class RGWHTTPClient
+class RGWIOProvider
+{
+public:
+ RGWIOProvider() {}
+
+ virtual void set_io_id(int64_t _io_id) = 0;
+ virtual void set_io_user_info(void *_user_info) = 0;
+ virtual int64_t get_io_id() = 0;
+ virtual void *get_io_user_info() = 0;
+};
+
+class RGWHTTPClient : public RGWIOProvider
{
friend class RGWHTTPManager;
@@ -30,9 +41,10 @@ class RGWHTTPClient
bool has_send_len;
long http_status;
- rgw_http_req_data *req_data;
+ int64_t io_id{-1};
+ void *user_info{nullptr};
- void *user_info;
+ rgw_http_req_data *req_data;
bool verify_ssl; // Do not validate self signed certificates, default to false
@@ -109,21 +121,12 @@ public:
has_send_len(false),
http_status(HTTP_STATUS_NOSTATUS),
req_data(nullptr),
- user_info(nullptr),
verify_ssl(cct->_conf->rgw_verify_ssl),
cct(cct),
method(_method),
url(_url) {
}
- void set_user_info(void *info) {
- user_info = info;
- }
-
- void *get_user_info() {
- return user_info;
- }
-
void append_header(const string& name, const string& val) {
headers.push_back(pair<string, string>(name, val));
}
@@ -160,6 +163,22 @@ public:
void set_method(const string& _method) {
method = _method;
}
+
+ void set_io_id(int64_t _io_id) override {
+ io_id = _io_id;
+ }
+
+ void set_io_user_info(void *_user_info) override {
+ user_info = _user_info;
+ }
+
+ int64_t get_io_id() override {
+ return io_id;
+ }
+
+ void *get_io_user_info() override {
+ return user_info;
+ }
};