public class LocalRaftMetaStorage extends Object implements RaftMetaStorage
| Constructor and Description |
|---|
LocalRaftMetaStorage(String path,
RaftOptions raftOptions) |
| Modifier and Type | Method and Description |
|---|---|
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 in interface Lifecycle<RaftMetaStorageOptions>public void shutdown()
Lifecycleshutdown in interface Lifecycle<RaftMetaStorageOptions>public boolean setTerm(long term)
RaftMetaStoragesetTerm in interface RaftMetaStoragepublic long getTerm()
RaftMetaStoragegetTerm in interface RaftMetaStoragepublic boolean setVotedFor(PeerId peerId)
RaftMetaStoragesetVotedFor in interface RaftMetaStoragepublic PeerId getVotedFor()
RaftMetaStoragegetVotedFor in interface RaftMetaStoragepublic boolean setTermAndVotedFor(long term,
PeerId peerId)
RaftMetaStoragesetTermAndVotedFor in interface RaftMetaStorageCopyright © 2024. All rights reserved.