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-11236. RU: Clarify Prerequisite Check for Service and MM details (dlysnichenko)
Date Tue, 19 May 2015 15:52:29 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e3d5fd618 -> 7e8d3dea8


AMBARI-11236. RU: Clarify Prerequisite Check for Service and MM details (dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 7e8d3dea89a9ff80f7e7e315498f71ff97c521b2
Parents: e3d5fd6
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Tue May 19 18:51:55 2015 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Tue May 19 18:51:55 2015 +0300

----------------------------------------------------------------------
 .../ambari/server/checks/ServicesMaintenanceModeCheck.java      | 2 +-
 .../ambari/server/checks/ServicesMaintenanceModeCheckTest.java  | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7e8d3dea/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 2b5ff49..5108afd 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
@@ -50,7 +50,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.isClientOnlyService() && (service.getDesiredState() != State.STARTED
|| service.getMaintenanceState() == MaintenanceState.ON)) {
+      if (!service.isClientOnlyService() && service.getMaintenanceState() == MaintenanceState.ON)
{
         prerequisiteCheck.getFailedOn().add(service.getName());
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/7e8d3dea/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
index 8b5cdb1..87ced01 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/checks/ServicesMaintenanceModeCheckTest.java
@@ -76,11 +76,12 @@ public class ServicesMaintenanceModeCheckTest {
     final Service service = Mockito.mock(Service.class);
     Mockito.when(cluster.getServices()).thenReturn(Collections.singletonMap("service", service));
     Mockito.when(service.isClientOnlyService()).thenReturn(false);
-    Mockito.when(service.getDesiredState()).thenReturn(State.UNKNOWN);
 
+    // We don't bother checking service desired state as it's performed by a separate check
+    Mockito.when(service.getDesiredState()).thenReturn(State.UNKNOWN);
     PrerequisiteCheck check = new PrerequisiteCheck(null, null);
     servicesMaintenanceModeCheck.perform(check, new PrereqCheckRequest("cluster"));
-    Assert.assertEquals(PrereqCheckStatus.FAIL, check.getStatus());
+    Assert.assertEquals(PrereqCheckStatus.PASS, check.getStatus());
 
     Mockito.when(service.getDesiredState()).thenReturn(State.STARTED);
     check = new PrerequisiteCheck(null, null);


Mime
View raw message