@@ -260,7 +260,7 @@ SystemConfig::SystemConfig() {
260260 NUM_PROP (kExchangeIoEvbViolationThresholdMs , 1000 ),
261261 NUM_PROP (kHttpSrvIoEvbViolationThresholdMs , 1000 ),
262262 NUM_PROP (kMaxLocalExchangePartitionBufferSize , 65536 ),
263- BOOL_PROP (kTextWriterEnabled , false ),
263+ BOOL_PROP (kTextWriterEnabled , false ),
264264 };
265265}
266266
@@ -910,17 +910,16 @@ std::string SystemConfig::pluginDir() const {
910910}
911911
912912int32_t SystemConfig::exchangeIoEvbViolationThresholdMs () const {
913- return optionalProperty<int32_t >(kExchangeIoEvbViolationThresholdMs )
914- .value ();
913+ return optionalProperty<int32_t >(kExchangeIoEvbViolationThresholdMs ).value ();
915914}
916915
917916int32_t SystemConfig::httpSrvIoEvbViolationThresholdMs () const {
918- return optionalProperty<int32_t >(kHttpSrvIoEvbViolationThresholdMs )
919- .value ();
917+ return optionalProperty<int32_t >(kHttpSrvIoEvbViolationThresholdMs ).value ();
920918}
921919
922920uint64_t SystemConfig::maxLocalExchangePartitionBufferSize () const {
923- return optionalProperty<uint64_t >(kMaxLocalExchangePartitionBufferSize ).value ();
921+ return optionalProperty<uint64_t >(kMaxLocalExchangePartitionBufferSize )
922+ .value ();
924923}
925924
926925bool SystemConfig::textWriterEnabled () const {
@@ -949,8 +948,7 @@ std::string NodeConfig::nodeEnvironment() const {
949948}
950949
951950int NodeConfig::prometheusExecutorThreads () const {
952- static constexpr int
953- kNodePrometheusExecutorThreadsDefault = 2 ;
951+ static constexpr int kNodePrometheusExecutorThreadsDefault = 2 ;
954952 auto resultOpt = optionalProperty<int >(kNodePrometheusExecutorThreads );
955953 if (resultOpt.has_value ()) {
956954 return resultOpt.value ();
@@ -992,115 +990,4 @@ std::string NodeConfig::nodeInternalAddress(
992990 }
993991}
994992
995- BaseVeloxQueryConfig::BaseVeloxQueryConfig () {
996- // Use empty instance to get default property values.
997- velox::core::QueryConfig c{{}};
998- using namespace velox ::core;
999- registeredProps_ =
1000- std::unordered_map<std::string, folly::Optional<std::string>>{
1001- BOOL_PROP (kMutableConfig , false ),
1002- STR_PROP (QueryConfig::kSessionTimezone , c.sessionTimezone ()),
1003- BOOL_PROP (
1004- QueryConfig::kAdjustTimestampToTimezone ,
1005- c.adjustTimestampToTimezone ()),
1006- BOOL_PROP (QueryConfig::kExprEvalSimplified , c.exprEvalSimplified ()),
1007- BOOL_PROP (QueryConfig::kExprTrackCpuUsage , c.exprTrackCpuUsage ()),
1008- BOOL_PROP (
1009- QueryConfig::kOperatorTrackCpuUsage , c.operatorTrackCpuUsage ()),
1010- BOOL_PROP (
1011- QueryConfig::kCastMatchStructByName , c.isMatchStructByName ()),
1012- NUM_PROP (
1013- QueryConfig::kMaxLocalExchangeBufferSize ,
1014- c.maxLocalExchangeBufferSize ()),
1015- NUM_PROP (
1016- QueryConfig::kMaxPartialAggregationMemory ,
1017- c.maxPartialAggregationMemoryUsage ()),
1018- NUM_PROP (
1019- QueryConfig::kMaxExtendedPartialAggregationMemory ,
1020- c.maxExtendedPartialAggregationMemoryUsage ()),
1021- NUM_PROP (
1022- QueryConfig::kAbandonPartialAggregationMinRows ,
1023- c.abandonPartialAggregationMinRows ()),
1024- NUM_PROP (
1025- QueryConfig::kAbandonPartialAggregationMinPct ,
1026- c.abandonPartialAggregationMinPct ()),
1027- NUM_PROP (
1028- QueryConfig::kMaxPartitionedOutputBufferSize ,
1029- c.maxPartitionedOutputBufferSize ()),
1030- NUM_PROP (
1031- QueryConfig::kPreferredOutputBatchBytes ,
1032- c.preferredOutputBatchBytes ()),
1033- NUM_PROP (
1034- QueryConfig::kPreferredOutputBatchRows ,
1035- c.preferredOutputBatchRows ()),
1036- NUM_PROP (QueryConfig::kMaxOutputBatchRows , c.maxOutputBatchRows ()),
1037- BOOL_PROP (
1038- QueryConfig::kHashAdaptivityEnabled , c.hashAdaptivityEnabled ()),
1039- BOOL_PROP (
1040- QueryConfig::kAdaptiveFilterReorderingEnabled ,
1041- c.adaptiveFilterReorderingEnabled ()),
1042- BOOL_PROP (QueryConfig::kSpillEnabled , c.spillEnabled ()),
1043- BOOL_PROP (
1044- QueryConfig::kAggregationSpillEnabled ,
1045- c.aggregationSpillEnabled ()),
1046- BOOL_PROP (QueryConfig::kJoinSpillEnabled , c.joinSpillEnabled ()),
1047- BOOL_PROP (QueryConfig::kOrderBySpillEnabled , c.orderBySpillEnabled ()),
1048- NUM_PROP (QueryConfig::kMaxSpillBytes , c.maxSpillBytes ()),
1049- NUM_PROP (QueryConfig::kMaxSpillLevel , c.maxSpillLevel ()),
1050- NUM_PROP (QueryConfig::kMaxSpillFileSize , c.maxSpillFileSize ()),
1051- NUM_PROP (
1052- QueryConfig::kSpillStartPartitionBit , c.spillStartPartitionBit ()),
1053- NUM_PROP (
1054- QueryConfig::kSpillNumPartitionBits , c.spillNumPartitionBits ()),
1055- NUM_PROP (
1056- QueryConfig::kSpillableReservationGrowthPct ,
1057- c.spillableReservationGrowthPct ()),
1058- BOOL_PROP (
1059- QueryConfig::kPrestoArrayAggIgnoreNulls ,
1060- c.prestoArrayAggIgnoreNulls ()),
1061- BOOL_PROP (
1062- QueryConfig::kSelectiveNimbleReaderEnabled ,
1063- c.selectiveNimbleReaderEnabled ()),
1064- NUM_PROP (QueryConfig::kMaxOutputBufferSize , c.maxOutputBufferSize ()),
1065- };
1066- }
1067-
1068- BaseVeloxQueryConfig* BaseVeloxQueryConfig::instance () {
1069- static std::unique_ptr<BaseVeloxQueryConfig> instance =
1070- std::make_unique<BaseVeloxQueryConfig>();
1071- return instance.get ();
1072- }
1073-
1074- void BaseVeloxQueryConfig::updateLoadedValues (
1075- std::unordered_map<std::string, std::string>& values) const {
1076- // Update velox config with values from presto system config.
1077- auto systemConfig = SystemConfig::instance ();
1078-
1079- using namespace velox ::core;
1080- std::unordered_map<std::string, std::string> updatedValues{};
1081-
1082- auto taskWriterCount = systemConfig->taskWriterCount ();
1083- if (taskWriterCount.has_value ()) {
1084- updatedValues[QueryConfig::kTaskWriterCount ] =
1085- std::to_string (taskWriterCount.value ());
1086- }
1087- auto taskPartitionedWriterCount = systemConfig->taskPartitionedWriterCount ();
1088- if (taskPartitionedWriterCount.has_value ()) {
1089- updatedValues[QueryConfig::kTaskPartitionedWriterCount ] =
1090- std::to_string (taskPartitionedWriterCount.value ());
1091- }
1092-
1093- std::stringstream updated;
1094- for (const auto & pair : updatedValues) {
1095- updated << " " << pair.first << " =" << pair.second << " \n " ;
1096- values[pair.first ] = pair.second ;
1097- }
1098- auto str = updated.str ();
1099- if (!str.empty ()) {
1100- PRESTO_STARTUP_LOG (INFO)
1101- << " Updated in '" << filePath_ << " ' from SystemProperties:\n "
1102- << str;
1103- }
1104- }
1105-
1106993} // namespace facebook::presto
0 commit comments