]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: add skeleton for BucketTrimManager
authorCasey Bodley <cbodley@redhat.com>
Fri, 1 Sep 2017 14:51:57 +0000 (10:51 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 10 Nov 2017 17:16:55 +0000 (12:16 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/CMakeLists.txt
src/rgw/rgw_sync_log_trim.cc [new file with mode: 0644]
src/rgw/rgw_sync_log_trim.h [new file with mode: 0644]

index 9e56be8b98fe11a424c6bea3dcdf02da85c08ecf..05071c04f162a697fd40348159da2e86713d5d1d 100644 (file)
@@ -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 (file)
index 0000000..315288e
--- /dev/null
@@ -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 <cbodley@redhat.com>
+ *
+ * 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 (file)
index 0000000..fb21ac7
--- /dev/null
@@ -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 <cbodley@redhat.com>
+ *
+ * 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 <memory>
+
+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> impl;
+ public:
+  BucketTrimManager(RGWRados *store, const BucketTrimConfig& config);
+  ~BucketTrimManager();
+};
+
+} // namespace rgw
+
+#endif // RGW_SYNC_LOG_TRIM_H