Skip to content

Commit 132a7ad

Browse files
authored
fix: Added spillBaseDir for PartitionAndSerializeReplayer (#26562)
Summary: Added spillBaseDir for PartitionAndSerializeReplayer ``` == NO RELEASE NOTE == ``` Differential Revision: D86552256
1 parent 1c80a57 commit 132a7ad

File tree

8 files changed

+101
-8
lines changed

8 files changed

+101
-8
lines changed

presto-native-execution/presto_cpp/main/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ add_subdirectory(common)
1616
add_subdirectory(thrift)
1717
add_subdirectory(connectors)
1818
add_subdirectory(functions)
19+
add_subdirectory(tool)
1920

2021
add_library(presto_session_properties SessionProperties.cpp)
2122

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
# Only build trace tools if Velox trace library is available
14+
if(TARGET velox_query_trace_replayer_base)
15+
add_subdirectory(trace)
16+
endif()
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
add_library(presto_tool_trace_replayers PartitionAndSerializeReplayer.cpp)
14+
15+
target_link_libraries(
16+
presto_tool_trace_replayers
17+
presto_operators
18+
velox_core
19+
velox_exec
20+
velox_query_trace_replayer_base
21+
)
22+
23+
add_executable(presto_trace_replayer TraceReplayerMain.cpp)
24+
25+
target_link_libraries(
26+
presto_trace_replayer
27+
presto_tool_trace_replayers
28+
presto_operators
29+
presto_type_converter
30+
velox_core
31+
velox_exec
32+
velox_query_trace_replayer_base
33+
${FOLLY_WITH_DEPENDENCIES}
34+
${GFLAGS_LIBRARIES}
35+
)
36+
37+
if(PRESTO_ENABLE_TESTING)
38+
add_subdirectory(tests)
39+
endif()

presto-native-execution/presto_cpp/main/tool/trace/PartitionAndSerializeReplayer.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
/*
15-
* Copyright (c) Facebook, Inc. and its affiliates.
16-
*/
1714
#include "presto_cpp/main/tool/trace/PartitionAndSerializeReplayer.h"
18-
1915
#include "presto_cpp/main/operators/PartitionAndSerialize.h"
2016
#include "velox/tool/trace/TraceReplayTaskRunner.h"
2117

@@ -32,6 +28,7 @@ PartitionAndSerializeReplayer::PartitionAndSerializeReplayer(
3228
const std::string& taskId,
3329
const std::string& nodeId,
3430
const std::string& nodeName,
31+
const std::string& spillBaseDir,
3532
const std::string& driverIds,
3633
uint64_t queryCapacity,
3734
folly::Executor* executor)
@@ -41,6 +38,7 @@ PartitionAndSerializeReplayer::PartitionAndSerializeReplayer(
4138
taskId,
4239
nodeId,
4340
nodeName,
41+
spillBaseDir,
4442
driverIds,
4543
queryCapacity,
4644
executor) {}

presto-native-execution/presto_cpp/main/tool/trace/PartitionAndSerializeReplayer.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,12 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
/*
15-
* Copyright (c) Facebook, Inc. and its affiliates.
16-
*/
1714
#pragma once
1815

1916
#include "velox/core/PlanNode.h"
2017
#include "velox/tool/trace/OperatorReplayerBase.h"
2118

2219
namespace facebook::velox::tool::trace {
23-
2420
/// The replayer to replay the traced 'PartitionAndSerialize' operators.
2521
class PartitionAndSerializeReplayer final : public OperatorReplayerBase {
2622
public:
@@ -30,6 +26,7 @@ class PartitionAndSerializeReplayer final : public OperatorReplayerBase {
3026
const std::string& taskId,
3127
const std::string& nodeId,
3228
const std::string& nodeName,
29+
const std::string& spillBaseDir,
3330
const std::string& driverIds,
3431
uint64_t queryCapacity,
3532
folly::Executor* executor);

presto-native-execution/presto_cpp/main/tool/trace/TraceReplayerMain.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class PrestoTraceReplayRunner
5656
FLAGS_task_id,
5757
FLAGS_node_id,
5858
nodeName,
59+
"",
5960
FLAGS_driver_ids,
6061
queryCapacityBytes,
6162
cpuExecutor_.get());
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
13+
add_executable(presto_partition_and_serialize_replayer_test PartitionAndSerializeReplayerTest.cpp)
14+
15+
target_link_libraries(
16+
presto_partition_and_serialize_replayer_test
17+
presto_tool_trace_replayers
18+
presto_operators
19+
presto_plan_builder
20+
velox_core
21+
velox_exec
22+
velox_exec_test_lib
23+
velox_hive_connector
24+
velox_query_trace_replayer_base
25+
gtest
26+
gtest_main
27+
${FOLLY_WITH_DEPENDENCIES}
28+
${GFLAGS_LIBRARIES}
29+
)
30+
31+
set_property(
32+
TARGET presto_partition_and_serialize_replayer_test
33+
PROPERTY JOB_POOL_LINK presto_link_job_pool
34+
)
35+
36+
add_test(
37+
NAME presto_partition_and_serialize_replayer_test
38+
COMMAND presto_partition_and_serialize_replayer_test
39+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
40+
)

presto-native-execution/presto_cpp/main/tool/trace/tests/PartitionAndSerializeReplayerTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ TEST_F(PartitionAndSerializeReplayerTest, basicReplay) {
202202
task->taskId(),
203203
partitionNodeId,
204204
"PartitionAndSerialize",
205+
"",
205206
driverIds,
206207
queryCapacity,
207208
executor_.get());

0 commit comments

Comments
 (0)