Skip to content

Commit

Permalink
Implement admin client for balancer (#553)
Browse files Browse the repository at this point in the history
* Implement AdminClient

* Address whitewum's comments

* Address wadeliuyi's comments

* Fix failed compile
dangleptr authored Jul 15, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9b295cb commit 0a3fbc4
Showing 12 changed files with 888 additions and 43 deletions.
1 change: 1 addition & 0 deletions src/daemons/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -81,6 +81,7 @@ add_executable(
$<TARGET_OBJECTS:meta_client>
$<TARGET_OBJECTS:meta_thrift_obj>
$<TARGET_OBJECTS:common_thrift_obj>
$<TARGET_OBJECTS:storage_thrift_obj>
$<TARGET_OBJECTS:raftex_obj>
$<TARGET_OBJECTS:raftex_thrift_obj>
$<TARGET_OBJECTS:wal_obj>
27 changes: 26 additions & 1 deletion src/interface/storage.thrift
Original file line number Diff line number Diff line change
@@ -161,12 +161,15 @@ struct AddEdgesRequest {
}

struct AdminExecResp {

1: ErrorCode code,
// Only valid when code is E_LEADER_CHANAGED.
2: common.HostAddr leader,
}

struct AddPartReq {
1: common.GraphSpaceID space_id,
2: common.PartitionID part_id,
3: bool as_learner,
}

struct RemovePartReq {
@@ -179,6 +182,25 @@ struct MemberChangeReq {
2: common.PartitionID part_id,
}

struct TransLeaderReq {
1: common.GraphSpaceID space_id,
2: common.PartitionID part_id,
3: common.HostAddr new_leader,
}

struct AddLearnerReq {
1: common.GraphSpaceID space_id,
2: common.PartitionID part_id,
3: common.HostAddr learner,
}

struct CatchUpDataReq {
1: common.GraphSpaceID space_id,
2: common.GraphSpaceID part_id,
3: common.HostAddr target,
}


service StorageService {
QueryResponse getOutBound(1: GetNeighborsRequest req)
QueryResponse getInBound(1: GetNeighborsRequest req)
@@ -194,7 +216,10 @@ service StorageService {
ExecResponse addEdges(1: AddEdgesRequest req);

// Interfaces for admin operations
AdminExecResp transLeader(1: TransLeaderReq req);
AdminExecResp addPart(1: AddPartReq req);
AdminExecResp addLearner(1: AddLearnerReq req);
AdminExecResp waitingForCatchUpData(1: CatchUpDataReq req);
AdminExecResp removePart(1: RemovePartReq req);
AdminExecResp memberChange(1: MemberChangeReq req);
}
1 change: 1 addition & 0 deletions src/meta/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ add_dependencies(
meta_service_handler
base_obj
meta_thrift_obj
storage_thrift_obj
common_thrift_obj
kvstore_obj
thread_obj
Loading

0 comments on commit 0a3fbc4

Please sign in to comment.