public class CliServiceImpl extends Object implements CliService
| 构造器和说明 |
|---|
CliServiceImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
Status |
addLearners(String groupId,
Configuration conf,
List<PeerId> learners)
Add some new learners into the replicating group which consists of |conf|.
|
Status |
addPeer(String groupId,
Configuration conf,
PeerId peer)
Add a new peer into the replicating group which consists of |conf|.
|
Status |
changePeers(String groupId,
Configuration conf,
Configuration newPeers)
Gracefully change the peers of the replication group.
|
List<PeerId> |
getAliveLearners(String groupId,
Configuration conf)
Ask all alive learners of the replication group.
|
List<PeerId> |
getAlivePeers(String groupId,
Configuration conf)
Ask all alive peers of the replication group.
|
CliClientService |
getCliClientService() |
Status |
getLeader(String groupId,
Configuration conf,
PeerId leaderId)
Get the leader of the replication group.
|
List<PeerId> |
getLearners(String groupId,
Configuration conf)
Ask all learners of the replication group.
|
List<PeerId> |
getPeers(String groupId,
Configuration conf)
Ask all peers of the replication group.
|
boolean |
init(CliOptions opts)
Initialize the service.
|
Status |
learner2Follower(String groupId,
Configuration conf,
PeerId learner)
Converts the specified learner to follower of |conf|.
|
Status |
rebalance(Set<String> balanceGroupIds,
Configuration conf,
Map<String,PeerId> rebalancedLeaderIds)
Balance the number of leaders.
|
Status |
removeLearners(String groupId,
Configuration conf,
List<PeerId> learners)
Remove some learners from the replicating group which consists of |conf|.
|
Status |
removePeer(String groupId,
Configuration conf,
PeerId peer)
Remove a peer from the replicating group which consists of |conf|.
|
Status |
resetLearners(String groupId,
Configuration conf,
List<PeerId> learners)
Update learners set in the replicating group which consists of |conf|.
|
Status |
resetPeer(String groupId,
PeerId peerId,
Configuration newPeers)
Reset the peer set of the target peer.
|
void |
shutdown()
Dispose the resources for service.
|
Status |
snapshot(String groupId,
PeerId peer)
Ask the peer to dump a snapshot immediately.
|
Status |
transferLeader(String groupId,
Configuration conf,
PeerId peer)
Transfer the leader of the replication group to the target peer
|
public boolean init(CliOptions opts)
Lifecycleinit 在接口中 Lifecycle<CliOptions>public void shutdown()
Lifecycleshutdown 在接口中 Lifecycle<CliOptions>public Status addPeer(String groupId, Configuration conf, PeerId peer)
CliServiceaddPeer 在接口中 CliServicegroupId - the raft group idconf - current configurationpeer - peer to addpublic Status removePeer(String groupId, Configuration conf, PeerId peer)
CliServiceremovePeer 在接口中 CliServicegroupId - the raft group idconf - current configurationpeer - peer to removepublic Status changePeers(String groupId, Configuration conf, Configuration newPeers)
CliServicechangePeers 在接口中 CliServicegroupId - the raft group idconf - current configurationnewPeers - new peers to changepublic Status resetPeer(String groupId, PeerId peerId, Configuration newPeers)
CliServiceresetPeer 在接口中 CliServicegroupId - the raft group idpeerId - target peernewPeers - new peers to resetpublic Status addLearners(String groupId, Configuration conf, List<PeerId> learners)
CliServiceaddLearners 在接口中 CliServicegroupId - the raft group idconf - current configurationlearners - learner peers to addpublic Status removeLearners(String groupId, Configuration conf, List<PeerId> learners)
CliServiceremoveLearners 在接口中 CliServicegroupId - the raft group idconf - current configurationlearners - learner peers to removepublic Status learner2Follower(String groupId, Configuration conf, PeerId learner)
CliServicelearner2Follower 在接口中 CliServicegroupId - the raft group idconf - current configurationlearner - learner peerpublic Status resetLearners(String groupId, Configuration conf, List<PeerId> learners)
CliServiceresetLearners 在接口中 CliServicegroupId - the raft group idconf - current configurationlearners - learner peers to setpublic Status transferLeader(String groupId, Configuration conf, PeerId peer)
CliServicetransferLeader 在接口中 CliServicegroupId - the raft group idconf - current configurationpeer - target peer of new leaderpublic Status snapshot(String groupId, PeerId peer)
CliServicesnapshot 在接口中 CliServicegroupId - the raft group idpeer - target peerpublic Status getLeader(String groupId, Configuration conf, PeerId leaderId)
CliServicegetLeader 在接口中 CliServicegroupId - the raft group idconf - configurationleaderId - id of leaderpublic List<PeerId> getPeers(String groupId, Configuration conf)
CliServicegetPeers 在接口中 CliServicegroupId - the raft group idconf - target peers configurationpublic List<PeerId> getAlivePeers(String groupId, Configuration conf)
CliServicegetAlivePeers 在接口中 CliServicegroupId - the raft group idconf - target peers configurationpublic List<PeerId> getLearners(String groupId, Configuration conf)
CliServicegetLearners 在接口中 CliServicegroupId - the raft group idconf - target peers configurationpublic List<PeerId> getAliveLearners(String groupId, Configuration conf)
CliServicegetAliveLearners 在接口中 CliServicegroupId - the raft group idconf - target peers configurationpublic Status rebalance(Set<String> balanceGroupIds, Configuration conf, Map<String,PeerId> rebalancedLeaderIds)
CliServicerebalance 在接口中 CliServicebalanceGroupIds - all raft group ids to balanceconf - configuration of all nodesrebalancedLeaderIds - the result of all balanced leader idspublic CliClientService getCliClientService()
Copyright © 2021. All rights reserved.