private void mergeComponents(
      ServiceModule parent, Map<String, StackModule> allStacks, Map<String, ServiceModule> commonServices, Map<String, ExtensionModule> extensions)
      throws AmbariException {
    serviceInfo.getComponents().clear();
    Collection<ComponentModule> mergedModules = mergeChildModules(
        allStacks, commonServices, extensions, componentModules, parent.componentModules);
    componentModules.clear();
    for (ComponentModule module : mergedModules) {
      if (!module.isDeleted()){
        componentModules.put(module.getId(), module);
        serviceInfo.getComponents().add(module.getModuleInfo());
      }
    }
  }
Merge components with the parent configurations.
This will update the child component module set as well as the underlying info instances.

@param parent          parent service module
@param allStacks       all stack modules
@param commonServices  common service modules
ambari-server/src/main/java/org/apache/ambari/server/stack/ServiceModule.java