diff --git a/components/core/src/clp_s/JsonParser.cpp b/components/core/src/clp_s/JsonParser.cpp index c4fe7a43e..d73643a64 100644 --- a/components/core/src/clp_s/JsonParser.cpp +++ b/components/core/src/clp_s/JsonParser.cpp @@ -11,9 +11,7 @@ namespace clp_s { JsonParser::JsonParser(JsonParserOption const& option) - : m_archives_dir(option.archives_dir), - m_num_messages(0), - m_compression_level(option.compression_level), + : m_num_messages(0), m_target_encoded_size(option.target_encoded_size), m_max_document_size(option.max_document_size), m_timestamp_key(option.timestamp_key), @@ -30,14 +28,13 @@ JsonParser::JsonParser(JsonParserOption const& option) FileUtils::find_all_files(file_path, m_file_paths); } - ArchiveWriterOption archive_writer_option; - archive_writer_option.archives_dir = m_archives_dir; - archive_writer_option.id = m_generator(); - archive_writer_option.compression_level = option.compression_level; - archive_writer_option.print_archive_stats = option.print_archive_stats; + m_archive_options.archives_dir = option.archives_dir; + m_archive_options.compression_level = option.compression_level; + m_archive_options.print_archive_stats = option.print_archive_stats; + m_archive_options.id = m_generator(); m_archive_writer = std::make_unique(option.metadata_db); - m_archive_writer->open(archive_writer_option); + m_archive_writer->open(m_archive_options); } void JsonParser::parse_obj_in_array(ondemand::object line, int32_t parent_node_id) { @@ -505,13 +502,8 @@ void JsonParser::store() { void JsonParser::split_archive() { m_archive_writer->close(); - - ArchiveWriterOption archive_writer_option; - archive_writer_option.archives_dir = m_archives_dir; - archive_writer_option.id = m_generator(); - archive_writer_option.compression_level = m_compression_level; - - m_archive_writer->open(archive_writer_option); + m_archive_options.id = m_generator(); + m_archive_writer->open(m_archive_options); } } // namespace clp_s diff --git a/components/core/src/clp_s/JsonParser.hpp b/components/core/src/clp_s/JsonParser.hpp index a0010e66f..f65f4c4b1 100644 --- a/components/core/src/clp_s/JsonParser.hpp +++ b/components/core/src/clp_s/JsonParser.hpp @@ -93,10 +93,7 @@ class JsonParser { void split_archive(); int m_num_messages; - int m_compression_level; std::vector m_file_paths; - std::string m_archives_dir; - std::string m_schema_tree_path; Schema m_current_schema; ParsedMessage m_current_parsed_message; @@ -106,6 +103,7 @@ class JsonParser { boost::uuids::random_generator m_generator; std::unique_ptr m_archive_writer; + ArchiveWriterOption m_archive_options{}; size_t m_target_encoded_size; size_t m_max_document_size; bool m_structurize_arrays{false};