private void mergeServiceWithExplicitParent(
      ServiceModule service, String parent, Map<String, StackModule> allStacks,
      Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions)
      throws AmbariException {

    LOG.info(String.format("Merge service %s with explicit parent: %s", service.getModuleInfo().getName(), parent));
    if(isCommonServiceParent(parent)) {
      mergeServiceWithCommonServiceParent(service, parent, allStacks, commonServices, extensions);
    } else if(isExtensionServiceParent(parent)) {
      mergeServiceWithExtensionServiceParent(service, parent, allStacks, commonServices, extensions);
    } else {
      mergeServiceWithStackServiceParent(service, parent, allStacks, commonServices, extensions);
    }
  }
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/StackModule.java