Skip to content

Commit

Permalink
[VL] Disable printing conf by default (facebookincubator#1968)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohahaha authored Jun 19, 2023
1 parent 32dd269 commit d466321
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions cpp/velox/compute/VeloxInitializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const std::string kSpillThresholdRatio = "spark.gluten.sql.columnar.backend.velo

namespace gluten {

void VeloxInitializer::log(const std::unordered_map<std::string, std::string>& conf) {
void VeloxInitializer::printConf(const std::unordered_map<std::string, std::string>& conf) {
std::ostringstream oss;
oss << "STARTUP: VeloxInitializer conf = {\n";
for (auto& [k, v] : conf) {
Expand Down Expand Up @@ -168,7 +168,9 @@ void VeloxInitializer::init(const std::unordered_map<std::string, std::string>&
initCache(conf);
initIOExecutor(conf);

log(conf);
#ifdef GLUTEN_PRINT_DEBUG
printConf(conf);
#endif

auto properties = std::make_shared<const velox::core::MemConfig>(configurationValues);
auto hiveConnector =
Expand Down Expand Up @@ -282,9 +284,8 @@ void VeloxInitializer::create(const std::unordered_map<std::string, std::string>
std::shared_ptr<VeloxInitializer> VeloxInitializer::get() {
std::lock_guard<std::mutex> 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<std::string, std::string> kEmptyConf;
static std::shared_ptr<VeloxInitializer> defaultInstance{new gluten::VeloxInitializer(kEmptyConf)};
return defaultInstance;
Expand Down
2 changes: 1 addition & 1 deletion cpp/velox/compute/VeloxInitializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class VeloxInitializer {
void initCache(const std::unordered_map<std::string, std::string>& conf);
void initIOExecutor(const std::unordered_map<std::string, std::string>& conf);

void log(const std::unordered_map<std::string, std::string>& conf);
void printConf(const std::unordered_map<std::string, std::string>& conf);

std::string getCacheFilePrefix() {
return "cache." + boost::lexical_cast<std::string>(boost::uuids::random_generator()()) + ".";
Expand Down

0 comments on commit d466321

Please sign in to comment.