public Set keysWithoutCreatesForTests() { checkReadiness(); Set<Integer> availableBuckets = new HashSet<Integer>(); for(int i =0; i < getTotalNumberOfBuckets(); i++) { if(distAdvisor.isStorageAssignedForBucket(i)) { availableBuckets.add(Integer.valueOf(i)); } } return Collections.unmodifiableSet(new KeysSet(availableBuckets)); }
public Set keysWithoutCreatesForTests() { checkReadiness(); Set<Integer> availableBuckets = new HashSet<Integer>(); for(int i =0; i < getTotalNumberOfBuckets(); i++) { if(distAdvisor.isStorageAssignedForBucket(i)) { availableBuckets.add(Integer.valueOf(i)); } } return Collections.unmodifiableSet(new KeysSet(availableBuckets, getTXState())); }
/** * Find the set of members which own primary buckets, including the local member * @return set of InternalDistributedMember ids */ public Set advisePrimaryOwners() { Assert.assertTrue(this.buckets != null); ProxyBucketRegion[] bucs = this.buckets; HashSet hs = new HashSet(); for (int i = 0; i < bucs.length; i++) { if (isStorageAssignedForBucket(i)) { InternalDistributedMember mem = bucs[i].getBucketAdvisor().getPrimary(); if (mem != null) { hs.add(mem); } } } return hs; }
private boolean anyOfTheseBucketsHasStorage(Set<Integer> failedBuckets) { boolean haveStorage = false; for (Integer bid : failedBuckets) { if (this.pr.getRegionAdvisor().isStorageAssignedForBucket(bid)) { Set ownrs = this.pr.getRegionAdvisor().getBucketOwners(bid); for (Iterator boi = ownrs.iterator(); boi.hasNext(); ) {
if (!getRegionAdvisor().isStorageAssignedForBucket(bucketId)) { if (logger.isDebugEnabled()) { logger.debug("No storage while waiting for primary for bucket ({}{}{}) {}", getPRId(), BUCKET_ID_SEPARATOR, bucketId, readOrWrite);
private boolean anyOfTheseBucketsHasStorage(Set<Integer> failedBuckets) { boolean haveStorage = false; for (Integer bid : failedBuckets) { if (this.pr.getRegionAdvisor().isStorageAssignedForBucket(bid)) { Set ownrs = this.pr.getRegionAdvisor().getBucketOwners(bid); for (Iterator boi = ownrs.iterator(); boi.hasNext(); ) {
/** * @param bucketId the bucket to check redundancy on * @param minRedundancy the amount of expected redundancy; ignored if wait is false * @param wait true if caller wants us to wait for redundancy * @return true if redundancy on given bucket is detected */ public boolean isStorageAssignedForBucket(int bucketId, int minRedundancy, boolean wait) { if (!wait) { return isStorageAssignedForBucket(bucketId); } else { Assert.assertTrue(this.buckets != null); return this.buckets[bucketId].getBucketAdvisor() .waitForRedundancy(minRedundancy); } }
/** * @param bucketId the bucket to check redundancy on * @param minRedundancy the amount of expected redundancy; ignored if wait is false * @param wait true if caller wants us to wait for redundancy * @return true if redundancy on given bucket is detected */ public boolean isStorageAssignedForBucket(int bucketId, int minRedundancy, boolean wait) { if (!wait) { return isStorageAssignedForBucket(bucketId); } else { Assert.assertTrue(this.buckets != null); return this.buckets[bucketId].getBucketAdvisor() .waitForRedundancy(minRedundancy); } }
/** * Get the current primary owner for a bucket. If the bucket is not yet * created it returns null immediately * * @throws IllegalStateException * if the provided region is something other than a * {@linkplain DataPolicy#PARTITION partitioned Region} * @return the primary member for the bucket, possibly null if a primary is * not yet determined * @since 6.5 * @param region * @param bucketId */ private static DistributedMember getPrimaryMemberForBucket( final Region<?, ?> region, final int bucketId) { PartitionedRegion pr = prCheck(region, bucketId); if (pr.getRegionAdvisor().isStorageAssignedForBucket(bucketId)) { return pr.getBucketPrimary(bucketId); } else { return null; } }
public Object next() { if (++this.currentItem < BucketSet.this.pbrs.length) { if (isStorageAssignedForBucket(this.currentItem)) { return Integer.valueOf(this.currentItem);
public Object next() { if (++this.currentItem < BucketSet.this.pbrs.length) { if (isStorageAssignedForBucket(this.currentItem)) { return Integer.valueOf(this.currentItem);
/** * Find the set of members which own primary buckets, including the local member * @return set of InternalDistributedMember ids */ public Set advisePrimaryOwners() { Assert.assertTrue(this.buckets != null); ProxyBucketRegion[] bucs = this.buckets; THashSet hs = new THashSet(); for (int i = 0; i < bucs.length; i++) { if (isStorageAssignedForBucket(i)) { InternalDistributedMember mem = bucs[i].getBucketAdvisor().getPrimary(); if (mem != null) { hs.add(mem); } } } return hs; }
if (!getRegionAdvisor().isStorageAssignedForBucket(bucketId)) { if (logger.fineEnabled()) { logger.fine("No storage while waiting for primary for bucket ("
if ( ! getRegionAdvisor().isStorageAssignedForBucket(bucketId, this.minimumWriteRedundancy, false)) { if (isDebugEnabled) { logger.debug("No storage assigned for bucket ({}{}{}) writer", getPRId(), BUCKET_ID_SEPARATOR, bucketId);
.isStorageAssignedForBucket(bucketId.intValue())) { // bucket no
.isStorageAssignedForBucket(bucketId.intValue())) { // bucket no
if ( ! getRegionAdvisor().isStorageAssignedForBucket(bucketId, this.minimumWriteRedundancy, false)) { if (logger.fineEnabled()) { logger.fine("No storage assigned for bucket ("
.isStorageAssignedForBucket(bucketId.intValue())) { // bucket no
.isStorageAssignedForBucket(bucketId.intValue())) { // bucket no
if( ! advisor.isPrimaryForBucket(bucketId) && advisor.isStorageAssignedForBucket(bucketId)) { continue;