Skip to content

Commit

Permalink
Merge branch 'prestodb:master' into orc_reader
Browse files Browse the repository at this point in the history
  • Loading branch information
wypb authored Jun 21, 2024
2 parents acfba81 + b7204ee commit 55a8d5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions presto-native-execution/presto_cpp/main/PrestoServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,8 @@ void PrestoServer::initializeVeloxMemory() {
options.memoryPoolTransferCapacity =
systemConfig->memoryPoolTransferCapacity();
options.memoryReclaimWaitMs = systemConfig->memoryReclaimWaitMs();
options.globalArbitrationEnabled =
systemConfig->memoryArbitratorGlobalArbitrationEnabled();
options.arbitrationStateCheckCb = velox::exec::memoryArbitrationStateCheck;
}
memory::initializeMemoryManager(options);
Expand Down
6 changes: 6 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Configs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ SystemConfig::SystemConfig() {
BOOL_PROP(kEnableSerializedPageChecksum, true),
BOOL_PROP(kUseMmapAllocator, true),
STR_PROP(kMemoryArbitratorKind, ""),
BOOL_PROP(kMemoryArbitratorGlobalArbitrationEnabled, false),
NUM_PROP(kQueryMemoryGb, 38),
NUM_PROP(kQueryReservedMemoryGb, 4),
BOOL_PROP(kEnableVeloxTaskLogging, false),
Expand Down Expand Up @@ -478,6 +479,11 @@ std::string SystemConfig::memoryArbitratorKind() const {
return optionalProperty<std::string>(kMemoryArbitratorKind).value_or("");
}

bool SystemConfig::memoryArbitratorGlobalArbitrationEnabled() const {
return optionalProperty<bool>(kMemoryArbitratorGlobalArbitrationEnabled)
.value_or(false);
}

int32_t SystemConfig::queryMemoryGb() const {
return optionalProperty<int32_t>(kQueryMemoryGb).value();
}
Expand Down
7 changes: 7 additions & 0 deletions presto-native-execution/presto_cpp/main/common/Configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ class SystemConfig : public ConfigBase {
static constexpr std::string_view kMemoryArbitratorKind{
"memory-arbitrator-kind"};

/// If true, it allows memory arbitrator to reclaim used memory cross query
/// memory pools.
static constexpr std::string_view kMemoryArbitratorGlobalArbitrationEnabled{
"memory-arbitrator-global-arbitration-enabled"};

/// The initial memory pool capacity in bytes allocated on creation.
///
/// NOTE: this config only applies if the memory arbitration has been enabled.
Expand Down Expand Up @@ -659,6 +664,8 @@ class SystemConfig : public ConfigBase {

std::string memoryArbitratorKind() const;

bool memoryArbitratorGlobalArbitrationEnabled() const;

int32_t queryMemoryGb() const;

int32_t queryReservedMemoryGb() const;
Expand Down

0 comments on commit 55a8d5b

Please sign in to comment.