public static Map<String, LocalDataSet> getColocatedLocalDataSetsForBuckets( PartitionedRegion region, Set<Integer> bucketSet) { if (region.getColocatedWith() == null && (!region.isColocatedBy())) { return Collections.emptyMap(); } Map<String, LocalDataSet> ret = new HashMap<String, LocalDataSet>(); Map<String, PartitionedRegion> colocatedRegions = ColocationHelper.getAllColocationRegions(region); for (Region colocatedRegion : colocatedRegions.values()) { ret.put(colocatedRegion.getFullPath(), new LocalDataSet((PartitionedRegion) colocatedRegion, bucketSet)); } return ret; }
if (getPartitionedRegion().getColocatedWith() == null) { buk.getBucketAdvisor().setShadowBucketDestroyed(false); bukReg.invokePartitionListenerAfterBucketCreated(); } else { if (buk.getPartitionedRegion().getColocatedWith() == null) { buk.getBucketAdvisor().setShadowBucketDestroyed(true);
public static Map<String, LocalDataSet> constructAndGetAllColocatedLocalDataSet( PartitionedRegion region, Set<Integer> bucketSet) { Map<String, LocalDataSet> colocatedLocalDataSets = new HashMap<String, LocalDataSet>(); if (region.getColocatedWith() == null && (!region.isColocatedBy())) { colocatedLocalDataSets.put(region.getFullPath(), new LocalDataSet(region, bucketSet)); return colocatedLocalDataSets; } Map<String, PartitionedRegion> colocatedRegions = ColocationHelper.getAllColocationRegions(region); for (Region colocatedRegion : colocatedRegions.values()) { colocatedLocalDataSets.put(colocatedRegion.getFullPath(), new LocalDataSet((PartitionedRegion) colocatedRegion, bucketSet)); } colocatedLocalDataSets.put(region.getFullPath(), new LocalDataSet(region, bucketSet)); return colocatedLocalDataSets; }
public void scheduleCreateMissingBuckets() { if (this.prRegion.getColocatedWith() != null && ColocationHelper.isColocationComplete(this.prRegion)) { Runnable task = new CreateMissingBucketsTask(this); final InternalResourceManager resourceManager = this.prRegion.getGemFireCache().getInternalResourceManager(); resourceManager.getExecutor().execute(task); } }
@Override public void localDestroyRegion(Object aCallbackArgument) { getDataView().checkSupportsRegionDestroy(); String prName = this.getColocatedWith(); List<PartitionedRegion> listOfChildRegions = ColocationHelper.getColocatedChildRegions(this); List<String> childRegionsWithoutSendersList = new ArrayList<String>(); if (listOfChildRegions.size() != 0) { for (PartitionedRegion childRegion : listOfChildRegions) { if (!childRegion.getName().contains(ParallelGatewaySenderQueue.QSTRING)) { childRegionsWithoutSendersList.add(childRegion.getFullPath()); } } } if ((prName != null) || (!childRegionsWithoutSendersList.isEmpty())) { throw new UnsupportedOperationException( "Any Region in colocation chain cannot be destroyed locally."); } RegionEventImpl event = new RegionEventImpl(this, Operation.REGION_LOCAL_DESTROY, aCallbackArgument, false, getMyId(), generateEventID()/* generate EventID */); try { basicDestroyRegion(event, false); } catch (CacheWriterException e) { // not possible with local operation, CacheWriter not called throw new Error("CacheWriterException should not be thrown in localDestroyRegion", e); } catch (TimeoutException e) { // not possible with local operation, no distributed locks possible throw new Error("TimeoutException should not be thrown in localDestroyRegion", e); } }
if (root instanceof PartitionedRegion) { PartitionedRegion pr = (PartitionedRegion) root; if (pr.getColocatedWith() != null) { colocatedChildRegions.add(root); } else { if (subregion instanceof PartitionedRegion) { PartitionedRegion pr = (PartitionedRegion) subregion; if (pr.getColocatedWith() != null) { colocatedChildRegions.add(root); found = true;
return false; if (colocatedRegion.getColocatedWith() == null) { colocatedRegions.addFirst(colocatedRegion); } else {
PartitionedRegion prRegion = PartitionedRegion.getPRFromId(prID); if (prRegion != null) { if (prRegion.getColocatedWith() != null) { if (prRegion.getColocatedWith().equals(partitionedRegion.getFullPath()) || ("/" + prRegion.getColocatedWith()).equals(partitionedRegion.getFullPath())) {
try { if (!this.keySet().isEmpty()) { if (getPartitionedRegion().getColocatedWith() == null) { List<EventID> keys = new ArrayList<EventID>(this.keySet()); Collections.sort(keys, new Comparator<EventID>() {
private void setEventSeqNum() { if (this.partitionedRegion.isShadowPR() && this.partitionedRegion.getColocatedWith() != null) { PartitionedRegion parentPR = ColocationHelper.getLeaderRegion(this.partitionedRegion); BucketRegion parentBucket = parentPR.getDataStore().getLocalBucketById(getId()); // needs to be set only once. if (parentBucket.eventSeqNum == null) { parentBucket.eventSeqNum = new AtomicLong5(getId()); } } if (this.partitionedRegion.getColocatedWith() == null) { this.eventSeqNum = new AtomicLong5(getId()); } else { PartitionedRegion parentPR = ColocationHelper.getLeaderRegion(this.partitionedRegion); BucketRegion parentBucket = parentPR.getDataStore().getLocalBucketById(getId()); if (parentBucket == null && logger.isDebugEnabled()) { logger.debug("The parentBucket of region {} bucketId {} is NULL", this.partitionedRegion.getFullPath(), getId()); } Assert.assertTrue(parentBucket != null); this.eventSeqNum = parentBucket.eventSeqNum; } }
if (getPartitionedRegion().getColocatedWith() == null) { return success;
if (region.getColocatedWith() == null && filter.include(region)) {
String leaderRegionName = prRgion.getColocatedWith(); if (leaderRegionName != null) { Cache cache = prRgion.getCache(); while (leaderRegionName != null) { leaderRegion = (PartitionedRegion) cache.getRegion(leaderRegionName); if (leaderRegion.getColocatedWith() == null) { leaderRegionPath = leaderRegion.getFullPath(); break; } else { leaderRegionName = leaderRegion.getColocatedWith();
String colocatedWithPath = pr.getColocatedWith();
String leaderRegionName = prRgion.getColocatedWith(); if (leaderRegionName != null) { Cache cache = prRgion.getCache(); while (leaderRegionName != null) { leaderRegion = (PartitionedRegion) cache.getRegion(leaderRegionName); if (leaderRegion.getColocatedWith() == null) { leaderRegionPath = leaderRegion.getFullPath(); break; } else { leaderRegionName = leaderRegion.getColocatedWith();
if (this.getColocatedWith() == null) { Set<FixedPartitionAttributesImpl> elderFPAs = prConfig.getElderFPAs(); int startingBucketID = 0;
} else { if (this.partitionedRegion.isShadowPR() && this.partitionedRegion.getColocatedWith() != null) { PartitionedRegion colocatedRegion = ColocationHelper.getColocatedRegion(this.partitionedRegion);