Skip to content

Commit

Permalink
refactor: move task to a seperated directory (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhao liwei authored Jun 28, 2020
1 parent 062bedc commit c9944f3
Show file tree
Hide file tree
Showing 30 changed files with 17 additions and 112 deletions.
44 changes: 0 additions & 44 deletions include/dsn/tool/providers.hpc.h

This file was deleted.

3 changes: 2 additions & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ add_subdirectory(tools)
add_subdirectory(tests)
add_subdirectory(aio)
add_subdirectory(rpc)
add_subdirectory(task)

add_library(dsn_runtime STATIC
$<TARGET_OBJECTS:dsn.core>
$<TARGET_OBJECTS:dsn.rpc>
$<TARGET_OBJECTS:dsn.task>
$<TARGET_OBJECTS:dsn.perf_counter>
$<TARGET_OBJECTS:dsn.tools.common>
$<TARGET_OBJECTS:dsn.tools.hpc>
$<TARGET_OBJECTS:dsn.tools.simulator>
)
install(TARGETS dsn_runtime DESTINATION "lib")
2 changes: 1 addition & 1 deletion src/core/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/core/task_engine.h"
#include "core/task/task_engine.h"
#include <dsn/tool-api/file_io.h>
#include <dsn/utility/error_code.h>

Expand Down
1 change: 0 additions & 1 deletion src/core/core/admission_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
*/

#include <dsn/tool-api/admission_controller.h>
#include "task_engine.h"

namespace dsn {

Expand Down
2 changes: 0 additions & 2 deletions src/core/core/core_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@
#include <dsn/toollet/explorer.h>

#include <dsn/tool/providers.common.h>
#include <dsn/tool/providers.hpc.h>
#include <dsn/utility/singleton.h>

void dsn_core_init()
{
// register all providers
dsn::tools::register_common_providers();
dsn::tools::register_hpc_providers();

// register all possible tools and toollets
dsn::tools::register_tool<dsn::tools::nativerun>("nativerun");
Expand Down
2 changes: 1 addition & 1 deletion src/core/core/service_api_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

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

//
Expand Down
2 changes: 1 addition & 1 deletion src/core/core/service_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

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

#include <dsn/utility/filesystem.h>
Expand Down
2 changes: 1 addition & 1 deletion src/core/rpc/rpc_message.cpp
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/core/task_engine.h"
#include "core/task/task_engine.h"

using namespace dsn::utils;

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

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

namespace dsn {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
set(MY_PROJ_NAME dsn.tools.hpc)

# Source files under CURRENT project directory will be automatically included.
# You can manually set MY_PROJ_SRC to include source files under other directories.
set(MY_PROJ_SRC "")
set(MY_PROJ_NAME dsn.task)

# 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.
2 changes: 1 addition & 1 deletion src/core/core/task.cpp → src/core/task/task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <dsn/dist/fmt_logging.h>

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

namespace 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 "service_engine.h"
#include "core/core/service_engine.h"
#include <dsn/tool-api/task_queue.h>
#include <dsn/tool-api/admission_controller.h>
#include <dsn/perf_counter/perf_counter.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 "scheduler.h"
#include "core/tools/simulator/scheduler.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.
2 changes: 1 addition & 1 deletion src/core/tests/sim_lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <gtest/gtest.h>
#include <thread>
#include "core/core/service_engine.h"
#include "core/tools/simulator/task_engine.sim.h"
#include "core/task/task_engine.sim.h"
#include "core/tools/simulator/scheduler.h"

TEST(tools_simulator, dsn_semaphore)
Expand Down
2 changes: 1 addition & 1 deletion src/core/tests/task_engine.cpp
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/task_engine.h"
#include "core/task/task_engine.h"
#include "test_utils.h"
#include <dsn/tool_api.h>
#include <gtest/gtest.h>
Expand Down
1 change: 0 additions & 1 deletion src/core/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
add_subdirectory(common)
add_subdirectory(simulator)
add_subdirectory(hpc)
4 changes: 3 additions & 1 deletion src/core/tools/common/providers.common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
#include "core/rpc/asio_net_provider.h"
#include <dsn/tool/providers.common.h>
#include "lockp.std.h"
#include "simple_task_queue.h"
#include "core/task/simple_task_queue.h"
#include "core/task/hpc_task_queue.h"
#include "core/rpc/network.sim.h"
#include "simple_logger.h"
#include "core/rpc/dsn_message_parser.h"
Expand All @@ -58,6 +59,7 @@ void register_common_providers()
register_component_provider<asio_udp_provider>("dsn::tools::asio_udp_provider");
register_component_provider<sim_network_provider>("dsn::tools::sim_network_provider");
register_component_provider<simple_task_queue>("dsn::tools::simple_task_queue");
register_component_provider<hpc_concurrent_task_queue>("dsn::tools::hpc_concurrent_task_queue");
register_component_provider<simple_timer_service>("dsn::tools::simple_timer_service");

register_message_header_parser<dsn_message_parser>(NET_HDR_DSN, {"RDSN"});
Expand Down
46 changes: 0 additions & 46 deletions src/core/tools/hpc/providers.hpc.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/core/tools/simulator/simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "scheduler.h"

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

namespace dsn {
Expand Down

0 comments on commit c9944f3

Please sign in to comment.