public abstract class ClusterCheck extends Object implements org.apache.ambari.spi.upgrade.UpgradeCheck
UpgradeCheck
which offers injected helpers and access
to information about repositories and the cluster.Modifier and Type | Field and Description |
---|---|
protected com.google.inject.Provider<Clusters> |
clustersProvider |
Modifier | Constructor and Description |
---|---|
protected |
ClusterCheck(org.apache.ambari.spi.upgrade.UpgradeCheckDescription description)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected String |
formatEntityList(LinkedHashSet<String> entities)
Formats lists of given entities to human readable form:
[entity1] -> {entity1} {noun}
[entity1, entity2] -> {entity1} and {entity2} {noun}s
[entity1, entity2, entity3] -> {entity1}, {entity2} and {entity3} {noun}s
The noun for the entities is taken from check type, it may be cluster, service or host.
|
Set<String> |
getApplicableServices()
Gets the set of services that this check is associated with.
|
org.apache.ambari.spi.upgrade.UpgradeCheckDescription |
getCheckDescription() |
org.apache.ambari.spi.upgrade.UpgradeCheckDescription |
getDescription()
Gets the description of the check.
|
protected String |
getFailReason(String key,
org.apache.ambari.spi.upgrade.UpgradeCheckResult upgradeCheckResult,
org.apache.ambari.spi.upgrade.UpgradeCheckRequest request)
Gets the fail reason
|
protected String |
getFailReason(org.apache.ambari.spi.upgrade.UpgradeCheckResult upgradeCheckResult,
org.apache.ambari.spi.upgrade.UpgradeCheckRequest request)
Gets the default fail reason
|
protected String |
getProperty(org.apache.ambari.spi.upgrade.UpgradeCheckRequest request,
String configType,
String propertyName)
Gets a cluster configuration property if it exists, or
null
otherwise. |
List<org.apache.ambari.spi.upgrade.CheckQualification> |
getQualifications()
Gets any additional qualifications which an upgrade check should run in
order to determine if it's applicable to the upgrade.
|
@Inject protected com.google.inject.Provider<Clusters> clustersProvider
protected ClusterCheck(org.apache.ambari.spi.upgrade.UpgradeCheckDescription description)
description
- descriptionpublic org.apache.ambari.spi.upgrade.UpgradeCheckDescription getCheckDescription()
getCheckDescription
in interface org.apache.ambari.spi.upgrade.UpgradeCheck
public Set<String> getApplicableServices()
getApplicableServices
in interface org.apache.ambari.spi.upgrade.UpgradeCheck
public List<org.apache.ambari.spi.upgrade.CheckQualification> getQualifications()
getQualifications
in interface org.apache.ambari.spi.upgrade.UpgradeCheck
public org.apache.ambari.spi.upgrade.UpgradeCheckDescription getDescription()
null
).protected String getFailReason(org.apache.ambari.spi.upgrade.UpgradeCheckResult upgradeCheckResult, org.apache.ambari.spi.upgrade.UpgradeCheckRequest request) throws org.apache.ambari.server.AmbariException
upgradeCheckResult
- the check being performedrequest
- the requestorg.apache.ambari.server.AmbariException
protected String getProperty(org.apache.ambari.spi.upgrade.UpgradeCheckRequest request, String configType, String propertyName) throws org.apache.ambari.server.AmbariException
null
otherwise.request
- the request (not null
).configType
- the configuration type, such as hdfs-site
(not
null
).propertyName
- the name of the property (not null
).null
if not found.org.apache.ambari.server.AmbariException
protected String getFailReason(String key, org.apache.ambari.spi.upgrade.UpgradeCheckResult upgradeCheckResult, org.apache.ambari.spi.upgrade.UpgradeCheckRequest request) throws org.apache.ambari.server.AmbariException
key
- the failure text keyUpgradeCheck
- the check being performedrequest
- the requestorg.apache.ambari.server.AmbariException
protected String formatEntityList(LinkedHashSet<String> entities)
entities
- list of entities to formatCopyright © 2022 Apache Software Foundation. All rights reserved.