ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject ambari git commit: AMBARI-9221. RU: says I do not have WPR enabled but it is set (yshylov via dlysnichenko)
Date Wed, 21 Jan 2015 12:25:47 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk f3b73cd3a -> ea9e63662


AMBARI-9221. RU: says I do not have WPR enabled but it is set (yshylov via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: ea9e63662cce6f3993918b11b35ded7c0f41c027
Parents: f3b73cd
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Wed Jan 21 14:24:53 2015 +0200
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Wed Jan 21 14:24:53 2015 +0200

----------------------------------------------------------------------
 .../server/checks/HostsRepositoryVersionCheck.java  | 16 ++++++++++++----
 .../server/checks/ServicesMaintenanceModeCheck.java |  2 +-
 .../checks/ServicesYarnWorkPreservingCheck.java     |  3 ++-
 3 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ea9e6366/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 267c625..53e628c 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
@@ -17,6 +17,8 @@
  */
 package org.apache.ambari.server.checks;
 
+import java.util.Map;
+
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.controller.PrereqCheckRequest;
 import org.apache.ambari.server.orm.entities.HostVersionEntity;
@@ -25,11 +27,10 @@ import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Host;
 import org.apache.ambari.server.state.MaintenanceState;
 import org.apache.ambari.server.state.RepositoryVersionState;
-import org.apache.ambari.server.state.stack.PrerequisiteCheck;
+import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrereqCheckType;
-
-import java.util.Map;
+import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 
 /**
  * Checks that all hosts have particular repository version.
@@ -53,10 +54,17 @@ public class HostsRepositoryVersionCheck extends AbstractCheckDescriptor
{
     final String clusterName = request.getClusterName();
     final Cluster cluster = clustersProvider.get().getCluster(clusterName);
     final Map<String, Host> clusterHosts = clustersProvider.get().getHostsForCluster(clusterName);
+    final StackId stackId = cluster.getDesiredStackVersion();
     for (Map.Entry<String, Host> hostEntry : clusterHosts.entrySet()) {
       final Host host = hostEntry.getValue();
       if (host.getMaintenanceState(cluster.getClusterId()) == MaintenanceState.OFF) {
-        final RepositoryVersionEntity repositoryVersion = repositoryVersionDaoProvider.get().findByDisplayName(request.getRepositoryVersion());
+        final RepositoryVersionEntity repositoryVersion = repositoryVersionDaoProvider.get().findByStackAndVersion(stackId.getStackId(),
request.getRepositoryVersion());
+        if (repositoryVersion == null) {
+          prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
+          prerequisiteCheck.setFailReason("Repository version " + request.getRepositoryVersion()
+ " doesn't exist");
+          prerequisiteCheck.getFailedOn().addAll(clusterHosts.keySet());
+          return;
+        }
         final HostVersionEntity hostVersion = hostVersionDaoProvider.get().findByClusterStackVersionAndHost(clusterName,
repositoryVersion.getStack(), repositoryVersion.getVersion(), host.getHostName());
         if (hostVersion == null || hostVersion.getState() != RepositoryVersionState.INSTALLED)
{
           prerequisiteCheck.getFailedOn().add(host.getHostName());

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea9e6366/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 c448ec3..332b58a 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
@@ -47,7 +47,7 @@ public class ServicesMaintenanceModeCheck extends AbstractCheckDescriptor
{
     final Cluster cluster = clustersProvider.get().getCluster(clusterName);
     for (Map.Entry<String, Service> serviceEntry : cluster.getServices().entrySet())
{
       final Service service = serviceEntry.getValue();
-      if (service.getDesiredState() != State.STARTED || service.getMaintenanceState() ==
MaintenanceState.ON) {
+      if (!service.isClientOnlyService() && (service.getDesiredState() != State.STARTED
|| service.getMaintenanceState() == MaintenanceState.ON)) {
         prerequisiteCheck.getFailedOn().add(service.getName());
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea9e6366/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesYarnWorkPreservingCheck.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesYarnWorkPreservingCheck.java
b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesYarnWorkPreservingCheck.java
index 7ab6e01..f9249b2 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesYarnWorkPreservingCheck.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/checks/ServicesYarnWorkPreservingCheck.java
@@ -26,6 +26,7 @@ import org.apache.ambari.server.state.DesiredConfig;
 import org.apache.ambari.server.state.stack.PrerequisiteCheck;
 import org.apache.ambari.server.state.stack.PrereqCheckStatus;
 import org.apache.ambari.server.state.stack.PrereqCheckType;
+import org.apache.commons.lang.BooleanUtils;
 
 import java.util.Map;
 
@@ -61,7 +62,7 @@ public class ServicesYarnWorkPreservingCheck extends AbstractCheckDescriptor
{
     final DesiredConfig desiredConfig = desiredConfigs.get(configType);
     final Config config = cluster.getConfig(configType, desiredConfig.getTag());
     if (!config.getProperties().containsKey("yarn.resourcemanager.work-preserving-recovery.enabled")
||
-      !Boolean.getBoolean(config.getProperties().get("yarn.resourcemanager.work-preserving-recovery.enabled")))
{
+      !BooleanUtils.toBoolean(config.getProperties().get("yarn.resourcemanager.work-preserving-recovery.enabled")))
{
       prerequisiteCheck.getFailedOn().add("YARN");
       prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL);
       prerequisiteCheck.setFailReason("YARN doesn't have work preserving restart, yarn.resourcemanager.work-preserving-recovery.enabled
property is missing");


Mime
View raw message