jdeppe-pivotal commented on a change in pull request #6873:
URL: https://github.com/apache/geode/pull/6873#discussion_r710100210



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/RegionProvider.java
##########
@@ -300,14 +299,18 @@ public RedisKeyCommands getKeyCommands() {
     return keyCommands;
   }
 
+  @SuppressWarnings("unchecked")
   public Set<DistributedMember> getRegionMembers() {
-    PartitionRegionInfo info = 
PartitionRegionHelper.getPartitionRegionInfo(dataRegion);
-    Set<DistributedMember> membersWithDataRegion = new HashSet<>();
-    for (PartitionMemberInfo memberInfo : info.getPartitionMemberInfo()) {
-      membersWithDataRegion.add(memberInfo.getDistributedMember());
+    InternalDistributedMember myId =
+        partitionedRegion.getDistributionManager().getDistributionManagerId();
+    Set<InternalDistributedMember> otherIds =
+        partitionedRegion.getRegionAdvisor().adviseDataStore();
+    if (otherIds.isEmpty()) {
+      return singleton(myId);
+    } else {
+      otherIds.add(myId);
+      return (Set<DistributedMember>) (Set<?>) otherIds;

Review comment:
       Not very important, but I think you can call `adviseDataStore(true)` 
here and then avoid this empty check. It's the same thing essentially but would 
avoid folks wondering why it's done this way.




-- 
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