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 23:28:51 UTC

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

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



##########
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:
       I reworked this so that this method only returns remote members and the caller of it executes the publish directly for the local member and only using the FunctionService for remote members.




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