]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/erasure-code: remove ceph_erasure_code 43407/head
authorMykola Golub <mgolub@suse.com>
Wed, 25 Mar 2020 08:44:18 +0000 (08:44 +0000)
committerMykola Golub <mgolub@suse.com>
Mon, 4 Oct 2021 08:16:53 +0000 (11:16 +0300)
Its functionality is moved to ceph-erasure-code-tool.

Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 56aaaf8a97574a0284bad37cc0ba5e1c262f33e0)

alpine/APKBUILD.in
ceph.spec.in
debian/ceph-test.install
src/test/CMakeLists.txt
src/test/erasure-code/CMakeLists.txt
src/test/erasure-code/ceph_erasure_code.cc [deleted file]

index 9348f9ccf91474f5d334bb8c36b83de48b6f8343..a9a9a58ecfced5e547783fab35340dce6eb0e168 100644 (file)
@@ -415,7 +415,6 @@ ceph_test() {
                ceph_bench_log \
                ceph_kvstorebench \
                ceph_multi_stress_watch \
-               ceph_erasure_code \
                ceph_erasure_code_benchmark \
                ceph_omapbench \
                ceph_objectstore_bench \
index d6398c643d6dd4c07643738d7ffa4b67baa0117c..f35bbe6002f71c66aee9f8fd450c9ba6b404bdcb 100644 (file)
@@ -2176,7 +2176,6 @@ fi
 %{_bindir}/ceph_bench_log
 %{_bindir}/ceph_kvstorebench
 %{_bindir}/ceph_multi_stress_watch
-%{_bindir}/ceph_erasure_code
 %{_bindir}/ceph_erasure_code_benchmark
 %{_bindir}/ceph_omapbench
 %{_bindir}/ceph_objectstore_bench
index dae063ab6c42593a8aa0c53e3c25f5c2cc490bca..52e29010501137b5c71df79366af6b13a4a6ad14 100644 (file)
@@ -1,7 +1,6 @@
 usr/bin/ceph-client-debug
 usr/bin/ceph-coverage
 usr/bin/ceph_bench_log
-usr/bin/ceph_erasure_code
 usr/bin/ceph_erasure_code_benchmark
 usr/bin/ceph_kvstorebench
 usr/bin/ceph_multi_stress_watch
index 3ae4120bdc95d8beb2e9240a9fecd87929f224b5..7f9c97d5f7beb1617aa28946e4da215291645933 100644 (file)
@@ -487,7 +487,6 @@ add_dependencies(tests
   cls_lock
   ceph_test_objectstore
   ceph_erasure_code_non_regression
-  ceph_erasure_code
   cython_modules)
 if (WITH_CEPHFS)
   add_dependencies(tests ceph-mds)
index 49f12adc9184aabe46b3ca06642d157f7ad95a1b..640de24bd5fc3c6ad7465e5ccc83191e29a78132 100644 (file)
@@ -9,11 +9,6 @@ install(TARGETS ceph_erasure_code_benchmark
 add_executable(ceph_erasure_code_non_regression ceph_erasure_code_non_regression.cc)
 target_link_libraries(ceph_erasure_code_non_regression ceph-common Boost::program_options global ${CMAKE_DL_LIBS})
 
-add_executable(ceph_erasure_code ceph_erasure_code.cc)
-target_link_libraries(ceph_erasure_code ceph-common Boost::program_options global ${CMAKE_DL_LIBS})
-install(TARGETS ceph_erasure_code
-  DESTINATION bin)
-
 add_library(ec_example SHARED 
   ErasureCodePluginExample.cc
   $<TARGET_OBJECTS:erasure_code_objs>)
diff --git a/src/test/erasure-code/ceph_erasure_code.cc b/src/test/erasure-code/ceph_erasure_code.cc
deleted file mode 100644 (file)
index 1f2fb61..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- *
- * Author: Loic Dachary <loic@dachary.org>
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include <boost/scoped_ptr.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/program_options/option.hpp>
-#include <boost/program_options/options_description.hpp>
-#include <boost/program_options/variables_map.hpp>
-#include <boost/program_options/cmdline.hpp>
-#include <boost/program_options/parsers.hpp>
-#include <boost/algorithm/string.hpp>
-
-#include "global/global_context.h"
-#include "global/global_init.h"
-#include "common/ceph_argparse.h"
-#include "common/ceph_context.h"
-#include "common/config.h"
-#include "common/Clock.h"
-#include "include/utime.h"
-#include "erasure-code/ErasureCodePlugin.h"
-
-namespace po = boost::program_options;
-
-class ErasureCodeCommand {
-  po::variables_map vm;
-  ErasureCodeProfile profile;
-  boost::intrusive_ptr<CephContext> cct;
-public:
-  int setup(int argc, char** argv);
-  int run();
-  int plugin_exists();
-  int display_information();
-};
-
-int ErasureCodeCommand::setup(int argc, char** argv) {
-
-  po::options_description desc("Allowed options");
-  desc.add_options()
-    ("help,h", "produce help message")
-    ("all", "implies "
-     "--get_chunk_size 1024 "
-     "--get_data_chunk_count "
-     "--get_coding_chunk_count "
-     "--get_chunk_count ")
-    ("get_chunk_size", po::value<unsigned int>(),
-     "display get_chunk_size(<object size>)")
-    ("get_data_chunk_count", "display get_data_chunk_count()")
-    ("get_coding_chunk_count", "display get_coding_chunk_count()")
-    ("get_chunk_count", "display get_chunk_count()")
-    ("parameter,P", po::value<vector<string> >(),
-     "parameters")
-    ("plugin_exists", po::value<string>(),
-     "succeeds if the plugin given in argument exists and can be loaded")
-    ;
-
-  po::parsed_options parsed =
-    po::command_line_parser(argc, argv).options(desc).allow_unregistered().run();
-  po::store(
-    parsed,
-    vm);
-  po::notify(vm);
-
-  vector<const char *> ceph_options;
-  vector<string> ceph_option_strings = po::collect_unrecognized(
-    parsed.options, po::include_positional);
-  ceph_options.reserve(ceph_option_strings.size());
-  for (vector<string>::iterator i = ceph_option_strings.begin();
-       i != ceph_option_strings.end();
-       ++i) {
-    ceph_options.push_back(i->c_str());
-  }
-
-  cct = global_init(
-    NULL, ceph_options, CEPH_ENTITY_TYPE_CLIENT,
-    CODE_ENVIRONMENT_UTILITY,
-    CINIT_FLAG_NO_MON_CONFIG);
-  common_init_finish(g_ceph_context);
-  g_ceph_context->_conf.apply_changes(nullptr);
-
-  if (vm.count("help")) {
-    cout << desc << std::endl;
-    return 1;
-  }
-
-  if (vm.count("parameter")) {
-    const vector<string> &p = vm["parameter"].as< vector<string> >();
-    for (vector<string>::const_iterator i = p.begin();
-        i != p.end();
-        ++i) {
-      std::vector<std::string> strs;
-      boost::split(strs, *i, boost::is_any_of("="));
-      if (strs.size() != 2) {
-       cerr << "--parameter " << *i
-            << " ignored because it does not contain exactly one =" << endl;
-      } else {
-       profile[strs[0]] = strs[1];
-      }
-    }
-  }
-
-  return 0;
-}
-
-int ErasureCodeCommand::run() {
-  if (vm.count("plugin_exists"))
-    return plugin_exists();
-  else
-    return display_information();
-}
-
-int ErasureCodeCommand::plugin_exists() {
-  ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
-  ErasureCodePlugin *plugin = 0;
-  std::lock_guard l{instance.lock};
-  stringstream ss;
-  int code = instance.load(vm["plugin_exists"].as<string>(),
-                          g_conf().get_val<std::string>("erasure_code_dir"), &plugin, &ss);
-  if (code)
-    cerr << ss.str() << endl;
-  return code;
-}
-
-int ErasureCodeCommand::display_information() {
-  ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
-  ErasureCodeInterfaceRef erasure_code;
-
-  if (profile.count("plugin") == 0) {
-    cerr << "--parameter plugin=<plugin> is mandatory" << endl;
-    return 1;
-  }
-
-  int code = instance.factory(profile["plugin"],
-                             g_conf().get_val<std::string>("erasure_code_dir"),
-                             profile,
-                             &erasure_code, &cerr);
-  if (code)
-    return code;
-
-  if (vm.count("all") || vm.count("get_chunk_size")) {
-    unsigned int object_size = 1024;
-    if (vm.count("get_chunk_size"))
-      object_size = vm["get_chunk_size"].as<unsigned int>();
-    cout << "get_chunk_size(" << object_size << ")\t"
-        << erasure_code->get_chunk_size(object_size) << endl;
-  }
-  if (vm.count("all") || vm.count("get_data_chunk_count"))
-    cout << "get_data_chunk_count\t"
-        << erasure_code->get_data_chunk_count() << endl;
-  if (vm.count("all") || vm.count("get_coding_chunk_count"))
-    cout << "get_coding_chunk_count\t"
-        << erasure_code->get_coding_chunk_count() << endl;
-  if (vm.count("all") || vm.count("get_chunk_count"))
-    cout << "get_chunk_count\t"
-        << erasure_code->get_chunk_count() << endl;
-  return 0;
-}
-
-int main(int argc, char** argv) {
-  ErasureCodeCommand eccommand;
-  try {
-    int err = eccommand.setup(argc, argv);
-    if (err)
-      return err;
-    return eccommand.run();
-  } catch(po::error &e) {
-    cerr << e.what() << endl; 
-    return 1;
-  }
-}
-
-/*
- * Local Variables:
- * compile-command: "cd ../.. ; make -j4 &&
- *   make -j4 ceph_erasure_code &&
- *   libtool --mode=execute valgrind --tool=memcheck --leak-check=full \
- *      ./ceph_erasure_code \
- *      --parameter plugin=jerasure \
- *      --parameter technique=reed_sol_van \
- *      --parameter k=2 \
- *      --parameter m=2 \
- *      --get_chunk_size 1024 \
- *      --get_data_chunk_count \
- *      --get_coding_chunk_count \
- *      --get_chunk_count \
- * "
- * End:
- */