public BucketRegion getInitializedBucketForId(Object key, Integer bucketId)
      throws ForceReattemptException {
    final BucketRegion bucketRegion = localBucket2RegionMap.get(bucketId);
    if (null == bucketRegion) {
      partitionedRegion.checkReadiness();
      if (logger.isDebugEnabled()) {
        logger.debug("Got null bucket region for bucketId={}{}{} for PartitionedRegion = {}",
            partitionedRegion.getPRId(), PartitionedRegion.BUCKET_ID_SEPARATOR, bucketId,
            partitionedRegion);
      }
      ForceReattemptException fre = new BucketNotFoundException(
          String.format("Bucket id %s not found on VM %s",

              partitionedRegion.bucketStringForLogs(bucketId),
              partitionedRegion.getMyId()));
      if (key != null) {
        fre.setHash(key.hashCode());
      }
      throw fre;
    }
    bucketRegion.waitForData();
    return bucketRegion;
  }
Fetch a BucketRegion, but do not return until it is initialized

@param key optional for error reporting; if none, no key available.
@param bucketId the bucket to fetch
@return the region
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java