public abstract static class RaftClient.Builder extends Object implements io.atomix.utils.Builder<RaftClient>
New client builders should be constructed using the static RaftClient.newBuilder() factory method.
RaftClient client = RaftClient.builder(new Address("123.456.789.0", 5000), new Address("123.456.789.1", 5000)
.withTransport(new NettyTransport())
.build();
| Modifier and Type | Method and Description |
|---|---|
RaftClient.Builder |
withClientId(String clientId)
Sets the client ID.
|
RaftClient.Builder |
withMemberId(MemberId nodeId)
Sets the local node identifier.
|
RaftClient.Builder |
withProtocol(RaftClientProtocol protocol)
Sets the client protocol.
|
RaftClient.Builder |
withThreadModel(ThreadModel threadModel)
Sets the client thread model.
|
RaftClient.Builder |
withThreadPoolSize(int threadPoolSize)
Sets the client thread pool size.
|
public RaftClient.Builder withClientId(String clientId)
The client ID is a name that should be unique among all clients. The ID will be used to resolve and recover sessions.
clientId - The client ID.NullPointerException - if clientId is nullpublic RaftClient.Builder withMemberId(MemberId nodeId)
nodeId - The local node identifier.NullPointerException - if nodeId is nullpublic RaftClient.Builder withProtocol(RaftClientProtocol protocol)
protocol - the client protocolNullPointerException - if the protocol is nullpublic RaftClient.Builder withThreadModel(ThreadModel threadModel)
threadModel - the client thread modelNullPointerException - if the thread model is nullpublic RaftClient.Builder withThreadPoolSize(int threadPoolSize)
threadPoolSize - The client thread pool size.IllegalArgumentException - if the thread pool size is not positiveCopyright © 2013–2017. All rights reserved.