Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Commit

Permalink
refactor: use THREAD_POOL_BLOCK_SERVICE ro replace THREAD_POOL_FDS_SE…
Browse files Browse the repository at this point in the history
…RVICE/THREAD_POOL_LOCAL_SERVICE (#677)
  • Loading branch information
zhangyifan27 authored and hycdong committed Dec 28, 2020
1 parent c25c4f7 commit 630a2ef
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 22 deletions.
3 changes: 3 additions & 0 deletions include/dsn/dist/block_service.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <dsn/tool-api/task_code.h>
#include <dsn/tool-api/task_tracker.h>
#include <dsn/dist/replication.h>
#include <functional>
Expand All @@ -9,6 +10,8 @@ namespace dsn {
namespace dist {
namespace block_service {

DEFINE_THREAD_POOL_CODE(THREAD_POOL_BLOCK_SERVICE)

class block_file;
typedef dsn::ref_ptr<block_file> block_file_ptr;

Expand Down
3 changes: 1 addition & 2 deletions src/block_service/fds/fds_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ std::string utils::path_from_fds(const std::string &input, bool /*is_dir*/)
return result;
}

DEFINE_THREAD_POOL_CODE(THREAD_POOL_FDS_SERVICE)
DEFINE_TASK_CODE(LPC_FDS_CALL, TASK_PRIORITY_COMMON, THREAD_POOL_FDS_SERVICE)
DEFINE_TASK_CODE(LPC_FDS_CALL, TASK_PRIORITY_COMMON, THREAD_POOL_BLOCK_SERVICE)

const std::string fds_service::FILE_LENGTH_CUSTOM_KEY = "x-xiaomi-meta-content-length";
const std::string fds_service::FILE_MD5_KEY = "content-md5";
Expand Down
1 change: 0 additions & 1 deletion src/block_service/hdfs/hdfs_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ namespace dsn {
namespace dist {
namespace block_service {

DEFINE_THREAD_POOL_CODE(THREAD_POOL_BLOCK_SERVICE)
DEFINE_TASK_CODE(LPC_HDFS_SERVICE_CALL, TASK_PRIORITY_COMMON, THREAD_POOL_BLOCK_SERVICE)

DSN_DEFINE_uint64("replication",
Expand Down
3 changes: 1 addition & 2 deletions src/block_service/local/local_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ namespace dsn {
namespace dist {
namespace block_service {

DEFINE_THREAD_POOL_CODE(THREAD_POOL_LOCAL_SERVICE)
DEFINE_TASK_CODE(LPC_LOCAL_SERVICE_CALL, TASK_PRIORITY_COMMON, THREAD_POOL_LOCAL_SERVICE)
DEFINE_TASK_CODE(LPC_LOCAL_SERVICE_CALL, TASK_PRIORITY_COMMON, THREAD_POOL_BLOCK_SERVICE)

struct file_metadata
{
Expand Down
5 changes: 1 addition & 4 deletions src/block_service/test/config-test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type = replica
run = true
count = 1
ports = 54321
pools = THREAD_POOL_DEFAULT,THREAD_POOL_LOCAL_SERVICE,THREAD_POOL_FDS_SERVICE,THREAD_POOL_BLOCK_SERVICE
pools = THREAD_POOL_DEFAULT,THREAD_POOL_BLOCK_SERVICE

[core]
tool = nativerun
Expand All @@ -20,9 +20,6 @@ fast_flush = true
short_header = false
stderr_start_level = LOG_LEVEL_WARNING

[threadpool.THREAD_POOL_FDS_SERVICE]
worker_count = 8

[fds_concurrent_test]
total_files = 64
min_size = 100
Expand Down
4 changes: 2 additions & 2 deletions src/failure_detector/test/config-test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ run = true
ports =
count = 1
delay_seconds = 1
pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_FDS_SERVICE,THREAD_POOL_SLOG,THREAD_POOL_PLOG
pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_SLOG,THREAD_POOL_PLOG

[apps.server]
type = test
Expand Down Expand Up @@ -93,7 +93,7 @@ worker_priority = THREAD_xPRIORITY_NORMAL
[threadpool.THREAD_POOL_TEST_SERVER]
partitioned = false

[threadpool.THREAD_POOL_FDS_SERVICE]
[threadpool.THREAD_POOL_BLOCK_SERVICE]
worker_count = 8

[threadpool.THREAD_POOL_DLOCK]
Expand Down
4 changes: 2 additions & 2 deletions src/failure_detector/test/config-whitelist-test-failed.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ run = true
ports =
count = 1
delay_seconds = 1
pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_FDS_SERVICE,THREAD_POOL_SLOG,THREAD_POOL_PLOG
pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_SLOG,THREAD_POOL_PLOG

[apps.server]
type = test
Expand Down Expand Up @@ -94,7 +94,7 @@ worker_priority = THREAD_xPRIORITY_NORMAL
[threadpool.THREAD_POOL_TEST_SERVER]
partitioned = false

[threadpool.THREAD_POOL_FDS_SERVICE]
[threadpool.THREAD_POOL_BLOCK_SERVICE]
worker_count = 8

[threadpool.THREAD_POOL_DLOCK]
Expand Down
4 changes: 2 additions & 2 deletions src/failure_detector/test/config-whitelist-test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ run = true
ports =
count = 1
delay_seconds = 1
pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_FDS_SERVICE,THREAD_POOL_SLOG,THREAD_POOL_PLOG
pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_SLOG,THREAD_POOL_PLOG

[apps.server]
type = test
Expand Down Expand Up @@ -94,7 +94,7 @@ worker_priority = THREAD_xPRIORITY_NORMAL
[threadpool.THREAD_POOL_TEST_SERVER]
partitioned = false

[threadpool.THREAD_POOL_FDS_SERVICE]
[threadpool.THREAD_POOL_BLOCK_SERVICE]
worker_count = 8

[threadpool.THREAD_POOL_DLOCK]
Expand Down
2 changes: 1 addition & 1 deletion src/meta/test/config-test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type = test_meta
run = true
count = 1
ports = 54321
pools = THREAD_POOL_DEFAULT,THREAD_POOL_META_SERVER,THREAD_POOL_DLOCK,THREAD_POOL_META_STATE,THREAD_POOL_LOCAL_SERVICE,THREAD_POOL_META_TEST
pools = THREAD_POOL_DEFAULT,THREAD_POOL_META_SERVER,THREAD_POOL_DLOCK,THREAD_POOL_META_STATE,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_META_TEST

[core]
;tool = simulator
Expand Down
4 changes: 2 additions & 2 deletions src/meta/test/meta_state/config-test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ run = true
ports =
count = 1
delay_seconds = 1
pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_FDS_SERVICE
pools = THREAD_POOL_DEFAULT, THREAD_POOL_DLOCK, THREAD_POOL_REPLICATION, THREAD_POOL_REPLICATION_LONG, THREAD_POOL_BLOCK_SERVICE

[apps.server]
type = test
Expand Down Expand Up @@ -77,7 +77,7 @@ worker_priority = THREAD_xPRIORITY_NORMAL
[threadpool.THREAD_POOL_TEST_SERVER]
partitioned = false

[threadpool.THREAD_POOL_FDS_SERVICE]
[threadpool.THREAD_POOL_BLOCK_SERVICE]
worker_count = 8

[threadpool.THREAD_POOL_DLOCK]
Expand Down
6 changes: 3 additions & 3 deletions src/replica/bulk_load/test/config-test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type = replica
run = true
count = 1
ports = 54321
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_LOCAL_SERVICE,THREAD_POOL_SLOG,THREAD_POOL_PLOG
pools = THREAD_POOL_DEFAULT,THREAD_POOL_REPLICATION_LONG,THREAD_POOL_REPLICATION,THREAD_POOL_BLOCK_SERVICE,THREAD_POOL_SLOG,THREAD_POOL_PLOG

[core]
;tool = simulator
Expand Down Expand Up @@ -58,8 +58,8 @@ worker_count = 3
[threadpool.THREAD_POOL_REPLICATION_LONG]
name = replica_long

[threadpool.THREAD_POOL_LOCAL_SERVICE]
name = local_service
[threadpool.THREAD_POOL_BLOCK_SERVICE]
name = block_service
worker_count = 1

[task..default]
Expand Down
2 changes: 1 addition & 1 deletion src/zookeeper/test/config-test.ini
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ worker_priority = THREAD_xPRIORITY_NORMAL
[threadpool.THREAD_POOL_TEST_SERVER]
partitioned = false

[threadpool.THREAD_POOL_FDS_SERVICE]
[threadpool.THREAD_POOL_BLOCK_SERVICE]
worker_count = 8

[threadpool.THREAD_POOL_DLOCK]
Expand Down

0 comments on commit 630a2ef

Please sign in to comment.