private void validateFixedPartitionAttributesAgainstTotalNumberBuckets() {
    for (FixedPartitionAttributesImpl fpa : pr.getFixedPartitionAttributesImpl()) {
      int numBuckets = 0;

      Set<FixedPartitionAttributesImpl> allFPAs = new HashSet<>(
          pr.getRegionAdvisor().adviseAllFixedPartitionAttributes());
      allFPAs.add(fpa);

      for (FixedPartitionAttributes samefpa : allFPAs) {
        numBuckets = numBuckets + samefpa.getNumBuckets();
      }
      if (numBuckets > pr.getTotalNumberOfBuckets()) {
        throw new IllegalStateException(
            String.format(
                "For region %s,sum of num-buckets %s for different primary partitions should not be greater than total-num-buckets %s.",
                pr.getName(), numBuckets, pr.getTotalNumberOfBuckets()));
      }
    }
  }
validate that for all partitions defined across all datastores, sum of num-buckets is not more
than total-num-buckets defined
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionRegionConfigValidator.java