Skip to content

Commit d2190bb

Browse files
committed
Merge remote-tracking branch 'upstream/main' into task-clang-tidy
2 parents fc77fd5 + 84db3fc commit d2190bb

File tree

80 files changed

+397
-349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+397
-349
lines changed

components/core/src/clp/ArrayBackedPosIntSet.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ void ArrayBackedPosIntSet<PosIntType>::insert(PosIntType value) {
132132
}
133133

134134
template <typename PosIntType>
135-
void ArrayBackedPosIntSet<PosIntType>::insert_all(ArrayBackedPosIntSet<PosIntType> const& input_set
136-
) {
135+
void
136+
ArrayBackedPosIntSet<PosIntType>::insert_all(ArrayBackedPosIntSet<PosIntType> const& input_set) {
137137
// Increase capacity if necessary
138138
size_t input_set_largest_value = input_set.m_largest_value;
139139
if (input_set_largest_value >= m_data.size()) {

components/core/src/clp/DictionaryReader.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ void DictionaryReader<DictionaryIdType, EntryType>::read_new_entries() {
211211
}
212212

213213
template <typename DictionaryIdType, typename EntryType>
214-
EntryType const& DictionaryReader<DictionaryIdType, EntryType>::get_entry(DictionaryIdType id
215-
) const {
214+
EntryType const&
215+
DictionaryReader<DictionaryIdType, EntryType>::get_entry(DictionaryIdType id) const {
216216
if (false == m_is_open) {
217217
throw OperationFailed(ErrorCode_NotInit, __FILENAME__, __LINE__);
218218
}
@@ -224,8 +224,8 @@ EntryType const& DictionaryReader<DictionaryIdType, EntryType>::get_entry(Dictio
224224
}
225225

226226
template <typename DictionaryIdType, typename EntryType>
227-
std::string const& DictionaryReader<DictionaryIdType, EntryType>::get_value(DictionaryIdType id
228-
) const {
227+
std::string const&
228+
DictionaryReader<DictionaryIdType, EntryType>::get_value(DictionaryIdType id) const {
229229
if (id >= m_entries.size()) {
230230
throw OperationFailed(ErrorCode_Corrupt, __FILENAME__, __LINE__);
231231
}

components/core/src/clp/GlobalSQLiteMetadataDB.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@ void GlobalSQLiteMetadataDB::open() {
259259
archive_field_names_and_types[enum_to_underlying_type(ArchivesTableFieldIndexes::Id)].second
260260
= "TEXT PRIMARY KEY";
261261

262-
archive_field_names_and_types[enum_to_underlying_type(ArchivesTableFieldIndexes::BeginTimestamp
263-
)]
264-
.first
262+
archive_field_names_and_types
263+
[enum_to_underlying_type(ArchivesTableFieldIndexes::BeginTimestamp)]
264+
.first
265265
= streaming_archive::cMetadataDB::Archive::BeginTimestamp;
266-
archive_field_names_and_types[enum_to_underlying_type(ArchivesTableFieldIndexes::BeginTimestamp
267-
)]
268-
.second
266+
archive_field_names_and_types
267+
[enum_to_underlying_type(ArchivesTableFieldIndexes::BeginTimestamp)]
268+
.second
269269
= "INTEGER";
270270

271271
archive_field_names_and_types[enum_to_underlying_type(ArchivesTableFieldIndexes::EndTimestamp)]
@@ -333,13 +333,13 @@ void GlobalSQLiteMetadataDB::open() {
333333
file_field_names_and_types[enum_to_underlying_type(FilesTableFieldIndexes::EndTimestamp)].second
334334
= "INTEGER";
335335

336-
file_field_names_and_types[enum_to_underlying_type(FilesTableFieldIndexes::NumUncompressedBytes
337-
)]
338-
.first
336+
file_field_names_and_types
337+
[enum_to_underlying_type(FilesTableFieldIndexes::NumUncompressedBytes)]
338+
.first
339339
= streaming_archive::cMetadataDB::File::NumUncompressedBytes;
340-
file_field_names_and_types[enum_to_underlying_type(FilesTableFieldIndexes::NumUncompressedBytes
341-
)]
342-
.second
340+
file_field_names_and_types
341+
[enum_to_underlying_type(FilesTableFieldIndexes::NumUncompressedBytes)]
342+
.second
343343
= "INTEGER";
344344

345345
file_field_names_and_types[enum_to_underlying_type(FilesTableFieldIndexes::BeginMessageIx)]
@@ -597,5 +597,4 @@ bool GlobalSQLiteMetadataDB::get_file_split(
597597

598598
return true;
599599
}
600-
601600
} // namespace clp

components/core/src/clp/GlobalSQLiteMetadataDB.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ class GlobalSQLiteMetadataDB : public GlobalMetadataDB {
8989
return new ArchiveIterator(m_db, begin_ts, end_ts);
9090
}
9191

92-
GlobalMetadataDB::ArchiveIterator* get_archive_iterator_for_file_path(std::string const& path
92+
GlobalMetadataDB::ArchiveIterator* get_archive_iterator_for_file_path(
93+
std::string const& path
9394
) override {
9495
return new ArchiveIterator(m_db, path);
9596
}

components/core/src/clp/Utils.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,13 @@ void load_lexer_from_file(
167167

168168
lexer.add_rule(
169169
lexer.m_symbol_id["newLine"],
170-
std::move(std::make_unique<log_surgeon::finite_automata::RegexASTLiteral<
171-
log_surgeon::finite_automata::RegexNFAByteState>>(
172-
log_surgeon::finite_automata::RegexASTLiteral<
173-
log_surgeon::finite_automata::RegexNFAByteState>('\n')
174-
))
170+
std::move(
171+
std::make_unique<log_surgeon::finite_automata::RegexASTLiteral<
172+
log_surgeon::finite_automata::RegexNFAByteState>>(
173+
log_surgeon::finite_automata::RegexASTLiteral<
174+
log_surgeon::finite_automata::RegexNFAByteState>('\n')
175+
)
176+
)
175177
);
176178

177179
for (auto const& delimiters_ast : schema_ast->m_delimiters) {

components/core/src/clp/aws/AwsAuthenticationSigner.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,13 @@ AwsAuthenticationSigner::get_canonical_query_string(string_view scope, string_vi
260260
cDefaultExpireTime.count()
261261
);
262262
if (m_session_token.has_value()) {
263-
canonical_query_string.append(fmt::format(
264-
"&{}={}",
265-
cXAmzSecurityToken,
266-
encode_uri(m_session_token.value(), false)
267-
));
263+
canonical_query_string.append(
264+
fmt::format(
265+
"&{}={}",
266+
cXAmzSecurityToken,
267+
encode_uri(m_session_token.value(), false)
268+
)
269+
);
268270
}
269271
canonical_query_string.append(fmt::format("&{}={}", cXAmzSignedHeaders, cDefaultSignedHeaders));
270272
return canonical_query_string;

components/core/src/clp/clg/CommandLineArguments.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,10 @@ CommandLineArguments::parse_arguments(int argc, char const* argv[]) {
213213
// Validate at least one wildcard string exists
214214
if (m_search_strings_file_path.empty() == false) {
215215
if (m_search_string.empty() == false) {
216-
throw invalid_argument("Wildcard strings cannot be specified both through the "
217-
"command line and a file.");
216+
throw invalid_argument(
217+
"Wildcard strings cannot be specified both through the command line and a"
218+
" file."
219+
);
218220
}
219221
} else if (m_search_string.empty()) {
220222
throw invalid_argument("Wildcard string not specified or empty.");

components/core/src/clp/clo/CommandLineArguments.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,10 @@ auto CommandLineArguments::parse_search_arguments(
599599
}
600600
if ((false == aggregation_was_specified && OutputHandlerType::Reducer == m_output_handler_type))
601601
{
602-
throw invalid_argument("The reducer output handler currently only supports count and "
603-
"count-by-time aggregations.");
602+
throw invalid_argument(
603+
"The reducer output handler currently only supports count and count-by-time"
604+
" aggregations."
605+
);
604606
}
605607

606608
if (m_do_count_by_time_aggregation && m_do_count_results_aggregation) {

components/core/src/clp/clo/OutputHandler.cpp

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,26 @@ ErrorCode ResultsCacheOutputHandler::add_result(
7070
auto const timestamp = encoded_message.get_ts_in_milli();
7171
auto const log_event_ix = encoded_message.get_log_event_ix();
7272
if (m_latest_results.size() < m_max_num_results) {
73-
m_latest_results.emplace(std::make_unique<QueryResult>(
74-
orig_file_path,
75-
orig_file_id,
76-
log_event_ix,
77-
timestamp,
78-
decompressed_message
79-
));
73+
m_latest_results.emplace(
74+
std::make_unique<QueryResult>(
75+
orig_file_path,
76+
orig_file_id,
77+
log_event_ix,
78+
timestamp,
79+
decompressed_message
80+
)
81+
);
8082
} else if (m_latest_results.top()->timestamp < timestamp) {
8183
m_latest_results.pop();
82-
m_latest_results.emplace(std::make_unique<QueryResult>(
83-
orig_file_path,
84-
orig_file_id,
85-
log_event_ix,
86-
timestamp,
87-
decompressed_message
88-
));
84+
m_latest_results.emplace(
85+
std::make_unique<QueryResult>(
86+
orig_file_path,
87+
orig_file_id,
88+
log_event_ix,
89+
timestamp,
90+
decompressed_message
91+
)
92+
);
8993
}
9094

9195
return ErrorCode_Success;
@@ -98,28 +102,32 @@ ErrorCode ResultsCacheOutputHandler::flush() {
98102
m_latest_results.pop();
99103

100104
try {
101-
m_results.emplace_back(std::move(bsoncxx::builder::basic::make_document(
102-
bsoncxx::builder::basic::kvp(
103-
cResultsCacheKeys::SearchOutput::OrigFileId,
104-
std::move(result.orig_file_id)
105-
),
106-
bsoncxx::builder::basic::kvp(
107-
cResultsCacheKeys::SearchOutput::OrigFilePath,
108-
std::move(result.orig_file_path)
109-
),
110-
bsoncxx::builder::basic::kvp(
111-
cResultsCacheKeys::SearchOutput::LogEventIx,
112-
result.log_event_ix
113-
),
114-
bsoncxx::builder::basic::kvp(
115-
cResultsCacheKeys::SearchOutput::Timestamp,
116-
result.timestamp
117-
),
118-
bsoncxx::builder::basic::kvp(
119-
cResultsCacheKeys::SearchOutput::Message,
120-
std::move(result.decompressed_message)
105+
m_results.emplace_back(
106+
std::move(
107+
bsoncxx::builder::basic::make_document(
108+
bsoncxx::builder::basic::kvp(
109+
cResultsCacheKeys::SearchOutput::OrigFileId,
110+
std::move(result.orig_file_id)
111+
),
112+
bsoncxx::builder::basic::kvp(
113+
cResultsCacheKeys::SearchOutput::OrigFilePath,
114+
std::move(result.orig_file_path)
115+
),
116+
bsoncxx::builder::basic::kvp(
117+
cResultsCacheKeys::SearchOutput::LogEventIx,
118+
result.log_event_ix
119+
),
120+
bsoncxx::builder::basic::kvp(
121+
cResultsCacheKeys::SearchOutput::Timestamp,
122+
result.timestamp
123+
),
124+
bsoncxx::builder::basic::kvp(
125+
cResultsCacheKeys::SearchOutput::Message,
126+
std::move(result.decompressed_message)
127+
)
128+
)
121129
)
122-
)));
130+
);
123131
count++;
124132

125133
if (count == m_batch_size) {

components/core/src/clp/clo/OutputHandler.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ class ResultsCacheOutputHandler : public OutputHandler {
187187
*/
188188
ErrorCode flush() override;
189189

190-
[[nodiscard]] bool can_skip_file(::clp::streaming_archive::MetadataDB::FileIterator const& it
190+
[[nodiscard]] bool can_skip_file(
191+
::clp::streaming_archive::MetadataDB::FileIterator const& it
191192
) override {
192193
return is_latest_results_full() && get_smallest_timestamp() > it.get_end_ts();
193194
}

0 commit comments

Comments
 (0)