public interface RaftClient
| Modifier and Type | Interface and Description |
|---|---|
static class |
RaftClient.Builder
Builds a new Raft client.
|
| Modifier and Type | Method and Description |
|---|---|
static RaftClient.Builder |
builder()
Returns a new Raft client builder.
|
static RaftClient.Builder |
builder(Collection<io.atomix.cluster.MemberId> cluster)
Returns a new Raft client builder.
|
static RaftClient.Builder |
builder(io.atomix.cluster.MemberId... cluster)
Returns a new Raft client builder.
|
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<io.atomix.cluster.MemberId> members)
Connects the client to Raft cluster via the provided server addresses.
|
default CompletableFuture<RaftClient> |
connect(io.atomix.cluster.MemberId... members)
Connects the client to Raft cluster via the provided server addresses.
|
io.atomix.cluster.MemberId |
leader()
Returns the current leader.
|
RaftMetadataClient |
metadata()
Returns the Raft metadata.
|
RaftSessionClient.Builder |
sessionBuilder(String primitiveName,
io.atomix.primitive.PrimitiveType primitiveType,
io.atomix.primitive.service.ServiceConfig serviceConfig)
Builds a Raft proxy session.
|
long |
term()
Returns the current term.
|
static RaftClient.Builder builder()
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 builder(io.atomix.cluster.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 builder(Collection<io.atomix.cluster.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()
long term()
io.atomix.cluster.MemberId leader()
RaftMetadataClient metadata()
RaftSessionClient.Builder sessionBuilder(String primitiveName, io.atomix.primitive.PrimitiveType primitiveType, io.atomix.primitive.service.ServiceConfig serviceConfig)
primitiveName - the primitive nameprimitiveType - the primitive typeserviceConfig - the service configurationdefault 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(io.atomix.cluster.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<io.atomix.cluster.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–2018. All rights reserved.