diff --git a/components/core/src/clp/clo/OutputHandler.cpp b/components/core/src/clp/clo/OutputHandler.cpp index afb758865..82d67c35f 100644 --- a/components/core/src/clp/clo/OutputHandler.cpp +++ b/components/core/src/clp/clo/OutputHandler.cpp @@ -1,8 +1,8 @@ #include "OutputHandler.hpp" #include +#include #include -#include #include #include @@ -73,8 +73,8 @@ ErrorCode ResultsCacheOutputHandler::add_result( orig_file_path, orig_file_id, log_event_ix, - decompressed_message, - timestamp + timestamp, + decompressed_message )); } else if (m_latest_results.top()->timestamp < timestamp) { m_latest_results.pop(); @@ -82,8 +82,8 @@ ErrorCode ResultsCacheOutputHandler::add_result( orig_file_path, orig_file_id, log_event_ix, - decompressed_message, - timestamp + timestamp, + decompressed_message )); } @@ -104,8 +104,8 @@ ErrorCode ResultsCacheOutputHandler::flush() { ), bsoncxx::builder::basic::kvp("orig_file_id", std::move(result.orig_file_id)), bsoncxx::builder::basic::kvp("log_event_ix", result.log_event_ix), - bsoncxx::builder::basic::kvp("message", std::move(result.decompressed_message)), - bsoncxx::builder::basic::kvp("timestamp", result.timestamp) + bsoncxx::builder::basic::kvp("timestamp", result.timestamp), + bsoncxx::builder::basic::kvp("message", std::move(result.decompressed_message)) ))); count++; diff --git a/components/core/src/clp/clo/OutputHandler.hpp b/components/core/src/clp/clo/OutputHandler.hpp index 677814c81..5b5ddf55f 100644 --- a/components/core/src/clp/clo/OutputHandler.hpp +++ b/components/core/src/clp/clo/OutputHandler.hpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -29,14 +30,14 @@ class OutputHandler { // Methods /** * Adds a query result to a batch or sends it to the destination. - * @param original_path The original path of the file input log event belongs to. - * @param original_path The original id of the file input log event belongs to. - * @param encoded_message The encoded log event - * @param decompressed_message The content of the log event. + * @param orig_file_path original path of the file that input log event belongs to + * @param orig_file_id original id of the file that input log event belongs to + * @param encoded_message encoded log event + * @param decompressed_message decompressed log event * @return ErrorCode_Success if the result was added successfully, an error code otherwise. */ virtual ErrorCode add_result( - std::string_view original_path, + std::string_view orig_file_path, std::string_view orig_file_id, streaming_archive::reader::Message const& encoded_message, std::string_view decompressed_message @@ -87,13 +88,14 @@ class NetworkOutputHandler : public OutputHandler { // Methods inherited from Client /** * Sends a result to the network destination. - * @param original_path The original path of the file input log event belongs to. - * @param original_path The original id of the file input log event belongs to. - * @param encoded_message The encoded log event - * @param message The content of the log event. + * @param orig_file_path original path of the file that input log event belongs to + * @param orig_file_id original id of the file that input log event belongs to + * @param encoded_message encoded log event + * @param decompressed_message decompressed log event + * @return Same as networking::try_send */ ErrorCode add_result( - std::string_view original_path, + std::string_view orig_file_path, std::string_view orig_file_id, streaming_archive::reader::Message const& encoded_message, std::string_view decompressed_message @@ -124,20 +126,20 @@ class ResultsCacheOutputHandler : public OutputHandler { std::string_view orig_file_path, std::string_view orig_file_id, size_t log_event_ix, - std::string_view decompressed_message, - epochtime_t timestamp + epochtime_t timestamp, + std::string_view decompressed_message ) : orig_file_path(orig_file_path), orig_file_id(orig_file_id), log_event_ix(log_event_ix), - decompressed_message(decompressed_message), - timestamp(timestamp) {} + timestamp(timestamp), + decompressed_message(decompressed_message) {} std::string orig_file_path; std::string orig_file_id; int64_t log_event_ix; - std::string decompressed_message; epochtime_t timestamp; + std::string decompressed_message; }; struct QueryResultGreaterTimestampComparator { @@ -172,14 +174,14 @@ class ResultsCacheOutputHandler : public OutputHandler { // Methods inherited from OutputHandler /** * Adds a result to the batch. - * @param original_path The original path of the file input log event belongs to. - * @param original_path The original id of the file input log event belongs to. - * @param encoded_message The encoded log event - * @param message The content of the log event. - * @return + * @param orig_file_path original path of the file that input log event belongs to + * @param orig_file_id original id of the file that input log event belongs to + * @param encoded_message encoded log event + * @param decompressed_message decompressed log event + * @return ErrorCode_Success */ ErrorCode add_result( - std::string_view original_path, + std::string_view orig_file_path, std::string_view orig_file_id, streaming_archive::reader::Message const& encoded_message, std::string_view decompressed_message @@ -234,16 +236,8 @@ class CountOutputHandler : public OutputHandler { explicit CountOutputHandler(int reducer_socket_fd); // Methods inherited from OutputHandler - /** - * Adds a result. - * @param original_path The original path of the file input log event belongs to. - * @param original_path The original id of the file input log event belongs to. - * @param encoded_message The encoded log event - * @param message The content of the log event. - * @return Errorcode - */ ErrorCode add_result( - std::string_view original_path, + std::string_view orig_file_path, std::string_view orig_file_id, streaming_archive::reader::Message const& encoded_message, std::string_view decompressed_message @@ -274,7 +268,7 @@ class CountByTimeOutputHandler : public OutputHandler { // Methods inherited from OutputHandler ErrorCode add_result( - std::string_view original_path, + std::string_view orig_file_path, std::string_view orig_file_id, streaming_archive::reader::Message const& encoded_message, std::string_view decompressed_message diff --git a/components/core/src/clp/clo/clo.cpp b/components/core/src/clp/clo/clo.cpp index 7c6cf5797..f0328dc3f 100644 --- a/components/core/src/clp/clo/clo.cpp +++ b/components/core/src/clp/clo/clo.cpp @@ -98,7 +98,7 @@ static SearchFilesResult search_file( std::unique_ptr& output_handler ) { File compressed_file; - Message compressed_message; + Message encoded_message; string decompressed_message; ErrorCode error_code = archive.open_file(compressed_file, file_metadata_ix); @@ -119,7 +119,7 @@ static SearchFilesResult search_file( query, archive, compressed_file, - compressed_message, + encoded_message, decompressed_message )) { @@ -127,7 +127,7 @@ static SearchFilesResult search_file( != output_handler->add_result( compressed_file.get_orig_path(), compressed_file.get_orig_file_id_as_string(), - compressed_message, + encoded_message, decompressed_message )) {