public abstract static class RaftClient.Builder extends java.lang.Object implements Builder<RaftClient>
New client builders should be constructed using the static RaftClient.builder() 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(java.lang.String clientId)
Sets the client ID.
|
RaftClient.Builder |
withMemberId(MemberId memberId)
Sets the local node identifier.
|
RaftClient.Builder |
withPartitionId(PartitionId partitionId)
Sets the partition identifier.
|
RaftClient.Builder |
withProtocol(io.atomix.protocols.raft.protocol.RaftClientProtocol protocol)
Sets the client protocol.
|
RaftClient.Builder |
withThreadContextFactory(io.atomix.utils.concurrent.ThreadContextFactory threadContextFactory)
Sets the client thread context factory.
|
RaftClient.Builder |
withThreadModel(io.atomix.utils.concurrent.ThreadModel threadModel)
Sets the client thread model.
|
RaftClient.Builder |
withThreadPoolSize(int threadPoolSize)
Sets the client thread pool size.
|
public RaftClient.Builder withClientId(java.lang.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.java.lang.NullPointerException - if clientId is nullpublic RaftClient.Builder withPartitionId(PartitionId partitionId)
partitionId - The partition identifier.java.lang.NullPointerException - if partitionId is nullpublic RaftClient.Builder withMemberId(MemberId memberId)
memberId - The local node identifier.java.lang.NullPointerException - if memberId is nullpublic RaftClient.Builder withProtocol(io.atomix.protocols.raft.protocol.RaftClientProtocol protocol)
protocol - the client protocoljava.lang.NullPointerException - if the protocol is nullpublic RaftClient.Builder withThreadModel(io.atomix.utils.concurrent.ThreadModel threadModel)
threadModel - the client thread modeljava.lang.NullPointerException - if the thread model is nullpublic RaftClient.Builder withThreadPoolSize(int threadPoolSize)
threadPoolSize - The client thread pool size.java.lang.IllegalArgumentException - if the thread pool size is not positivepublic RaftClient.Builder withThreadContextFactory(io.atomix.utils.concurrent.ThreadContextFactory threadContextFactory)
threadContextFactory - the client thread context factoryjava.lang.NullPointerException - if the factory is nullCopyright © 2013-2019. All Rights Reserved.