ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject ambari git commit: AMBARI-19285 - HOU pre-checks indicate HA as a requirement (jonathanhurley)
Date Fri, 23 Dec 2016 15:50:34 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 163fa4c9c -> 2304971d0


AMBARI-19285 - HOU pre-checks indicate HA as a requirement (jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2304971d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2304971d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2304971d

Branch: refs/heads/trunk
Commit: 2304971d09f3c525ebd2b1cf864d82ee9b858d5e
Parents: 163fa4c
Author: Jonathan Hurley <jhurley@hortonworks.com>
Authored: Thu Dec 22 12:07:25 2016 -0500
Committer: Jonathan Hurley <jhurley@hortonworks.com>
Committed: Fri Dec 23 10:50:25 2016 -0500

----------------------------------------------------------------------
 .../server/checks/AbstractCheckDescriptor.java  |  22 +++-
 .../ambari/server/checks/CheckDescription.java  |   6 -
 .../server/checks/ClientRetryPropertyCheck.java |   5 +-
 .../checks/ComponentsInstallationCheck.java     |   6 +-
 .../server/checks/ConfigurationMergeCheck.java  |   5 +-
 .../HardcodedStackVersionPropertiesCheck.java   |   5 +-
 .../ambari/server/checks/HealthCheck.java       |   5 +-
 .../HiveDynamicServiceDiscoveryCheck.java       |   6 +-
 .../server/checks/HiveNotRollingWarning.java    |   2 +-
 .../server/checks/HostMaintenanceModeCheck.java |   5 +-
 .../server/checks/HostsHeartbeatCheck.java      |   6 +-
 .../checks/HostsMasterMaintenanceCheck.java     |   7 +-
 .../checks/HostsRepositoryVersionCheck.java     |   5 +-
 .../server/checks/InstallPackagesCheck.java     |   6 +-
 .../server/checks/PreviousUpgradeCompleted.java |   8 +-
 .../server/checks/RangerPasswordCheck.java      |   6 +-
 .../checks/ServiceCheckValidityCheck.java       |   5 +-
 .../checks/ServicesMaintenanceModeCheck.java    |   8 +-
 .../ambari/server/checks/ServicesUpCheck.java   |   6 +-
 .../server/checks/StormRestAPIDeletedCheck.java | 109 -------------------
 .../server/checks/StormShutdownWarning.java     |   2 +-
 .../ambari/server/checks/UpgradeCheck.java      |  14 ++-
 .../server/checks/UpgradeCheckRegistry.java     |   2 +-
 .../server/checks/VersionMismatchCheck.java     |   6 +-
 .../HDP/2.5/upgrades/host-ordered-upgrade.xml   |  12 --
 .../checks/AbstractCheckDescriptorTest.java     |  70 ++++++++++++
 26 files changed, 181 insertions(+), 158 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
index 3fc8650..36467c9 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/AbstractCheckDescriptor.java
@@ -37,7 +37,9 @@ import org.apache.ambari.server.state.DesiredConfig;
 import org.apache.ambari.server.state.ServiceInfo;
 import org.apache.ambari.server.state.stack.PrereqCheckType;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.UpgradePack;
 import org.apache.ambari.server.state.stack.upgrade.RepositoryVersionHelper;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -283,13 +285,23 @@ public abstract class AbstractCheckDescriptor {
   }
 
   /**
-   * Return the optionality flag of the Upgrade Check
-   * @return
+   * Gets whether this upgrade check is required for the specified
+   * {@link UpgradeType}. Checks which are marked as required do not need to be
+   * explicitely declared in the {@link UpgradePack} to be run.
+   *
+   * @return {@code true} if it is required, {@code false} otherwise.
    */
-  public Boolean isRequired(){
-      return getClass().getAnnotation(UpgradeCheck.class).required();
+  public boolean isRequired(UpgradeType upgradeType) {
+    UpgradeType[] upgradeTypes = getClass().getAnnotation(UpgradeCheck.class).required();
+    for (UpgradeType requiredType : upgradeTypes) {
+      if (upgradeType == requiredType) {
+        return true;
+      }
+    }
+
+    return false;
   }
-  
+
   /**
    * Return a boolean indicating whether or not configs allow bypassing errors during the
RU/EU PreChecks.
    * @return

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
index 45497b5..a204ada 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/CheckDescription.java
@@ -96,12 +96,6 @@ public class CheckDescription {
     new ImmutableMap.Builder<String, String>()
       .put(AbstractCheckDescriptor.DEFAULT, "The SNameNode component must be deleted from
host: %s.").build());
 
-  public static CheckDescription STORM_REST_API_MUST_BE_DELETED = new CheckDescription("STORM_REST_API_MUST_BE_DELETED",
-    PrereqCheckType.SERVICE,
-    "The STORM_REST_API component will no longer be available and must be deleted from the
cluster before upgrading. The same functionality is now provided by STORM_UI_SERVER. First,
stop the entire Storm service. Next, delete STORM_REST_API using the API, e.g., curl -u $user:$password
-X DELETE -H 'X-Requested-By:admin' http://$server:8080/api/v1/clusters/$name/services/STORM/components/STORM_REST_API
. Finally, start Storm service.",
-    new ImmutableMap.Builder<String, String>()
-      .put(AbstractCheckDescriptor.DEFAULT, "The following component must be deleted from
the cluster: {{fails}}.").build());
-
   public static CheckDescription SERVICES_HIVE_MULTIPLE_METASTORES = new CheckDescription("SERVICES_HIVE_MULTIPLE_METASTORES",
     PrereqCheckType.SERVICE,
     "Hive Metastore Availability",

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/ClientRetryPropertyCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ClientRetryPropertyCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ClientRetryPropertyCheck.java
index 18fb2ad..226d82c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ClientRetryPropertyCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ClientRetryPropertyCheck.java
@@ -28,6 +28,7 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Singleton;
@@ -37,7 +38,9 @@ import com.google.inject.Singleton;
  * client retry properties for HIVE and OOZIE are set, but not for HDFS.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.CLIENT_RETRY_PROPERTY, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.CLIENT_RETRY_PROPERTY,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class ClientRetryPropertyCheck extends AbstractCheckDescriptor {
 
   static final String HDFS_CLIENT_RETRY_DISABLED_KEY = "hdfs.client.retry.enabled.key";

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsInstallationCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsInstallationCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsInstallationCheck.java
index 455a92d..09872f2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsInstallationCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ComponentsInstallationCheck.java
@@ -36,6 +36,7 @@ import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Singleton;
@@ -44,7 +45,10 @@ import com.google.inject.Singleton;
  * Checks that service components are installed.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.LIVELINESS, order = 2.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.LIVELINESS,
+    order = 2.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class ComponentsInstallationCheck extends AbstractCheckDescriptor {
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/ConfigurationMergeCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ConfigurationMergeCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ConfigurationMergeCheck.java
index dd1385b..c5e3807 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ConfigurationMergeCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ConfigurationMergeCheck.java
@@ -29,6 +29,7 @@ import org.apache.ambari.server.state.ConfigMergeHelper;
 import org.apache.ambari.server.state.ConfigMergeHelper.ThreeWayValue;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Inject;
@@ -38,7 +39,9 @@ import com.google.inject.Singleton;
  * Checks for configuration merge conflicts.
  */
 @Singleton
-@UpgradeCheck(order = 99.0f, required = true)
+@UpgradeCheck(
+    order = 99.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class ConfigurationMergeCheck extends AbstractCheckDescriptor {
 
   @Inject

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/HardcodedStackVersionPropertiesCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HardcodedStackVersionPropertiesCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HardcodedStackVersionPropertiesCheck.java
index 11d6676..314d1a7 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HardcodedStackVersionPropertiesCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HardcodedStackVersionPropertiesCheck.java
@@ -35,6 +35,7 @@ import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.DesiredConfig;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -47,7 +48,9 @@ import com.google.inject.Singleton;
  * That is a potential problem when doing stack update.
  */
 @Singleton
-@UpgradeCheck(order = 98.0f, required = true)
+@UpgradeCheck(
+    order = 98.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class HardcodedStackVersionPropertiesCheck extends AbstractCheckDescriptor {
 
   @Inject

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/HealthCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HealthCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HealthCheck.java
index b75e923..8feb77a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HealthCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HealthCheck.java
@@ -35,6 +35,7 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Inject;
@@ -46,7 +47,9 @@ import com.google.inject.Singleton;
  * That is a potential problem when doing stack update.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.DEFAULT, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.DEFAULT,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class HealthCheck extends AbstractCheckDescriptor {
 
   private static final List<AlertState> ALERT_STATES = asList(WARNING, CRITICAL);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveDynamicServiceDiscoveryCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveDynamicServiceDiscoveryCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveDynamicServiceDiscoveryCheck.java
index 6289ff5..1dd4159 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveDynamicServiceDiscoveryCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveDynamicServiceDiscoveryCheck.java
@@ -27,6 +27,7 @@ import org.apache.ambari.server.controller.PrereqCheckRequest;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.UpgradePack.PrerequisiteCheckConfig;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.commons.lang.StringUtils;
 
@@ -37,7 +38,10 @@ import com.google.inject.Singleton;
  * is properly configured for dynamic discovery.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.DEFAULT, order = 20.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.DEFAULT,
+    order = 20.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING })
 public class HiveDynamicServiceDiscoveryCheck extends AbstractCheckDescriptor {
 
   static final String HIVE_DYNAMIC_SERVICE_DISCOVERY_ENABLED_KEY = "hive.dynamic-service.discovery.enabled.key";

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
index 5e44c7c..2b1c62e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HiveNotRollingWarning.java
@@ -40,7 +40,7 @@ import com.google.inject.Singleton;
  * that at this point in time, Hive will not be upgraded in a rolling fashion.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.INFORMATIONAL_WARNING, required = true)
+@UpgradeCheck(group = UpgradeCheckGroup.INFORMATIONAL_WARNING, required = UpgradeType.ROLLING)
 public class HiveNotRollingWarning extends AbstractCheckDescriptor {
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
index 88d9de6..3125c26 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostMaintenanceModeCheck.java
@@ -40,7 +40,10 @@ import com.google.inject.Singleton;
  * @see HostsHeartbeatCheck
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.MAINTENANCE_MODE, order = 7.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.MAINTENANCE_MODE,
+    order = 7.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class HostMaintenanceModeCheck extends AbstractCheckDescriptor {
 
   public static final String KEY_CANNOT_START_HOST_ORDERED = "cannot_upgrade_mm_hosts";

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
index 1f1980f..3218807 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsHeartbeatCheck.java
@@ -27,6 +27,7 @@ import org.apache.ambari.server.state.HostHealthStatus.HealthStatus;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 
 import com.google.inject.Singleton;
 
@@ -41,7 +42,10 @@ import com.google.inject.Singleton;
  * @see HostMaintenanceModeCheck
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.LIVELINESS, order = 1.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.LIVELINESS,
+    order = 1.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class HostsHeartbeatCheck extends AbstractCheckDescriptor {
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
index eaedd3f..01bf6ae 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsMasterMaintenanceCheck.java
@@ -33,6 +33,7 @@ import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.UpgradePack;
 import org.apache.ambari.server.state.stack.UpgradePack.ProcessingComponent;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 
 import com.google.inject.Singleton;
 
@@ -40,7 +41,10 @@ import com.google.inject.Singleton;
  * Checks that all hosts in maintenance state do not have master components.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.MAINTENANCE_MODE, order = 5.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.MAINTENANCE_MODE,
+    order = 5.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class HostsMasterMaintenanceCheck extends AbstractCheckDescriptor {
 
   static final String KEY_NO_UPGRADE_NAME = "no_upgrade_name";
@@ -53,6 +57,7 @@ public class HostsMasterMaintenanceCheck extends AbstractCheckDescriptor
{
     super(CheckDescription.HOSTS_MASTER_MAINTENANCE);
   }
 
+  @Override
   public boolean isApplicable(PrereqCheckRequest request) throws AmbariException {
       return super.isApplicable(request) && request.getRepositoryVersion() != null;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
index 620c651..a4cea31 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/HostsRepositoryVersionCheck.java
@@ -31,6 +31,7 @@ import org.apache.ambari.server.state.RepositoryVersionState;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 
 import com.google.inject.Singleton;
 
@@ -41,7 +42,9 @@ import com.google.inject.Singleton;
  * orchstration, so no warning is required.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.REPOSITORY_VERSION, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.REPOSITORY_VERSION,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class HostsRepositoryVersionCheck extends AbstractCheckDescriptor {
 
   static final String KEY_NO_REPO_VERSION = "no_repo_version";

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/InstallPackagesCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/InstallPackagesCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/InstallPackagesCheck.java
index 52546d2..38bdda2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/InstallPackagesCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/InstallPackagesCheck.java
@@ -34,6 +34,7 @@ import org.apache.ambari.server.state.RepositoryVersionState;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Singleton;
@@ -42,7 +43,10 @@ import com.google.inject.Singleton;
  * Checks if Install Packages needs to be re-run
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.DEFAULT, order = 3.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.DEFAULT,
+    order = 3.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class InstallPackagesCheck extends AbstractCheckDescriptor {
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
index a77ad9f..ff82750 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/PreviousUpgradeCompleted.java
@@ -35,6 +35,7 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -43,7 +44,10 @@ import com.google.inject.Singleton;
  * Checks if Install Packages needs to be re-run
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.DEFAULT, order = 4.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.DEFAULT,
+    order = 4.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class PreviousUpgradeCompleted extends AbstractCheckDescriptor {
 
   /**
@@ -105,7 +109,7 @@ public class PreviousUpgradeCompleted extends AbstractCheckDescriptor
{
           // Should have only 1 element.
           List<HostRoleCommandEntity> finalizeCommandList = hostRoleCommandDaoProvider.get().
               findSortedCommandsByRequestIdAndCustomCommandName(mostRecentUpgrade.getRequestId(),
FINALIZE_ACTION_CLASS_NAME);
-  
+
           // If the action is not COMPLETED, then something went wrong.
           if (finalizeCommandList != null) {
             for (HostRoleCommandEntity command : finalizeCommandList) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/RangerPasswordCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/RangerPasswordCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/RangerPasswordCheck.java
index 5e2db33..a55a148 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/RangerPasswordCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/RangerPasswordCheck.java
@@ -36,6 +36,7 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.ambari.server.utils.VersionUtils;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.lang.StringUtils;
@@ -50,7 +51,10 @@ import com.google.inject.Singleton;
  * user had changed the password using the Ranger UI.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.CONFIGURATION_WARNING, order = 23.0f, required=true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.CONFIGURATION_WARNING,
+    order = 23.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class RangerPasswordCheck extends AbstractCheckDescriptor {
 
   private static final Logger LOG = LoggerFactory.getLogger(RangerPasswordCheck.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
index b77e1d5..34b45bd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServiceCheckValidityCheck.java
@@ -49,6 +49,7 @@ import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.ServiceComponent;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,7 +64,9 @@ import com.google.inject.Singleton;
  * That is a potential problem when doing stack update.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.DEFAULT, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.DEFAULT,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class ServiceCheckValidityCheck extends AbstractCheckDescriptor {
 
   private static final Logger LOG = LoggerFactory.getLogger(ServiceCheckValidityCheck.class);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheck.java
index 18a5bde..08f4fd8 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheck.java
@@ -26,14 +26,18 @@ import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 
 import com.google.inject.Singleton;
 
 /**
- * Checks that services are in the maintenance mode.
+ * Checks to ensure that services are not in maintenance mode.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.MAINTENANCE_MODE, order = 6.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.MAINTENANCE_MODE,
+    order = 6.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class ServicesMaintenanceModeCheck extends AbstractCheckDescriptor {
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesUpCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesUpCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesUpCheck.java
index d4c7894..d838f6a 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesUpCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesUpCheck.java
@@ -38,6 +38,7 @@ import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Singleton;
@@ -63,7 +64,10 @@ import com.google.inject.Singleton;
  * want hosts to be scehdule for upgrade of their other components.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.LIVELINESS, order = 2.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.LIVELINESS,
+    order = 2.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class ServicesUpCheck extends AbstractCheckDescriptor {
 
   private static final float SLAVE_THRESHOLD = 0.5f;

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/StormRestAPIDeletedCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/StormRestAPIDeletedCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/StormRestAPIDeletedCheck.java
deleted file mode 100644
index 90eea97..0000000
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/StormRestAPIDeletedCheck.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.ambari.server.checks;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.ambari.server.AmbariException;
-import org.apache.ambari.server.ServiceComponentNotFoundException;
-import org.apache.ambari.server.ServiceNotFoundException;
-import org.apache.ambari.server.controller.PrereqCheckRequest;
-import org.apache.ambari.server.orm.dao.HostComponentStateDAO;
-import org.apache.ambari.server.orm.entities.HostComponentStateEntity;
-import org.apache.ambari.server.state.Cluster;
-import org.apache.ambari.server.state.ServiceComponent;
-import org.apache.ambari.server.state.stack.PrereqCheckStatus;
-import org.apache.ambari.server.state.stack.PrerequisiteCheck;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
-/**
- * The {@link StormRestAPIDeletedCheck}
- * checks that STORM_REST_API Component is deleted when upgrading from HDP 2.1 to 2.2 or
higher.
- */
-@Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.TOPOLOGY, order = 15.0f, required= false)
-public class StormRestAPIDeletedCheck extends AbstractCheckDescriptor {
-
-  @Inject
-  HostComponentStateDAO hostComponentStateDao;
-
-  /**
-   * Constructor.
-   */
-  public StormRestAPIDeletedCheck() {
-    super(CheckDescription.STORM_REST_API_MUST_BE_DELETED);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public boolean isApplicable(PrereqCheckRequest request) throws AmbariException {
-    if (!super.isApplicable(request, Arrays.asList("STORM"), true)) {
-      return false;
-    }
-
-    return true;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws
AmbariException {
-    Set<String> hosts = new HashSet<String>();
-    final String STORM = "STORM";
-    final String STORM_REST_API = "STORM_REST_API";
-
-    final String clusterName = request.getClusterName();
-    final Cluster cluster = clustersProvider.get().getCluster(clusterName);
-    try {
-      ServiceComponent serviceComponent = cluster.getService(STORM).getServiceComponent(STORM_REST_API);
-      if (serviceComponent != null) {
-        hosts = serviceComponent.getServiceComponentHosts().keySet();
-      }
-    } catch (ServiceNotFoundException err) {
-      // This exception can be ignored if the component doesn't exist because it is a best-attempt
at finding it.
-      ;
-    } catch (ServiceComponentNotFoundException err) {
-      // This exception can be ignored if the component doesn't exist because it is a best-attempt
at finding it.
-      ;
-    }
-
-    // Try another method to find references to STORM_REST_API
-    if (hosts.isEmpty()) {
-      List<HostComponentStateEntity> allHostComponents = hostComponentStateDao.findAll();
-      for (HostComponentStateEntity hc : allHostComponents) {
-        if (hc.getServiceName().equalsIgnoreCase(STORM) && hc.getComponentName().equalsIgnoreCase(STORM_REST_API))
{
-          hosts.add(hc.getHostName());
-        }
-      }
-    }
-
-    if (!hosts.isEmpty()) {
-      prerequisiteCheck.getFailedOn().add(STORM_REST_API);
-      prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
-      prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request));
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/StormShutdownWarning.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/StormShutdownWarning.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/StormShutdownWarning.java
index 3ed7a27..b5435f1 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/StormShutdownWarning.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/StormShutdownWarning.java
@@ -38,7 +38,7 @@ import com.google.inject.Singleton;
  * Storm and the type of upgrade.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.INFORMATIONAL_WARNING, required = false)
+@UpgradeCheck(group = UpgradeCheckGroup.INFORMATIONAL_WARNING, required = UpgradeType.ROLLING)
 public class StormShutdownWarning extends AbstractCheckDescriptor {
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheck.java
index 9e43560..442bf0b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheck.java
@@ -23,6 +23,8 @@ import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.Target;
 
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+
 import com.google.inject.ScopeAnnotation;
 import com.google.inject.Singleton;
 
@@ -57,10 +59,14 @@ public @interface UpgradeCheck {
   float order() default 1.0f;
 
   /**
-   * Gets whether the pre-upgrade check is required.
-   * By default, a pre-upgrade check needs to be declared in the upgrade pack. This flag
will override that setting.
+   * Gets the upgrade types for which an upgrade check is required. By default,
+   * a pre-upgrade check needs to be declared in the upgrade pack. This flag
+   * will override that setting.
+   * <p/>
+   * Leaving this blank assumes that the check is not required.
    *
-   * @return  flag state, or {@code true} if not specified
+   * @return the upgrade types which do not need the check to be explicitely
+   *         defined in the upgrade pack or an empty array for none.
    */
-  boolean required() default false;
+  UpgradeType[] required() default {};
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
index b770dd5..f4e67fd 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/UpgradeCheckRegistry.java
@@ -144,7 +144,7 @@ public class UpgradeCheckRegistry {
     List<String> prerequisiteChecks = upgradePack.getPrerequisiteChecks();
     List<AbstractCheckDescriptor> resultCheckDescriptor = new ArrayList<AbstractCheckDescriptor>();
     for (AbstractCheckDescriptor descriptor: m_upgradeChecks){
-      if (descriptor.isRequired()){
+      if (descriptor.isRequired(upgradePack.getType())) {
         resultCheckDescriptor.add(descriptor);
       } else if (prerequisiteChecks.contains(descriptor.getClass().getName())){
         resultCheckDescriptor.add(descriptor);

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
index 050d43e..3dc320b 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java
@@ -30,6 +30,7 @@ import org.apache.ambari.server.state.ServiceComponentHost;
 import org.apache.ambari.server.state.UpgradeState;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
 import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Singleton;
@@ -39,7 +40,10 @@ import com.google.inject.Singleton;
  * fail. In failure description, lists actual and expected component versions.
  */
 @Singleton
-@UpgradeCheck(group = UpgradeCheckGroup.COMPONENT_VERSION, order = 7.0f, required = true)
+@UpgradeCheck(
+    group = UpgradeCheckGroup.COMPONENT_VERSION,
+    order = 7.0f,
+    required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED })
 public class VersionMismatchCheck extends AbstractCheckDescriptor {
 
   public VersionMismatchCheck() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-ordered-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-ordered-upgrade.xml
b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-ordered-upgrade.xml
index 64c79a8..f6480bf 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-ordered-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/host-ordered-upgrade.xml
@@ -24,23 +24,11 @@
   <type>HOST_ORDERED</type>
   <prerequisite-checks>
     <!-- List of additional pre-req checks to run in addition to the required pre-reqs
-->
-    <check>org.apache.ambari.server.checks.HiveMultipleMetastoreCheck</check>
     <check>org.apache.ambari.server.checks.MapReduce2JobHistoryStatePreservingCheck</check>
-    <check>org.apache.ambari.server.checks.SecondaryNamenodeDeletedCheck</check>
     <check>org.apache.ambari.server.checks.ServicesMapReduceDistributedCacheCheck</check>
-    <check>org.apache.ambari.server.checks.ServicesNamenodeHighAvailabilityCheck</check>
     <check>org.apache.ambari.server.checks.ServicesTezDistributedCacheCheck</check>
     <check>org.apache.ambari.server.checks.ServicesYarnWorkPreservingCheck</check>
-    <check>org.apache.ambari.server.checks.YarnRMHighAvailabilityCheck</check>
     <check>org.apache.ambari.server.checks.YarnTimelineServerStatePreservingCheck</check>
-
-    <configuration>
-      <!-- Configuration properties for all pre-reqs including required pre-reqs -->
-      <!--TODO: is it required? -->
-      <check-properties name="org.apache.ambari.server.checks.HiveDynamicServiceDiscoveryCheck">
-        <property name="min-failure-stack-version">HDP-2.3.0.0</property>
-      </check-properties>
-    </configuration>
   </prerequisite-checks>
 
   <order>

http://git-wip-us.apache.org/repos/asf/ambari/blob/2304971d/ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java
index 2bcd482..e65b3e4 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/AbstractCheckDescriptorTest.java
@@ -48,6 +48,10 @@ import junit.framework.Assert;
 public class AbstractCheckDescriptorTest {
   final private Clusters clusters = EasyMock.createNiceMock(Clusters.class);
 
+  @UpgradeCheck(
+      group = UpgradeCheckGroup.DEFAULT,
+      order = 1.0f,
+      required = { UpgradeType.ROLLING, UpgradeType.NON_ROLLING, UpgradeType.HOST_ORDERED
})
   private class TestCheckImpl extends AbstractCheckDescriptor {
     private PrereqCheckType m_type;
 
@@ -74,6 +78,50 @@ public class AbstractCheckDescriptorTest {
     }
   }
 
+  @UpgradeCheck(group = UpgradeCheckGroup.DEFAULT, order = 1.0f, required = { UpgradeType.ROLLING
})
+  private class RollingTestCheckImpl extends AbstractCheckDescriptor {
+    private PrereqCheckType m_type;
+
+    RollingTestCheckImpl(PrereqCheckType type) {
+      super(null);
+      m_type = type;
+
+      clustersProvider = new Provider<Clusters>() {
+        @Override
+        public Clusters get() {
+          return clusters;
+        }
+      };
+    }
+
+    @Override
+    public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request)
+        throws AmbariException {
+    }
+  }
+
+  @UpgradeCheck(group = UpgradeCheckGroup.DEFAULT, order = 1.0f)
+  private class NotRequiredCheckTest extends AbstractCheckDescriptor {
+    private PrereqCheckType m_type;
+
+    NotRequiredCheckTest(PrereqCheckType type) {
+      super(null);
+      m_type = type;
+
+      clustersProvider = new Provider<Clusters>() {
+        @Override
+        public Clusters get() {
+          return clusters;
+        }
+      };
+    }
+
+    @Override
+    public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request)
+        throws AmbariException {
+    }
+  }
+
   @Test
   public void testFormatEntityList() {
     AbstractCheckDescriptor check = new TestCheckImpl(PrereqCheckType.HOST);
@@ -154,4 +202,26 @@ public class AbstractCheckDescriptorTest {
     Assert.assertEquals(false, check.isApplicable(request, nonExistedList, true));
   }
 
+  /**
+   * Tests {@link UpgradeCheck#required()}.
+   *
+   * @throws Exception
+   */
+  @Test
+  public void testRequired() throws Exception {
+    RollingTestCheckImpl rollingCheck = new RollingTestCheckImpl(PrereqCheckType.SERVICE);
+    Assert.assertTrue(rollingCheck.isRequired(UpgradeType.ROLLING));
+    Assert.assertFalse(rollingCheck.isRequired(UpgradeType.NON_ROLLING));
+
+    NotRequiredCheckTest notRequiredCheck = new NotRequiredCheckTest(PrereqCheckType.SERVICE);
+    Assert.assertFalse(notRequiredCheck.isRequired(UpgradeType.ROLLING));
+    Assert.assertFalse(notRequiredCheck.isRequired(UpgradeType.NON_ROLLING));
+    Assert.assertFalse(notRequiredCheck.isRequired(UpgradeType.HOST_ORDERED));
+
+    TestCheckImpl requiredCheck = new TestCheckImpl(PrereqCheckType.SERVICE);
+    Assert.assertTrue(requiredCheck.isRequired(UpgradeType.ROLLING));
+    Assert.assertTrue(requiredCheck.isRequired(UpgradeType.NON_ROLLING));
+    Assert.assertTrue(requiredCheck.isRequired(UpgradeType.HOST_ORDERED));
+  }
+
 }


Mime
View raw message