public static class RaftServer.Builder extends Object
RaftServer objects.| 构造器和说明 |
|---|
Builder() |
| 限定符和类型 | 方法和说明 |
|---|---|
RaftServer |
build() |
RaftServer.Builder |
setGroup(RaftGroup group)
Set all the peers (including the server being built) in the Raft cluster.
|
RaftServer.Builder |
setOption(RaftStorage.StartupOption option)
Set the startup option for the group.
|
RaftServer.Builder |
setParameters(Parameters parameters)
Set
Parameters. |
RaftServer.Builder |
setProperties(RaftProperties properties)
Set
RaftProperties. |
RaftServer.Builder |
setServerId(RaftPeerId serverId)
Set the server ID.
|
RaftServer.Builder |
setStateMachine(StateMachine stateMachine)
Set the
StateMachine of the server. |
RaftServer.Builder |
setStateMachineRegistry(StateMachine.Registry stateMachineRegistry)
Set the
StateMachine.Registry of the server. |
RaftServer.Builder |
setThreadGroup(ThreadGroup threadGroup)
Set
ThreadGroup so the application can control RaftServer threads consistently with the application. |
public RaftServer build() throws IOException
RaftServer object.IOExceptionpublic RaftServer.Builder setServerId(RaftPeerId serverId)
public RaftServer.Builder setStateMachine(StateMachine stateMachine)
StateMachine of the server.public RaftServer.Builder setStateMachineRegistry(StateMachine.Registry stateMachineRegistry)
StateMachine.Registry of the server.public RaftServer.Builder setGroup(RaftGroup group)
public RaftServer.Builder setOption(RaftStorage.StartupOption option)
public RaftServer.Builder setProperties(RaftProperties properties)
RaftProperties.public RaftServer.Builder setParameters(Parameters parameters)
Parameters.public RaftServer.Builder setThreadGroup(ThreadGroup threadGroup)
ThreadGroup so the application can control RaftServer threads consistently with the application.
For example, configure ThreadGroup.uncaughtException(Thread, Throwable) for the whole thread group.
If not set, the new thread will be put into the thread group of the caller thread.Copyright © 2017–2025 The Apache Software Foundation. All rights reserved.