Skip to content

Commit

Permalink
refactor: move runtime module from src/core/core to src/runtime (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
levy5307 authored Jul 21, 2020
1 parent d5ba2c4 commit 95002ff
Show file tree
Hide file tree
Showing 102 changed files with 111 additions and 145 deletions.
2 changes: 1 addition & 1 deletion compile_thrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"file_move": {
"_types.h": "include/dsn/cpp/serialization_helper",
"_types.cpp": "src/core/core"
"_types.cpp": "src/runtime"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function usage_build()
type: address|leak|thread|undefined"
if [ "$ONLY_BUILD" == "NO" ]; then
echo " -m|--test_module specify modules to test, split by ',',"
echo " e.g., \"dsn.core.tests,dsn_meta_state_tests\","
echo " e.g., \"dsn_runtime_tests,dsn_meta_state_tests\","
echo " if not set, then run all tests"
fi
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ echo "################################# start testing ##########################
if [ -z "$TEST_MODULE" ]
then
# supported test module
TEST_MODULE="dsn.core.tests,dsn_utils_tests,dsn_perf_counter_test,dsn.zookeeper.tests,dsn_aio_test,dsn.failure_detector.tests,dsn_meta_state_tests,dsn_nfs_test,dsn_block_service_test,dsn.replication.simple_kv,dsn.rep_tests.simple_kv,dsn.meta.test,dsn.replica.test,dsn_http_test,dsn_replica_dup_test,dsn_replica_backup_test,dsn_replica_bulk_load_test"
TEST_MODULE="dsn_runtime_tests,dsn_utils_tests,dsn_perf_counter_test,dsn.zookeeper.tests,dsn_aio_test,dsn.failure_detector.tests,dsn_meta_state_tests,dsn_nfs_test,dsn_block_service_test,dsn.replication.simple_kv,dsn.rep_tests.simple_kv,dsn.meta.test,dsn.replica.test,dsn_http_test,dsn_replica_dup_test,dsn_replica_backup_test,dsn_replica_bulk_load_test"
fi

echo "TEST_MODULE=$TEST_MODULE"
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if(UNIX)
add_compile_options(-fPIC)
endif()
add_subdirectory(core)
add_subdirectory(runtime)
add_subdirectory(aio)
add_subdirectory(zookeeper)
add_subdirectory(perf_counter)
Expand Down
2 changes: 1 addition & 1 deletion src/aio/aio_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This source code is licensed under the Apache License Version 2.0, which
// can be found in the LICENSE file in the root directory of this source tree.

#include "core/task/task_engine.h"
#include "runtime/task/task_engine.h"
#include <dsn/tool-api/file_io.h>
#include <dsn/utility/error_code.h>

Expand Down
2 changes: 1 addition & 1 deletion src/aio/disk_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <dsn/tool-api/aio_task.h>
#include "disk_engine.h"
#include "sim_aio_provider.h"
#include "core/core/service_engine.h"
#include "runtime/service_engine.h"

using namespace dsn::utils;

Expand Down
17 changes: 0 additions & 17 deletions src/core/CMakeLists.txt

This file was deleted.

13 changes: 0 additions & 13 deletions src/core/core/CMakeLists.txt

This file was deleted.

33 changes: 0 additions & 33 deletions src/core/tests/run.sh

This file was deleted.

2 changes: 0 additions & 2 deletions src/core/tools/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions src/core/tools/common/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions src/core/tools/simulator/CMakeLists.txt

This file was deleted.

2 changes: 1 addition & 1 deletion src/perf_counter/perf_counters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#include "perf_counter_atomic.h"
#include "builtin_counters.h"
#include "core/core/service_engine.h"
#include "runtime/service_engine.h"

namespace dsn {

Expand Down
2 changes: 1 addition & 1 deletion src/replica/storage/simple_kv/test/case.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <dsn/tool-api/task.h>
#include <dsn/tool-api/rpc_message.h>
#include "replica/replica_stub.h"
#include "core/core/service_engine.h"
#include "runtime/service_engine.h"
#include "meta/server_load_balancer.h"

#include <iostream>
Expand Down
4 changes: 2 additions & 2 deletions src/replica/storage/simple_kv/test/checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
#include "meta/server_state.h"
#include "meta/server_load_balancer.h"

#include "core/core/service_engine.h"
#include "core/rpc/rpc_engine.h"
#include "runtime/service_engine.h"
#include "runtime/rpc/rpc_engine.h"

namespace dsn {
namespace replication {
Expand Down
32 changes: 32 additions & 0 deletions src/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
add_subdirectory(test)
add_subdirectory(rpc)
add_subdirectory(task)

# TODO(zlw) remove perf_counter from dsn_runtime after the refactor by WuTao
add_library(dsn_runtime STATIC
$<TARGET_OBJECTS:dsn.rpc>
$<TARGET_OBJECTS:dsn.task>
$<TARGET_OBJECTS:dsn.perf_counter>
core_main.cpp
dsn.layer2_types.cpp
env.sim.cpp
explorer.cpp
fault_injector.cpp
global_config.cpp
message_utils.cpp
nativerun.cpp
profiler.cpp
profiler_command.cpp
profiler_output.cpp
providers.common.cpp
scheduler.cpp
service_api_c.cpp
service_engine.cpp
simulator.cpp
threadpool_code.cpp
tool_api.cpp
tracer.cpp
zlocks.cpp
)
target_link_libraries(dsn_runtime dsn_utils)
install(TARGETS dsn_runtime DESTINATION "lib")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
* xxxx-xx-xx, author, fix bug about xxx
*/

#include "core/rpc/asio_net_provider.h"
#include "runtime/rpc/asio_net_provider.h"
#include <dsn/tool/providers.common.h>
#include "utils/lockp.std.h"
#include "core/task/simple_task_queue.h"
#include "core/task/hpc_task_queue.h"
#include "core/rpc/network.sim.h"
#include "runtime/task/simple_task_queue.h"
#include "runtime/task/hpc_task_queue.h"
#include "runtime/rpc/network.sim.h"
#include "utils/simple_logger.h"
#include "core/rpc/dsn_message_parser.h"
#include "core/rpc/thrift_message_parser.h"
#include "core/rpc/raw_message_parser.h"
#include "runtime/rpc/dsn_message_parser.h"
#include "runtime/rpc/thrift_message_parser.h"
#include "runtime/rpc/raw_message_parser.h"

namespace dsn {
namespace tools {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/core/rpc/network.cpp → src/runtime/rpc/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <dsn/tool-api/network.h>
#include <dsn/utility/factory_store.h>
#include "message_parser_manager.h"
#include "core/rpc/rpc_engine.h"
#include "runtime/rpc/rpc_engine.h"

namespace dsn {
/*static*/ join_point<void, rpc_session *>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <arpa/inet.h>

#include "rpc_engine.h"
#include "core/core/service_engine.h"
#include "runtime/service_engine.h"
#include <dsn/utility/factory_store.h>
#include <dsn/tool-api/group_address.h>
#include <dsn/tool-api/task_queue.h>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include <dsn/tool-api/message_parser.h>
#include <cctype>

#include "core/task/task_engine.h"
#include "runtime/task/task_engine.h"

using namespace dsn::utils;

Expand Down
2 changes: 1 addition & 1 deletion src/core/rpc/rpc_task.cpp → src/runtime/rpc/rpc_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* THE SOFTWARE.
*/

#include "core/task/task_engine.h"
#include "runtime/task/task_engine.h"
#include <dsn/tool-api/task.h>

namespace dsn {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
#endif

#include "service_engine.h"
#include "core/rpc/rpc_engine.h"
#include "core/task/task_engine.h"
#include "runtime/rpc/rpc_engine.h"
#include "runtime/task/task_engine.h"
#include "utils/coredump.h"

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
*/

#include "service_engine.h"
#include "core/task/task_engine.h"
#include "core/rpc/rpc_engine.h"
#include "runtime/task/task_engine.h"
#include "runtime/rpc/rpc_engine.h"

#include <dsn/utility/filesystem.h>
#include <dsn/utility/smart_pointers.h>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "scheduler.h"

#include "env.sim.h"
#include "core/task/task_engine.sim.h"
#include "runtime/task/task_engine.sim.h"
#include "sim_clock.h"

namespace dsn {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/core/task/task.cpp → src/runtime/task/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
#include <dsn/dist/fmt_logging.h>

#include "task_engine.h"
#include "core/core/service_engine.h"
#include "core/rpc/rpc_engine.h"
#include "runtime/service_engine.h"
#include "runtime/rpc/rpc_engine.h"

namespace dsn {
__thread struct __tls_dsn__ tls_dsn;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#pragma once

#include "core/core/service_engine.h"
#include "runtime/service_engine.h"
#include <dsn/tool-api/task_queue.h>
#include <dsn/tool-api/admission_controller.h>
#include <dsn/tool-api/task_worker.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include <dsn/utility/rand.h>
#include "task_engine.sim.h"
#include "core/tools/simulator/scheduler.h"
#include "runtime/scheduler.h"

namespace dsn {
namespace tools {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <dsn/tool-api/task_queue.h>
#include "task_engine.h"
#include <dsn/tool-api/network.h>
#include "core/rpc/rpc_engine.h"
#include "runtime/rpc/rpc_engine.h"

namespace dsn {

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(MY_PROJ_NAME dsn.core.tests)
set(MY_PROJ_NAME dsn_runtime_tests)

# Search mode for source files under CURRENT project directory?
# "GLOB_RECURSE" for recursive search
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
#include <dsn/tool-api/task.h>
#include <dsn/tool-api/task_spec.h>

#include "core/rpc/asio_net_provider.h"
#include "core/rpc/network.sim.h"
#include "core/core/service_engine.h"
#include "core/rpc/rpc_engine.h"
#include "runtime/rpc/asio_net_provider.h"
#include "runtime/rpc/network.sim.h"
#include "runtime/rpc/rpc_engine.h"
#include "runtime/service_engine.h"
#include "test_utils.h"

using namespace dsn;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* xxxx-xx-xx, author, fix bug about xxx
*/

#include "core/core/message_utils.cpp"
#include "runtime/message_utils.cpp"
#include <dsn/utility/crc.h>
#include <dsn/utility/transient_memory.h>
#include <dsn/tool-api/rpc_message.h>
Expand Down
Loading

0 comments on commit 95002ff

Please sign in to comment.