You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/09/16 13:09:07 UTC

[GitHub] [geode] jdeppe-pivotal commented on a change in pull request #6873: GEODE-9575: improve how publish executes a function

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: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org