public class Configuration extends Object implements Iterable<PeerId>, Copiable<Configuration>
| 构造器和说明 |
|---|
Configuration() |
Configuration(Configuration conf)
Construct a configuration from another conf.
|
Configuration(Iterable<PeerId> conf)
Construct a configuration instance with peers.
|
Configuration(Iterable<PeerId> conf,
Iterable<PeerId> learners)
Construct a Configuration instance with peers and learners.
|
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
addLearner(PeerId learner)
Add a learner peer.
|
int |
addLearners(Iterable<PeerId> learners)
Add learners in batch, returns the added count.
|
boolean |
addPeer(PeerId peer) |
void |
appendPeers(Collection<PeerId> set) |
boolean |
contains(PeerId peer) |
Configuration |
copy()
Copy current object(deep-clone).
|
void |
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|
|
boolean |
equals(Object obj) |
LinkedHashSet<PeerId> |
getLearners()
Retrieve the learners set.
|
List<PeerId> |
getPeers() |
Set<PeerId> |
getPeerSet() |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isValid()
Returns true when the configuration is valid.
|
Iterator<PeerId> |
iterator() |
List<PeerId> |
listLearners()
Retrieve the learners set copy.
|
List<PeerId> |
listPeers() |
boolean |
parse(String conf) |
boolean |
removeLearner(PeerId learner)
Remove a learner peer.
|
boolean |
removePeer(PeerId peer) |
void |
reset() |
void |
setLearners(LinkedHashSet<PeerId> learners) |
void |
setPeers(List<PeerId> peers) |
int |
size()
Returns the peers total number.
|
String |
toString() |
forEach, spliteratorpublic Configuration()
public Configuration(Iterable<PeerId> conf)
conf - configurationpublic Configuration(Configuration conf)
conf - configurationpublic void setLearners(LinkedHashSet<PeerId> learners)
public boolean addLearner(PeerId learner)
learner - learner to addpublic int addLearners(Iterable<PeerId> learners)
learners - learners to addpublic boolean removeLearner(PeerId learner)
learner - learner to removepublic LinkedHashSet<PeerId> getLearners()
public Configuration copy()
Copiablecopy 在接口中 Copiable<Configuration>public boolean isValid()
public void reset()
public boolean isEmpty()
public int size()
public void appendPeers(Collection<PeerId> set)
public boolean addPeer(PeerId peer)
public boolean removePeer(PeerId peer)
public boolean contains(PeerId peer)
public boolean parse(String conf)
public void diff(Configuration rhs, Configuration included, Configuration excluded)
Copyright © 2021. All rights reserved.