geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [geode] branch develop updated: GEODE-6621: ensure that getBucketOwners result is modifiable (#3438)
Date Wed, 10 Apr 2019 15:05:39 GMT
This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 4ad95a5  GEODE-6621: ensure that getBucketOwners result is modifiable (#3438)
4ad95a5 is described below

commit 4ad95a5562c7c9f4a45dbade6a65db83505c11fe
Author: Darrel Schneider <dschneider@pivotal.io>
AuthorDate: Wed Apr 10 08:05:25 2019 -0700

    GEODE-6621: ensure that getBucketOwners result is modifiable (#3438)
    
    A new HashSet is now created if we got back an empty set from adviseInitialized
---
 .../java/org/apache/geode/internal/cache/ProxyBucketRegion.java   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyBucketRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyBucketRegion.java
index 40f99bb..2e18eec 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyBucketRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/ProxyBucketRegion.java
@@ -352,10 +352,12 @@ public class ProxyBucketRegion implements Bucket {
   @Override
   public Set<InternalDistributedMember> getBucketOwners() {
     Set<InternalDistributedMember> s = this.advisor.adviseInitialized();
+    if (s.isEmpty()) {
+      // getBucketOwners needs to return a modifiable set.
+      // adviseInitialized returns an unmodifiable set when it is empty.
+      s = new HashSet<>();
+    }
     if (isHosting()) {
-      if (s.isEmpty()) {
-        s = new HashSet<>();
-      }
       s.add(this.partitionedRegion.getDistributionManager().getId());
     }
     return s;


Mime
View raw message