code: public String validateLayout(Set<Integer> liveHosts) {
          if (m_unbalancedPartitionCount > 0) {
              return String.format("%d out of %d partitions are unbalanced across placement groups.",
                      m_unbalancedPartitionCount, partitionsById.size());
          }
  
          if (liveHosts == null) {
              return null;
          }
  
          // verify the partition leaders on live hosts
          for (Host host : hostsById.values()) {
              if (liveHosts.contains(Integer.valueOf(host.id))) {
                  for (Partition p : host.partitions) {
                      if (!liveHosts.contains(Integer.valueOf(p.leaderHostId))) {
                          return String.format("The leader host %d of partition %d is not on live host.",
                                  p.leaderHostId, p.id);
                      }
                  }
              }
          }
          return null;
      }
docs: The default placement group (a.k.a. rack-aware group) is "0", if user override the setting
  in command line configuration, we need to check whether the partition layout meets the
  requirement (tolerate entire rack loss without shutdown the cluster). And also because we
  support partition group by default, if we can meet both requirements ( we prefer partition
  group because online upgrade with minimum hardware option needs it), at least we need tell
  user the fact.
  
  @return null if the topology is balanced, otherwise return the error message