public static void assignBucketsToPartitions(Region<?, ?> region) {
    PartitionedRegion pr = isPartitionedCheck(region);
    RecoveryLock lock = null;
    try {
      lock = pr.getRecoveryLock();
      lock.lock();
      for (int i = 0; i < getNumberOfBuckets(pr); i++) {
        // This method will return quickly if the bucket already exists
        pr.createBucket(i, 0, null);
      }
    } finally {
      if (lock != null) {
        lock.unlock();
      }
    }
  }
Decide which partitions will host which buckets. Gemfire normally assigns buckets to partitions
as needed when data is added to a partitioned region. This method provides way to assign all of
the buckets without putting any data in partition region. This method should not be called
until all of the partitions are running because it will divide the buckets between the running
partitions. If the buckets are already assigned this method will have no effect.

This method will block until all buckets are assigned.

@param region The region which should have it's buckets assigned.
@throws IllegalStateException if the provided region is something other than a
        {@linkplain DataPolicy#PARTITION partitioned Region}
@since GemFire 6.0
geode-core/src/main/java/org/apache/geode/cache/partition/PartitionRegionHelper.java