Class XSiteAdminOperations

java.lang.Object
org.infinispan.xsite.XSiteAdminOperations
All Implemented Interfaces:
CustomMetricsSupplier

@MBean(objectName="XSiteAdmin", description="Exposes tooling for handling backing up data to remote sites.") public class XSiteAdminOperations extends Object implements CustomMetricsSupplier
A Managed bean exposing system administration operations for Cross-Site replication functionality (cache scope only)
Since:
5.2
Author:
Mircea Markus
  • Field Details

  • Constructor Details

    • XSiteAdminOperations

      public XSiteAdminOperations()
  • Method Details

    • siteStatusToString

      public static String siteStatusToString(SiteStatus status, Function<CacheMixedSiteStatus,String> mixedFunction)
    • siteStatusToString

      public static String siteStatusToString(SiteStatus status)
    • clusterStatus

      public Map<String,SiteStatus> clusterStatus()
    • siteStatus

      @ManagedOperation(description="Check whether the given backup site is offline or not.", displayName="Check whether the given backup site is offline or not.") public String siteStatus(@Parameter(name="site",description="The name of the backup site") String site)
    • nodeStatus

      public Map<Address,String> nodeStatus(String site)
      Gets the status of the nodes from a site
      Parameters:
      site - The name of the backup site
      Returns:
      a Map<String, String> with the Address and the status of each node in the site.
    • status

      @ManagedOperation(description="Returns the the status(offline/online) of all the configured backup sites.", displayName="Returns the the status(offline/online) of all the configured backup sites.") public String status()
    • takeSiteOffline

      @ManagedOperation(description="Takes this site offline in all nodes in the cluster.", displayName="Takes this site offline in all nodes in the cluster.") public String takeSiteOffline(@Parameter(name="site",description="The name of the backup site") String site)
    • setTakeOfflineAfterFailures

      @ManagedOperation(description="Amends the values for \'afterFailures\' for the \'TakeOffline\' functionality on all the nodes in the cluster.", displayName="Amends the values for \'TakeOffline.afterFailures\' on all the nodes in the cluster.") public String setTakeOfflineAfterFailures(@Parameter(name="site",description="The name of the backup site") String site, @Parameter(name="afterFailures",description="The number of failures after which the site will be taken offline") int afterFailures)
    • setTakeOfflineMinTimeToWait

      @ManagedOperation(description="Amends the values for \'minTimeToWait\' for the \'TakeOffline\' functionality on all the nodes in the cluster.", displayName="Amends the values for \'TakeOffline.minTimeToWait\' on all the nodes in the cluster.") public String setTakeOfflineMinTimeToWait(@Parameter(name="site",description="The name of the backup site") String site, @Parameter(name="minTimeToWait",description="The minimum amount of time in milliseconds to wait before taking a site offline") long minTimeToWait)
    • amendTakeOffline

      @ManagedOperation(description="Amends the values for \'TakeOffline\' functionality on all the nodes in the cluster.", displayName="Amends the values for \'TakeOffline\' functionality on all the nodes in the cluster.") public String amendTakeOffline(@Parameter(name="site",description="The name of the backup site") String site, @Parameter(name="afterFailures",description="The number of failures after which the site will be taken offline") int afterFailures, @Parameter(name="minTimeToWait",description="The minimum amount of time in milliseconds to wait before taking a site offline") long minTimeToWait)
    • getTakeOfflineMinTimeToWait

      @ManagedOperation(description="Returns the value of the \'minTimeToWait\' for the \'TakeOffline\' functionality.", displayName="Returns the value of the \'minTimeToWait\' for the \'TakeOffline\' functionality.") public String getTakeOfflineMinTimeToWait(@Parameter(name="site",description="The name of the backup site") String site)
    • getTakeOfflineAfterFailures

      @ManagedOperation(description="Returns the value of the \'afterFailures\' for the \'TakeOffline\' functionality.", displayName="Returns the value of the \'afterFailures\' for the \'TakeOffline\' functionality.") public String getTakeOfflineAfterFailures(@Parameter(name="site",description="The name of the backup site") String site)
    • getTakeOfflineConfiguration

      public TakeOfflineConfiguration getTakeOfflineConfiguration(String site)
    • checkSite

      public boolean checkSite(String site)
    • bringSiteOnline

      @ManagedOperation(description="Brings the given site back online on all the cluster.", displayName="Brings the given site back online on all the cluster.") public String bringSiteOnline(@Parameter(name="site",description="The name of the backup site") String site)
    • pushState

      @ManagedOperation(displayName="Push state to site", description="Pushes the state of this cache to the remote site. The remote site will be bring back online", name="pushState") public final String pushState(@Parameter(description="The destination site name",name="SiteName") String siteName)
    • getRunningStateTransfer

      public final List<String> getRunningStateTransfer()
      For debugging only!
    • getPushStateStatus

      @ManagedOperation(displayName="Push State Status", description="Shows a map with destination site name and the state transfer status.", name="PushStateStatus") public final Map<String,String> getPushStateStatus()
    • clearPushStateStatus

      @ManagedOperation(displayName="Clear State Status", description="Clears the state transfer status.", name="ClearPushStateStatus") public final String clearPushStateStatus()
    • cancelPushState

      @ManagedOperation(displayName="Cancel Push State", description="Cancels the push state to remote site.", name="CancelPushState") public final String cancelPushState(@Parameter(description="The destination site name",name="SiteName") String siteName)
    • cancelReceiveState

      @ManagedOperation(displayName="Cancel Receive State", description="Cancels the push state to this site. All the state received from state transfer will be ignored.", name="CancelReceiveState") public final String cancelReceiveState(@Parameter(description="The sending site name",name="SiteName") String siteName)
    • getSendingSiteName

      @ManagedOperation(displayName="Sending Site Name", description="Returns the site name from which this site is receiving state.", name="SendingSiteName") public final String getSendingSiteName()
    • asyncGetStateTransferMode

      public final CompletionStage<String> asyncGetStateTransferMode(String site)
    • getStateTransferMode

      @ManagedOperation(displayName="State Transfer Mode", description="Returns the cross-site replication state transfer mode.", name="GetStateTransferMode") public final String getStateTransferMode(String site)
    • asyncSetStateTransferMode

      public CompletionStage<Boolean> asyncSetStateTransferMode(String site, String mode)
    • setStateTransferMode

      @ManagedOperation(displayName="Sets State Transfer Mode", description="Sets the cross-site state transfer mode.", name="SetStateTransferMode") public final boolean setStateTransferMode(String site, String mode)
    • getCustomMetrics

      public Collection<org.infinispan.commons.stat.MetricInfo> getCustomMetrics(GlobalMetricsConfiguration configuration)
      Description copied from interface: CustomMetricsSupplier
      Extra metrics to be registered.

      These can be dynamic metrics that cannot use ManagedAttribute annotation. Extra tags can be set in MBeanMetadata.AttributeMetadata.

      Specified by:
      getCustomMetrics in interface CustomMetricsSupplier
      Parameters:
      configuration - The GlobalMetricsConfiguration. Implementation can make decision based on GlobalMetricsConfiguration.namesAsTags() or GlobalMetricsConfiguration.histograms().
      Returns:
      A list of MBeanMetadata.AttributeMetadata to be registered.