@@ -76,21 +76,6 @@ std::string ConfigBase::capacityPropertyAsBytesString(
76
76
velox::config::CapacityUnit::BYTE));
77
77
}
78
78
79
- bool ConfigBase::registerProperty (
80
- const std::string& propertyName,
81
- const folly::Optional<std::string>& defaultValue) {
82
- if (registeredProps_.count (propertyName) != 0 ) {
83
- PRESTO_STARTUP_LOG (WARNING)
84
- << " Property '" << propertyName
85
- << " ' is already registered with default value '"
86
- << registeredProps_[propertyName].value_or (" <none>" ) << " '." ;
87
- return false ;
88
- }
89
-
90
- registeredProps_[propertyName] = defaultValue;
91
- return true ;
92
- }
93
-
94
79
folly::Optional<std::string> ConfigBase::setValue (
95
80
const std::string& propertyName,
96
81
const std::string& value) {
@@ -138,7 +123,7 @@ SystemConfig::SystemConfig() {
138
123
BOOL_PROP (kHttpServerReusePort , false ),
139
124
BOOL_PROP (kHttpServerBindToNodeInternalAddressOnlyEnabled , false ),
140
125
NONE_PROP (kDiscoveryUri ),
141
- NUM_PROP (kMaxDriversPerTask , 16 ),
126
+ NONE_PROP (kMaxDriversPerTask ),
142
127
NONE_PROP (kTaskWriterCount ),
143
128
NONE_PROP (kTaskPartitionedWriterCount ),
144
129
NUM_PROP (kConcurrentLifespansPerTask , 1 ),
@@ -292,14 +277,16 @@ std::string SystemConfig::prestoVersion() const {
292
277
}
293
278
294
279
std::string SystemConfig::poolType () const {
295
- static const std::unordered_set<std::string> kPoolTypes = {" LEAF" , " INTERMEDIATE" , " DEFAULT" };
296
- static constexpr std::string_view kPoolTypeDefault = " DEFAULT" ;
297
- auto value = optionalProperty<std::string>(kPoolType ).value_or (std::string (kPoolTypeDefault ));
298
- VELOX_USER_CHECK (
299
- kPoolTypes .count (value),
300
- " {} must be one of 'LEAF', 'INTERMEDIATE', or 'DEFAULT'" ,
301
- kPoolType );
302
- return value;
280
+ static const std::unordered_set<std::string> kPoolTypes = {
281
+ " LEAF" , " INTERMEDIATE" , " DEFAULT" };
282
+ static constexpr std::string_view kPoolTypeDefault = " DEFAULT" ;
283
+ auto value = optionalProperty<std::string>(kPoolType ).value_or (
284
+ std::string (kPoolTypeDefault ));
285
+ VELOX_USER_CHECK (
286
+ kPoolTypes .count (value),
287
+ " {} must be one of 'LEAF', 'INTERMEDIATE', or 'DEFAULT'" ,
288
+ kPoolType );
289
+ return value;
303
290
}
304
291
305
292
bool SystemConfig::mutableConfig () const {
@@ -355,7 +342,17 @@ std::string SystemConfig::remoteFunctionServerSerde() const {
355
342
}
356
343
357
344
int32_t SystemConfig::maxDriversPerTask () const {
358
- return optionalProperty<int32_t >(kMaxDriversPerTask ).value ();
345
+ auto val = optionalProperty<int32_t >(kMaxDriversPerTask );
346
+ if (val.has_value ()) {
347
+ return val.value ();
348
+ }
349
+ auto numThreads = std::thread::hardware_concurrency ();
350
+ // The spec says std::thread::hardware_concurrency() might return 0.
351
+ if (numThreads > 0 ) {
352
+ return numThreads;
353
+ } else {
354
+ return 16 ;
355
+ }
359
356
}
360
357
361
358
folly::Optional<int32_t > SystemConfig::taskWriterCount () const {
0 commit comments