From 276d3628e90022948b37f258f3aae2ac40f1061c Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Thu, 15 Sep 2022 13:05:18 +0200 Subject: [PATCH] Small style fixes --- src/Interpreters/AsynchronousMetrics.cpp | 2 +- src/Interpreters/UserDefinedExecutableFunctionFactory.cpp | 8 ++++++-- src/Processors/Sources/ShellCommandSource.h | 2 +- src/Storages/Kafka/StorageKafka.cpp | 2 -- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Interpreters/AsynchronousMetrics.cpp b/src/Interpreters/AsynchronousMetrics.cpp index bccfa8f5b1e..4fe69e49546 100644 --- a/src/Interpreters/AsynchronousMetrics.cpp +++ b/src/Interpreters/AsynchronousMetrics.cpp @@ -1665,7 +1665,7 @@ void AsynchronousMetrics::updateHeavyMetricsIfNeeded(TimePoint current_time, Tim LOG_IMPL(log, log_level.first, log_level.second, "Update heavy metrics. " "Update period {} sec. " - "Update heavy metrics period {} sec. " + "Update heavy metrics period {} sec. " "Heavy metrics calculation elapsed: {} sec.", update_period.count(), heavy_metric_update_period.count(), diff --git a/src/Interpreters/UserDefinedExecutableFunctionFactory.cpp b/src/Interpreters/UserDefinedExecutableFunctionFactory.cpp index 8e4b66ef893..18784609397 100644 --- a/src/Interpreters/UserDefinedExecutableFunctionFactory.cpp +++ b/src/Interpreters/UserDefinedExecutableFunctionFactory.cpp @@ -28,16 +28,18 @@ namespace ErrorCodes extern const int BAD_ARGUMENTS; } +namespace +{ + class UserDefinedFunction final : public IFunction { public: - explicit UserDefinedFunction( ExternalUserDefinedExecutableFunctionsLoader::UserDefinedExecutableFunctionPtr executable_function_, ContextPtr context_, Array parameters_) : executable_function(std::move(executable_function_)) - , context(context_) + , context(std::move(context_)) { const auto & configuration = executable_function->getConfiguration(); size_t command_parameters_size = configuration.parameters.size(); @@ -230,6 +232,8 @@ private: std::vector command_arguments_with_parameters; }; +} + UserDefinedExecutableFunctionFactory & UserDefinedExecutableFunctionFactory::instance() { static UserDefinedExecutableFunctionFactory result; diff --git a/src/Processors/Sources/ShellCommandSource.h b/src/Processors/Sources/ShellCommandSource.h index a0b4aff4c1b..80ba1d59adf 100644 --- a/src/Processors/Sources/ShellCommandSource.h +++ b/src/Processors/Sources/ShellCommandSource.h @@ -58,7 +58,7 @@ public: /// Pool size valid only if executable_pool = true size_t pool_size = 16; - /// Max command execution time in milliseconds. Valid only if executable_pool = true + /// Max command execution time in seconds. Valid only if executable_pool = true size_t max_command_execution_time_seconds = 10; /// Should pool of processes be created. diff --git a/src/Storages/Kafka/StorageKafka.cpp b/src/Storages/Kafka/StorageKafka.cpp index 06ce4fb308d..d9bacffd053 100644 --- a/src/Storages/Kafka/StorageKafka.cpp +++ b/src/Storages/Kafka/StorageKafka.cpp @@ -179,8 +179,6 @@ namespace void loadFromConfig(cppkafka::Configuration & conf, const Poco::Util::AbstractConfiguration & config, const std::string & path) { Poco::Util::AbstractConfiguration::Keys keys; - std::vector errstr(512); - config.keys(path, keys); for (const auto & key : keys)