boglesby commented on a change in pull request #7144:
URL: https://github.com/apache/geode/pull/7144#discussion_r783545633
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
##########
@@ -1201,23 +1203,25 @@ protected void addRemovedEvent(PartitionedRegion prQ,
int bucketId, Object key)
public void sendQueueRemovalMesssageForDroppedEvent(PartitionedRegion prQ,
int bucketId,
Review comment:
I know you didn't add this method, but can you rename it (from Messsage
to Message)?
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
##########
@@ -351,6 +351,23 @@ void removeBucket() {
setHosting(false);
}
+ /**
+ * Return all members hosting this bucket
+ *
+ * @return members hosting bucket
+ */
+ public Set<InternalDistributedMember> getAllHostingMembers() {
+ Set<InternalDistributedMember> recipients = new HashSet<>();
+ Profile[] locProfiles = profiles; // grab current profiles
+ for (Profile profile : locProfiles) {
+ BucketProfile bp = (BucketProfile) profile;
+ if (bp.isHosting) {
+ recipients.add(bp.getDistributedMember());
+ }
+ }
+ return recipients;
+ }
+
/**
Review comment:
I'm pretty sure `adviseInitialized` does the same thing as the new
`getAllHostingMembers` method.
The main difference is that `adviseFilter` calls `initializationGate()`, but
the `sendQueueRemovalMesssageForDroppedEvent` method used to call
`getAllRecipients` which calls `adviseDataStore` which calls `adviseFilter`.
adviseInitialized calls adviseFilter with `bucketProfile.isHosting`:
```
Set<InternalDistributedMember> adviseInitialized() {
return adviseFilter(profile -> {
assert profile instanceof BucketProfile;
BucketProfile bucketProfile = (BucketProfile) profile;
return bucketProfile.isHosting;
});
}
```
So I think you can use this in
`ParallelGatewaySenderQueue.getAllRecipientsForEvent`:
```
Set<InternalDistributedMember> bucketMembers =
bucketRegionQueue.getBucketAdvisor().adviseInitialized();
```
--
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]