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
1 change: 1 addition & 0 deletions presto-native-execution/presto_cpp/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ add_subdirectory(common)
add_subdirectory(thrift)
add_subdirectory(connectors)
add_subdirectory(functions)
add_subdirectory(tool)

add_library(presto_session_properties SessionProperties.cpp)

Expand Down
16 changes: 16 additions & 0 deletions presto-native-execution/presto_cpp/main/tool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Only build trace tools if Velox trace library is available
if(TARGET velox_query_trace_replayer_base)
add_subdirectory(trace)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_library(presto_tool_trace_replayers PartitionAndSerializeReplayer.cpp)

target_link_libraries(
presto_tool_trace_replayers
presto_operators
velox_core
velox_exec
velox_query_trace_replayer_base
)

add_executable(presto_trace_replayer TraceReplayerMain.cpp)

target_link_libraries(
presto_trace_replayer
presto_tool_trace_replayers
presto_operators
presto_type_converter
velox_core
velox_exec
velox_query_trace_replayer_base
${FOLLY_WITH_DEPENDENCIES}
${GFLAGS_LIBRARIES}
)

if(PRESTO_ENABLE_TESTING)
add_subdirectory(tests)
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
#include "presto_cpp/main/tool/trace/PartitionAndSerializeReplayer.h"

#include "presto_cpp/main/operators/PartitionAndSerialize.h"
#include "velox/tool/trace/TraceReplayTaskRunner.h"

Expand All @@ -32,6 +28,7 @@ PartitionAndSerializeReplayer::PartitionAndSerializeReplayer(
const std::string& taskId,
const std::string& nodeId,
const std::string& nodeName,
const std::string& spillBaseDir,
const std::string& driverIds,
uint64_t queryCapacity,
folly::Executor* executor)
Expand All @@ -41,6 +38,7 @@ PartitionAndSerializeReplayer::PartitionAndSerializeReplayer(
taskId,
nodeId,
nodeName,
spillBaseDir,
driverIds,
queryCapacity,
executor) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
#pragma once

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

namespace facebook::velox::tool::trace {

/// The replayer to replay the traced 'PartitionAndSerialize' operators.
class PartitionAndSerializeReplayer final : public OperatorReplayerBase {
public:
Expand All @@ -30,6 +26,7 @@ class PartitionAndSerializeReplayer final : public OperatorReplayerBase {
const std::string& taskId,
const std::string& nodeId,
const std::string& nodeName,
const std::string& spillBaseDir,
const std::string& driverIds,
uint64_t queryCapacity,
folly::Executor* executor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PrestoTraceReplayRunner
FLAGS_task_id,
FLAGS_node_id,
nodeName,
"",
FLAGS_driver_ids,
queryCapacityBytes,
cpuExecutor_.get());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

add_executable(presto_partition_and_serialize_replayer_test PartitionAndSerializeReplayerTest.cpp)

target_link_libraries(
presto_partition_and_serialize_replayer_test
presto_tool_trace_replayers
presto_operators
presto_plan_builder
velox_core
velox_exec
velox_exec_test_lib
velox_hive_connector
velox_query_trace_replayer_base
gtest
gtest_main
${FOLLY_WITH_DEPENDENCIES}
${GFLAGS_LIBRARIES}
)

set_property(
TARGET presto_partition_and_serialize_replayer_test
PROPERTY JOB_POOL_LINK presto_link_job_pool
)

add_test(
NAME presto_partition_and_serialize_replayer_test
COMMAND presto_partition_and_serialize_replayer_test
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ TEST_F(PartitionAndSerializeReplayerTest, basicReplay) {
task->taskId(),
partitionNodeId,
"PartitionAndSerialize",
"",
driverIds,
queryCapacity,
executor_.get());
Expand Down
Loading