From 4d21d9b04c42e3f9de2ddfa19491240e9cb99ce4 Mon Sep 17 00:00:00 2001 From: haiqi96 <14502009+haiqi96@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:58:02 -0500 Subject: [PATCH] revert(core): Remove temporary output directory option from `clp` and `clo`. (#619) --- components/core/src/clp/clo/CommandLineArguments.cpp | 8 -------- components/core/src/clp/clo/CommandLineArguments.hpp | 5 ----- components/core/src/clp/clo/clo.cpp | 2 +- components/core/src/clp/clp/CommandLineArguments.cpp | 11 ----------- components/core/src/clp/clp/CommandLineArguments.hpp | 3 --- components/core/src/clp/clp/decompression.cpp | 2 +- 6 files changed, 2 insertions(+), 29 deletions(-) diff --git a/components/core/src/clp/clo/CommandLineArguments.cpp b/components/core/src/clp/clo/CommandLineArguments.cpp index fffc3d783..4e187f985 100644 --- a/components/core/src/clp/clo/CommandLineArguments.cpp +++ b/components/core/src/clp/clo/CommandLineArguments.cpp @@ -181,10 +181,6 @@ auto CommandLineArguments::parse_ir_extraction_arguments( // clang-format off options_ir_extraction .add_options()( - "temp-output-dir", - po::value(&m_ir_temp_output_dir)->value_name("DIR"), - "Temporary output directory for IR chunks while they're being written" - )( "target-size", po::value(&m_ir_target_size)->value_name("SIZE"), "Target size (B) for each IR chunk before a new chunk is created" @@ -287,10 +283,6 @@ auto CommandLineArguments::parse_ir_extraction_arguments( if (m_ir_mongodb_collection.empty()) { throw invalid_argument("COLLECTION not specified or empty."); } - - if (m_ir_temp_output_dir.empty()) { - m_ir_temp_output_dir = m_ir_output_dir; - } return ParsingResult::Success; } diff --git a/components/core/src/clp/clo/CommandLineArguments.hpp b/components/core/src/clp/clo/CommandLineArguments.hpp index 9e6d311c3..d84b96a18 100644 --- a/components/core/src/clp/clo/CommandLineArguments.hpp +++ b/components/core/src/clp/clo/CommandLineArguments.hpp @@ -54,10 +54,6 @@ class CommandLineArguments : public CommandLineArgumentsBase { [[nodiscard]] auto get_ir_output_dir() const -> std::string const& { return m_ir_output_dir; } - [[nodiscard]] auto get_ir_temp_output_dir() const -> std::string const& { - return m_ir_temp_output_dir; - } - [[nodiscard]] auto get_ir_mongodb_uri() const -> std::string const& { return m_ir_mongodb_uri; } [[nodiscard]] auto get_ir_mongodb_collection() const -> std::string const& { @@ -187,7 +183,6 @@ class CommandLineArguments : public CommandLineArgumentsBase { std::string m_file_split_id; size_t m_ir_target_size{128ULL * 1024 * 1024}; std::string m_ir_output_dir; - std::string m_ir_temp_output_dir; std::string m_ir_mongodb_uri; std::string m_ir_mongodb_collection; diff --git a/components/core/src/clp/clo/clo.cpp b/components/core/src/clp/clo/clo.cpp index f29df0306..23ff6f67e 100644 --- a/components/core/src/clp/clo/clo.cpp +++ b/components/core/src/clp/clo/clo.cpp @@ -224,7 +224,7 @@ bool extract_ir(CommandLineArguments const& command_line_args) { archive_reader, *file_metadata_ix_ptr, command_line_args.get_ir_target_size(), - command_line_args.get_ir_temp_output_dir(), + command_line_args.get_ir_output_dir(), ir_output_handler )) { diff --git a/components/core/src/clp/clp/CommandLineArguments.cpp b/components/core/src/clp/clp/CommandLineArguments.cpp index ccdc99793..cb44d96d8 100644 --- a/components/core/src/clp/clp/CommandLineArguments.cpp +++ b/components/core/src/clp/clp/CommandLineArguments.cpp @@ -255,13 +255,6 @@ CommandLineArguments::parse_arguments(int argc, char const* argv[]) { ->default_value(m_ir_target_size), "Target size (B) for each IR chunk before a new chunk is created" ); - options_ir.add_options()( - "temp-output-dir", - po::value(&m_ir_temp_output_dir) - ->value_name("DIR") - ->default_value(m_ir_temp_output_dir), - "Temporary output directory for IR chunks while they're being written" - ); po::options_description all_ir_options; all_ir_options.add(ir_positional_options); @@ -311,10 +304,6 @@ CommandLineArguments::parse_arguments(int argc, char const* argv[]) { if (m_orig_file_id.empty()) { throw invalid_argument("ORIG_FILE_ID cannot be empty."); } - - if (m_ir_temp_output_dir.empty()) { - m_ir_temp_output_dir = m_output_dir; - } } else if (Command::Compress == m_command) { // Define compression hidden positional options po::options_description compression_positional_options; diff --git a/components/core/src/clp/clp/CommandLineArguments.hpp b/components/core/src/clp/clp/CommandLineArguments.hpp index b9cf15740..6e14a4b3b 100644 --- a/components/core/src/clp/clp/CommandLineArguments.hpp +++ b/components/core/src/clp/clp/CommandLineArguments.hpp @@ -37,8 +37,6 @@ class CommandLineArguments : public CommandLineArgumentsBase { std::string const& get_path_prefix_to_remove() const { return m_path_prefix_to_remove; } - std::string const& get_ir_temp_output_dir() const { return m_ir_temp_output_dir; } - std::string const& get_output_dir() const { return m_output_dir; } std::string const& get_schema_file_path() const { return m_schema_file_path; } @@ -91,7 +89,6 @@ class CommandLineArguments : public CommandLineArgumentsBase { size_t m_ir_msg_ix{0}; size_t m_ir_target_size{128ULL * 1024 * 1024}; bool m_sort_input_files; - std::string m_ir_temp_output_dir; std::string m_output_dir; std::string m_schema_file_path; bool m_show_progress; diff --git a/components/core/src/clp/clp/decompression.cpp b/components/core/src/clp/clp/decompression.cpp index 6b87f6777..b8ae06350 100644 --- a/components/core/src/clp/clp/decompression.cpp +++ b/components/core/src/clp/clp/decompression.cpp @@ -310,7 +310,7 @@ bool decompress_to_ir(CommandLineArguments& command_line_args) { archive_reader, *file_metadata_ix_ptr, command_line_args.get_ir_target_size(), - command_line_args.get_ir_temp_output_dir(), + command_line_args.get_output_dir(), ir_output_handler )) {