@SuppressWarnings("unchecked")
  public void initialize(Cluster cluster, LinkedHashSet<String> sectionKeys) {

    // in the event that initialize is called twice, ensure that we start with a
    // clean RCO instance
    this.sectionKeys = sectionKeys;
    dependencies.clear();

    Set<StackId> stackIds = new HashSet<>();
    for (Service service : cluster.getServices().values()) {
      stackIds.add(service.getDesiredStackId());
    }

    for (StackId stackId : stackIds) {
      StackInfo stack;
      try {
        stack = ambariMetaInfo.getStack(stackId.getStackName(),
          stackId.getStackVersion());
      } catch (AmbariException ignored) {
        throw new NullPointerException("Stack not found: " + stackId);
      }

      Map<String,Object> userData = stack.getRoleCommandOrder().getContent();
      Map<String,Object> generalSection =
        (Map<String, Object>) userData.get(GENERAL_DEPS_KEY);

      addDependencies(generalSection);

      for (String sectionKey : sectionKeys) {
        Map<String, Object> section = (Map<String, Object>) userData.get(sectionKey);

        addDependencies(section);
      }
    }

    extendTransitiveDependency();
    addMissingRestartDependencies();
  }
Add a pair of tuples where the tuple defined by the first two parameters are blocked on
the tuple defined by the last two pair.
@param blockedRole Role that is blocked
@param blockedCommand The command on the role that is blocked
@param blockerRole The role that is blocking
@param blockerCommand The command on the blocking role
ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java