Skip to content

Commit

Permalink
revert(core): Remove temporary output directory option from clp and…
Browse files Browse the repository at this point in the history
… `clo`. (y-scope#619)
  • Loading branch information
haiqi96 authored and davidlion committed Dec 19, 2024
1 parent 44b0f2b commit 4d21d9b
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 29 deletions.
8 changes: 0 additions & 8 deletions components/core/src/clp/clo/CommandLineArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,6 @@ auto CommandLineArguments::parse_ir_extraction_arguments(
// clang-format off
options_ir_extraction
.add_options()(
"temp-output-dir",
po::value<string>(&m_ir_temp_output_dir)->value_name("DIR"),
"Temporary output directory for IR chunks while they're being written"
)(
"target-size",
po::value<size_t>(&m_ir_target_size)->value_name("SIZE"),
"Target size (B) for each IR chunk before a new chunk is created"
Expand Down Expand Up @@ -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;
}

Expand Down
5 changes: 0 additions & 5 deletions components/core/src/clp/clo/CommandLineArguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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& {
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clp/clo/clo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
))
{
Expand Down
11 changes: 0 additions & 11 deletions components/core/src/clp/clp/CommandLineArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>(&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);
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 0 additions & 3 deletions components/core/src/clp/clp/CommandLineArguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion components/core/src/clp/clp/decompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
))
{
Expand Down

0 comments on commit 4d21d9b

Please sign in to comment.