F
- type of the fencing tokenpublic class FencedRpcEndpoint<F extends Serializable> extends RpcEndpoint
RpcEndpoint
. A fenced rpc endpoint expects all rpc messages
being enriched with fencing tokens. Furthermore, the rpc endpoint has its own fencing token
assigned. The rpc is then only executed if the attached fencing token equals the endpoint's own
token.RpcEndpoint.MainThreadExecutor
log, rpcServer
Modifier | Constructor and Description |
---|---|
protected |
FencedRpcEndpoint(RpcService rpcService) |
protected |
FencedRpcEndpoint(RpcService rpcService,
String endpointId) |
Modifier and Type | Method and Description |
---|---|
protected <V> CompletableFuture<V> |
callAsyncWithoutFencing(Callable<V> callable,
Time timeout)
Run the given callable in the main thread of the RpcEndpoint without checking the fencing
token.
|
F |
getFencingToken() |
protected RpcEndpoint.MainThreadExecutor |
getMainThreadExecutor()
Returns a main thread executor which is bound to the currently valid fencing token.
|
protected void |
runAsyncWithoutFencing(Runnable runnable)
Run the given runnable in the main thread of the RpcEndpoint without checking the fencing
token.
|
protected void |
setFencingToken(F newFencingToken) |
callAsync, getAddress, getEndpointId, getHostname, getRpcService, getSelfGateway, getTerminationFuture, postStop, runAsync, scheduleRunAsync, scheduleRunAsync, shutDown, start, stop, validateRunsInMainThread
protected FencedRpcEndpoint(RpcService rpcService, String endpointId)
protected FencedRpcEndpoint(RpcService rpcService)
public F getFencingToken()
protected RpcEndpoint.MainThreadExecutor getMainThreadExecutor()
getMainThreadExecutor
in class RpcEndpoint
protected void runAsyncWithoutFencing(Runnable runnable)
runnable
- to execute in the main thread of the rpc endpoint without checking the fencing token.protected <V> CompletableFuture<V> callAsyncWithoutFencing(Callable<V> callable, Time timeout)
callable
- to run in the main thread of the rpc endpoint without checkint the fencing token.timeout
- for the operation.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.