public class RaftJournalConfiguration extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RaftJournalConfiguration.StorageLevel
Enum corresponding to io.atomix.copycat.server.storage.StorageLevel.
|
Constructor and Description |
---|
RaftJournalConfiguration() |
Modifier and Type | Method and Description |
---|---|
static RaftJournalConfiguration |
defaults(NetworkAddressUtils.ServiceType serviceType) |
List<InetSocketAddress> |
getClusterAddresses() |
long |
getElectionTimeoutMs() |
long |
getHeartbeatIntervalMs() |
InetSocketAddress |
getLocalAddress() |
long |
getMaxLogSize() |
File |
getPath() |
InetSocketAddress |
getProxyAddress() |
RaftJournalConfiguration.StorageLevel |
getStorageLevel() |
RaftJournalConfiguration |
setClusterAddresses(List<InetSocketAddress> clusterAddresses) |
RaftJournalConfiguration |
setElectionTimeoutMs(long electionTimeoutMs) |
RaftJournalConfiguration |
setHeartbeatIntervalMs(long heartbeatIntervalMs) |
RaftJournalConfiguration |
setLocalAddress(InetSocketAddress localAddress) |
RaftJournalConfiguration |
setMaxLogSize(long maxLogSize) |
RaftJournalConfiguration |
setPath(File path) |
RaftJournalConfiguration |
setStorageLevel(RaftJournalConfiguration.StorageLevel storageLevel) |
void |
validate()
Validates the configuration.
|
public static RaftJournalConfiguration defaults(NetworkAddressUtils.ServiceType serviceType)
serviceType
- either master raft service or job master raft servicepublic void validate()
public List<InetSocketAddress> getClusterAddresses()
public long getElectionTimeoutMs()
public long getHeartbeatIntervalMs()
public InetSocketAddress getLocalAddress()
public InetSocketAddress getProxyAddress()
public long getMaxLogSize()
public File getPath()
public RaftJournalConfiguration.StorageLevel getStorageLevel()
public RaftJournalConfiguration setClusterAddresses(List<InetSocketAddress> clusterAddresses)
clusterAddresses
- addresses of all nodes in the Raft clusterpublic RaftJournalConfiguration setElectionTimeoutMs(long electionTimeoutMs)
electionTimeoutMs
- election timeoutpublic RaftJournalConfiguration setHeartbeatIntervalMs(long heartbeatIntervalMs)
heartbeatIntervalMs
- heartbeat intervalpublic RaftJournalConfiguration setLocalAddress(InetSocketAddress localAddress)
localAddress
- address of this Raft cluster nodepublic RaftJournalConfiguration setMaxLogSize(long maxLogSize)
maxLogSize
- maximum log file sizepublic RaftJournalConfiguration setPath(File path)
path
- where to store journal logspublic RaftJournalConfiguration setStorageLevel(RaftJournalConfiguration.StorageLevel storageLevel)
storageLevel
- storage levelCopyright © 2023. All Rights Reserved.