summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_trim_datalog.cc
diff options
context:
space:
mode:
authorDaniel Gryniewicz <dang@redhat.com>2019-06-06 20:41:55 +0200
committerDaniel Gryniewicz <dang@redhat.com>2019-08-15 14:48:13 +0200
commit7e613fdc55bd3db200cce912b0e27a99a128aa27 (patch)
tree942df2b6952c8c91e23f4c7447a5bd470b83f235 /src/rgw/rgw_trim_datalog.cc
parentmgr/dashboard: Fix e2e issue in HACKING.rst (#29640) (diff)
downloadceph-7e613fdc55bd3db200cce912b0e27a99a128aa27.tar.xz
ceph-7e613fdc55bd3db200cce912b0e27a99a128aa27.zip
Project Zipper Part 1 - Framework and RGWRadosStore
This is the first part of Project Zipper, the Store Abstraction Layer. It introduces the basic framework, and wraps RGWRados in RGWRadosStore. The goal over the next few weeks is to do the same for user, bucket, and object. This will make most of the remaining users of RGWRados wrapped in SAL classes, allowing it to be completely absorbed into the private RGWRadosStore. This will also expose all the APIs that need to be pusheg up to higher layers in the SAL. Signed-off-by: Daniel Gryniewicz <dang@redhat.com>
Diffstat (limited to 'src/rgw/rgw_trim_datalog.cc')
-rw-r--r--src/rgw/rgw_trim_datalog.cc26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/rgw/rgw_trim_datalog.cc b/src/rgw/rgw_trim_datalog.cc
index e2ccb075af9..78b764ab465 100644
--- a/src/rgw/rgw_trim_datalog.cc
+++ b/src/rgw/rgw_trim_datalog.cc
@@ -53,7 +53,7 @@ void take_min_markers(IterIn first, IterIn last, IterOut dest)
class DataLogTrimCR : public RGWCoroutine {
using TrimCR = RGWSyncLogTrimCR;
- RGWRados *store;
+ rgw::sal::RGWRadosStore *store;
RGWHTTPManager *http;
const int num_shards;
const std::string& zone_id; //< my zone id
@@ -63,12 +63,12 @@ class DataLogTrimCR : public RGWCoroutine {
int ret{0};
public:
- DataLogTrimCR(RGWRados *store, RGWHTTPManager *http,
+ DataLogTrimCR(rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
int num_shards, std::vector<std::string>& last_trim)
: RGWCoroutine(store->ctx()), store(store), http(http),
num_shards(num_shards),
- zone_id(store->svc.zone->get_zone().id),
- peer_status(store->svc.zone->get_zone_data_notify_to_map().size()),
+ zone_id(store->svc()->zone->get_zone().id),
+ peer_status(store->svc()->zone->get_zone_data_notify_to_map().size()),
min_shard_markers(num_shards, TrimCR::max_marker),
last_trim(last_trim)
{}
@@ -91,7 +91,7 @@ int DataLogTrimCR::operate()
};
auto p = peer_status.begin();
- for (auto& c : store->svc.zone->get_zone_data_notify_to_map()) {
+ for (auto& c : store->svc()->zone->get_zone_data_notify_to_map()) {
ldout(cct, 20) << "query sync status from " << c.first << dendl;
using StatusCR = RGWReadRESTResourceCR<rgw_data_sync_status>;
spawn(new StatusCR(cct, c.second, http, "/admin/log/", params, &*p),
@@ -128,7 +128,7 @@ int DataLogTrimCR::operate()
ldout(cct, 10) << "trimming log shard " << i
<< " at marker=" << m
<< " last_trim=" << last_trim[i] << dendl;
- spawn(new TrimCR(store, store->svc.datalog_rados->get_oid(i),
+ spawn(new TrimCR(store, store->svc()->datalog_rados->get_oid(i),
m, &last_trim[i]),
true);
}
@@ -138,7 +138,7 @@ int DataLogTrimCR::operate()
return 0;
}
-RGWCoroutine* create_admin_data_log_trim_cr(RGWRados *store,
+RGWCoroutine* create_admin_data_log_trim_cr(rgw::sal::RGWRadosStore *store,
RGWHTTPManager *http,
int num_shards,
std::vector<std::string>& markers)
@@ -147,7 +147,7 @@ RGWCoroutine* create_admin_data_log_trim_cr(RGWRados *store,
}
class DataLogTrimPollCR : public RGWCoroutine {
- RGWRados *store;
+ rgw::sal::RGWRadosStore *store;
RGWHTTPManager *http;
const int num_shards;
const utime_t interval; //< polling interval
@@ -156,11 +156,11 @@ class DataLogTrimPollCR : public RGWCoroutine {
std::vector<std::string> last_trim; //< last trimmed marker per shard
public:
- DataLogTrimPollCR(RGWRados *store, RGWHTTPManager *http,
+ DataLogTrimPollCR(rgw::sal::RGWRadosStore *store, RGWHTTPManager *http,
int num_shards, utime_t interval)
: RGWCoroutine(store->ctx()), store(store), http(http),
num_shards(num_shards), interval(interval),
- lock_oid(store->svc.datalog_rados->get_oid(0)),
+ lock_oid(store->svc()->datalog_rados->get_oid(0)),
lock_cookie(RGWSimpleRadosLockCR::gen_random_cookie(cct)),
last_trim(num_shards)
{}
@@ -178,8 +178,8 @@ int DataLogTrimPollCR::operate()
// request a 'data_trim' lock that covers the entire wait interval to
// prevent other gateways from attempting to trim for the duration
set_status("acquiring trim lock");
- yield call(new RGWSimpleRadosLockCR(store->svc.rados->get_async_processor(), store,
- rgw_raw_obj(store->svc.zone->get_zone_params().log_pool, lock_oid),
+ yield call(new RGWSimpleRadosLockCR(store->svc()->rados->get_async_processor(), store,
+ rgw_raw_obj(store->svc()->zone->get_zone_params().log_pool, lock_oid),
"data_trim", lock_cookie,
interval.sec()));
if (retcode < 0) {
@@ -199,7 +199,7 @@ int DataLogTrimPollCR::operate()
return 0;
}
-RGWCoroutine* create_data_log_trim_cr(RGWRados *store,
+RGWCoroutine* create_data_log_trim_cr(rgw::sal::RGWRadosStore *store,
RGWHTTPManager *http,
int num_shards, utime_t interval)
{