/** * * @param refTablePR * @return bucketID of the bucket which has no primary in the system or -1 if all are having primary */ private static int checkIfAllHostedBucketsHavePrimary(PartitionedRegion refTablePR) { RegionAdvisor ra = refTablePR.getRegionAdvisor(); Set<Integer> allHostedBuckets = ra.getBucketSet(); for( int bucketID:allHostedBuckets) { BucketAdvisor ba = ra.getBucketAdvisor(bucketID); if(!ba.hasPrimary()) { return bucketID; } } return -1; }
/** * * @param refTablePR * @return bucketID of the bucket which has no primary in the system or -1 if all are having primary */ private static int checkIfAllHostedBucketsHavePrimary(PartitionedRegion refTablePR) { RegionAdvisor ra = refTablePR.getRegionAdvisor(); Set<Integer> allHostedBuckets = ra.getBucketSet(); for( int bucketID:allHostedBuckets) { BucketAdvisor ba = ra.getBucketAdvisor(bucketID); if(!ba.hasPrimary()) { return bucketID; } } return -1; }
/** * * @param refTablePR * @return bucketID of the bucket which has no primary in the system or -1 if all are having primary */ private static int checkIfAllHostedBucketsHavePrimary(PartitionedRegion refTablePR) { RegionAdvisor ra = refTablePR.getRegionAdvisor(); Set<Integer> allHostedBuckets = ra.getBucketSet(); for( int bucketID:allHostedBuckets) { BucketAdvisor ba = ra.getBucketAdvisor(bucketID); if(!ba.hasPrimary()) { return bucketID; } } return -1; }
if (hasPrimary()) { requestPrimaryState(OTHER_PRIMARY_HOSTING); if (hasPrimary()) { // has primary... if (isPrimary()) { requestPrimaryState(NO_PRIMARY_NOT_HOSTING);
if (hasPrimary()) { requestPrimaryState(OTHER_PRIMARY_HOSTING); if (hasPrimary()) { // has primary... if (isPrimary()) { requestPrimaryState(NO_PRIMARY_NOT_HOSTING);
if (hasPrimary() && isPrimary()) { shouldInvokeListeners = true;
if (hasPrimary() && isPrimary()) { shouldInvokeListeners = true;