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

Commit

Permalink
feat(split): add query split status interface (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
hycdong authored Feb 2, 2021
1 parent 7404376 commit eabef24
Show file tree
Hide file tree
Showing 12 changed files with 1,192 additions and 656 deletions.
1 change: 1 addition & 0 deletions include/dsn/dist/replication/replication.codes.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ MAKE_EVENT_CODE_RPC(RPC_CM_UPDATE_APP_ENV, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_RPC(RPC_CM_DDD_DIAGNOSE, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_RPC(RPC_CM_START_PARTITION_SPLIT, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_RPC(RPC_CM_CONTROL_PARTITION_SPLIT, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_RPC(RPC_CM_QUERY_PARTITION_SPLIT, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_RPC(RPC_CM_REGISTER_CHILD_REPLICA, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_RPC(RPC_CM_NOTIFY_STOP_SPLIT, TASK_PRIORITY_COMMON)
MAKE_EVENT_CODE_RPC(RPC_CM_START_BULK_LOAD, TASK_PRIORITY_COMMON)
Expand Down
2 changes: 2 additions & 0 deletions include/dsn/dist/replication/replication_ddl_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ class replication_ddl_client
const int32_t parent_pidx,
const int32_t old_partition_count);

error_with<query_split_response> query_partition_split(const std::string &app_name);

private:
bool static valid_app_char(int c);

Expand Down
119 changes: 119 additions & 0 deletions include/dsn/dist/replication/replication_types.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/client/replication_ddl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1639,5 +1639,13 @@ replication_ddl_client::control_partition_split(const std::string &app_name,
return call_rpc_sync(control_split_rpc(std::move(req), RPC_CM_CONTROL_PARTITION_SPLIT));
}

error_with<query_split_response>
replication_ddl_client::query_partition_split(const std::string &app_name)
{
auto req = make_unique<query_split_request>();
req->__set_app_name(app_name);
return call_rpc_sync(query_split_rpc(std::move(req), RPC_CM_QUERY_PARTITION_SPLIT));
}

} // namespace replication
} // namespace dsn
1 change: 1 addition & 0 deletions src/common/replication_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ typedef rpc_holder<query_bulk_load_request, query_bulk_load_response> query_bulk

typedef rpc_holder<start_partition_split_request, start_partition_split_response> start_split_rpc;
typedef rpc_holder<control_split_request, control_split_response> control_split_rpc;
typedef rpc_holder<query_split_request, query_split_response> query_split_rpc;
typedef rpc_holder<notify_stop_split_request, notify_stop_split_response> notify_stop_split_rpc;

class replication_options
Expand Down
Loading

0 comments on commit eabef24

Please sign in to comment.