Class RpcManagerImpl

  • All Implemented Interfaces:
    JmxStatisticsExposer, RpcManager

    public class RpcManagerImpl
    extends Object
    implements RpcManager, JmxStatisticsExposer
    This component really is just a wrapper around a Transport implementation, and is used to set up the transport and provide lifecycle and dependency hooks into external transport implementations.
    Since:
    4.0
    Author:
    Manik Surtani, Galder ZamarreƱo, Mircea.Markus@jboss.com, Pedro Ruivo
    • Constructor Detail

      • RpcManagerImpl

        public RpcManagerImpl()
    • Method Detail

      • getCommittedViewAsString

        public String getCommittedViewAsString()
      • getPendingViewAsString

        public String getPendingViewAsString()
      • invokeRemotelyAsync

        public CompletableFuture<Map<Address,​Response>> invokeRemotelyAsync​(Collection<Address> recipients,
                                                                                  org.infinispan.commands.ReplicableCommand rpc,
                                                                                  RpcOptions options)
        Description copied from interface: RpcManager
        Invokes a command on remote nodes.
        Specified by:
        invokeRemotelyAsync in interface RpcManager
        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.
      • invokeRemotely

        public Map<Address,​Response> invokeRemotely​(Collection<Address> recipients,
                                                          org.infinispan.commands.ReplicableCommand rpc,
                                                          RpcOptions options)
        Description copied from interface: RpcManager
        Invokes an RPC call on other caches in the cluster.
        Specified by:
        invokeRemotely in interface RpcManager
        Parameters:
        recipients - a list of Addresses to invoke the call on. If this is null, the call is broadcast to the entire cluster.
        rpc - command to execute remotely.
        options - it configures the invocation. The same instance can be re-used since RpcManager does not change it. Any change in RpcOptions during a remote invocation can lead to unpredictable behavior.
        Returns:
        a map of responses from each member contacted.
      • sendTo

        public void sendTo​(Address destination,
                           org.infinispan.commands.ReplicableCommand command,
                           DeliverOrder deliverOrder)
        Description copied from interface: RpcManager
        Asynchronously sends the ReplicableCommand to the destination using the specified DeliverOrder.
        Specified by:
        sendTo in interface RpcManager
        Parameters:
        destination - the destination's Address.
        command - the ReplicableCommand to send.
        deliverOrder - the DeliverOrder to use.
      • sendToMany

        public void sendToMany​(Collection<Address> destinations,
                               org.infinispan.commands.ReplicableCommand command,
                               DeliverOrder deliverOrder)
        Description copied from interface: RpcManager
        Asynchronously sends the ReplicableCommand to the set of destination using the specified DeliverOrder.
        Specified by:
        sendToMany in interface RpcManager
        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

        public void sendToAll​(org.infinispan.commands.ReplicableCommand command,
                              DeliverOrder deliverOrder)
        Description copied from interface: RpcManager
        Asynchronously sends the ReplicableCommand to the entire cluster.
        Specified by:
        sendToAll in interface RpcManager
      • getReplicationCount

        public long getReplicationCount()
      • getReplicationFailures

        public long getReplicationFailures()
      • isStatisticsEnabled

        public boolean isStatisticsEnabled()
      • setStatisticsEnabled

        @Deprecated
        public void setStatisticsEnabled​(boolean statisticsEnabled)
        Deprecated.
        We already have an attribute, we shouldn't have an operation for the same thing.
        Description copied from interface: JmxStatisticsExposer
        Enables an interceptor's cache statistics If true, the interceptor will capture statistics and make them available through the mbean.
        Specified by:
        setStatisticsEnabled in interface JmxStatisticsExposer
        Parameters:
        statisticsEnabled - true if statistics should be captured
      • getSuccessRatio

        public String getSuccessRatio()
      • getSuccessRatioFloatingPoint

        public double getSuccessRatioFloatingPoint()
      • getAverageReplicationTime

        public long getAverageReplicationTime()
      • getSitesView

        public String getSitesView()
      • getAverageXSiteReplicationTime

        public long getAverageXSiteReplicationTime()
      • getMinimumXSiteReplicationTime

        public long getMinimumXSiteReplicationTime()
      • getMaximumXSiteReplicationTime

        public long getMaximumXSiteReplicationTime()
      • getSyncXSiteCount

        public long getSyncXSiteCount()
      • getAsyncXSiteCount

        public long getAsyncXSiteCount()
      • getAverageAsyncXSiteReplicationTime

        public long getAverageAsyncXSiteReplicationTime()
      • getMinimumAsyncXSiteReplicationTime

        public long getMinimumAsyncXSiteReplicationTime()
      • getMaximumAsyncXSiteReplicationTime

        public long getMaximumAsyncXSiteReplicationTime()
      • getAsyncXSiteAcksCount

        public long getAsyncXSiteAcksCount()
      • setTransport

        public void setTransport​(Transport t)
      • getAddress

        public Address getAddress()
        Description copied from interface: RpcManager
        Returns the address associated with this RpcManager or null if not part of the cluster.
        Specified by:
        getAddress in interface RpcManager
      • getTopologyId

        public int getTopologyId()
        Description copied from interface: RpcManager
        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.
        Specified by:
        getTopologyId in interface RpcManager
      • getMembers

        public List<Address> getMembers()
        Description copied from interface: RpcManager
        Returns members of a cluster scoped to the cache owning this RpcManager. Note that this List is always a subset of Transport.getMembers()
        Specified by:
        getMembers in interface RpcManager
        Returns:
        a list of cache scoped cluster members