From: myoungwon oh Date: Thu, 12 Oct 2023 15:19:37 +0000 (+0000) Subject: tool/ceph_dedup: remove unused code X-Git-Tag: v20.0.0~2095^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=098633081cf4f351106a5c64cf31b66bebbeb03c;p=ceph.git tool/ceph_dedup: remove unused code Since the ceph-dedup-daemon exclusively uses set-chunk op, dedup options in pool_info_t is not necessary. These options are relevant only when handling tier-flush op. Plus, this commit include the removal of unused code that is no longer in use. Signed-off-by: Myoungwon Oh --- diff --git a/src/tools/ceph_dedup/ceph_dedup_daemon.cc b/src/tools/ceph_dedup/ceph_dedup_daemon.cc index cbc3c60e47e..4bad4b4ff6f 100644 --- a/src/tools/ceph_dedup/ceph_dedup_daemon.cc +++ b/src/tools/ceph_dedup/ceph_dedup_daemon.cc @@ -19,15 +19,8 @@ po::options_description make_usage() { ("chunk-pool", po::value(), ": set chunk pool name") ("max-thread", po::value(), ": set max thread") ("report-period", po::value(), ": set report-period") - ("max-seconds", po::value(), ": set max runtime") - ("max-read-size", po::value(), ": set max read size") ("pool", po::value(), ": set pool name") - ("min-chunk-size", po::value(), ": min chunk size (byte)") - ("max-chunk-size", po::value(), ": max chunk size (byte)") - ("dedup-cdc-chunk-size", po::value(), ": set dedup chunk size for cdc") ("snap", ": deduplciate snapshotted object") - ("debug", ": enable debug") - ("pgid", ": set pgid") ("chunk-dedup-threshold", po::value(), ": set the threshold for chunk dedup (number of duplication) ") ("sampling-ratio", po::value(), ": set the sampling ratio (percentile)") ("wakeup-period", po::value(), ": set the wakeup period of crawler thread (sec)") @@ -293,7 +286,6 @@ private: size_t max_object_count); std::vector sample_object(size_t count); void try_dedup_and_accumulate_result(ObjectItem &object, snap_t snap = 0); - bool ok_to_dedup_all(); int do_chunk_dedup(chunk_t &chunk, snap_t snap); bufferlist read_object(ObjectItem &object); std::vector>> do_cdc( @@ -644,35 +636,6 @@ int make_crawling_daemon(const po::variables_map &opts) << cpp_strerror(ret) << std::endl; return -EINVAL; } - bufferlist inbl; - ret = rados.mon_command( - make_pool_str(base_pool_name, "fingerprint_algorithm", fp_algo), - inbl, NULL, NULL); - if (ret < 0) { - cerr << " operate fail : " << cpp_strerror(ret) << std::endl; - return ret; - } - ret = rados.mon_command( - make_pool_str(base_pool_name, "dedup_chunk_algorithm", "fastcdc"), - inbl, NULL, NULL); - if (ret < 0) { - cerr << " operate fail : " << cpp_strerror(ret) << std::endl; - return ret; - } - ret = rados.mon_command( - make_pool_str(base_pool_name, "dedup_cdc_chunk_size", chunk_size), - inbl, NULL, NULL); - if (ret < 0) { - cerr << " operate fail : " << cpp_strerror(ret) << std::endl; - return ret; - } - ret = rados.mon_command( - make_pool_str(base_pool_name, "dedup_tier", chunk_pool_name), - inbl, NULL, NULL); - if (ret < 0) { - cerr << " operate fail : " << cpp_strerror(ret) << std::endl; - return ret; - } cout << "SampleRatio : " << sampling_ratio << std::endl << "Chunk Dedup Threshold : " << chunk_dedup_threshold << std::endl diff --git a/src/tools/ceph_dedup/common.h b/src/tools/ceph_dedup/common.h index d79331d8f3a..ccc1da5217d 100644 --- a/src/tools/ceph_dedup/common.h +++ b/src/tools/ceph_dedup/common.h @@ -47,8 +47,6 @@ namespace po = boost::program_options; using namespace librados; constexpr unsigned default_op_size = 1 << 26; -constexpr unsigned default_max_thread = 2; -constexpr int32_t default_report_period = 10; string get_opts_pool_name(const po::variables_map &opts); string get_opts_chunk_algo(const po::variables_map &opts);