Interface RpcManager

All Known Implementing Classes:
ExtendedStatisticRpcManager, RpcManagerImpl

public interface RpcManager
Provides a mechanism for communicating with other caches in the cluster, by formatting and passing requests down to the registered Transport.
Since:
4.0
Author:
Manik Surtani, Mircea.Markus@jboss.com
  • Method Details

    • invokeCommand

      <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. If the target is the local node, the command is never executed and ResponseCollector.finish() is called directly.
      Since:
      9.2
    • invokeCommand

      <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. If one of the targets is the local node, it is ignored. The command is only executed on the remote nodes.
      Since:
      9.2
    • invokeCommandOnAll

      <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. The command is not executed locally and it is not sent across RELAY2 bridges to remote sites.
      Since:
      9.2
    • invokeCommandStaggered

      <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. 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.
      Since:
      9.2
    • invokeCommands

      <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. 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.
      Since:
      9.2
    • blocking

      <T> T blocking(CompletionStage<T> request)
      Block on a request and return its result.
      Since:
      9.2
    • invokeRemotelyAsync

      @Deprecated(forRemoval=true) default CompletableFuture<Map<Address,Response>> invokeRemotelyAsync(Collection<Address> recipients, ReplicableCommand rpc, RpcOptions options)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Invokes a command on remote nodes.
      Parameters:
      recipients - A list of nodes, or null to invoke the command on all the members of the cluster
      rpc - The command to invoke
      options - The invocation options
      Returns:
      A future that, when completed, returns the responses from the remote nodes.
    • sendTo

      void sendTo(Address destination, ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder)
      Asynchronously sends the ReplicableCommand to the destination using the specified DeliverOrder.
      Parameters:
      destination - the destination's Address.
      command - the ReplicableCommand to send.
      deliverOrder - the DeliverOrder to use.
    • sendToMany

      void sendToMany(Collection<Address> destinations, ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder)
      Asynchronously sends the ReplicableCommand to the set of destination using the specified DeliverOrder.
      Parameters:
      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.
    • sendToAll

      void sendToAll(ReplicableCommand command, org.infinispan.remoting.inboundhandler.DeliverOrder deliverOrder)
      Asynchronously sends the ReplicableCommand to the entire cluster.
      Since:
      9.2
    • invokeXSite

      <O> XSiteResponse<O> invokeXSite(org.infinispan.xsite.XSiteBackup backup, XSiteCacheRequest<O> command)
      Sends the XSiteCacheRequest 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.

      Parameters:
      backup - The site to where the command is sent.
      command - The command to send.
      Returns:
      A XSiteResponse that is completed when the request is completed.
    • getTransport

      Transport getTransport()
      Returns:
      a reference to the underlying transport.
    • getMembers

      List<Address> getMembers()
      Returns members of a cluster scoped to the cache owning this RpcManager. Note that this List is always a subset of Transport.getMembers()
      Returns:
      a list of cache scoped cluster members
    • getAddress

      Address getAddress()
      Returns the address associated with this RpcManager or null if not part of the cluster.
    • getTopologyId

      int getTopologyId()
      Returns the current topology id. As opposed to the viewId which is updated whenever the cluster changes, the topologyId is updated when a new cache instance is started or removed - this doesn't necessarily coincide with a node being added/removed to the cluster.
    • getSyncRpcOptions

      RpcOptions getSyncRpcOptions()
      Returns:
      The default options for synchronous remote invocations.
    • getTotalSyncRpcOptions

      default RpcOptions getTotalSyncRpcOptions()
      Returns:
      The default options for total order remote invocations.