提交 6ba8e29c 编写于 作者: W WeijieSun 提交者: QinZuoyan

client & server: fix as storage rpc code definition are modified in rdsn (#28)

上级 1217a9a9
Subproject commit 4da42959926c43d971e6ea93f30f59b5ba02e6bb
Subproject commit 655e8b7a2b78644190ddfbe3d5961fba51177165
#pragma once
#include "rrdb.code.definition.h"
#include "rrdb.types.h"
#include <iostream>
namespace dsn {
......@@ -9,6 +10,7 @@ class rrdb_client : public virtual ::dsn::clientlet
public:
rrdb_client() {}
explicit rrdb_client(::dsn::rpc_address server) { _server = server; }
virtual ~rrdb_client() {}
// ---------- call RPC_RRDB_RRDB_PUT ------------
......@@ -465,4 +467,4 @@ private:
::dsn::rpc_address _server;
};
}
}
\ No newline at end of file
}
#pragma once
#include <dsn/service_api_cpp.h>
#include "rrdb.types.h"
#include <dsn/dist/replication/replication.codes.h>
namespace dsn {
namespace apps {
// define your own thread pool using DEFINE_THREAD_POOL_CODE(xxx)
// define RPC task code for service 'rrdb'
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_PUT, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_MULTI_PUT, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_REMOVE, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_MULTI_REMOVE, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_GET, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_MULTI_GET, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_SORTKEY_COUNT, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_TTL, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_GET_SCANNER, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_SCAN, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_TASK_CODE_RPC(RPC_RRDB_RRDB_CLEAR_SCANNER, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
// test timer task code
DEFINE_TASK_CODE(LPC_RRDB_TEST_TIMER, TASK_PRIORITY_COMMON, ::dsn::THREAD_POOL_DEFAULT)
DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_PUT, true)
DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_MULTI_PUT, false)
DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_REMOVE, true)
DEFINE_STORAGE_WRITE_RPC_CODE(RPC_RRDB_RRDB_MULTI_REMOVE, false)
DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET)
DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_MULTI_GET)
DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SORTKEY_COUNT)
DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_TTL)
DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_GET_SCANNER)
DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_SCAN)
DEFINE_STORAGE_READ_RPC_CODE(RPC_RRDB_RRDB_CLEAR_SCANNER)
}
}
......@@ -324,24 +324,6 @@ is_profile = true
;profiler::qps = false
;profiler::cancelled = false
[task.RPC_L2_CLIENT_READ]
is_profile = true
profiler::inqueue = false
;profiler::queue = false
;profiler::exec = false
;profiler::qps = false
;profiler::cancelled = false
;profiler::latency.server = false
[task.RPC_L2_CLIENT_WRITE]
is_profile = true
profiler::inqueue = false
;profiler::queue = false
;profiler::exec = false
;profiler::qps = false
;profiler::cancelled = false
;profiler::latency.server = false
[task.LPC_AIO_BATCH_WRITE]
is_profile = true
profiler::inqueue = false
......
......@@ -449,21 +449,7 @@
[task.LPC_REPLICATION_COLD_BACKUP]
;is_profile = true
[task.RPC_L2_CLIENT_WRITE]
is_profile = true
[task.RPC_L2_CLIENT_WRITE_ACK]
is_profiler = true
[task.RPC_L2_CLIENT_READ]
is_profile = true
[task.RPC_L2_CLIENT_READ_ACK]
is_profiler = true
[task.RPC_RRDB_RRDB_PUT]
rpc_request_is_write_operation = true
rpc_request_is_write_allow_batch = true
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -472,8 +458,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_MULTI_PUT]
rpc_request_is_write_operation = true
rpc_request_is_write_allow_batch = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -482,8 +466,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_REMOVE]
rpc_request_is_write_operation = true
rpc_request_is_write_allow_batch = true
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -492,8 +474,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_MULTI_REMOVE]
rpc_request_is_write_operation = true
rpc_request_is_write_allow_batch = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -502,7 +482,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_GET]
rpc_request_is_write_operation = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -511,7 +490,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_MULTI_GET]
rpc_request_is_write_operation = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -520,7 +498,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_SORTKEY_COUNT]
rpc_request_is_write_operation = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -529,7 +506,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_TTL]
rpc_request_is_write_operation = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -538,7 +514,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_GET_SCANNER]
rpc_request_is_write_operation = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -547,7 +522,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_SCAN]
rpc_request_is_write_operation = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......@@ -556,7 +530,6 @@
is_profile = true
[task.RPC_RRDB_RRDB_CLEAR_SCANNER]
rpc_request_is_write_operation = false
rpc_request_throttling_mode = TM_DELAY
rpc_request_delays_milliseconds = 1000, 1000, 1000, 1000, 1000, 10000
is_profile = true
......
......@@ -35,10 +35,6 @@ using namespace dsn::replication;
void dsn_app_registration_pegasus()
{
dsn::task_code rpc_read(
"RPC_L2_CLIENT_READ", TASK_TYPE_RPC_REQUEST, TASK_PRIORITY_COMMON, THREAD_POOL_LOCAL_APP);
dsn::task_code rpc_write(
"RPC_L2_CLIENT_WRITE", TASK_TYPE_RPC_REQUEST, TASK_PRIORITY_LOW, THREAD_POOL_REPLICATION);
dsn_meta_sever_register_providers();
service_app::register_factory<::pegasus::server::pegasus_replication_service_app>("replica");
......
......@@ -25,12 +25,12 @@ namespace server {
// clang-format off
static const char *s_brief_stat_mapper[] = {
"write_qps", "zion*profiler*RPC_L2_CLIENT_WRITE.qps",
"PUT_P99(ns)","zion*profiler*RPC_RRDB_RRDB_PUT.latency.server",
"MULTI_PUT_P99(ns)", "zion*profiler*RPC_RRDB_RRDB_MULTI_PUT.latency.server",
"read_qps", "zion*profiler*RPC_L2_CLIENT_READ.qps",
"GET_P99(ns)", "zion*profiler*RPC_RRDB_RRDB_GET.latency.server",
"MULTI_GET_P99(ns)", "zion*profiler*RPC_RRDB_RRDB_MULTI_GET.latency.server",
"put_qps", "zion*profiler*RPC_RRDB_RRDB_PUT.qps",
"put_p99(ns)","zion*profiler*RPC_RRDB_RRDB_PUT.latency.server",
"multi_put_p99(ns)", "zion*profiler*RPC_RRDB_RRDB_MULTI_PUT.latency.server",
"get_qps", "zion*profiler*RPC_RRDB_RRDB_GET.qps",
"get_p99(ns)", "zion*profiler*RPC_RRDB_RRDB_GET.latency.server",
"multi_get_p99(ns)", "zion*profiler*RPC_RRDB_RRDB_MULTI_GET.latency.server",
"serving_replica_count", "replica*eon.replica_stub*replica(Count)",
"opening_replica_count", "replica*eon.replica_stub*opening.replica(Count)",
"closing_replica_count", "replica*eon.replica_stub*closing.replica(Count)",
......
......@@ -20,6 +20,7 @@
#include <dsn/dist/replication/replication_ddl_client.h>
#include <dsn/dist/replication/mutation_log_tool.h>
#include <rrdb/rrdb.code.definition.h>
#include <rrdb/rrdb.types.h>
#include <dsn/tool/cli/cli.client.h>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册