|
@@ -18,12 +18,44 @@
|
|
|
|
|
|
package org.apache.ambari.server.controller;
|
|
|
|
|
|
-import com.google.gson.Gson;
|
|
|
-import com.google.gson.JsonArray;
|
|
|
-import com.google.gson.JsonElement;
|
|
|
-import com.google.gson.JsonObject;
|
|
|
-import com.google.inject.Inject;
|
|
|
-import com.google.inject.Singleton;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AGENT_STACK_RETRY_COUNT;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AGENT_STACK_RETRY_ON_UNAVAILABILITY;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.CLIENTS_TO_UPDATE_CONFIGS;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.COMMAND_TIMEOUT;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.COMPONENT_CATEGORY;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.CUSTOM_COMMAND;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_DRIVER_FILENAME;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_NAME;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GROUP_LIST;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOOKS_FOLDER;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOST_SYS_PREPPED;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JAVA_HOME;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JAVA_VERSION;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JCE_NAME;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCATION;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_NAME;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.MYSQL_JDBC_URL;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.NOT_MANAGED_HDFS_PATH_LIST;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.ORACLE_JDBC_URL;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.REPO_INFO;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT_TYPE;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SERVICE_PACKAGE_FOLDER;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_NAME;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_VERSION;
|
|
|
+import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.USER_LIST;
|
|
|
+
|
|
|
+import java.text.MessageFormat;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.Iterator;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
+import java.util.TreeMap;
|
|
|
+
|
|
|
import org.apache.ambari.server.AmbariException;
|
|
|
import org.apache.ambari.server.Role;
|
|
|
import org.apache.ambari.server.RoleCommand;
|
|
@@ -70,43 +102,12 @@ import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
-import java.text.MessageFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.HashSet;
|
|
|
-import java.util.Iterator;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
-import java.util.TreeMap;
|
|
|
-
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AGENT_STACK_RETRY_COUNT;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.AGENT_STACK_RETRY_ON_UNAVAILABILITY;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.CLIENTS_TO_UPDATE_CONFIGS;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.COMMAND_TIMEOUT;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.COMPONENT_CATEGORY;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.CUSTOM_COMMAND;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_DRIVER_FILENAME;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.DB_NAME;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.GROUP_LIST;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOOKS_FOLDER;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.HOST_SYS_PREPPED;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JAVA_HOME;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JAVA_VERSION;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JCE_NAME;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_LOCATION;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.JDK_NAME;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.MYSQL_JDBC_URL;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.NOT_MANAGED_HDFS_PATH_LIST;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.ORACLE_JDBC_URL;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.REPO_INFO;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SCRIPT_TYPE;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.SERVICE_PACKAGE_FOLDER;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_NAME;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.STACK_VERSION;
|
|
|
-import static org.apache.ambari.server.agent.ExecutionCommand.KeyNames.USER_LIST;
|
|
|
+import com.google.gson.Gson;
|
|
|
+import com.google.gson.JsonArray;
|
|
|
+import com.google.gson.JsonElement;
|
|
|
+import com.google.gson.JsonObject;
|
|
|
+import com.google.inject.Inject;
|
|
|
+import com.google.inject.Singleton;
|
|
|
|
|
|
/**
|
|
|
* Helper class containing logic to process custom command execution requests .
|
|
@@ -431,6 +432,12 @@ public class AmbariCustomCommandExecutionHelper {
|
|
|
roleParams = new TreeMap<String, String>();
|
|
|
}
|
|
|
|
|
|
+ // if there is a stack upgrade which is currently suspended then pass that
|
|
|
+ // information down with the command as some components may need to know
|
|
|
+ if (cluster.isUpgradeSuspended()) {
|
|
|
+ roleParams.put(KeyNames.UPGRADE_SUSPENDED, Boolean.TRUE.toString().toLowerCase());
|
|
|
+ }
|
|
|
+
|
|
|
roleParams.put(COMPONENT_CATEGORY, componentInfo.getCategory());
|
|
|
execCmd.setRoleParams(roleParams);
|
|
|
}
|