From d4663216f7126aca6e616a90a0178f62ad137f9e Mon Sep 17 00:00:00 2001 From: Yang Zhang <34979747+Yohahaha@users.noreply.github.com> Date: Mon, 19 Jun 2023 11:41:51 +0800 Subject: [PATCH] [VL] Disable printing conf by default (#1968) --- cpp/velox/compute/VeloxInitializer.cc | 11 ++++++----- cpp/velox/compute/VeloxInitializer.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cpp/velox/compute/VeloxInitializer.cc b/cpp/velox/compute/VeloxInitializer.cc index 5748081ed495..4c29ccba890d 100644 --- a/cpp/velox/compute/VeloxInitializer.cc +++ b/cpp/velox/compute/VeloxInitializer.cc @@ -75,7 +75,7 @@ const std::string kSpillThresholdRatio = "spark.gluten.sql.columnar.backend.velo namespace gluten { -void VeloxInitializer::log(const std::unordered_map& conf) { +void VeloxInitializer::printConf(const std::unordered_map& conf) { std::ostringstream oss; oss << "STARTUP: VeloxInitializer conf = {\n"; for (auto& [k, v] : conf) { @@ -168,7 +168,9 @@ void VeloxInitializer::init(const std::unordered_map& initCache(conf); initIOExecutor(conf); - log(conf); +#ifdef GLUTEN_PRINT_DEBUG + printConf(conf); +#endif auto properties = std::make_shared(configurationValues); auto hiveConnector = @@ -282,9 +284,8 @@ void VeloxInitializer::create(const std::unordered_map std::shared_ptr VeloxInitializer::get() { std::lock_guard lockGuard(mutex_); if (instance_ == nullptr) { - std::cout - << "VeloxInitializer not set, using default VeloxInitializer instance. This should only happen in test code." - << std::endl; + LOG(INFO) + << "VeloxInitializer not set, using default VeloxInitializer instance. This should only happen in test code."; static const std::unordered_map kEmptyConf; static std::shared_ptr defaultInstance{new gluten::VeloxInitializer(kEmptyConf)}; return defaultInstance; diff --git a/cpp/velox/compute/VeloxInitializer.h b/cpp/velox/compute/VeloxInitializer.h index 260f9e075695..314e6c1e3097 100644 --- a/cpp/velox/compute/VeloxInitializer.h +++ b/cpp/velox/compute/VeloxInitializer.h @@ -66,7 +66,7 @@ class VeloxInitializer { void initCache(const std::unordered_map& conf); void initIOExecutor(const std::unordered_map& conf); - void log(const std::unordered_map& conf); + void printConf(const std::unordered_map& conf); std::string getCacheFilePrefix() { return "cache." + boost::lexical_cast(boost::uuids::random_generator()()) + ".";