public class RecoveryConfigHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
RECOVERY_ENABLED_KEY
Recovery related configuration
|
static String |
RECOVERY_LIFETIME_MAX_COUNT_DEFAULT |
static String |
RECOVERY_LIFETIME_MAX_COUNT_KEY |
static String |
RECOVERY_MAX_COUNT_DEFAULT |
static String |
RECOVERY_MAX_COUNT_KEY |
static String |
RECOVERY_RETRY_GAP_DEFAULT |
static String |
RECOVERY_RETRY_GAP_KEY |
static String |
RECOVERY_TYPE_DEFAULT |
static String |
RECOVERY_TYPE_KEY |
static String |
RECOVERY_WINDOW_IN_MIN_DEFAULT |
static String |
RECOVERY_WINDOW_IN_MIN_KEY |
| Constructor and Description |
|---|
RecoveryConfigHelper(AmbariEventPublisher eventPublisher) |
| Modifier and Type | Method and Description |
|---|---|
RecoveryConfig |
getDefaultRecoveryConfig() |
RecoveryConfig |
getRecoveryConfig(String clusterName,
String hostname) |
void |
handleClusterEnvConfigChangedEvent(ClusterConfigChangedEvent event)
Cluster-env configuration changed.
|
void |
handleMaintenanceModeEvent(MaintenanceModeEvent event)
Maintenance mode of a host, service or service component host changed.
|
void |
handleServiceComponentInstalledEvent(ServiceComponentInstalledEvent event)
A service component was installed on a host.
|
void |
handleServiceComponentRecoveryChangedEvent(ServiceComponentRecoveryChangedEvent event)
Recovery enabled was turned on or off.
|
void |
handleServiceComponentUninstalledEvent(ServiceComponentUninstalledEvent event)
A service component was uninstalled from a host.
|
boolean |
isConfigStale(String clusterName,
String hostname,
long recoveryTimestamp)
Computes if the recovery configuration was updated since the last time it was sent to the agent.
|
public static final String RECOVERY_ENABLED_KEY
public static final String RECOVERY_TYPE_KEY
public static final String RECOVERY_TYPE_DEFAULT
public static final String RECOVERY_LIFETIME_MAX_COUNT_KEY
public static final String RECOVERY_LIFETIME_MAX_COUNT_DEFAULT
public static final String RECOVERY_MAX_COUNT_KEY
public static final String RECOVERY_MAX_COUNT_DEFAULT
public static final String RECOVERY_WINDOW_IN_MIN_KEY
public static final String RECOVERY_WINDOW_IN_MIN_DEFAULT
public static final String RECOVERY_RETRY_GAP_KEY
public static final String RECOVERY_RETRY_GAP_DEFAULT
@Inject public RecoveryConfigHelper(AmbariEventPublisher eventPublisher)
public RecoveryConfig getDefaultRecoveryConfig() throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariExceptionpublic RecoveryConfig getRecoveryConfig(String clusterName, String hostname) throws org.apache.ambari.server.AmbariException
org.apache.ambari.server.AmbariExceptionpublic boolean isConfigStale(String clusterName, String hostname, long recoveryTimestamp)
clusterName - - Name of the cluster which the host belongs to.hostname - - Host name from agent.recoveryTimestamp - - Time when the recovery configuration was last sent to the agent. Agent
stores this value and sends it during each heartbeat. -1 if agent was
restarted or configuration was not sent to the agent since it started.public void handleMaintenanceModeEvent(MaintenanceModeEvent event) throws org.apache.ambari.server.AmbariException
event - org.apache.ambari.server.AmbariExceptionpublic void handleServiceComponentInstalledEvent(ServiceComponentInstalledEvent event) throws org.apache.ambari.server.AmbariException
event - org.apache.ambari.server.AmbariExceptionpublic void handleServiceComponentUninstalledEvent(ServiceComponentUninstalledEvent event) throws org.apache.ambari.server.AmbariException
event - org.apache.ambari.server.AmbariExceptionpublic void handleServiceComponentRecoveryChangedEvent(ServiceComponentRecoveryChangedEvent event)
event - public void handleClusterEnvConfigChangedEvent(ClusterConfigChangedEvent event)
event - Copyright © 2022 Apache Software Foundation. All rights reserved.