Class ProcessingUnitAlertGroups
java.lang.Object
org.openspaces.admin.internal.alert.bean.util.ProcessingUnitAlertGroups
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intmax number of undeployed processing unit names / space name associations retained (least recently used are evicted), to bound the state across many deployments. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidalertTriggered(String confirmedProcessingUnitName, String fallbackName, Alert alert) A resolved alert stops tracking its group; any other alert updates the group or starts tracking it.voidalertTriggered(SpaceInstance spaceInstance, Alert alert) Should be called for every alert triggered by the bean for the given space instance.booleanisUndeployed(String confirmedProcessingUnitName, String fallbackName, Predicate<String> isDeployed) booleanisUndeployed(SpaceInstance spaceInstance, Predicate<String> isDeployed) An in-flight event (e.g.voidresolveAll(String processingUnitName, AlertManager alertManager, Function<Alert, Alert> wrapper) Triggers aAlertStatus.RESOLVEDalert for each open alert group of the undeployed processing unit.
-
Field Details
-
MAX_RETAINED_NAMES
public static final int MAX_RETAINED_NAMESmax 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
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
-
alertTriggered
Should be called for every alert triggered by the bean for the given space instance. -
alertTriggered
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 aAlertStatus.RESOLVEDalert 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)
-