Skip to content

Commit

Permalink
Implement AdminClient
Browse files Browse the repository at this point in the history
  • Loading branch information
heng committed Jun 28, 2019
1 parent eba3bb9 commit 0b45406
Show file tree
Hide file tree
Showing 12 changed files with 884 additions and 41 deletions.
1 change: 1 addition & 0 deletions src/daemons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,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>
Expand Down
27 changes: 26 additions & 1 deletion src/interface/storage.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand All @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions src/meta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ add_dependencies(
meta_service_handler
base_obj
meta_thrift_obj
storage_thrift_obj
common_thrift_obj
kvstore_obj
thread_obj
Expand Down
Loading

0 comments on commit 0b45406

Please sign in to comment.