pivotal-jbarrett commented on code in PR #7596:
URL: https://github.com/apache/geode/pull/7596#discussion_r857941403
##########
geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java:
##########
@@ -629,6 +642,153 @@ public void handleWANEvent(EntryEventImpl event) {
}
}
+ boolean needToWaitForColocatedBucketsBecomePrimary() {
+ if (hasChildRegion() || getBucketAdvisor().hasParent()) {
+ synchronized (allColocatedBucketsBecomePrimaryLock) {
+ return notPrimary;
+ }
+ }
+ synchronized (allColocatedBucketsBecomePrimaryLock) {
+ // If there are no colocated regions for this bucket region,
+ notPrimary = false;
+ }
+ return false;
+ }
+
+ boolean hasChildRegion() {
+ return
ColocationHelper.getFirstColocatedNonShadowChildRegions(partitionedRegion).size()
> 0;
Review Comment:
```java
!ColocationHelper.getFirstColocatedNonShadowChildRegions(partitionedRegion).isEmpty()
```
Calling `size()` can be costly depending on the implementation.
--
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]