private boolean isRecoveryNeeded() { return getDataPolicy().withPersistence() && getDiskRegion().isRecreated(); }
private boolean isRecoveryNeeded() { return getDataPolicy().withPersistence() && getDiskRegion().isRecreated(); }
@Override void basicLocalClear(RegionEventImpl rEvent) { if (getScope().isDistributed() && getDataPolicy().withReplication() && !LOCALCLEAR_TESTHOOK) { throw new UnsupportedOperationException(LocalizedStrings.DistributedRegion_LOCALCLEAR_IS_NOT_SUPPORTED_ON_DISTRIBUTED_REPLICATED_REGIONS.toLocalizedString()); } super.basicLocalClear(rEvent); }
@Override void basicLocalClear(RegionEventImpl rEvent) { if (getScope().isDistributed() && getDataPolicy().withReplication() && !LOCALCLEAR_TESTHOOK) { throw new UnsupportedOperationException(LocalizedStrings.DistributedRegion_LOCALCLEAR_IS_NOT_SUPPORTED_ON_DISTRIBUTED_REPLICATED_REGIONS.toLocalizedString()); } super.basicLocalClear(rEvent); }
public boolean goWithFullGII(DistributedRegion rgn, RegionVersionVector requesterRVV) { if (getSender().getVersionObject().compareTo(Version.GFE_80) < 0) { // pre-8.0 could not handle a delta-GII return true; } if (!rgn.getDataPolicy().withPersistence()) { // non-persistent regions always do full GII if (logger.isDebugEnabled()) { logger.debug("Region {} is not a persistent region, do full GII", rgn.getFullPath()); } return true; } if (!rgn.getVersionVector().isRVVGCDominatedBy(requesterRVV)) { if (logger.isDebugEnabled()) { logger.debug("Region {}'s local RVVGC is not dominated by remote RVV={}, do full GII", rgn.getFullPath(), requesterRVV); } return true; } // TODO GGG: verify GII after UpgradeDiskStore return false; }
if(dr.getDataPolicy().withPersistence() && persistentId==null) {
@Override protected void checkForDataStoreAvailability(DistributedRegion region, Set<InternalDistributedMember> recipients) { if (region.getCache().isGFXDSystem()) { if (recipients.isEmpty() && !region.isUsedForMetaRegion() && !region.isUsedForPartitionedRegionAdmin() && !region.isUsedForPartitionedRegionBucket() && !region.getDataPolicy().withStorage()) { throw new NoDataStoreAvailableException(LocalizedStrings .DistributedRegion_NO_DATA_STORE_FOUND_FOR_DISTRIBUTION .toLocalizedString(region)); } } }
@Override protected void checkForDataStoreAvailability(DistributedRegion region, Set<InternalDistributedMember> recipients) { if (region.getCache().isGFXDSystem()) { if (recipients.isEmpty() && !region.isUsedForMetaRegion() && !region.isUsedForPartitionedRegionAdmin() && !region.isUsedForPartitionedRegionBucket() && !region.getDataPolicy().withStorage()) { throw new NoDataStoreAvailableException( LocalizedStrings.DistributedRegion_NO_DATA_STORE_FOUND_FOR_DISTRIBUTION .toLocalizedString(region)) ; } } }
/** * @see LocalRegion#basicInvalidateRegion(RegionEventImpl) */ @Override void basicInvalidateRegion(RegionEventImpl event) { // disallow local invalidation for replicated regions if (!event.isDistributed() && getScope().isDistributed() && getDataPolicy().withReplication()) { throw new IllegalStateException(LocalizedStrings.DistributedRegion_NOT_ALLOWED_TO_DO_A_LOCAL_INVALIDATION_ON_A_REPLICATED_REGION.toLocalizedString()); } if (shouldDistributeInvalidateRegion(event)) { distributeInvalidateRegion(event); } super.basicInvalidateRegion(event); }
/** * @see LocalRegion#basicInvalidateRegion(RegionEventImpl) */ @Override void basicInvalidateRegion(RegionEventImpl event) { // disallow local invalidation for replicated regions if (!event.isDistributed() && getScope().isDistributed() && getDataPolicy().withReplication()) { throw new IllegalStateException(LocalizedStrings.DistributedRegion_NOT_ALLOWED_TO_DO_A_LOCAL_INVALIDATION_ON_A_REPLICATED_REGION.toLocalizedString()); } if (shouldDistributeInvalidateRegion(event)) { distributeInvalidateRegion(event); } super.basicInvalidateRegion(event); }
if (this.region.getDataPolicy().withPersistence() && localRVV.isNewerThanOrCanFillExceptionsFor(remoteRVV)) {
protected void saveReceivedRVV(RegionVersionVector rvv) { assert rvv != null; // Make sure the RVV is at least as current as // the provider's was when the GII began. This ensures that a // concurrent clear() doesn't prevent the new region's RVV from being // initialized and that any vector entries that are no longer represented // by stamps in the region are not lost if (logger.isTraceEnabled(LogMarker.GII)) { logger.trace(LogMarker.GII, "Applying received version vector {} to {}", rvv.fullToString(), region.getName()); } //TODO - RVV - Our current RVV might reflect some operations //that are concurrent updates. We want to keep those updates. However //it might also reflect things that we recovered from disk that we are going //to remove. We'll need to remove those from the RVV somehow. region.getVersionVector().recordVersions(rvv); if(region.getDataPolicy().withPersistence()) { region.getDiskRegion().writeRVV(region, false); region.getDiskRegion().writeRVVGC(region); } if (logger.isTraceEnabled(LogMarker.GII)) { logger.trace(LogMarker.GII, "version vector is now {}", region.getVersionVector().fullToString()); } }
if(dr.getDataPolicy().withPersistence() && persistentId==null) {
if (this.region.getDataPolicy().withPersistence() && localRVV.isNewerThanOrCanFillExceptionsFor(remoteRVV)) {
@Override protected boolean operateOnRegion(CacheEvent event, DistributionManager dm) throws EntryNotFoundException { DistributedRegion region = (DistributedRegion)event.getRegion(); switch (this.clearOp) { case OP_CLEAR: region.clearRegionLocally((RegionEventImpl)event, false, this.rvv); region.notifyBridgeClients((RegionEventImpl)event); this.appliedOperation = true; break; case OP_LOCK_FOR_CLEAR: if (region.getDataPolicy().withStorage()) { DistributedClearOperation.regionLocked(this.getSender(), region.getFullPath(), region); region.lockLocallyForClear(dm, this.getSender()); } this.appliedOperation = true; break; } return true; }
@Override protected boolean operateOnRegion(CacheEvent event, DistributionManager dm) throws EntryNotFoundException { DistributedRegion region = (DistributedRegion)event.getRegion(); switch (this.clearOp) { case OP_CLEAR: region.clearRegionLocally((RegionEventImpl)event, false, this.rvv); region.notifyBridgeClients(event); this.appliedOperation = true; break; case OP_LOCK_FOR_CLEAR: if (region.getDataPolicy().withStorage()) { DistributedClearOperation.regionLocked(this.getSender(), region.getFullPath(), region); region.lockLocallyForClear(dm, this.getSender()); } this.appliedOperation = true; break; } return true; }
public boolean goWithFullGII(DistributedRegion rgn, RegionVersionVector requesterRVV) { LogWriterI18n logger = rgn.getLogWriterI18n(); if (!rgn.getDataPolicy().withPersistence()) { // non-persistent regions always do full GII if (logger.fineEnabled()) { logger.fine("Region " + rgn.getFullPath() + " is not a persistent region, do full GII"); } return true; } if (!rgn.getVersionVector().isRVVGCDominatedBy(requesterRVV)) { if (logger.fineEnabled()) { logger.fine("Region " + rgn.getFullPath() + "'s local RVVGC is not dominated by remote RVV="+requesterRVV+", do full GII"); } return true; } // TODO GGG: verify GII after UpgradeDiskStore return false; }
public void fillInProfile(Profile p) { assert p instanceof CacheProfile; CacheProfile profile = (CacheProfile)p; profile.dataPolicy = getDataPolicy(); profile.hasCacheLoader = basicGetLoader() != null; profile.hasCacheWriter = basicGetWriter() != null; profile.scope = this.scope; profile.inRecovery = getImageState().getInRecovery(); profile.isPersistent = getDataPolicy().withPersistence(); profile.setSubscriptionAttributes(getSubscriptionAttributes());
protected void saveReceivedRVV(RegionVersionVector rvv) { assert rvv != null; // Make sure the RVV is at least as current as // the provider's was when the GII began. This ensures that a // concurrent clear() doesn't prevent the new region's RVV from being // initialized and that any vector entries that are no longer represented // by stamps in the region are not lost if (TRACE_GII) { region.getLogWriterI18n().info(LocalizedStrings.DEBUG, "Applying received version vector "+rvv.fullToString()+ " to " + region.getName()); } //TODO - RVV - Our current RVV might reflect some operations //that are concurrent updates. We want to keep those updates. However //it might also reflect things that we recovered from disk that we are going //to remove. We'll need to remove those from the RVV somehow. region.getVersionVector().recordVersions(rvv, null); if(region.getDataPolicy().withPersistence()) { region.getDiskRegion().writeRVV(region, false); region.getDiskRegion().writeRVVGC(region); } if (TRACE_GII) { region.getLogWriterI18n().info(LocalizedStrings.DEBUG, "version vector is now " + region.getVersionVector().fullToString()); } }
public void fillInProfile(Profile p) { assert p instanceof CacheProfile; CacheProfile profile = (CacheProfile)p; profile.dataPolicy = getDataPolicy(); profile.hasCacheLoader = basicGetLoader() != null; profile.hasCacheWriter = basicGetWriter() != null; profile.scope = this.scope; profile.inRecovery = getImageState().getInRecovery(); profile.isPersistent = getDataPolicy().withPersistence(); profile.setSubscriptionAttributes(getSubscriptionAttributes()); profile.isGatewayEnabled = getEnableGateway();