private void createAndExecuteRefreshIncludeExcludeFilesActionForMasters(Map<String, String> serviceMasterMap, Map<String, Set<String>> masterSlaveHostsMap, String clusterName, boolean isDecommission) throws AmbariException {
    //Clear include/exclude files or draining list except HBASE
    serviceMasterMap.remove(Service.Type.HBASE.toString());
    //exit if empty
    if (serviceMasterMap.isEmpty()) {
      return;
    }
    LOG.debug("Refresh include/exclude files action will be executed for " + serviceMasterMap);
    HashMap<String, String> requestProperties = new HashMap<>();
    requestProperties.put(RequestResourceProvider.CONTEXT, "Update Include/Exclude Files for " + serviceMasterMap.keySet().toString());
    HashMap<String, String> params = new HashMap<>();
    params.put(AmbariCustomCommandExecutionHelper.UPDATE_FILES_ONLY, String.valueOf(isDecommission));

    for (String masterName : masterSlaveHostsMap.keySet()) {
      if (!isDecommission) {
        params.put(masterName + "_" + AmbariCustomCommandExecutionHelper.DECOM_INCLUDED_HOSTS, StringUtils.join(masterSlaveHostsMap.get(masterName).toArray(), ","));
      }
    }

    params.put(AmbariCustomCommandExecutionHelper.IS_ADD_OR_DELETE_SLAVE_REQUEST, "true");

    //Create filter for command
    List<RequestResourceFilter> resourceFilters = new ArrayList<>(serviceMasterMap.size());
    for (String serviceName : serviceMasterMap.keySet()) {
      resourceFilters.add(new RequestResourceFilter(serviceName, serviceMasterMap.get(serviceName), null));
    }

    //Create request for command
    ExecuteActionRequest actionRequest = new ExecuteActionRequest(
      clusterName, AmbariCustomCommandExecutionHelper.DECOMMISSION_COMMAND_NAME, null,
      resourceFilters, null, params, false);
    //Send action
    createAction(actionRequest, requestProperties);
  }
Creates and triggers an action to update include and exclude files for the master components depending on current cluster topology and components state
@param serviceMasterMap
@param masterSlaveHostsMap
@param clusterName  @throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java