public interface RaftClient
| Modifier and Type | Interface and Description |
|---|---|
static class |
RaftClient.Builder
Builds a new Raft client.
|
| Modifier and Type | Method and Description |
|---|---|
String |
clientId()
Returns the globally unique client identifier.
|
CompletableFuture<Void> |
close()
Closes the client.
|
default CompletableFuture<RaftClient> |
connect()
Connects the client to Raft cluster via the default server address.
|
CompletableFuture<RaftClient> |
connect(Collection<MemberId> members)
Connects the client to Raft cluster via the provided server addresses.
|
default CompletableFuture<RaftClient> |
connect(MemberId... members)
Connects the client to Raft cluster via the provided server addresses.
|
RaftMetadataClient |
metadata()
Returns the Raft metadata.
|
static RaftClient.Builder |
newBuilder()
Returns a new Raft client builder.
|
static RaftClient.Builder |
newBuilder(Collection<MemberId> cluster)
Returns a new Raft client builder.
|
static RaftClient.Builder |
newBuilder(MemberId... cluster)
Returns a new Raft client builder.
|
RaftProxy.Builder |
newProxyBuilder()
Returns a new proxy builder.
|
static RaftClient.Builder newBuilder()
The provided set of members will be used to connect to the Raft cluster. The members list does not have to represent the complete list of servers in the cluster, but it must have at least one reachable member that can communicate with the cluster's leader.
static RaftClient.Builder newBuilder(MemberId... cluster)
The provided set of members will be used to connect to the Raft cluster. The members list does not have to represent the complete list of servers in the cluster, but it must have at least one reachable member that can communicate with the cluster's leader.
cluster - The cluster to which to connect.static RaftClient.Builder newBuilder(Collection<MemberId> cluster)
The provided set of members will be used to connect to the Raft cluster. The members list does not have to represent the complete list of servers in the cluster, but it must have at least one reachable member that can communicate with the cluster's leader.
cluster - The cluster to which to connect.String clientId()
RaftMetadataClient metadata()
RaftProxy.Builder newProxyBuilder()
default CompletableFuture<RaftClient> connect()
If the client was built with a default cluster list, the default server addresses will be used. Otherwise, the client will attempt to connect to localhost:8700.
The client will connect to servers in the cluster according to the pattern specified by the configured
CommunicationStrategy.
default CompletableFuture<RaftClient> connect(MemberId... members)
The client will connect to servers in the cluster according to the pattern specified by the configured
CommunicationStrategy.
members - A set of server addresses to which to connect.CompletableFuture<RaftClient> connect(Collection<MemberId> members)
The client will connect to servers in the cluster according to the pattern specified by the configured
CommunicationStrategy.
members - A set of server addresses to which to connect.CompletableFuture<Void> close()
Copyright © 2013–2017. All rights reserved.