kirklund commented on a change in pull request #7440:
URL: https://github.com/apache/geode/pull/7440#discussion_r824943556



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionHelper.java
##########
@@ -717,6 +714,31 @@ public static Bucket getProxyBucketRegion(Cache cache, 
String fullPath, boolean
 
   }
 
+  public static PartitionedRegion 
getPartitionedRegionUsingBucketRegionName(Cache cache,
+      String fullPath) {
+    if (cache == null) {
+      // No cache
+      return null;
+    }
+    // fullPath = /__PR/_B_1_10
+    String bucketName = getBucketName(fullPath);
+    if (bucketName == null) {
+      return null;
+    }
+    String prid = getPRPath(bucketName);
+    Region region;
+    final InitializationLevel oldLevel = 
LocalRegion.setThreadInitLevelRequirement(ANY_INIT);
+    try {
+      region = cache.getRegion(prid);
+    } finally {
+      LocalRegion.setThreadInitLevelRequirement(oldLevel);
+    }

Review comment:
       Perfect!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to