public interface RaftProxy extends RaftProxyExecutor, io.atomix.utils.Managed<RaftProxy>
| Modifier and Type | Interface and Description |
|---|---|
static class |
RaftProxy.Builder
Raft session builder.
|
static class |
RaftProxy.State
Indicates the state of the client's communication with the Raft cluster.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(EventType eventType,
Consumer<byte[]> listener)
Adds a session event listener.
|
<T> void |
addEventListener(EventType eventType,
Function<byte[],T> decoder,
Consumer<T> listener)
Adds an event listener.
|
void |
addEventListener(EventType eventType,
Runnable listener)
Adds an empty session event listener.
|
default CompletableFuture<Void> |
invoke(OperationId operationId)
Submits an empty operation to the Raft cluster, awaiting a void result.
|
default <R> CompletableFuture<R> |
invoke(OperationId operationId,
Function<byte[],R> decoder)
Submits an empty operation to the Raft cluster.
|
default <T> CompletableFuture<Void> |
invoke(OperationId operationId,
Function<T,byte[]> encoder,
T operation)
Submits an operation to the Raft cluster.
|
default <T,R> CompletableFuture<R> |
invoke(OperationId operationId,
Function<T,byte[]> encoder,
T operation,
Function<byte[],R> decoder)
Submits an operation to the Raft cluster.
|
void |
removeEventListener(EventType eventType,
Consumer listener)
Removes a session event listener.
|
void |
removeEventListener(EventType eventType,
Runnable listener)
Removes an empty session event listener.
|
addEventListener, addStateChangeListener, execute, execute, execute, getState, name, removeEventListener, removeStateChangeListener, serviceType, sessionIddefault CompletableFuture<Void> invoke(OperationId operationId)
operationId - the operation identifierRaftOperation submission futures that preceded it. The future will always be completed on theNullPointerException - if operation is nulldefault <R> CompletableFuture<R> invoke(OperationId operationId, Function<byte[],R> decoder)
R - the operation result typeoperationId - the operation identifierdecoder - the operation result decoderRaftOperation submission futures that preceded it.NullPointerException - if operation is nulldefault <T> CompletableFuture<Void> invoke(OperationId operationId, Function<T,byte[]> encoder, T operation)
T - the operation typeoperationId - the operation identifierencoder - the operation encoderRaftOperation submission futures that preceded it.NullPointerException - if operation is nulldefault <T,R> CompletableFuture<R> invoke(OperationId operationId, Function<T,byte[]> encoder, T operation, Function<byte[],R> decoder)
T - the operation typeR - the operation result typeoperationId - the operation identifierencoder - the operation encoderoperation - the operation to submitdecoder - the operation result decoderRaftOperation submission futures that preceded it.NullPointerException - if operation is null<T> void addEventListener(EventType eventType, Function<byte[],T> decoder, Consumer<T> listener)
T - the event value type.eventType - the event type identifier.decoder - the event decoder.listener - the event listener.void addEventListener(EventType eventType, Runnable listener)
eventType - the event typelistener - the event listener to addvoid addEventListener(EventType eventType, Consumer<byte[]> listener)
eventType - the event type identifierlistener - the event listener to addvoid removeEventListener(EventType eventType, Runnable listener)
eventType - the event typelistener - the event listener to addCopyright © 2013–2017. All rights reserved.