From 75d18bc79b389a67b2d4c47f587cadd8939ec3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Tue, 29 Jun 2021 11:25:34 +0200 Subject: [PATCH] CI linters and compiler errors --- src/Common/Exception.cpp | 4 +-- .../PushingToViewsBlockOutputStream.cpp | 34 +++++++++---------- .../PushingToViewsBlockOutputStream.h | 12 +++---- src/Interpreters/QueryViewsLog.h | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Common/Exception.cpp b/src/Common/Exception.cpp index 104942a7b75..09629b436b2 100644 --- a/src/Common/Exception.cpp +++ b/src/Common/Exception.cpp @@ -402,9 +402,9 @@ int getExceptionErrorCode(std::exception_ptr e) { std::rethrow_exception(e); } - catch (const Exception & e) + catch (const Exception & exception) { - return e.code(); + return exception.code(); } catch (const Poco::Exception &) { diff --git a/src/DataStreams/PushingToViewsBlockOutputStream.cpp b/src/DataStreams/PushingToViewsBlockOutputStream.cpp index ea9b0248cae..26bf8213350 100644 --- a/src/DataStreams/PushingToViewsBlockOutputStream.cpp +++ b/src/DataStreams/PushingToViewsBlockOutputStream.cpp @@ -248,10 +248,10 @@ void PushingToViewsBlockOutputStream::writePrefix() for (auto & view : views) { - process_prefix(view); + processPrefix(view); if (view.exception) { - log_query_views(); + logQueryViews(); std::rethrow_exception(view.exception); } } @@ -285,7 +285,7 @@ void PushingToViewsBlockOutputStream::writeSuffix() pool.scheduleOrThrowOnError([&] { setThreadName("PushingToViews"); - process_suffix(view); + processSuffix(view); if (view.exception) exception_count.fetch_add(1, std::memory_order_relaxed); }); @@ -302,20 +302,20 @@ void PushingToViewsBlockOutputStream::writeSuffix() exception_happened = true; continue; } - process_suffix(view); + processSuffix(view); if (view.exception) exception_happened = true; } } if (exception_happened) - check_exceptions_in_views(); + checkExceptionsInViews(); if (views.size() > 1) { UInt64 milliseconds = main_watch.elapsedMilliseconds(); LOG_DEBUG(log, "Pushing from {} to {} views took {} ms.", storage->getStorageID().getNameForLogs(), views.size(), milliseconds); } - log_query_views(); + logQueryViews(); } void PushingToViewsBlockOutputStream::flush() @@ -391,17 +391,17 @@ void PushingToViewsBlockOutputStream::process(const Block & block, ViewInfo & vi catch (Exception & ex) { ex.addMessage("while pushing to view " + view.table_id.getNameForLogs()); - view.set_exception(std::current_exception()); + view.setException(std::current_exception()); } catch (...) { - view.set_exception(std::current_exception()); + view.setException(std::current_exception()); } view.runtime_stats.elapsed_ms += watch.elapsedMilliseconds(); } -void PushingToViewsBlockOutputStream::process_prefix(ViewInfo & view) +void PushingToViewsBlockOutputStream::processPrefix(ViewInfo & view) { Stopwatch watch; /// Change thread context to store individual metrics per view. Once the work in done, go back to the original thread @@ -420,17 +420,17 @@ void PushingToViewsBlockOutputStream::process_prefix(ViewInfo & view) catch (Exception & ex) { ex.addMessage("while writing prefix to view " + view.table_id.getNameForLogs()); - view.set_exception(std::current_exception()); + view.setException(std::current_exception()); } catch (...) { - view.set_exception(std::current_exception()); + view.setException(std::current_exception()); } view.runtime_stats.elapsed_ms += watch.elapsedMilliseconds(); } -void PushingToViewsBlockOutputStream::process_suffix(ViewInfo & view) +void PushingToViewsBlockOutputStream::processSuffix(ViewInfo & view) { Stopwatch watch; /// Change thread context to store individual metrics per view. Once the work in done, go back to the original thread @@ -450,11 +450,11 @@ void PushingToViewsBlockOutputStream::process_suffix(ViewInfo & view) catch (Exception & ex) { ex.addMessage("while writing suffix to view " + view.table_id.getNameForLogs()); - view.set_exception(std::current_exception()); + view.setException(std::current_exception()); } catch (...) { - view.set_exception(std::current_exception()); + view.setException(std::current_exception()); } view.runtime_stats.elapsed_ms += watch.elapsedMilliseconds(); if (!view.exception) @@ -468,19 +468,19 @@ void PushingToViewsBlockOutputStream::process_suffix(ViewInfo & view) } } -void PushingToViewsBlockOutputStream::check_exceptions_in_views() +void PushingToViewsBlockOutputStream::checkExceptionsInViews() { for (auto & view : views) { if (view.exception) { - log_query_views(); + logQueryViews(); std::rethrow_exception(view.exception); } } } -void PushingToViewsBlockOutputStream::log_query_views() +void PushingToViewsBlockOutputStream::logQueryViews() { const auto & settings = getContext()->getSettingsRef(); const UInt64 min_query_duration = settings.log_queries_min_query_duration_ms.totalMilliseconds(); diff --git a/src/DataStreams/PushingToViewsBlockOutputStream.h b/src/DataStreams/PushingToViewsBlockOutputStream.h index 387716ada05..0ce74979e40 100644 --- a/src/DataStreams/PushingToViewsBlockOutputStream.h +++ b/src/DataStreams/PushingToViewsBlockOutputStream.h @@ -9,7 +9,7 @@ namespace Poco { class Logger; -}; +} namespace DB { @@ -24,7 +24,7 @@ struct ViewInfo std::exception_ptr exception; QueryViewsLogElement::ViewRuntimeStats runtime_stats; - void set_exception(std::exception_ptr e) + void setException(std::exception_ptr e) { exception = e; runtime_stats.setStatus(QueryViewsLogElement::ViewStatus::EXCEPTION_WHILE_PROCESSING); @@ -65,10 +65,10 @@ private: ContextMutablePtr insert_context; void process(const Block & block, ViewInfo & view); - void process_prefix(ViewInfo & view); - void process_suffix(ViewInfo & view); - void check_exceptions_in_views(); - void log_query_views(); + static void processPrefix(ViewInfo & view); + void processSuffix(ViewInfo & view); + void checkExceptionsInViews(); + void logQueryViews(); }; diff --git a/src/Interpreters/QueryViewsLog.h b/src/Interpreters/QueryViewsLog.h index dadb188fb95..9139da1b0fb 100644 --- a/src/Interpreters/QueryViewsLog.h +++ b/src/Interpreters/QueryViewsLog.h @@ -66,7 +66,7 @@ struct QueryViewsLogElement Int64 peak_memory_usage{}; std::shared_ptr profile_counters; - ViewStatus status; + ViewStatus status = ViewStatus::QUERY_START; Int32 exception_code{}; String exception; String stack_trace;