public class MetaStore extends Object implements AutoCloseable
The server metastore is responsible for persisting server configurations according to the configured
storage level. Each server persists their current term
and last vote as is dictated by the Raft consensus algorithm. Additionally, the
metastore is responsible for storing the last know server Configuration, including cluster
membership.
| Constructor and Description |
|---|
MetaStore(RaftStorage storage,
io.atomix.serializer.Serializer serializer) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Configuration |
loadConfiguration()
Loads the current cluster configuration.
|
long |
loadTerm()
Loads the stored server term.
|
MemberId |
loadVote()
Loads the last vote for the server.
|
void |
storeConfiguration(Configuration configuration)
Stores the current cluster configuration.
|
void |
storeTerm(long term)
Stores the current server term.
|
void |
storeVote(MemberId vote)
Stores the last voted server.
|
String |
toString() |
public MetaStore(RaftStorage storage, io.atomix.serializer.Serializer serializer)
public void storeTerm(long term)
term - The current server term.public long loadTerm()
public void storeVote(MemberId vote)
vote - The server vote.public MemberId loadVote()
public void storeConfiguration(Configuration configuration)
configuration - The current cluster configuration.public Configuration loadConfiguration()
public void close()
close in interface AutoCloseableCopyright © 2013–2017. All rights reserved.