From: Casey Bodley Date: Fri, 1 Sep 2017 14:51:57 +0000 (-0400) Subject: rgw: add skeleton for BucketTrimManager X-Git-Tag: v13.0.1~210^2~32 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4309adb36be8dff737ab2196f59743c316b12bca;p=ceph.git rgw: add skeleton for BucketTrimManager Signed-off-by: Casey Bodley --- diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 9e56be8b98fe1..05071c04f162a 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -76,6 +76,7 @@ set(rgw_a_srcs rgw_sync_module_es.cc rgw_sync_module_es_rest.cc rgw_sync_module_log.cc + rgw_sync_log_trim.cc rgw_sync_trace.cc rgw_period_history.cc rgw_period_puller.cc diff --git a/src/rgw/rgw_sync_log_trim.cc b/src/rgw/rgw_sync_log_trim.cc new file mode 100644 index 0000000000000..315288edce1b5 --- /dev/null +++ b/src/rgw/rgw_sync_log_trim.cc @@ -0,0 +1,44 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2017 Red Hat, Inc + * + * Author: Casey Bodley + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + */ + +#include "rgw_sync_log_trim.h" + +#define dout_subsys ceph_subsys_rgw + +#undef dout_prefix +#define dout_prefix (*_dout << "trim: ") + +using rgw::BucketTrimConfig; + +namespace rgw { + +class BucketTrimManager::Impl { + public: + RGWRados *const store; + const BucketTrimConfig config; + + Impl(RGWRados *store, const BucketTrimConfig& config) + : store(store), config(config) + {} +}; + +BucketTrimManager::BucketTrimManager(RGWRados *store, + const BucketTrimConfig& config) + : impl(new Impl(store, config)) +{ +} +BucketTrimManager::~BucketTrimManager() = default; + +} // namespace rgw diff --git a/src/rgw/rgw_sync_log_trim.h b/src/rgw/rgw_sync_log_trim.h new file mode 100644 index 0000000000000..fb21ac7d9decf --- /dev/null +++ b/src/rgw/rgw_sync_log_trim.h @@ -0,0 +1,47 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2017 Red Hat, Inc + * + * Author: Casey Bodley + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + */ + +#ifndef RGW_SYNC_LOG_TRIM_H +#define RGW_SYNC_LOG_TRIM_H + +#include + +class CephContext; +class RGWRados; + +namespace rgw { + +/// Configuration for BucketTrimManager +struct BucketTrimConfig { +}; + +/// fill out the BucketTrimConfig from the ceph context +void configure_bucket_trim(CephContext *cct, BucketTrimConfig& config); + +/// Determines the buckets on which to focus trim activity, using two sources of +/// input: the frequency of entries read from the data changes log, and a global +/// listing of the bucket.instance metadata. This allows us to trim active +/// buckets quickly, while also ensuring that all buckets will eventually trim +class BucketTrimManager { + class Impl; + std::unique_ptr impl; + public: + BucketTrimManager(RGWRados *store, const BucketTrimConfig& config); + ~BucketTrimManager(); +}; + +} // namespace rgw + +#endif // RGW_SYNC_LOG_TRIM_H