int calculateLowestRedundancy(PartitionedRegion region) {
    int numBuckets = region.getPartitionAttributes().getTotalNumBuckets();
    int minRedundancy = Integer.MAX_VALUE;
    for (int i = 0; i < numBuckets; i++) {
      int bucketRedundancy = region.getRegionAdvisor().getBucketRedundancy(i);
      // Only consider redundancy for buckets that exist. Buckets that have not been created yet
      // have a redundancy value of -1
      if (bucketRedundancy != -1 && bucketRedundancy < minRedundancy) {
        minRedundancy = bucketRedundancy;
      }
    }
    return minRedundancy == Integer.MAX_VALUE ? 0 : minRedundancy;
  }
Calculates the lowest redundancy for any bucket in the region.

@param region The region for which the lowest redundancy should be calculated.
@return The redundancy of the least redundant bucket in the region.
geode-core/src/main/java/org/apache/geode/internal/cache/control/SerializableRegionRedundancyStatusImpl.java