public Map<String, String> getInitializedCommandParameters() {
    Map<String, String> parameters = new HashMap<>();

    Direction direction = getDirection();
    parameters.put(COMMAND_PARAM_CLUSTER_NAME, m_cluster.getClusterName());
    parameters.put(COMMAND_PARAM_DIRECTION, direction.name().toLowerCase());

    if (null != getType()) {
      // use the serialized attributes of the enum to convert it to a string,
      // but first we must convert it into an element so that we don't get a
      // quoted string - using toString() actually returns a quoted stirng which
      // is bad
      JsonElement json = m_gson.toJsonTree(getType());
      parameters.put(COMMAND_PARAM_UPGRADE_TYPE, json.getAsString());
    }

    return parameters;
  }
Gets a map initialized with parameters required for upgrades to work. The
following properties are already set:
<ul>
<li>{@link #COMMAND_PARAM_CLUSTER_NAME}
<li>{@link #COMMAND_PARAM_DIRECTION}
<li>{@link #COMMAND_PARAM_UPGRADE_TYPE}
<li>{@link KeyNames#REFRESH_CONFIG_TAGS_BEFORE_EXECUTION} - necessary in
order to have the commands contain the correct configurations. Otherwise,
they will contain the configurations that were available at the time the
command was created. For upgrades, this is problematic since the commands
are all created ahead of time, but the upgrade may change configs as part
of the upgrade pack.</li>
<ul>

@return the initialized parameter map.
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/orchestrate/UpgradeContext.java