Skip to content

Commit 66e4b58

Browse files
committed
add local exchange partition buffer size system config
1 parent 2235708 commit 66e4b58

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-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
@@ -226,6 +226,14 @@ avoid exceeding memory limits for the query.
226226
When ``spill_enabled`` is ``true``, this determines whether Presto will try spilling memory to disk for order by to
227227
avoid exceeding memory limits for the query.
228228

229+
``local-exchange.max-partition-buffer-size``
230+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
231+
232+
* **Type:** ``integer``
233+
* **Default value:** ``65536`` (64KB)
234+
235+
Specifies the maximum size in bytes to accumulate for a single partition of a local exchange before flushing.
236+
229237

230238
``shared-arbitrator.reserved-capacity``
231239
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ void updateFromSystemConfigs(
5959
{core::QueryConfig::kRequestDataSizesMaxWaitSec,
6060
std::string(SystemConfig::kRequestDataSizesMaxWaitSec)},
6161
{core::QueryConfig::kMaxSplitPreloadPerDriver,
62-
std::string(SystemConfig::kDriverMaxSplitPreload)}};
62+
std::string(SystemConfig::kDriverMaxSplitPreload)},
63+
{core::QueryConfig::kMaxLocalExchangePartitionBufferSize,
64+
std::string(SystemConfig::kMaxLocalExchangePartitionBufferSize)}};
6365
for (const auto& configNameEntry : sessionSystemConfigMapping) {
6466
const auto& sessionName = configNameEntry.first;
6567
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
@@ -264,6 +264,7 @@ SystemConfig::SystemConfig() {
264264
STR_PROP(kPluginDir, ""),
265265
NUM_PROP(kExchangeIoEvbViolationThresholdMs, 1000),
266266
NUM_PROP(kHttpSrvIoEvbViolationThresholdMs, 1000),
267+
NUM_PROP(kMaxLocalExchangePartitionBufferSize, 65536),
267268
};
268269
}
269270

@@ -914,6 +915,10 @@ int32_t SystemConfig::httpSrvIoEvbViolationThresholdMs() const {
914915
.value();
915916
}
916917

918+
uint64_t SystemConfig::maxLocalExchangePartitionBufferSize() const {
919+
return optionalProperty<uint64_t>(kMaxLocalExchangePartitionBufferSize).value();
920+
}
921+
917922
NodeConfig::NodeConfig() {
918923
registeredProps_ =
919924
std::unordered_map<std::string, folly::Optional<std::string>>{

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,9 @@ class SystemConfig : public ConfigBase {
760760
static constexpr std::string_view kHttpSrvIoEvbViolationThresholdMs{
761761
"http-server.io-evb-violation-threshold-ms"};
762762

763+
static constexpr std::string_view kMaxLocalExchangePartitionBufferSize{
764+
"local-exchange.max-partition-buffer-size"};
765+
763766
SystemConfig();
764767

765768
virtual ~SystemConfig() = default;
@@ -1042,6 +1045,8 @@ class SystemConfig : public ConfigBase {
10421045
int32_t exchangeIoEvbViolationThresholdMs() const;
10431046

10441047
int32_t httpSrvIoEvbViolationThresholdMs() const;
1048+
1049+
uint64_t maxLocalExchangePartitionBufferSize() const;
10451050
};
10461051

10471052
/// Provides access to node properties defined in node.properties file.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ TEST_F(QueryContextManagerTest, defaultSessionProperties) {
129129
queryConfig.requestDataSizesMaxWaitSec(), defaultQC->requestDataSizesMaxWaitSec());
130130
EXPECT_EQ(
131131
queryConfig.maxSplitPreloadPerDriver(), defaultQC->maxSplitPreloadPerDriver());
132+
EXPECT_EQ(
133+
queryConfig.maxLocalExchangePartitionBufferSize(), defaultQC->maxLocalExchangePartitionBufferSize());
132134
}
133135

134136
TEST_F(QueryContextManagerTest, overridingSessionProperties) {

0 commit comments

Comments
 (0)