From 18c16f971e2826b27639900cb4f739c8e70d6ec2 Mon Sep 17 00:00:00 2001 From: Orit Wasserman Date: Tue, 18 Apr 2017 12:37:23 +0300 Subject: [PATCH] rgw: add RGWReshard object to RGWRados Signed-off-by: Orit Wasserman --- src/rgw/rgw_rados.cc | 5 +++++ src/rgw/rgw_rados.h | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 034416f8e1c..d01c249f3d1 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -69,6 +69,7 @@ using namespace librados; #include "rgw_sync.h" #include "rgw_data_sync.h" #include "rgw_realm_watcher.h" +#include "rgw_reshard.h" #include "compressor/Compressor.h" @@ -4265,6 +4266,8 @@ int RGWRados::init_complete() obj_tombstone_cache = new tombstone_cache_t(cct->_conf->rgw_obj_tombstone_cache_size); } + reshard = new RGWReshard(cct, this); + return ret; } @@ -8223,6 +8226,8 @@ int RGWRados::bucket_check_index(RGWBucketInfo& bucket_info, int RGWRados::bucket_rebuild_index(RGWBucketInfo& bucket_info) { + /* hande on going bucket resharding */ + librados::IoCtx index_ctx; map bucket_objs; int r = open_bucket_index(bucket_info, index_ctx, bucket_objs); diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index c8472e83465..4b50699d861 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -38,6 +38,7 @@ class RGWSyncLogTrimThread; class RGWRESTConn; struct RGWZoneGroup; struct RGWZoneParams; +class RGWReshard; /* flags for put_obj_meta() */ #define PUT_OBJ_CREATE 0x01 @@ -2324,7 +2325,7 @@ public: cr_registry(NULL), zone_short_id(0), rest_master_conn(NULL), - meta_mgr(NULL), data_log(NULL) {} + meta_mgr(NULL), data_log(NULL), reshard(NULL) {} uint64_t get_new_req_id() { return ++max_req_id; @@ -2445,6 +2446,8 @@ public: RGWDataChangesLog *data_log; + RGWReshard *reshard; + virtual ~RGWRados() = default; tombstone_cache_t *get_tombstone_cache() { -- 2.39.5