Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion presto-native-execution/presto_cpp/main/PrestoServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ void PrestoServer::run() {
fmt::format("{}/config.properties", configDirectoryPath_));
nodeConfig->initialize(
fmt::format("{}/node.properties", configDirectoryPath_));
// velox.properties is optional.
baseVeloxQueryConfig->initialize(
fmt::format("{}/velox.properties", configDirectoryPath_));
fmt::format("{}/velox.properties", configDirectoryPath_), true);

if (systemConfig->enableRuntimeMetricsCollection()) {
enableRuntimeMetricReporting();
Expand Down
11 changes: 8 additions & 3 deletions presto-native-execution/presto_cpp/main/common/Configs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@ std::string bool2String(bool value) {
ConfigBase::ConfigBase()
: config_(std::make_unique<velox::core::MemConfig>()) {}

void ConfigBase::initialize(const std::string& filePath) {
// See if we want to create a mutable config.
auto values = util::readConfig(fs::path(filePath));
void ConfigBase::initialize(const std::string& filePath, bool optionalConfig) {
auto path = fs::path(filePath);
std::unordered_map<std::string, std::string> values;
if (!optionalConfig || fs::exists(path)) {
// See if we want to create a mutable config.
values = util::readConfig(path);
}

filePath_ = filePath;
checkRegisteredProperties(values);
updateLoadedValues(values);
Expand Down
3 changes: 2 additions & 1 deletion presto-native-execution/presto_cpp/main/common/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class ConfigBase {
/// Reads configuration properties from the specified file. Must be called
/// before calling any of the getters below.
/// @param filePath Path to configuration file.
void initialize(const std::string& filePath);
/// @param optionalConfig Specify if the configuration file is optional.
void initialize(const std::string& filePath, bool optionalConfig = false);

/// Allows individual config to manipulate just-loaded-from-file key-value map
/// before it is used to initialize the config.
Expand Down