Class ProcessingUnitAlertGroups

java.lang.Object
org.openspaces.admin.internal.alert.bean.util.ProcessingUnitAlertGroups

public class ProcessingUnitAlertGroups extends Object
Keeps track of the open (raised/NA) alert groups of an alert bean per processing unit, so that they can be resolved once the processing unit is undeployed - after undeploy the alerting components (space instances) are gone, and no other event would resolve these groups.
  • Field Details

    • MAX_RETAINED_NAMES

      public static final int MAX_RETAINED_NAMES
      max number of undeployed processing unit names / space name associations retained (least recently used are evicted), to bound the state across many deployments.
      See Also:
  • Constructor Details

    • ProcessingUnitAlertGroups

      public ProcessingUnitAlertGroups()
  • Method Details

    • isUndeployed

      public boolean isUndeployed(SpaceInstance spaceInstance, Predicate<String> isDeployed)
      An in-flight event (e.g. statistics poll) may be delivered after the processing unit was removed; such alerts would never be resolved, so the bean should not trigger them.
      Parameters:
      isDeployed - tells whether a processing unit with the given name is currently deployed.
      Returns:
      true if a non-resolved alert of this space instance should not be triggered since its processing unit was undeployed.
    • isUndeployed

      public boolean isUndeployed(String confirmedProcessingUnitName, String fallbackName, Predicate<String> isDeployed)
    • alertTriggered

      public void alertTriggered(SpaceInstance spaceInstance, Alert alert)
      Should be called for every alert triggered by the bean for the given space instance.
    • alertTriggered

      public void alertTriggered(String confirmedProcessingUnitName, String fallbackName, Alert alert)
      A resolved alert stops tracking its group; any other alert updates the group or starts tracking it. A group tracked under the fallback name is moved to the confirmed processing unit name once known; a confirmed owner is never overwritten.
      Parameters:
      confirmedProcessingUnitName - the hosting processing unit name; null if unknown.
      fallbackName - name to track the group under if the processing unit is unknown (the space name).
    • resolveAll

      public void resolveAll(String processingUnitName, AlertManager alertManager, Function<Alert,Alert> wrapper)
      Triggers a AlertStatus.RESOLVED alert for each open alert group of the undeployed processing unit.
      Parameters:
      wrapper - wraps the resolution alert with the bean specific alert type (e.g. ReplicationChannelDisconnectedAlert::new)