public interface RpcManager
Transport
.Modifier and Type | Method and Description |
---|---|
<T> T |
blocking(CompletionStage<T> request)
Block on a request and return its result.
|
Address |
getAddress()
Returns the address associated with this RpcManager or null if not part of the cluster.
|
List<Address> |
getMembers()
Returns members of a cluster scoped to the cache owning this RpcManager.
|
RpcOptions |
getSyncRpcOptions() |
int |
getTopologyId()
Returns the current topology id.
|
default RpcOptions |
getTotalSyncRpcOptions() |
Transport |
getTransport() |
<T> CompletionStage<T> |
invokeCommand(Address target,
ReplicableCommand command,
ResponseCollector<T> collector,
RpcOptions rpcOptions)
Invoke a command on a single node and pass the response to a
ResponseCollector . |
<T> CompletionStage<T> |
invokeCommand(Collection<Address> targets,
ReplicableCommand command,
ResponseCollector<T> collector,
RpcOptions rpcOptions)
Invoke a command on a collection of node and pass the responses to a
ResponseCollector . |
<T> CompletionStage<T> |
invokeCommandOnAll(ReplicableCommand command,
ResponseCollector<T> collector,
RpcOptions rpcOptions)
Invoke a command on all the nodes in the cluster and pass the responses to a
ResponseCollector . |
<T> CompletionStage<T> |
invokeCommands(Collection<Address> targets,
Function<Address,ReplicableCommand> commandGenerator,
ResponseCollector<T> collector,
RpcOptions rpcOptions)
Invoke different commands on a collection of nodes and pass the responses to a
ResponseCollector . |
<T> CompletionStage<T> |
invokeCommandStaggered(Collection<Address> targets,
ReplicableCommand command,
ResponseCollector<T> collector,
RpcOptions rpcOptions)
Invoke a command on a collection of nodes and pass the responses to a
ResponseCollector . |
default CompletableFuture<Map<Address,Response>> |
invokeRemotelyAsync(Collection<Address> recipients,
ReplicableCommand rpc,
RpcOptions options)
Deprecated.
|
XSiteResponse |
invokeXSite(XSiteBackup backup,
XSiteReplicateCommand command)
Sends the
XSiteReplicateCommand to a remote site. |
void |
sendTo(Address destination,
ReplicableCommand command,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the destination using the specified DeliverOrder . |
void |
sendToAll(ReplicableCommand command,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the entire cluster. |
void |
sendToMany(Collection<Address> destinations,
ReplicableCommand command,
DeliverOrder deliverOrder)
Asynchronously sends the
ReplicableCommand to the set of destination using the specified DeliverOrder . |
<T> CompletionStage<T> invokeCommand(Address target, ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions)
ResponseCollector
.
If the target is the local node, the command is never executed and ResponseCollector.finish()
is called directly.<T> CompletionStage<T> invokeCommand(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions)
ResponseCollector
.
If one of the targets is the local node, it is ignored. The command is only executed on the remote nodes.<T> CompletionStage<T> invokeCommandOnAll(ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions)
ResponseCollector
.
The command is not executed locally and it is not sent across RELAY2 bridges to remote sites.<T> CompletionStage<T> invokeCommandStaggered(Collection<Address> targets, ReplicableCommand command, ResponseCollector<T> collector, RpcOptions rpcOptions)
ResponseCollector
.
The command is only sent immediately to the first target, and there is an implementation-dependent
delay before sending the command to each target. There is no delay if the target responds or leaves
the cluster. The remaining targets are skipped if ResponseCollector.addResponse(Address, Response)
returns a non-null
value.
The command is only executed on the remote nodes.<T> CompletionStage<T> invokeCommands(Collection<Address> targets, Function<Address,ReplicableCommand> commandGenerator, ResponseCollector<T> collector, RpcOptions rpcOptions)
ResponseCollector
.
The command is only executed on the remote nodes and it is not executed in the local node even if it is in the targets
.<T> T blocking(CompletionStage<T> request)
@Deprecated default CompletableFuture<Map<Address,Response>> invokeRemotelyAsync(Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options)
sendToMany(Collection, ReplicableCommand, DeliverOrder)
or
invokeCommand(Collection, ReplicableCommand, ResponseCollector, RpcOptions)
instead.recipients
- A list of nodes, or null
to invoke the command on all the members of the clusterrpc
- The command to invokeoptions
- The invocation optionsvoid sendTo(Address destination, ReplicableCommand command, DeliverOrder deliverOrder)
ReplicableCommand
to the destination using the specified DeliverOrder
.destination
- the destination's Address
.command
- the ReplicableCommand
to send.deliverOrder
- the DeliverOrder
to use.void sendToMany(Collection<Address> destinations, ReplicableCommand command, DeliverOrder deliverOrder)
ReplicableCommand
to the set of destination using the specified DeliverOrder
.destinations
- the collection of destination's Address
. If null
, it sends to all the members
in the cluster.command
- the ReplicableCommand
to send.deliverOrder
- the DeliverOrder
to use.void sendToAll(ReplicableCommand command, DeliverOrder deliverOrder)
ReplicableCommand
to the entire cluster.XSiteResponse invokeXSite(XSiteBackup backup, XSiteReplicateCommand command)
XSiteReplicateCommand
to a remote site.
If XSiteBackup.isSync()
returns false
, the XSiteResponse
is only completed when the an
ACK from the remote site is received. The invoker needs to make sure not to wait for the XSiteResponse
.
backup
- The site to where the command is sent.command
- The command to send.XSiteResponse
that is completed when the request is completed.Transport getTransport()
List<Address> getMembers()
Transport.getMembers()
Address getAddress()
int getTopologyId()
RpcOptions getSyncRpcOptions()
default RpcOptions getTotalSyncRpcOptions()
Copyright © 2021 JBoss by Red Hat. All rights reserved.