public int compareDeps(RoleCommandOrder rco) {
    Set<RoleCommandPair> v1;
    Set<RoleCommandPair> v2;
    if (this == rco) {
      return 0;
    }

    // Check for key set match
    if (!dependencies.keySet().equals(rco.dependencies.keySet())){
      LOG.debug("dependency keysets differ");
      return 1;
    }
    LOG.debug("dependency keysets match");

    // So far so good.  Since the keysets match, let's check the
    // actual entries against each other
    for (Map.Entry<RoleCommandPair, Set<RoleCommandPair>> roleCommandPairSetEntry : dependencies.entrySet()) {
      v1 = dependencies.get(roleCommandPairSetEntry.getKey());
      v2 = rco.dependencies.get(roleCommandPairSetEntry.getKey());
      if (!v1.equals(v2)) {
        LOG.debug("different entry found for key ({}, {})", roleCommandPairSetEntry.getKey().getRole(), roleCommandPairSetEntry.getKey().getCmd());
        return 1;
      }
    }
    LOG.debug("dependency entries match");
    return 0;
  }
RoleCommand.RESTART dependencies that are missing from role_command_order.json
will be added to the RCO graph to make sure RESTART ALL type of
operations respect the RCO. Only those @{@link RoleCommandPair} will be
added which do not have any RESTART definition in the role_command_order.json
by copying dependencies from the START operation.
ambari-server/src/main/java/org/apache/ambari/server/metadata/RoleCommandOrder.java