From 3d62e5e9bbcc2fe351f19e76955febd50a5c062e Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Fri, 13 Dec 2024 16:06:14 +0000 Subject: [PATCH 1/5] Refactor many clp_s components to use string_view, and remove some duplicated code --- components/core/src/clp_s/ArchiveWriter.hpp | 2 +- components/core/src/clp_s/ParsedMessage.hpp | 9 +++++++++ .../core/src/clp_s/TimestampDictionaryWriter.cpp | 10 ++++++---- .../core/src/clp_s/TimestampDictionaryWriter.hpp | 10 ++++++---- components/core/src/clp_s/TimestampEntry.hpp | 3 ++- components/core/src/clp_s/TimestampPattern.cpp | 13 +++++++------ components/core/src/clp_s/TimestampPattern.hpp | 5 +++-- .../core/src/clp_s/search/StringLiteral.hpp | 15 +++------------ 8 files changed, 37 insertions(+), 30 deletions(-) diff --git a/components/core/src/clp_s/ArchiveWriter.hpp b/components/core/src/clp_s/ArchiveWriter.hpp index 3b13f4426..f65e964d1 100644 --- a/components/core/src/clp_s/ArchiveWriter.hpp +++ b/components/core/src/clp_s/ArchiveWriter.hpp @@ -124,7 +124,7 @@ class ArchiveWriter { epochtime_t ingest_timestamp_entry( std::string const& key, int32_t node_id, - std::string const& timestamp, + std::string_view const timestamp, uint64_t& pattern_id ) { return m_timestamp_dict.ingest_entry(key, node_id, timestamp, pattern_id); diff --git a/components/core/src/clp_s/ParsedMessage.hpp b/components/core/src/clp_s/ParsedMessage.hpp index c843e2b7b..e6025429b 100644 --- a/components/core/src/clp_s/ParsedMessage.hpp +++ b/components/core/src/clp_s/ParsedMessage.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -34,6 +35,10 @@ class ParsedMessage { m_message.emplace(node_id, value); } + inline void add_value(int32_t node_id, std::string_view const value) { + m_message.emplace(node_id, std::string{value}); + } + /** * Adds a timestamp value and its encoding to the message for a given MST node ID. * @param node_id @@ -55,6 +60,10 @@ class ParsedMessage { m_unordered_message.emplace_back(value); } + inline void add_unordered_value(std::string_view const value) { + m_unordered_message.emplace_back(std::string{value}); + } + /** * Clears the message */ diff --git a/components/core/src/clp_s/TimestampDictionaryWriter.cpp b/components/core/src/clp_s/TimestampDictionaryWriter.cpp index 39e66a6af..bcb006079 100644 --- a/components/core/src/clp_s/TimestampDictionaryWriter.cpp +++ b/components/core/src/clp_s/TimestampDictionaryWriter.cpp @@ -1,6 +1,8 @@ #include "TimestampDictionaryWriter.hpp" +#include #include +#include #include "Utils.hpp" @@ -42,9 +44,9 @@ uint64_t TimestampDictionaryWriter::get_pattern_id(TimestampPattern const* patte } epochtime_t TimestampDictionaryWriter::ingest_entry( - std::string const& key, + std::string_view const key, int32_t node_id, - std::string const& timestamp, + std::string_view const timestamp, uint64_t& pattern_id ) { epochtime_t ret; @@ -88,7 +90,7 @@ epochtime_t TimestampDictionaryWriter::ingest_entry( } void TimestampDictionaryWriter::ingest_entry( - std::string const& key, + std::string_view const key, int32_t node_id, double timestamp ) { @@ -103,7 +105,7 @@ void TimestampDictionaryWriter::ingest_entry( } void TimestampDictionaryWriter::ingest_entry( - std::string const& key, + std::string_view const key, int32_t node_id, int64_t timestamp ) { diff --git a/components/core/src/clp_s/TimestampDictionaryWriter.hpp b/components/core/src/clp_s/TimestampDictionaryWriter.hpp index 29288fd48..f6daf0445 100644 --- a/components/core/src/clp_s/TimestampDictionaryWriter.hpp +++ b/components/core/src/clp_s/TimestampDictionaryWriter.hpp @@ -1,9 +1,11 @@ #ifndef CLP_S_TIMESTAMPDICTIONARYWRITER_HPP #define CLP_S_TIMESTAMPDICTIONARYWRITER_HPP +#include #include #include #include +#include #include #include @@ -47,9 +49,9 @@ class TimestampDictionaryWriter { * @return the epoch time corresponding to the string timestamp */ epochtime_t ingest_entry( - std::string const& key, + std::string_view const key, int32_t node_id, - std::string const& timestamp, + std::string_view const timestamp, uint64_t& pattern_id ); @@ -59,9 +61,9 @@ class TimestampDictionaryWriter { * @param node_id * @param timestamp */ - void ingest_entry(std::string const& key, int32_t node_id, double timestamp); + void ingest_entry(std::string_view const key, int32_t node_id, double timestamp); - void ingest_entry(std::string const& key, int32_t node_id, int64_t timestamp); + void ingest_entry(std::string_view const key, int32_t node_id, int64_t timestamp); /** * TODO: guarantee epoch milliseconds. The current clp-s approach to encoding timestamps and diff --git a/components/core/src/clp_s/TimestampEntry.hpp b/components/core/src/clp_s/TimestampEntry.hpp index 326ed9d73..ddc25e6a6 100644 --- a/components/core/src/clp_s/TimestampEntry.hpp +++ b/components/core/src/clp_s/TimestampEntry.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -43,7 +44,7 @@ class TimestampEntry { m_epoch_start(cEpochTimeMax), m_epoch_end(cEpochTimeMin) {} - TimestampEntry(std::string const& key_name) + TimestampEntry(std::string_view const key_name) : m_encoding(UnkownTimestampEncoding), m_epoch_start_double(cDoubleEpochTimeMax), m_epoch_end_double(cDoubleEpochTimeMin), diff --git a/components/core/src/clp_s/TimestampPattern.cpp b/components/core/src/clp_s/TimestampPattern.cpp index 4ddb5648e..80db3215a 100644 --- a/components/core/src/clp_s/TimestampPattern.cpp +++ b/components/core/src/clp_s/TimestampPattern.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -71,7 +72,7 @@ append_padded_value_notz(int value, char padding_character, size_t max_length, s * @return true if conversion succeeds, false otherwise */ static bool convert_string_to_number( - string const& str, + std::string_view const str, size_t begin_ix, size_t end_ix, char padding_character, @@ -89,7 +90,7 @@ static bool convert_string_to_number( * @return true if conversion succeeds, false otherwise */ static bool convert_string_to_number_notz( - string const& str, + std::string_view const str, size_t max_digits, size_t begin_ix, size_t& end_ix, @@ -125,7 +126,7 @@ append_padded_value_notz(int value, char padding_character, size_t max_length, s } static bool convert_string_to_number( - string const& str, + std::string_view const str, size_t begin_ix, size_t end_ix, char padding_character, @@ -154,7 +155,7 @@ static bool convert_string_to_number( } static bool convert_string_to_number_notz( - string const& str, + std::string_view const str, size_t max_digits, size_t begin_ix, size_t& end_ix, @@ -306,7 +307,7 @@ void TimestampPattern::init() { } TimestampPattern const* TimestampPattern::search_known_ts_patterns( - string const& line, + std::string_view const line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos @@ -342,7 +343,7 @@ void TimestampPattern::clear() { } bool TimestampPattern::parse_timestamp( - string const& line, + std::string_view const line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos diff --git a/components/core/src/clp_s/TimestampPattern.hpp b/components/core/src/clp_s/TimestampPattern.hpp index 9219d33bb..8f6c62cfd 100644 --- a/components/core/src/clp_s/TimestampPattern.hpp +++ b/components/core/src/clp_s/TimestampPattern.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "Defs.hpp" @@ -83,7 +84,7 @@ class TimestampPattern { * @return pointer to the timestamp pattern if found, nullptr otherwise */ static TimestampPattern const* search_known_ts_patterns( - std::string const& line, + std::string_view const line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos @@ -121,7 +122,7 @@ class TimestampPattern { * @return true if parsed successfully, false otherwise */ bool parse_timestamp( - std::string const& line, + std::string_view const line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos diff --git a/components/core/src/clp_s/search/StringLiteral.hpp b/components/core/src/clp_s/search/StringLiteral.hpp index 4ac6b9f2f..b741541e9 100644 --- a/components/core/src/clp_s/search/StringLiteral.hpp +++ b/components/core/src/clp_s/search/StringLiteral.hpp @@ -4,6 +4,7 @@ #include #include +#include "../Utils.hpp" #include "Literal.hpp" namespace clp_s::search { @@ -69,18 +70,8 @@ class StringLiteral : public Literal { } // If '?' and '*' are not escaped, we add LiteralType::ClpStringT to m_string_type - bool escape = false; - for (char const c : m_v) { - if ('\\' == c) { - escape = !escape; - } else if ('?' == c || '*' == c) { - if (false == escape) { - m_string_type |= LiteralType::ClpStringT; - break; - } - } else { - escape = false; - } + if (StringUtils::has_unescaped_wildcards(m_v)) { + m_string_type |= LiteralType::ClpStringT; } } }; From 896fe91bab56ccfc392f5c8b765fa15c4a8440cd Mon Sep 17 00:00:00 2001 From: Devin Gibson Date: Fri, 13 Dec 2024 15:30:58 -0500 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: haiqi96 <14502009+haiqi96@users.noreply.github.com> --- components/core/src/clp_s/ParsedMessage.hpp | 1 + components/core/src/clp_s/TimestampPattern.cpp | 1 + components/core/src/clp_s/TimestampPattern.hpp | 1 + 3 files changed, 3 insertions(+) diff --git a/components/core/src/clp_s/ParsedMessage.hpp b/components/core/src/clp_s/ParsedMessage.hpp index e6025429b..3c047f40b 100644 --- a/components/core/src/clp_s/ParsedMessage.hpp +++ b/components/core/src/clp_s/ParsedMessage.hpp @@ -1,6 +1,7 @@ #ifndef CLP_S_PARSEDMESSAGE_HPP #define CLP_S_PARSEDMESSAGE_HPP +#include #include #include #include diff --git a/components/core/src/clp_s/TimestampPattern.cpp b/components/core/src/clp_s/TimestampPattern.cpp index 80db3215a..5b8fce0d7 100644 --- a/components/core/src/clp_s/TimestampPattern.cpp +++ b/components/core/src/clp_s/TimestampPattern.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/components/core/src/clp_s/TimestampPattern.hpp b/components/core/src/clp_s/TimestampPattern.hpp index 8f6c62cfd..78e8d8285 100644 --- a/components/core/src/clp_s/TimestampPattern.hpp +++ b/components/core/src/clp_s/TimestampPattern.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include From dd1539deaa97cd84c19879e44f9aa0bc70e86e47 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Fri, 13 Dec 2024 20:38:15 +0000 Subject: [PATCH 3/5] Address review comments --- components/core/src/clp_s/ArchiveWriter.hpp | 2 +- components/core/src/clp_s/ParsedMessage.hpp | 4 ++-- .../core/src/clp_s/TimestampDictionaryWriter.cpp | 8 ++++---- .../core/src/clp_s/TimestampDictionaryWriter.hpp | 8 ++++---- components/core/src/clp_s/TimestampEntry.hpp | 2 +- components/core/src/clp_s/TimestampPattern.cpp | 12 ++++++------ components/core/src/clp_s/TimestampPattern.hpp | 4 ++-- components/core/src/clp_s/search/StringLiteral.hpp | 1 - 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/components/core/src/clp_s/ArchiveWriter.hpp b/components/core/src/clp_s/ArchiveWriter.hpp index f65e964d1..b69417804 100644 --- a/components/core/src/clp_s/ArchiveWriter.hpp +++ b/components/core/src/clp_s/ArchiveWriter.hpp @@ -124,7 +124,7 @@ class ArchiveWriter { epochtime_t ingest_timestamp_entry( std::string const& key, int32_t node_id, - std::string_view const timestamp, + std::string_view timestamp, uint64_t& pattern_id ) { return m_timestamp_dict.ingest_entry(key, node_id, timestamp, pattern_id); diff --git a/components/core/src/clp_s/ParsedMessage.hpp b/components/core/src/clp_s/ParsedMessage.hpp index 3c047f40b..c1b6d7a35 100644 --- a/components/core/src/clp_s/ParsedMessage.hpp +++ b/components/core/src/clp_s/ParsedMessage.hpp @@ -36,7 +36,7 @@ class ParsedMessage { m_message.emplace(node_id, value); } - inline void add_value(int32_t node_id, std::string_view const value) { + inline void add_value(int32_t node_id, std::string_view value) { m_message.emplace(node_id, std::string{value}); } @@ -61,7 +61,7 @@ class ParsedMessage { m_unordered_message.emplace_back(value); } - inline void add_unordered_value(std::string_view const value) { + inline void add_unordered_value(std::string_view value) { m_unordered_message.emplace_back(std::string{value}); } diff --git a/components/core/src/clp_s/TimestampDictionaryWriter.cpp b/components/core/src/clp_s/TimestampDictionaryWriter.cpp index bcb006079..952bc36db 100644 --- a/components/core/src/clp_s/TimestampDictionaryWriter.cpp +++ b/components/core/src/clp_s/TimestampDictionaryWriter.cpp @@ -44,9 +44,9 @@ uint64_t TimestampDictionaryWriter::get_pattern_id(TimestampPattern const* patte } epochtime_t TimestampDictionaryWriter::ingest_entry( - std::string_view const key, + std::string_view key, int32_t node_id, - std::string_view const timestamp, + std::string_view timestamp, uint64_t& pattern_id ) { epochtime_t ret; @@ -90,7 +90,7 @@ epochtime_t TimestampDictionaryWriter::ingest_entry( } void TimestampDictionaryWriter::ingest_entry( - std::string_view const key, + std::string_view key, int32_t node_id, double timestamp ) { @@ -105,7 +105,7 @@ void TimestampDictionaryWriter::ingest_entry( } void TimestampDictionaryWriter::ingest_entry( - std::string_view const key, + std::string_view key, int32_t node_id, int64_t timestamp ) { diff --git a/components/core/src/clp_s/TimestampDictionaryWriter.hpp b/components/core/src/clp_s/TimestampDictionaryWriter.hpp index f6daf0445..7c214a39e 100644 --- a/components/core/src/clp_s/TimestampDictionaryWriter.hpp +++ b/components/core/src/clp_s/TimestampDictionaryWriter.hpp @@ -49,9 +49,9 @@ class TimestampDictionaryWriter { * @return the epoch time corresponding to the string timestamp */ epochtime_t ingest_entry( - std::string_view const key, + std::string_view key, int32_t node_id, - std::string_view const timestamp, + std::string_view timestamp, uint64_t& pattern_id ); @@ -61,9 +61,9 @@ class TimestampDictionaryWriter { * @param node_id * @param timestamp */ - void ingest_entry(std::string_view const key, int32_t node_id, double timestamp); + void ingest_entry(std::string_view key, int32_t node_id, double timestamp); - void ingest_entry(std::string_view const key, int32_t node_id, int64_t timestamp); + void ingest_entry(std::string_view key, int32_t node_id, int64_t timestamp); /** * TODO: guarantee epoch milliseconds. The current clp-s approach to encoding timestamps and diff --git a/components/core/src/clp_s/TimestampEntry.hpp b/components/core/src/clp_s/TimestampEntry.hpp index ddc25e6a6..47a26fd9e 100644 --- a/components/core/src/clp_s/TimestampEntry.hpp +++ b/components/core/src/clp_s/TimestampEntry.hpp @@ -44,7 +44,7 @@ class TimestampEntry { m_epoch_start(cEpochTimeMax), m_epoch_end(cEpochTimeMin) {} - TimestampEntry(std::string_view const key_name) + TimestampEntry(std::string_view key_name) : m_encoding(UnkownTimestampEncoding), m_epoch_start_double(cDoubleEpochTimeMax), m_epoch_end_double(cDoubleEpochTimeMin), diff --git a/components/core/src/clp_s/TimestampPattern.cpp b/components/core/src/clp_s/TimestampPattern.cpp index 5b8fce0d7..0bfa5cf0f 100644 --- a/components/core/src/clp_s/TimestampPattern.cpp +++ b/components/core/src/clp_s/TimestampPattern.cpp @@ -73,7 +73,7 @@ append_padded_value_notz(int value, char padding_character, size_t max_length, s * @return true if conversion succeeds, false otherwise */ static bool convert_string_to_number( - std::string_view const str, + std::string_view str, size_t begin_ix, size_t end_ix, char padding_character, @@ -91,7 +91,7 @@ static bool convert_string_to_number( * @return true if conversion succeeds, false otherwise */ static bool convert_string_to_number_notz( - std::string_view const str, + std::string_view str, size_t max_digits, size_t begin_ix, size_t& end_ix, @@ -127,7 +127,7 @@ append_padded_value_notz(int value, char padding_character, size_t max_length, s } static bool convert_string_to_number( - std::string_view const str, + std::string_view str, size_t begin_ix, size_t end_ix, char padding_character, @@ -156,7 +156,7 @@ static bool convert_string_to_number( } static bool convert_string_to_number_notz( - std::string_view const str, + std::string_view str, size_t max_digits, size_t begin_ix, size_t& end_ix, @@ -308,7 +308,7 @@ void TimestampPattern::init() { } TimestampPattern const* TimestampPattern::search_known_ts_patterns( - std::string_view const line, + std::string_view line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos @@ -344,7 +344,7 @@ void TimestampPattern::clear() { } bool TimestampPattern::parse_timestamp( - std::string_view const line, + std::string_view line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos diff --git a/components/core/src/clp_s/TimestampPattern.hpp b/components/core/src/clp_s/TimestampPattern.hpp index 78e8d8285..278bb82e1 100644 --- a/components/core/src/clp_s/TimestampPattern.hpp +++ b/components/core/src/clp_s/TimestampPattern.hpp @@ -85,7 +85,7 @@ class TimestampPattern { * @return pointer to the timestamp pattern if found, nullptr otherwise */ static TimestampPattern const* search_known_ts_patterns( - std::string_view const line, + std::string_view line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos @@ -123,7 +123,7 @@ class TimestampPattern { * @return true if parsed successfully, false otherwise */ bool parse_timestamp( - std::string_view const line, + std::string_view line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos diff --git a/components/core/src/clp_s/search/StringLiteral.hpp b/components/core/src/clp_s/search/StringLiteral.hpp index b741541e9..67c902a29 100644 --- a/components/core/src/clp_s/search/StringLiteral.hpp +++ b/components/core/src/clp_s/search/StringLiteral.hpp @@ -69,7 +69,6 @@ class StringLiteral : public Literal { m_string_type = LiteralType::VarStringT; } - // If '?' and '*' are not escaped, we add LiteralType::ClpStringT to m_string_type if (StringUtils::has_unescaped_wildcards(m_v)) { m_string_type |= LiteralType::ClpStringT; } From 22e5ad4bb547904e7537a34f1b137b1e1bbbb25a Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Fri, 13 Dec 2024 21:30:57 +0000 Subject: [PATCH 4/5] Address review comments --- .../core/src/clp_s/TimestampPattern.cpp | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/components/core/src/clp_s/TimestampPattern.cpp b/components/core/src/clp_s/TimestampPattern.cpp index 0bfa5cf0f..11fab3480 100644 --- a/components/core/src/clp_s/TimestampPattern.cpp +++ b/components/core/src/clp_s/TimestampPattern.cpp @@ -14,6 +14,7 @@ using clp::string_utils::convert_string_to_int; using std::string; +using std::string_view; using std::to_string; using std::vector; @@ -73,7 +74,7 @@ append_padded_value_notz(int value, char padding_character, size_t max_length, s * @return true if conversion succeeds, false otherwise */ static bool convert_string_to_number( - std::string_view str, + string_view str, size_t begin_ix, size_t end_ix, char padding_character, @@ -91,7 +92,7 @@ static bool convert_string_to_number( * @return true if conversion succeeds, false otherwise */ static bool convert_string_to_number_notz( - std::string_view str, + string_view str, size_t max_digits, size_t begin_ix, size_t& end_ix, @@ -127,7 +128,7 @@ append_padded_value_notz(int value, char padding_character, size_t max_length, s } static bool convert_string_to_number( - std::string_view str, + string_view str, size_t begin_ix, size_t end_ix, char padding_character, @@ -156,7 +157,7 @@ static bool convert_string_to_number( } static bool convert_string_to_number_notz( - std::string_view str, + string_view str, size_t max_digits, size_t begin_ix, size_t& end_ix, @@ -308,7 +309,7 @@ void TimestampPattern::init() { } TimestampPattern const* TimestampPattern::search_known_ts_patterns( - std::string_view line, + string_view line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos @@ -344,7 +345,7 @@ void TimestampPattern::clear() { } bool TimestampPattern::parse_timestamp( - std::string_view line, + string_view line, epochtime_t& timestamp, size_t& timestamp_begin_pos, size_t& timestamp_end_pos @@ -829,23 +830,20 @@ bool TimestampPattern::parse_timestamp( } auto dot_position = line.find('.'); auto nanosecond_start = dot_position + 1; - if (std::string::npos == dot_position || 0 == dot_position + if (string::npos == dot_position || 0 == dot_position || cNanosecondDigits != (line.length() - nanosecond_start)) { return false; } - auto timestamp_view = std::string_view(line); - if (false - == convert_string_to_int(timestamp_view.substr(0, dot_position), timestamp)) - { + if (false == convert_string_to_int(line.substr(0, dot_position), timestamp)) { return false; } epochtime_t timestamp_nanoseconds; if (false == convert_string_to_int( - timestamp_view.substr(nanosecond_start, cNanosecondDigits), + line.substr(nanosecond_start, cNanosecondDigits), timestamp_nanoseconds )) { @@ -1072,14 +1070,14 @@ void TimestampPattern::insert_formatted_timestamp(epochtime_t timestamp, string& case 'E': // UNIX epoch milliseconds // Note: this timestamp format is required to make up the entire timestamp, so // this is safe - new_msg = std::to_string(timestamp); + new_msg = to_string(timestamp); break; case 'F': { // Nanosecond precision floating point UNIX epoch timestamp constexpr auto cNanosecondDigits = 9; // Note: this timestamp format is required to make up the entire timestamp, so // this is safe - new_msg = std::to_string(timestamp); + new_msg = to_string(timestamp); new_msg.insert(new_msg.end() - cNanosecondDigits, '.'); break; } From c993273a69244bf9900253889576c0f6820e46a5 Mon Sep 17 00:00:00 2001 From: gibber9809 Date: Mon, 16 Dec 2024 16:14:54 +0000 Subject: [PATCH 5/5] Add missed string_view in ArchiveWriter --- components/core/src/clp_s/ArchiveWriter.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/core/src/clp_s/ArchiveWriter.hpp b/components/core/src/clp_s/ArchiveWriter.hpp index b69417804..82a0122bc 100644 --- a/components/core/src/clp_s/ArchiveWriter.hpp +++ b/components/core/src/clp_s/ArchiveWriter.hpp @@ -122,7 +122,7 @@ class ArchiveWriter { * @return the epoch time corresponding to the string timestamp */ epochtime_t ingest_timestamp_entry( - std::string const& key, + std::string_view key, int32_t node_id, std::string_view timestamp, uint64_t& pattern_id @@ -136,11 +136,11 @@ class ArchiveWriter { * @param node_id * @param timestamp */ - void ingest_timestamp_entry(std::string const& key, int32_t node_id, double timestamp) { + void ingest_timestamp_entry(std::string_view key, int32_t node_id, double timestamp) { m_timestamp_dict.ingest_entry(key, node_id, timestamp); } - void ingest_timestamp_entry(std::string const& key, int32_t node_id, int64_t timestamp) { + void ingest_timestamp_entry(std::string_view key, int32_t node_id, int64_t timestamp) { m_timestamp_dict.ingest_entry(key, node_id, timestamp); }