Package io.camunda.zeebe.transport.impl
Class AtomixClientTransportAdapter
java.lang.Object
io.camunda.zeebe.scheduler.Actor
io.camunda.zeebe.transport.impl.AtomixClientTransportAdapter
- All Implemented Interfaces:
AsyncClosable,ConcurrencyControl,ClientTransport,AutoCloseable,Executor
-
Nested Class Summary
Nested classes/interfaces inherited from class io.camunda.zeebe.scheduler.Actor
Actor.ActorBuilder -
Field Summary
Fields inherited from class io.camunda.zeebe.scheduler.Actor
actor, ACTOR_PROP_NAME, ACTOR_PROP_PARTITION_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionActorFuture<org.agrona.DirectBuffer> sendRequest(Supplier<String> nodeAddressSupplier, ClientRequest clientRequest, Duration timeout) Send a request to a node with out any retries.ActorFuture<org.agrona.DirectBuffer> sendRequestWithRetry(Supplier<String> nodeAddressSupplier, Predicate<org.agrona.DirectBuffer> responseValidator, ClientRequest clientRequest, Duration timeout) Send a request to a node with retries if there is no current connection or the node is not resolvable.Methods inherited from class io.camunda.zeebe.scheduler.Actor
buildActorName, call, close, closeAsync, createContext, getContext, getName, handleFailure, isActorClosed, newActor, onActorClosed, onActorCloseRequested, onActorClosing, onActorFailed, onActorStarted, onActorStarting, run, runOnCompletion, runOnCompletion, schedule, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.AutoCloseable
closeMethods inherited from interface io.camunda.zeebe.transport.ClientTransport
sendRequestWithRetryMethods inherited from interface io.camunda.zeebe.scheduler.ConcurrencyControl
createCompletedFuture, createFuture, execute
-
Constructor Details
-
AtomixClientTransportAdapter
-
-
Method Details
-
sendRequestWithRetry
public ActorFuture<org.agrona.DirectBuffer> sendRequestWithRetry(Supplier<String> nodeAddressSupplier, Predicate<org.agrona.DirectBuffer> responseValidator, ClientRequest clientRequest, Duration timeout) Description copied from interface:ClientTransportSend a request to a node with retries if there is no current connection or the node is not resolvable. Makes this method more robust in the presence of short intermittent disconnects.Guarantees:
- Not garbage-free
- n intermediary copies of the request (one local copy for making retries, one copy on the send buffer per try)
- Specified by:
sendRequestWithRetryin interfaceClientTransport- Parameters:
nodeAddressSupplier- supplier for the node address the retries are executed against (retries may be executed against different nodes). The supplier may resolve tonullto signal that a node address can not be determined. In that case, the request is retried after resubmit timeout.responseValidator- predicate which tests the received response, before completing the future to verify, whether this request needs to be retried or not, in respect of the current timeout. This avoids retrying, without new copy of the corresponding request and no separate logic in the client. When the validator returns *true* then the request is valid and should not be retried.clientRequest- the request which should be sendtimeout- The timeout until the returned future fails if no response is received.- Returns:
- a future carrying the response that was accepted or null in case no memory is currently available to allocate the request. Can complete exceptionally in failure cases such as timeout.
-
sendRequest
public ActorFuture<org.agrona.DirectBuffer> sendRequest(Supplier<String> nodeAddressSupplier, ClientRequest clientRequest, Duration timeout) Description copied from interface:ClientTransportSend a request to a node with out any retries.Guarantees:
- Not garbage-free
- 1 intermediary copies of the request
- Specified by:
sendRequestin interfaceClientTransport- Parameters:
nodeAddressSupplier- supplier for the node address the retries are executed against (retries may be executed against different nodes). The supplier may resolve tonullto signal that a node address can not be determined. In that case, the request will be completed with a NoRemoteAddressFoundException.clientRequest- the request which should be sendtimeout- The timeout until the returned future fails if no response is received.- Returns:
- a future carrying the response that was accepted or null in case no memory is currently available to allocate the request. Can complete exceptionally in failure cases such as timeout.
-