From 8fa89740a7da72da7af9027a91715ff80d8a62e8 Mon Sep 17 00:00:00 2001 From: aditi-pandit Date: Thu, 13 Mar 2025 22:43:02 -0700 Subject: [PATCH] [native] Advance Velox --- .../presto_cpp/main/PeriodicTaskManager.cpp | 2 +- presto-native-execution/presto_cpp/main/PrestoServer.cpp | 3 +-- presto-native-execution/presto_cpp/main/TaskManager.cpp | 2 +- .../presto_cpp/main/tests/TaskManagerTest.cpp | 2 +- presto-native-execution/velox | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/presto-native-execution/presto_cpp/main/PeriodicTaskManager.cpp b/presto-native-execution/presto_cpp/main/PeriodicTaskManager.cpp index 00b78e2b70321..0c0d475376fe3 100644 --- a/presto-native-execution/presto_cpp/main/PeriodicTaskManager.cpp +++ b/presto-native-execution/presto_cpp/main/PeriodicTaskManager.cpp @@ -362,7 +362,7 @@ void PeriodicTaskManager::updateTaskStats() { } RECORD_METRIC_VALUE( kCounterTotalPartitionedOutputBuffer, - velox::exec::OutputBufferManager::getInstance().lock()->numBuffers()); + velox::exec::OutputBufferManager::getInstanceRef()->numBuffers()); } void PeriodicTaskManager::addTaskStatsTask() { diff --git a/presto-native-execution/presto_cpp/main/PrestoServer.cpp b/presto-native-execution/presto_cpp/main/PrestoServer.cpp index 7c8e39988aa7b..94364d0b1c1f6 100644 --- a/presto-native-execution/presto_cpp/main/PrestoServer.cpp +++ b/presto-native-execution/presto_cpp/main/PrestoServer.cpp @@ -103,7 +103,7 @@ protocol::NodeState convertNodeState(presto::NodeState nodeState) { } void enableChecksum() { - velox::exec::OutputBufferManager::getInstance().lock()->setListenerFactory( + velox::exec::OutputBufferManager::getInstanceRef()->setListenerFactory( []() { return std::make_unique< velox::serializer::presto::PrestoOutputStreamListener>(); @@ -283,7 +283,6 @@ void PrestoServer::run() { registerPrestoToVeloxConnector( std::make_unique("$system@system")); - velox::exec::OutputBufferManager::initialize({}); initializeVeloxMemory(); initializeThreadPools(); diff --git a/presto-native-execution/presto_cpp/main/TaskManager.cpp b/presto-native-execution/presto_cpp/main/TaskManager.cpp index 817129d3eaaf7..1b93462615fb7 100644 --- a/presto-native-execution/presto_cpp/main/TaskManager.cpp +++ b/presto-native-execution/presto_cpp/main/TaskManager.cpp @@ -329,7 +329,7 @@ TaskManager::TaskManager( folly::Executor* driverExecutor, folly::Executor* httpSrvCpuExecutor, folly::Executor* spillerExecutor) - : bufferManager_(velox::exec::OutputBufferManager::getInstance().lock()), + : bufferManager_(velox::exec::OutputBufferManager::getInstanceRef()), queryContextManager_(std::make_unique( driverExecutor, spillerExecutor)), diff --git a/presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp b/presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp index b7002ad3f9d45..599f8f6a8123d 100644 --- a/presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp +++ b/presto-native-execution/presto_cpp/main/tests/TaskManagerTest.cpp @@ -1441,7 +1441,7 @@ TEST_P(TaskManagerTest, testCumulativeMemory) { veloxTask->start(1); prestoTask->taskStarted = true; - auto outputBufferManager = OutputBufferManager::getInstance().lock(); + auto outputBufferManager = OutputBufferManager::getInstanceRef(); ASSERT_TRUE(outputBufferManager != nullptr); // Wait until the task has produced all the output buffers so its memory usage // stay constant to ease test. diff --git a/presto-native-execution/velox b/presto-native-execution/velox index c81bb1b3e6ed1..fcb6b87324c85 160000 --- a/presto-native-execution/velox +++ b/presto-native-execution/velox @@ -1 +1 @@ -Subproject commit c81bb1b3e6ed1ef58c3f1e60c01d1124e6e4e649 +Subproject commit fcb6b87324c85c9df31e1ee84b783412646cf79e