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
Original file line number Diff line number Diff line change
Expand Up @@ -470,3 +470,12 @@ to produce a batch of the size specified by this property. If set to ``0``, then
* **Default value:** ``10``

Maximum wait time for exchange long poll requests in seconds.

``native_query_memory_reclaimer_priority``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* **Type:** ``integer``
* **Default value:** ``2147483647``

Priority of the query in the memory pool reclaimer. Lower value means higher priority.
This is used in global arbitration victim selection.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public class NativeWorkerSessionPropertyProvider
public static final String NATIVE_TABLE_SCAN_SCALE_UP_MEMORY_USAGE_RATIO = "native_table_scan_scale_up_memory_usage_ratio";
public static final String NATIVE_STREAMING_AGGREGATION_MIN_OUTPUT_BATCH_ROWS = "native_streaming_aggregation_min_output_batch_rows";
public static final String NATIVE_REQUEST_DATA_SIZES_MAX_WAIT_SEC = "native_request_data_sizes_max_wait_sec";
public static final String NATIVE_QUERY_MEMORY_RECLAIMER_PRIORITY = "native_query_memory_reclaimer_priority";
private final List<PropertyMetadata<?>> sessionProperties;

@Inject
Expand Down Expand Up @@ -350,6 +351,12 @@ public NativeWorkerSessionPropertyProvider(FeaturesConfig featuresConfig)
NATIVE_REQUEST_DATA_SIZES_MAX_WAIT_SEC,
"Maximum wait time for exchange long poll requests in seconds.",
10,
!nativeExecution),
integerProperty(
NATIVE_QUERY_MEMORY_RECLAIMER_PRIORITY,
"Native Execution only. Priority of memory recliamer when deciding on memory pool to abort." +
"Lower value has higher priority and less likely to be choosen for memory pool abort",
2147483647,
!nativeExecution));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,14 @@ SessionProperties::SessionProperties() {
10,
QueryConfig::kRequestDataSizesMaxWaitSec,
std::to_string(c.requestDataSizesMaxWaitSec()));

addSessionProperty(
kNativeQueryMemoryReclaimerPriority,
"Memory pool reclaimer priority.",
INTEGER(),
2147483647,
QueryConfig::kQueryMemoryReclaimerPriority,
std::to_string(c.queryMemoryReclaimerPriority()));
}

const std::unordered_map<std::string, std::shared_ptr<SessionProperty>>&
Expand Down
6 changes: 6 additions & 0 deletions presto-native-execution/presto_cpp/main/SessionProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ class SessionProperties {
static constexpr const char* kRequestDataSizesMaxWaitSec =
"native_request_data_sizes_max_wait_sec";

/// Priority of memory pool reclaimer when deciding on memory pool to abort.
/// Lower value has higher priority and less likely to be chosen as candidate
/// for memory pool abort.
static constexpr const char* kNativeQueryMemoryReclaimerPriority =
"native_query_memory_reclaimer_priority";

SessionProperties();

const std::unordered_map<std::string, std::shared_ptr<SessionProperty>>&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ TEST_F(SessionPropertiesTest, validateMapping) {
SessionProperties::kTableScanScaledProcessingEnabled,
SessionProperties::kTableScanScaleUpMemoryUsageRatio,
SessionProperties::kStreamingAggregationMinOutputBatchRows,
SessionProperties::kRequestDataSizesMaxWaitSec};
SessionProperties::kRequestDataSizesMaxWaitSec,
SessionProperties::kNativeQueryMemoryReclaimerPriority};
const std::vector<std::string> veloxConfigNames = {
core::QueryConfig::kAdjustTimestampToTimezone,
core::QueryConfig::kDriverCpuTimeSliceLimitMs,
Expand All @@ -48,7 +49,8 @@ TEST_F(SessionPropertiesTest, validateMapping) {
core::QueryConfig::kTableScanScaledProcessingEnabled,
core::QueryConfig::kTableScanScaleUpMemoryUsageRatio,
core::QueryConfig::kStreamingAggregationMinOutputBatchRows,
core::QueryConfig::kRequestDataSizesMaxWaitSec};
core::QueryConfig::kRequestDataSizesMaxWaitSec,
core::QueryConfig::kQueryMemoryReclaimerPriority};
auto sessionProperties = SessionProperties().getSessionProperties();
const auto len = names.size();
for (auto i = 0; i < len; i++) {
Expand Down
Loading