public class LocalRaftMetaStorage extends Object implements RaftMetaStorage
| 构造器和说明 |
|---|
LocalRaftMetaStorage(String path,
RaftOptions raftOptions) |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getTerm()
Get current term.
|
PeerId |
getVotedFor()
Get voted for information.
|
boolean |
init(RaftMetaStorageOptions opts)
Initialize the service.
|
boolean |
setTerm(long term)
Set current term.
|
boolean |
setTermAndVotedFor(long term,
PeerId peerId)
Set term and voted for information.
|
boolean |
setVotedFor(PeerId peerId)
Set voted for information.
|
void |
shutdown()
Dispose the resources for service.
|
String |
toString() |
public LocalRaftMetaStorage(String path, RaftOptions raftOptions)
public boolean init(RaftMetaStorageOptions opts)
Lifecycleinit 在接口中 Lifecycle<RaftMetaStorageOptions>public void shutdown()
Lifecycleshutdown 在接口中 Lifecycle<RaftMetaStorageOptions>public boolean setTerm(long term)
RaftMetaStoragesetTerm 在接口中 RaftMetaStoragepublic long getTerm()
RaftMetaStoragegetTerm 在接口中 RaftMetaStoragepublic boolean setVotedFor(PeerId peerId)
RaftMetaStoragesetVotedFor 在接口中 RaftMetaStoragepublic PeerId getVotedFor()
RaftMetaStoragegetVotedFor 在接口中 RaftMetaStoragepublic boolean setTermAndVotedFor(long term,
PeerId peerId)
RaftMetaStoragesetTermAndVotedFor 在接口中 RaftMetaStorageCopyright © 2021. All rights reserved.