@Override
  public int compareTo(HostRequest other) {
    if (containsMaster()) {
      return other.containsMaster() ? hashCode() - other.hashCode() : -1;
    } else if (other.containsMaster()) {
      return 1;
    } else {
      return hashCode() - other.hashCode();
    }
  }
Only to be used when replaying persisted requests upon server startup.

@param requestId    logical request id
@param id           host request id
@param predicate    host predicate
@param topology     cluster topology
@param entity       host request entity
ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java