| 程序包 | 说明 |
|---|---|
| com.alipay.sofa.jraft | |
| com.alipay.sofa.jraft.conf | |
| com.alipay.sofa.jraft.core | |
| com.alipay.sofa.jraft.entity | |
| com.alipay.sofa.jraft.option |
| 限定符和类型 | 方法和说明 |
|---|---|
static Configuration |
JRaftUtils.getConfiguration(String s)
Create a configuration from a string in the form of "host1:port1[:idx],host2:port2[:idx]
|
Configuration |
RouteTable.getConfiguration(String groupId)
Get the configuration by groupId, returns null when not found.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Status |
CliService.addLearners(String groupId,
Configuration conf,
List<PeerId> learners)
Add some new learners into the replicating group which consists of |conf|.
|
Status |
CliService.addPeer(String groupId,
Configuration conf,
PeerId peer)
Add a new peer into the replicating group which consists of |conf|.
|
void |
Node.changePeers(Configuration newPeers,
Closure done)
Change the configuration of the raft group to |newPeers| , done.un()
would be invoked after this operation finishes, describing the detailed result.
|
Status |
CliService.changePeers(String groupId,
Configuration conf,
Configuration newPeers)
Gracefully change the peers of the replication group.
|
List<PeerId> |
CliService.getAliveLearners(String groupId,
Configuration conf)
Ask all alive learners of the replication group.
|
List<PeerId> |
CliService.getAlivePeers(String groupId,
Configuration conf)
Ask all alive peers of the replication group.
|
Status |
CliService.getLeader(String groupId,
Configuration conf,
PeerId leaderId)
Get the leader of the replication group.
|
List<PeerId> |
CliService.getLearners(String groupId,
Configuration conf)
Ask all learners of the replication group.
|
List<PeerId> |
CliService.getPeers(String groupId,
Configuration conf)
Ask all peers of the replication group.
|
Status |
CliService.learner2Follower(String groupId,
Configuration conf,
PeerId learner)
Converts the specified learner to follower of |conf|.
|
void |
StateMachine.onConfigurationCommitted(Configuration conf)
Invoked when a configuration has been committed to the group.
|
Status |
CliService.rebalance(Set<String> balanceGroupIds,
Configuration conf,
Map<String,PeerId> balancedLeaderIds)
Balance the number of leaders.
|
Status |
CliService.removeLearners(String groupId,
Configuration conf,
List<PeerId> learners)
Remove some learners from the replicating group which consists of |conf|.
|
Status |
CliService.removePeer(String groupId,
Configuration conf,
PeerId peer)
Remove a peer from the replicating group which consists of |conf|.
|
Status |
CliService.resetLearners(String groupId,
Configuration conf,
List<PeerId> learners)
Update learners set in the replicating group which consists of |conf|.
|
Status |
CliService.resetPeer(String groupId,
PeerId peer,
Configuration newPeers)
Reset the peer set of the target peer.
|
Status |
Node.resetPeers(Configuration newPeers)
Reset the configuration of this node individually, without any replication
to other peers before this node becomes the leader.
|
Status |
CliService.transferLeader(String groupId,
Configuration conf,
PeerId peer)
Transfer the leader of the replication group to the target peer
|
boolean |
RouteTable.updateConfiguration(String groupId,
Configuration conf)
Update configuration of group in route table.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Configuration |
Configuration.copy() |
Configuration |
ConfigurationEntry.getConf() |
Configuration |
ConfigurationEntry.getOldConf() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
Configuration.diff(Configuration rhs,
Configuration included,
Configuration excluded)
Get the difference between |*this| and |rhs|
|included| would be assigned to |*this| - |rhs|
|excluded| would be assigned to |rhs| - |*this|
|
void |
ConfigurationEntry.setConf(Configuration conf) |
void |
ConfigurationEntry.setOldConf(Configuration oldConf) |
| 构造器和说明 |
|---|
Configuration(Configuration conf)
Construct a configuration from another conf.
|
ConfigurationEntry(LogId id,
Configuration conf,
Configuration oldConf) |
| 限定符和类型 | 方法和说明 |
|---|---|
Configuration |
NodeImpl.getCurrentConf()
Retrieve current configuration this node seen so far.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Status |
CliServiceImpl.addLearners(String groupId,
Configuration conf,
List<PeerId> learners) |
Status |
CliServiceImpl.addPeer(String groupId,
Configuration conf,
PeerId peer) |
boolean |
BallotBox.appendPendingTask(Configuration conf,
Configuration oldConf,
Closure done)
Called by leader, otherwise the behavior is undefined
Store application context before replication.
|
void |
NodeImpl.changePeers(Configuration newPeers,
Closure done) |
Status |
CliServiceImpl.changePeers(String groupId,
Configuration conf,
Configuration newPeers) |
List<PeerId> |
CliServiceImpl.getAliveLearners(String groupId,
Configuration conf) |
List<PeerId> |
CliServiceImpl.getAlivePeers(String groupId,
Configuration conf) |
Status |
CliServiceImpl.getLeader(String groupId,
Configuration conf,
PeerId leaderId) |
List<PeerId> |
CliServiceImpl.getLearners(String groupId,
Configuration conf) |
List<PeerId> |
CliServiceImpl.getPeers(String groupId,
Configuration conf) |
Status |
CliServiceImpl.learner2Follower(String groupId,
Configuration conf,
PeerId learner) |
void |
StateMachineAdapter.onConfigurationCommitted(Configuration conf) |
Status |
CliServiceImpl.rebalance(Set<String> balanceGroupIds,
Configuration conf,
Map<String,PeerId> rebalancedLeaderIds) |
Status |
CliServiceImpl.removeLearners(String groupId,
Configuration conf,
List<PeerId> learners) |
Status |
CliServiceImpl.removePeer(String groupId,
Configuration conf,
PeerId peer) |
Status |
CliServiceImpl.resetLearners(String groupId,
Configuration conf,
List<PeerId> learners) |
Status |
CliServiceImpl.resetPeer(String groupId,
PeerId peerId,
Configuration newPeers) |
Status |
NodeImpl.resetPeers(Configuration newPeers) |
Status |
CliServiceImpl.transferLeader(String groupId,
Configuration conf,
PeerId peer) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
Ballot.init(Configuration conf,
Configuration oldConf)
Init the ballot with current conf and old conf.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Configuration |
BootstrapOptions.getGroupConf() |
Configuration |
NodeOptions.getInitialConf() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
BootstrapOptions.setGroupConf(Configuration groupConf) |
void |
NodeOptions.setInitialConf(Configuration initialConf) |
Copyright © 2021. All rights reserved.