Class RpcManagerImpl

  • All Implemented Interfaces:
    JmxStatisticsExposer, org.infinispan.metrics.impl.CustomMetricsSupplier, RpcManager

    @MBean(objectName="RpcManager",
           description="Manages all remote calls to remote cache instances in the cluster.")
    public class RpcManagerImpl
    extends Object
    implements RpcManager, JmxStatisticsExposer, org.infinispan.metrics.impl.CustomMetricsSupplier
    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

        @ManagedAttribute(description="Retrieves the committed view.",
                          displayName="Committed view",
                          dataType=TRAIT)
        public String getCommittedViewAsString()
      • getPendingViewAsString

        @ManagedAttribute(description="Retrieves the pending view.",
                          displayName="Pending view",
                          dataType=TRAIT)
        public String getPendingViewAsString()
      • sendTo

        public void sendTo​(Address destination,
                           ReplicableCommand command,
                           org.infinispan.remoting.inboundhandler.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,
                               ReplicableCommand command,
                               org.infinispan.remoting.inboundhandler.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.
      • invokeXSite

        public <O> XSiteResponse<O> invokeXSite​(org.infinispan.xsite.XSiteBackup backup,
                                                org.infinispan.xsite.XSiteReplicateCommand<O> command)
        Description copied from interface: RpcManager
        Sends the 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.

        Specified by:
        invokeXSite in interface RpcManager
        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.
      • resetStatistics

        @ManagedOperation(description="Resets statistics gathered by this component",
                          displayName="Reset statistics")
        public void resetStatistics()
        Description copied from interface: JmxStatisticsExposer
        Resets an interceptor's cache statistics
        Specified by:
        resetStatistics in interface JmxStatisticsExposer
      • getReplicationCount

        @ManagedAttribute(description="Number of successful replications",
                          displayName="Number of successful replications",
                          measurementType=TRENDSUP)
        public long getReplicationCount()
      • getReplicationFailures

        @ManagedAttribute(description="Number of failed replications",
                          displayName="Number of failed replications",
                          measurementType=TRENDSUP)
        public long getReplicationFailures()
      • isStatisticsEnabled

        @ManagedAttribute(description="Enables or disables the gathering of statistics by this component",
                          displayName="Statistics enabled",
                          dataType=TRAIT,
                          writable=true)
        public boolean isStatisticsEnabled()
      • setStatisticsEnabled

        @Deprecated
        @ManagedOperation(displayName="Enable/disable statistics. Deprecated, use the statisticsEnabled attribute instead.")
        public void setStatisticsEnabled​(@Parameter(name="enabled",description="Whether statistics should be enabled or disabled (true/false)")
                                         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

        @ManagedAttribute(description="Successful replications as a ratio of total replications",
                          displayName="Successful replications ratio")
        public String getSuccessRatio()
      • getSuccessRatioFloatingPoint

        @ManagedAttribute(description="Successful replications as a ratio of total replications in numeric double format",
                          displayName="Successful replication ratio",
                          units=PERCENTAGE)
        public double getSuccessRatioFloatingPoint()
      • getAverageReplicationTime

        @ManagedAttribute(description="The average time spent in the transport layer, in milliseconds",
                          displayName="Average time spent in the transport layer",
                          units=MILLISECONDS)
        public long getAverageReplicationTime()
      • getSitesView

        @ManagedAttribute(description="Retrieves the x-site view.",
                          displayName="Cross site (x-site) view",
                          dataType=TRAIT)
        public String getSitesView()
      • getAverageXSiteReplicationTime

        @ManagedAttribute(description="Returns the average replication time, in milliseconds, for a cross-site replication request",
                          displayName="Average Cross-Site replication time",
                          units=MILLISECONDS)
        public long getAverageXSiteReplicationTime()
      • getAverageXSiteReplicationTimeTo

        @ManagedOperation(description="Returns the average replication time, in milliseconds, for cross-site request sent to the remote site.",
                          displayName="Average Cross-Site replication time to Site",
                          name="AverageXSiteReplicationTimeTo")
        public long getAverageXSiteReplicationTimeTo​(@Parameter(name="dstSite",description="Destination site name")
                                                     String dstSite)
      • getMinimumXSiteReplicationTime

        @ManagedAttribute(description="Returns the minimum replication time, in milliseconds, for a cross-site replication request",
                          displayName="Minimum Cross-Site replication time",
                          units=MILLISECONDS,
                          measurementType=TRENDSDOWN)
        public long getMinimumXSiteReplicationTime()
      • getMinimumXSiteReplicationTimeTo

        @ManagedOperation(description="Returns the minimum replication time, in milliseconds, for cross-site request sent to the remote site.",
                          displayName="Minimum Cross-Site replication time to Site",
                          name="MinimumXSiteReplicationTimeTo")
        public long getMinimumXSiteReplicationTimeTo​(@Parameter(name="dstSite",description="Destination site name")
                                                     String dstSite)
      • getMaximumXSiteReplicationTime

        @ManagedAttribute(description="Returns the maximum replication time, in milliseconds, for a cross-site replication request",
                          displayName="Maximum Cross-Site replication time",
                          units=MILLISECONDS,
                          measurementType=TRENDSUP)
        public long getMaximumXSiteReplicationTime()
      • getMaximumXSiteReplicationTimeTo

        @ManagedOperation(description="Returns the maximum replication time, in milliseconds, for cross-site request sent to the remote site.",
                          displayName="Maximum Cross-Site replication time to Site",
                          name="MaximumXSiteReplicationTimeTo")
        public long getMaximumXSiteReplicationTimeTo​(@Parameter(name="dstSite",description="Destination site name")
                                                     String dstSite)
      • getNumberXSiteRequests

        @ManagedAttribute(description="Returns the number of sync cross-site requests",
                          displayName="Cross-Site replication requests",
                          measurementType=TRENDSUP)
        public long getNumberXSiteRequests()
      • getNumberXSiteRequestsSentTo

        @ManagedOperation(description="Returns the number of cross-site requests sent to the remote site.",
                          displayName="Number of Cross-Site request sent to site",
                          name="NumberXSiteRequestsSentTo")
        public long getNumberXSiteRequestsSentTo​(@Parameter(name="dstSite",description="Destination site name")
                                                 String dstSite)
      • getNumberXSiteRequestsReceived

        @ManagedAttribute(description="Returns the number of cross-site requests received from all nodes",
                          displayName="Number of Cross-Site Requests Received from all sites",
                          measurementType=TRENDSUP)
        public long getNumberXSiteRequestsReceived()
      • getNumberXSiteRequestsReceivedFrom

        @ManagedOperation(description="Returns the number of cross-site requests received from the remote site.",
                          displayName="Number of Cross-Site request received from site",
                          name="NumberXSiteRequestsReceivedFrom")
        public long getNumberXSiteRequestsReceivedFrom​(@Parameter(name="srcSite",description="Originator site name")
                                                       String srcSite)
      • setCrossSiteReplicationTimes

        @ManagedAttribute(description="Cross Site Replication Times",
                          displayName="Cross Site Replication Times",
                          dataType=TIMER,
                          units=NANOSECONDS)
        public void setCrossSiteReplicationTimes​(TimerTracker timer)
      • 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