private boolean checkViolation(RegionInfo movingRegion, ReplicaKey movingReplicaKey,
    Set<RegionInfo> destinationRegions) {
    for (RegionInfo regionInfo : destinationRegions) {
      if (regionInfo.equals(movingRegion)) {
        continue;
      }
      if (getReplicaKey(regionInfo).equals(movingReplicaKey)) {
        return true;
      }
    }
    return false;
  }
If enabled, this class will help the balancer ensure that replicas aren't placed on the same
servers or racks as their primary. Configure this via
{@link BalancerConditionals#DISTRIBUTE_REPLICAS_KEY}
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/DistributeReplicasConditional.java