@Override public boolean equals(Object other) { if (!(other instanceof PartitionRebalanceDetailsImpl)) { return false; } PartitionRebalanceDetailsImpl o = (PartitionRebalanceDetailsImpl)other; return this.region.getFullPath().equals(o.region.getFullPath()); } @Override
@Override public int hashCode() { return this.region.getFullPath().hashCode(); } }
/** * If we have recovered a bucket earlier for the given pr then we will have an * LRUStatistics to return for it. Otherwise return null. */ LRUStatistics getPRLRUStats(PartitionedRegion pr) { String prName = pr.getFullPath(); LRUStatistics result = null; synchronized (this.prlruStatMap) { result = this.prlruStatMap.get(prName); } return result; }
@Override public int hashCode() { return this.region.getFullPath().hashCode(); } }
@Override public String toString() { if (this.partitionedRegion != null) { String rName = this.partitionedRegion.getFullPath(); return this.partitionedRegion.getMyId() + "@" + getClass().getName() + "@" + System.identityHashCode(this) + " name: " + rName + " bucket count: " + this.localBucket2RegionMap.size(); } return null; }
@Override public String toString() { if (this.partitionedRegion != null) { String rName = this.partitionedRegion.getFullPath(); return this.partitionedRegion.getMyId() + "@" + getClass().getName() + "@" + System.identityHashCode(this) + " name: " + rName + " bucket count: " + this.localBucket2RegionMap.size(); } return null; }
@Override public int compare(PartitionedRegion o1, PartitionedRegion o2) { if(o1.isShadowPR() == o2.isShadowPR()) { return o1.getFullPath().compareTo(o2.getFullPath()); } if(o1.isShadowPR()) { return 1; } return -1; } });
private void addColocatedChildRecursively(LinkedHashMap<String, PartitionedRegion> prMap, PartitionedRegion pr) { for (PartitionedRegion colocatedRegion : ColocationHelper.getColocatedChildRegions(pr)) { addColocatedChildRecursively(prMap, colocatedRegion); } prMap.put(pr.getFullPath(), pr); }
@Override protected boolean operateOnPartitionedRegion(DistributionManager dm, PartitionedRegion pr, long startTime) throws CacheException { if (logger.isTraceEnabled(LogMarker.DM)) { logger.trace(LogMarker.DM, "DumpAllPRConfigMessage operateOnRegion: {}", pr.getFullPath()); } pr.dumpSelfEntryFromAllPartitionedRegions(); if (logger.isTraceEnabled(LogMarker.DM)) { logger.debug("{} dumped allPartitionedRegions", getClass().getName()); } return true; }
/** * This method returns true if region is closed. * */ public void checkClosed() { if (this.isClosed) { throw new RegionDestroyedException(LocalizedStrings.PartitionedRegion_PR_0_IS_LOCALLY_CLOSED.toLocalizedString(this), getFullPath()); } }
private static PartitionedRegion getColocatedPR( final PartitionedRegion partitionedRegion, final String colocatedWith) { logger.info(LocalizedMessage.create( LocalizedStrings.HOPLOG_0_COLOCATE_WITH_REGION_1_NOT_INITIALIZED_YET, new Object[] { partitionedRegion.getFullPath(), colocatedWith })); PartitionedRegion colocatedPR = (PartitionedRegion) partitionedRegion .getCache().getPartitionedRegion(colocatedWith, false); assert colocatedPR != null; return colocatedPR; } /** Whether to ignore missing parallel queues on restart
public RegionStatus(PartitionedRegion region) { this.thisMember = createPersistentMemberID(region); this.region = region.getFullPath(); this.bucketRegions = region.getRegionAdvisor().getProxyBucketArray(); }
/** Log that recovery was rejected because it was already in progress. * Increment a counter that this vm rejected recovery. * */ public synchronized void recoveryConflated(PartitionedRegion region) { try { _addToActivityList(recoveryConflated + new Date() + " for " + region.getFullPath()); } catch (Exception e) { Log.getLogWriter().severe(TestHelper.getStackTrace(e)); } }
@Override public boolean execute(Object r) { final int movedBucketId; PartitionedRegion pr = (PartitionedRegion)r; if ((movedBucketId = areAllBucketsHosted(pr)) >= 0) { throw new BucketMovedException(LocalizedStrings .FunctionService_BUCKET_MIGRATED_TO_ANOTHER_NODE .toLocalizedString(), movedBucketId, pr.getFullPath()); } return true; } });
@Override protected boolean operateOnPartitionedRegion(DistributionManager dm, PartitionedRegion pr, long startTime) throws CacheException, ForceReattemptException { if (logger.isTraceEnabled(LogMarker.DM)) { logger.debug("FetchBulkEntriesMessage operateOnRegion: {}", pr.getFullPath()); } FetchBulkEntriesReplyMessage.sendReply(pr, getSender(), getProcessorId(), dm, this.bucketKeys, this.bucketIds, regex, this.allowTombstones, startTime); return false; }
@Override protected void beginWaitingForMembershipChange( Set<PersistentMemberID> membersToWaitFor) { if(recovering) { bucketLock.unlock(); } else { if(membersToWaitFor != null && !membersToWaitFor.isEmpty()) { String message = LocalizedStrings.PartitionedRegionDataStore_DATA_OFFLINE_MESSAGE.toLocalizedString(proxyBucket.getPartitionedRegion().getFullPath(), proxyBucket.getBucketId(), membersToWaitFor); throw new PartitionOfflineException((Set)membersToWaitFor, message); } } }
@Override protected void beginWaitingForMembershipChange( Set<PersistentMemberID> membersToWaitFor) { if(recovering) { bucketLock.unlock(); } else { if(membersToWaitFor != null && !membersToWaitFor.isEmpty()) { String message = LocalizedStrings.PartitionedRegionDataStore_DATA_OFFLINE_MESSAGE.toLocalizedString(proxyBucket.getPartitionedRegion().getFullPath(), proxyBucket.getBucketId(), membersToWaitFor); throw new PartitionOfflineException((Set)membersToWaitFor, message); } } }
private HoplogOrganizer getOrganizer(PartitionedRegion region, int bucketId) { BucketRegion br = region.getDataStore().getLocalBucketById(bucketId); if (br == null) { // got rebalanced or something throw new BucketMovedException("Bucket region is no longer available", bucketId, region.getFullPath()); } return br.getHoplogOrganizer(); }
private static PartitionedRegion getColocatedPR( final PartitionedRegion partitionedRegion, final String colocatedWith) { LogWriterI18n logger = partitionedRegion.getLogWriterI18n(); logger.info( LocalizedStrings.HOPLOG_0_COLOCATE_WITH_REGION_1_NOT_INITIALIZED_YET, new Object[] { partitionedRegion.getFullPath(), colocatedWith }); PartitionedRegion colocatedPR = (PartitionedRegion) partitionedRegion .getCache().getPartitionedRegion(colocatedWith, false); assert colocatedPR != null; return colocatedPR; }
protected void clearBackingCHM(Region<Integer, String> r) { PartitionedRegion pr = (PartitionedRegion)r; for (BucketRegion br : pr.getDataStore().getAllLocalBucketRegions()) { assertTrue(br.getRegionMap() instanceof HDFSRegionMap); ((AbstractRegionMap)br.getRegionMap())._getMap().clear(); // wait here to make sure that the queue has been flushed } sleep(pr.getFullPath()); }