Skip to content

Commit a7a7f80

Browse files
yuandagitsamitkdutta
authored andcommitted
Expose getting base directory
1 parent d4c632a commit a7a7f80

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,11 @@ void TaskManager::setBaseSpillDirectory(const std::string& baseSpillDirectory) {
351351
[&](auto& baseSpillDir) { baseSpillDir = baseSpillDirectory; });
352352
}
353353

354+
std::string TaskManager::getBaseSpillDirectory() const {
355+
return baseSpillDir_.withRLock(
356+
[](const auto& baseSpillDir) { return baseSpillDir; });
357+
}
358+
354359
bool TaskManager::emptyBaseSpillDirectory() const {
355360
return baseSpillDir_.withRLock(
356361
[](const auto& baseSpillDir) { return baseSpillDir.empty(); });

presto-native-execution/presto_cpp/main/TaskManager.h

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class TaskManager {
4242

4343
bool emptyBaseSpillDirectory() const;
4444

45+
std::string getBaseSpillDirectory() const;
46+
4547
/// Sets the time (ms) that a task is considered to be old for cleanup since
4648
/// its completion.
4749
void setOldTaskCleanUpMs(int32_t oldTaskCleanUpMs);

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

+5
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,11 @@ TEST_P(TaskManagerTest, timeoutOutOfOrderRequests) {
12211221
.getVia(eventBase));
12221222
}
12231223

1224+
TEST_P(TaskManagerTest, getBaseSpillDirectory) {
1225+
taskManager_->setBaseSpillDirectory("dummy");
1226+
EXPECT_EQ("dummy", taskManager_->getBaseSpillDirectory());
1227+
}
1228+
12241229
TEST_P(TaskManagerTest, aggregationSpill) {
12251230
// NOTE: we need to write more than one batches to each file (source split) to
12261231
// trigger spill.

0 commit comments

Comments
 (0)