@Override public boolean include(Profile profile) { // probably not needed as all profiles for a partitioned region are Partition profiles if (profile instanceof PartitionProfile) { PartitionProfile p = (PartitionProfile) profile; return p.isDataStore && (!p.dataPolicy.withPersistence() || p.regionInitialized); } return false; } });
public boolean isPersistent() { return this.dataPolicy.withPersistence(); }
@Override public boolean getPersistBackup() { return getDataPolicy().withPersistence(); }
@Override public boolean getPersistBackup() { return getDataPolicy().withPersistence(); }
@Override public boolean getPersistBackup() { return getDataPolicy().withPersistence(); }
@Override public boolean getPersistBackup() { return getDataPolicy().withPersistence(); }
protected boolean withPersistence() { RegionAttributes ra = dataRegion.getAttributes(); DataPolicy dp = ra.getDataPolicy(); final boolean withPersistence = dp.withPersistence(); return withPersistence; }
/** * whether concurrency checks should be disabled for this region */ @Override public boolean supportsConcurrencyChecks() { return !isSecret() || this.getDataPolicy().withPersistence(); }
/** * Test to see if there are any persistent child regions of a partitioned region. */ public static boolean hasPersistentChildRegion(PartitionedRegion region) { for (PartitionedRegion child : getColocatedChildRegions(region)) { if (child.getDataPolicy().withPersistence()) { return true; } } return false; } }
protected boolean isPersistent(final Region region) { return region.getAttributes().getDataPolicy().withPersistence(); }
/** * Throw an exception if persistent data recovery from disk is not complete for this region. */ public void checkPROffline() throws PartitionOfflineException { if (getDataPolicy().withPersistence() && !recoveredFromDisk) { Set<PersistentID> persistIds = new HashSet(getRegionAdvisor().advisePersistentMembers().values()); persistIds.removeAll(getRegionAdvisor().adviseInitializedPersistentMembers().values()); throw new PartitionOfflineException(persistIds, String.format("Partitioned Region %s is offline due to unrecovered persistent data, %s", new Object[] {getFullPath(), persistIds})); } }
private PartitionedRegion findPersistentRegionRecursively(PartitionedRegion pr) { if (pr.getDataPolicy().withPersistence()) { return pr; } for (PartitionedRegion child : ColocationHelper.getColocatedChildRegions(pr)) { PartitionedRegion leader = findPersistentRegionRecursively(child); if (leader != null) { return leader; } } return null; }
private boolean isRecoveryNeeded() { return getDataPolicy().withPersistence() && getDiskRegion().isRecreated(); }
private boolean isRebalanceNecessary() { // Fixed partitions will always be rebalanced. // Persistent partitions that have recovered from disk will // also need to rebalance primaries return isRebalance || director.isRebalanceNecessary( leaderRegion.getRedundancyProvider().isRedundancyImpaired(), leaderRegion.getDataPolicy().withPersistence()); }
/** * Returns true if this region's config indicates that it will use a disk store. Added for bug * 42055. */ protected boolean usesDiskStore(RegionAttributes regionAttributes) { return !isProxy() && (getAttributes().getDataPolicy().withPersistence() || isOverflowEnabled()); }
protected void checkVersionTag(DistributedRegion rgn, VersionTag tag) { RegionAttributes attr = rgn.getAttributes(); if (attr.getConcurrencyChecksEnabled() && attr.getDataPolicy().withPersistence() && attr.getScope() != Scope.GLOBAL && (tag.getMemberID() == null || test_InvalidVersion)) { if (logger.isDebugEnabled()) { logger.debug("Version tag is missing the memberID: {}", tag); } String msg = String.format("memberID cannot be null for persistent regions: %s", tag); RuntimeException ex = (sender.getVersionObject().compareTo(Version.GFE_80) < 0) ? new InternalGemFireException(msg) : new InvalidVersionException(msg); throw ex; } }
@Override public VersionSource getVersionMember() { if (this.getDataPolicy().withPersistence()) { return getDiskStore().getDiskStoreID(); } else { return this.cache.getInternalDistributedSystem().getDistributedMember(); } }
/** local regions do not perform versioning */ protected boolean shouldGenerateVersionTag(RegionEntry entry, EntryEventImpl event) { if (this.getDataPolicy().withPersistence()) { return true; } else { return this.getConcurrencyChecksEnabled() && (entry.getVersionStamp().hasValidVersion() || this.getDataPolicy().withReplication()); } }
/** * Wait for in an progress backup. When we backup the whole DS, we need to make sure we don't miss * a bucket because it is in the process of rebalancing. This doesn't wait for the whole backup to * complete, it only makes sure that this destroy will wait until the point when we know that we * that this bucket won't be destroyed on this member in the backup unless it was backed up on the * target member. */ private void waitForInProgressBackup() { BackupService backupService = getPartitionedRegion().getGemFireCache().getBackupService(); if (getPartitionedRegion().getDataPolicy().withPersistence()) { backupService.waitForBackup(); } }
public void recoverFromDiskRecursively() { recoverFromDisk(); List<PartitionedRegion> colocatedWithList = ColocationHelper.getColocatedChildRegions(partitionedRegion); for (PartitionedRegion childPR : colocatedWithList) { if (childPR.getDataPolicy().withPersistence()) { ProxyBucketRegion[] childBucketArray = childPR.getRegionAdvisor().getProxyBucketArray(); if (childBucketArray != null) { ProxyBucketRegion childBucket = childBucketArray[getBucketId()]; childBucket.recoverFromDisk(); } } } }