ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-21629 Update Include and Exclude Files for [HDFS]/Refreshnodes is called even if manage.include.files is set to false (dsen)
Date Tue, 08 Aug 2017 15:37:03 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 4dee0f0e8 -> 64cae8e0e


AMBARI-21629 Update Include and Exclude Files for [HDFS]/Refreshnodes is called even if manage.include.files
is set to false (dsen)


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

Branch: refs/heads/trunk
Commit: 64cae8e0e17d146ebc1d9f85b13b0ba137f2484b
Parents: 4dee0f0
Author: Dmytro Sen <dsen@apache.org>
Authored: Tue Aug 8 18:36:16 2017 +0300
Committer: Dmytro Sen <dsen@apache.org>
Committed: Tue Aug 8 18:36:16 2017 +0300

----------------------------------------------------------------------
 .../controller/AmbariCustomCommandExecutionHelper.java   | 11 ++++++++---
 .../controller/AmbariManagementControllerImpl.java       |  4 ++--
 .../controller/AmbariManagementControllerTest.java       |  4 ++--
 3 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/64cae8e0/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 5f02baa..6d97854 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -138,7 +138,7 @@ public class AmbariCustomCommandExecutionHelper {
   public final static String DECOM_SLAVE_COMPONENT = "slave_type";
   public final static String HBASE_MARK_DRAINING_ONLY = "mark_draining_only";
   public final static String UPDATE_FILES_ONLY = "update_files_only";
-  public final static String MULTI_SERVICES_DECOM_REQUEST = "multi_services_decom_request";
+  public final static String IS_ADD_OR_DELETE_SLAVE_REQUEST = "is_add_or_delete_slave_request";
 
   private final static String ALIGN_MAINTENANCE_STATE = "align_maintenance_state";
 
@@ -856,8 +856,8 @@ public class AmbariCustomCommandExecutionHelper {
     Set<String> includedHosts = getHostList(actionExecutionContext.getParameters(),
                                             DECOM_INCLUDED_HOSTS);
 
-    if (actionExecutionContext.getParameters().get(MULTI_SERVICES_DECOM_REQUEST) != null
&&
-            actionExecutionContext.getParameters().get(MULTI_SERVICES_DECOM_REQUEST).equalsIgnoreCase("true"))
{
+    if (actionExecutionContext.getParameters().get(IS_ADD_OR_DELETE_SLAVE_REQUEST) != null
&&
+            actionExecutionContext.getParameters().get(IS_ADD_OR_DELETE_SLAVE_REQUEST).equalsIgnoreCase("true"))
{
       includedHosts = getHostList(actionExecutionContext.getParameters(), masterCompType
+ "_" + DECOM_INCLUDED_HOSTS);
     }
 
@@ -1065,6 +1065,11 @@ public class AmbariCustomCommandExecutionHelper {
       List<String> listOfExcludedHosts) {
     StringBuilder commandDetail = new StringBuilder();
     commandDetail.append(actionExecutionContext.getActionName());
+    if (actionExecutionContext.getParameters().containsKey(IS_ADD_OR_DELETE_SLAVE_REQUEST)
&&
+      actionExecutionContext.getParameters().get(IS_ADD_OR_DELETE_SLAVE_REQUEST).equalsIgnoreCase("true"))
{
+      commandDetail.append(", Update Include/Exclude Files");
+      return commandDetail;
+    }
     if (listOfExcludedHosts.size() > 0) {
       commandDetail.append(", Excluded: ").append(StringUtils.join(listOfExcludedHosts, ','));
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/64cae8e0/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
index 9f0fa34..b4d9608 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java
@@ -3722,7 +3722,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
     }
     LOG.debug("Refresh include/exclude files action will be executed for " + serviceMasterMap);
     HashMap<String, String> requestProperties = new HashMap<>();
-    requestProperties.put("context", "Update Include and Exclude Files for " + serviceMasterMap.keySet().toString());
+    requestProperties.put("context", "Update Include/Exclude Files for " + serviceMasterMap.keySet().toString());
     requestProperties.put("exclusive", "true");
     HashMap<String, String> params = new HashMap<>();
     params.put(AmbariCustomCommandExecutionHelper.UPDATE_FILES_ONLY, String.valueOf(isDecommission));
@@ -3733,7 +3733,7 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
       }
     }
 
-    params.put(AmbariCustomCommandExecutionHelper.MULTI_SERVICES_DECOM_REQUEST, "true");
+    params.put(AmbariCustomCommandExecutionHelper.IS_ADD_OR_DELETE_SLAVE_REQUEST, "true");
 
     //Create filter for command
     List<RequestResourceFilter> resourceFilters = new ArrayList<>(serviceMasterMap.size());

http://git-wip-us.apache.org/repos/asf/ambari/blob/64cae8e0/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
index bda9576..a3bbe68 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
@@ -9387,11 +9387,11 @@ public class AmbariManagementControllerTest {
 
     List<Long> requestIDs = actionDB.getRequestsByStatus(null, 1, false);
     Request request = actionDB.getRequest(requestIDs.get(0));
-    assertEquals("Update Include and Exclude Files for [HDFS]", request.getRequestContext());
+    assertEquals("Update Include/Exclude Files for [HDFS]", request.getRequestContext());
     Type type = new TypeToken<Map<String, String>>(){}.getType();
     Map<String, String> requestParams = StageUtils.getGson().fromJson(request.getInputs(),
type);
     assertEquals(2, requestParams.size());
-    assertEquals("true", requestParams.get("multi_services_decom_request"));
+    assertEquals("true", requestParams.get("is_add_or_delete_slave_request"));
     assertEquals("true", requestParams.get("update_files_only"));
     assertEquals(1, request.getResourceFilters().size());
     RequestResourceFilter resourceFilter = request.getResourceFilters().get(0);


Mime
View raw message