@Override
  public void resolve(
      StackModule parentModule, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions)
      throws AmbariException {
    moduleState = ModuleState.VISITED;
    LOG.info(String.format("Resolve: %s:%s", stackInfo.getName(), stackInfo.getVersion()));
    String parentVersion = stackInfo.getParentStackVersion();
    mergeServicesWithExplicitParent(allStacks, commonServices, extensions);
    addExtensionServices();

    // merge with parent version of same stack definition
    if (parentVersion != null) {
      mergeStackWithParent(parentVersion, allStacks, commonServices, extensions);
    }

    for (ExtensionInfo extension : stackInfo.getExtensions()) {
      String extensionKey = extension.getName() + StackManager.PATH_DELIMITER + extension.getVersion();
      ExtensionModule extensionModule = extensions.get(extensionKey);
      if (extensionModule == null) {
        throw new AmbariException("Extension '" + stackInfo.getName() + ":" + stackInfo.getVersion() +
                        "' specifies an extension " + extensionKey + " that doesn't exist");
      }
      mergeStackWithExtension(extensionModule, allStacks, commonServices, extensions);
    }

    processUpgradePacks();
    processRepositories();
    processPropertyDependencies();
    validateBulkCommandComponents(allStacks);
    moduleState = ModuleState.RESOLVED;
  }
Fully resolve the stack. See stack resolution description in the class documentation.
If the stack has a parent, this stack will be merged against its fully resolved parent
if one is specified.Merging applies to all stack state including child service and
configuration modules.  Services may extend a service in another version in the
same stack hierarchy or may explicitly extend a service in a stack in a different
hierarchy.

@param parentModule   not used.  Each stack determines its own parent since stacks don't
                      have containing modules
@param allStacks      all stacks modules contained in the stack definition
@param commonServices all common services specified in the stack definition
@param extensions     all extension modules contained in the stack definition

@throws AmbariException if an exception occurs during stack resolution
ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java