private void mergeServiceWithExplicitParent(
      ServiceModule service, String parent, Map<String, StackModule> allStacks,
      Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions)
      throws AmbariException {
    if(isCommonServiceParent(parent)) {
      LOG.info("merging with common service: " + service.getModuleInfo().getName());
      mergeServiceWithCommonServiceParent(service, parent, allStacks, commonServices, extensions);
      LOG.info("display name: " + service.getModuleInfo().getDisplayName());
    } else {
      throw new AmbariException("The service '" + service.getModuleInfo().getName() + "' in extension '" + extensionInfo.getName() + ":"
          + extensionInfo.getVersion() + "' extends an invalid parent: '" + parent + "'");
    }
  }
Merge a service with its explicitly specified parent.
@param service          the service to merge
@param parent           the explicitly specified parent service
@param allStacks        all stacks specified in the stack definition
@param commonServices   all common services specified in the stack definition

@throws AmbariException if an exception occurs merging a service with its explicit parent
ambari-server/src/main/java/org/apache/ambari/server/stack/ExtensionModule.java