incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject svn commit: r1471186 - in /incubator/ambari/trunk: ./ ambari-server/src/main/java/org/apache/ambari/server/controller/ ambari-server/src/test/java/org/apache/ambari/server/controller/
Date Tue, 23 Apr 2013 22:46:52 GMT
Author: smohanty
Date: Tue Apr 23 22:46:52 2013
New Revision: 1471186

URL: http://svn.apache.org/r1471186
Log:
AMBARI-2007. Decom DataNode throws JS error. (smohanty)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
    incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1471186&r1=1471185&r2=1471186&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Apr 23 22:46:52 2013
@@ -774,6 +774,8 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2007. Decom DataNode throws JS error. (smohanty)
+
  AMBARI-1994. Adding component to Host should should wire-up + adjust
  associated Nagios alerts. (smohanty)
 

Modified: incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java?rev=1471186&r1=1471185&r2=1471186&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
(original)
+++ incubator/ambari/trunk/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
Tue Apr 23 22:46:52 2013
@@ -4086,11 +4086,15 @@ public class AmbariManagementControllerI
     String clusterName = null;
 
     String requestContext = "";
-    
-    if (requestProperties != null)
+
+    if (requestProperties != null) {
       requestContext = requestProperties.get(REQUEST_CONTEXT_PROPERTY);
-      
-    
+      if (requestContext == null) {
+        // guice needs a non-null value as there is no way to mark this parameter @Nullable
+        requestContext = "";
+      }
+    }
+
     String logDir = ""; //TODO empty for now
 
     for (ActionRequest actionRequest : request) {
@@ -4110,10 +4114,10 @@ public class AmbariManagementControllerI
         throw new AmbariException("Requests for different clusters found");
       }
     }
-    
+
     Stage stage = stageFactory.createNew(actionManager.getNextRequestId(),
         logDir, clusterName, requestContext);
-    
+
     stage.setStageId(0);
     for (ActionRequest actionRequest : request) {
       if (actionRequest.getActionName().contains("SERVICE_CHECK")) {
@@ -4135,7 +4139,6 @@ public class AmbariManagementControllerI
     }
   }
 
-
   @Override
   public Set<StackResponse> getStacks(Set<StackRequest> requests)
       throws AmbariException {

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java?rev=1471186&r1=1471185&r2=1471186&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
(original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
Tue Apr 23 22:46:52 2013
@@ -3486,8 +3486,6 @@ public class AmbariManagementControllerT
     assertEquals(requestProperties.get(REQUEST_CONTEXT_PROPERTY), stage.getRequestContext());
     actionRequests.add(new ActionRequest("c1", "MAPREDUCE", Role.MAPREDUCE_SERVICE_CHECK.name(),
null));
 
-
-
     response = controller.createActions(actionRequests, requestProperties);
 
     assertEquals(2, response.getTasks().size());
@@ -3495,6 +3493,11 @@ public class AmbariManagementControllerT
     List<HostRoleCommand> tasks = actionDB.getRequestTasks(response.getRequestId());
 
     assertEquals(2, tasks.size());
+
+    requestProperties.put(REQUEST_CONTEXT_PROPERTY, null);
+    response = controller.createActions(actionRequests, requestProperties);
+
+    assertEquals(2, response.getTasks().size());
   }
 
   private void createUser(String userName) throws Exception {



Mime
View raw message