public static class RaftServer.Builder extends net.kuujo.catalyst.util.Builder<RaftServer>
| Modifier and Type | Method and Description |
|---|---|
RaftServer |
build() |
RaftServer.Builder |
withElectionTimeout(Duration electionTimeout)
Sets the Raft election timeout, returning the Raft configuration for method chaining.
|
RaftServer.Builder |
withHeartbeatInterval(Duration heartbeatInterval)
Sets the Raft heartbeat interval, returning the Raft configuration for method chaining.
|
RaftServer.Builder |
withSerializer(net.kuujo.catalyst.serializer.Serializer serializer)
Sets the Raft serializer.
|
RaftServer.Builder |
withSessionTimeout(Duration sessionTimeout)
Sets the Raft session timeout, returning the Raft configuration for method chaining.
|
RaftServer.Builder |
withStateMachine(StateMachine stateMachine)
Sets the Raft state machine.
|
RaftServer.Builder |
withStorage(net.kuujo.catalog.server.storage.Storage storage)
Sets the storage module.
|
RaftServer.Builder |
withTransport(net.kuujo.catalyst.transport.Transport transport)
Sets the server transport.
|
public RaftServer.Builder withTransport(net.kuujo.catalyst.transport.Transport transport)
transport - The server transport.NullPointerException - if transport is nullpublic RaftServer.Builder withSerializer(net.kuujo.catalyst.serializer.Serializer serializer)
serializer - The Raft serializer.NullPointerException - if serializer is nullpublic RaftServer.Builder withStorage(net.kuujo.catalog.server.storage.Storage storage)
storage - The storage module.NullPointerException - if storage is nullpublic RaftServer.Builder withStateMachine(StateMachine stateMachine)
stateMachine - The Raft state machine.NullPointerException - if stateMachine is nullpublic RaftServer.Builder withElectionTimeout(Duration electionTimeout)
electionTimeout - The Raft election timeout duration.IllegalArgumentException - If the election timeout is not positiveNullPointerException - if electionTimeout is nullpublic RaftServer.Builder withHeartbeatInterval(Duration heartbeatInterval)
heartbeatInterval - The Raft heartbeat interval duration.IllegalArgumentException - If the heartbeat interval is not positiveNullPointerException - if heartbeatInterval is nullpublic RaftServer.Builder withSessionTimeout(Duration sessionTimeout)
sessionTimeout - The Raft session timeout duration.IllegalArgumentException - If the session timeout is not positiveNullPointerException - if sessionTimeout is nullpublic RaftServer build()
build in class net.kuujo.catalyst.util.Builder<RaftServer>net.kuujo.catalyst.util.ConfigurationException - if a state machine, members or transport are not configuredCopyright © 2013–2015. All rights reserved.