Skip to content

Commit 063d3c1

Browse files
committed
[Native] Add driver.max-split-preload system config
1 parent 982676d commit 063d3c1

File tree

5 files changed

+25
-1
lines changed

5 files changed

+25
-1
lines changed

presto-docs/src/main/sphinx/presto_cpp/properties.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ Presto C++ workers.
3838
These Presto coordinator configuration properties are described here, in
3939
alphabetical order.
4040

41+
``driver.max-split-preload``
42+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43+
* **Type:** ``integer``
44+
* **Default value:** ``2``
45+
46+
Maximum number of splits to preload per driver.
47+
Set to 0 to disable preloading.
48+
4149
``driver.cancel-tasks-with-stuck-operators-threshold-ms``
4250
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4351
* **Type:** ``string``

presto-native-execution/presto_cpp/main/QueryContextManager.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ void updateFromSystemConfigs(
5757
{core::QueryConfig::kAggregationSpillEnabled,
5858
std::string(SystemConfig::kAggregationSpillEnabled)},
5959
{core::QueryConfig::kRequestDataSizesMaxWaitSec,
60-
std::string(SystemConfig::kRequestDataSizesMaxWaitSec)}};
60+
std::string(SystemConfig::kRequestDataSizesMaxWaitSec)},
61+
{core::QueryConfig::kMaxSplitPreloadPerDriver,
62+
std::string(SystemConfig::kDriverMaxSplitPreload)}};
6163
for (const auto& configNameEntry : sessionSystemConfigMapping) {
6264
const auto& sessionName = configNameEntry.first;
6365
const auto& systemConfigName = configNameEntry.second;

presto-native-execution/presto_cpp/main/common/Configs.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ SystemConfig::SystemConfig() {
152152
NONE_PROP(kTaskPartitionedWriterCount),
153153
NUM_PROP(kConcurrentLifespansPerTask, 1),
154154
STR_PROP(kTaskMaxPartialAggregationMemory, "16MB"),
155+
NUM_PROP(kDriverMaxSplitPreload, 2),
155156
NUM_PROP(kHttpServerNumIoThreadsHwMultiplier, 1.0),
156157
NUM_PROP(kHttpServerNumCpuThreadsHwMultiplier, 1.0),
157158
NONE_PROP(kHttpServerHttpsPort),
@@ -402,6 +403,10 @@ int32_t SystemConfig::maxDriversPerTask() const {
402403
return optionalProperty<int32_t>(kMaxDriversPerTask).value();
403404
}
404405

406+
int32_t SystemConfig::driverMaxSplitPreload() const {
407+
return optionalProperty<int32_t>(kDriverMaxSplitPreload).value();
408+
}
409+
405410
folly::Optional<int32_t> SystemConfig::taskWriterCount() const {
406411
return optionalProperty<int32_t>(kTaskWriterCount);
407412
}

presto-native-execution/presto_cpp/main/common/Configs.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ class SystemConfig : public ConfigBase {
230230
static constexpr std::string_view kConnectorNumIoThreadsHwMultiplier{
231231
"connector.num-io-threads-hw-multiplier"};
232232

233+
/// Maximum number of splits to preload per driver.
234+
/// Set to 0 to disable preloading.
235+
static constexpr std::string_view kDriverMaxSplitPreload{
236+
"driver.max-split-preload"};
237+
233238
/// Floating point number used in calculating how many threads we would use
234239
/// for Driver CPU executor: hw_concurrency x multiplier. 4.0 is default.
235240
static constexpr std::string_view kDriverNumCpuThreadsHwMultiplier{
@@ -812,6 +817,8 @@ class SystemConfig : public ConfigBase {
812817

813818
int32_t maxDriversPerTask() const;
814819

820+
int32_t driverMaxSplitPreload() const;
821+
815822
folly::Optional<int32_t> taskWriterCount() const;
816823

817824
folly::Optional<int32_t> taskPartitionedWriterCount() const;

presto-native-execution/presto_cpp/main/tests/QueryContextManagerTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ TEST_F(QueryContextManagerTest, defaultSessionProperties) {
127127
queryConfig.spillWriteBufferSize(), defaultQC->spillWriteBufferSize());
128128
EXPECT_EQ(
129129
queryConfig.requestDataSizesMaxWaitSec(), defaultQC->requestDataSizesMaxWaitSec());
130+
EXPECT_EQ(
131+
queryConfig.maxSplitPreloadPerDriver(), defaultQC->maxSplitPreloadPerDriver());
130132
}
131133

132134
TEST_F(QueryContextManagerTest, overridingSessionProperties) {

0 commit comments

Comments
 (0)