@Override public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile) profile; if (cp.dataPolicy.withReplication()) { return true; } return false; } });
@Override public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile) profile; if (cp.dataPolicy.withReplication() && cp.regionInitialized) { return true; } return false; } });
@Override public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile) profile; if (cp.dataPolicy.withReplication() && !oldRecipients.contains(cp.getDistributedMember())) { return true; } return false; } });
@Override public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile) profile; DataPolicy dp = cp.dataPolicy; return dp.withReplication() || (cp.allEvents() && (dp.withStorage() || cp.hasCacheListener)); } });
public void setMirrorType(MirrorType mirrorType) { DataPolicy dp = mirrorType.getDataPolicy(); if (dp.withReplication()) { // requested a mirror type that has replication // if current data policy is not replicated change it if (!getDataPolicy().withReplication()) { setDataPolicy(dp); } } else { // requested a mirror type none; // if current data policy is replicated change it if (getDataPolicy().withReplication()) { setDataPolicy(dp); } } }
/** * This method determines whether this region should synchronize with peer replicated regions when * the given member has crashed. * * @param id the crashed member * @return true if synchronization should be attempted */ public boolean shouldSyncForCrashedMember(InternalDistributedMember id) { return this.getConcurrencyChecksEnabled() && this.getDataPolicy().withReplication() && !this.isUsedForPartitionedRegionAdmin && !this.isUsedForMetaRegion && !this.isUsedForSerialGatewaySenderQueue; }
void checkEntryTimeoutAction(String mode, ExpirationAction ea) { if ((this.getDataPolicy().withReplication() || this.getDataPolicy().withPartitioning()) && (ea == ExpirationAction.LOCAL_DESTROY || ea == ExpirationAction.LOCAL_INVALIDATE)) { throw new IllegalArgumentException( String.format("%s action is incompatible with this region's data policy.", mode)); } }
@Override public MirrorType getMirrorType() { if (this.dataPolicy.isNormal() || this.dataPolicy.isPreloaded() || this.dataPolicy.isEmpty() || this.dataPolicy.withPartitioning()) { return MirrorType.NONE; } else if (this.dataPolicy.withReplication()) { return MirrorType.KEYS_VALUES; } else { throw new IllegalStateException( String.format("No mirror type corresponds to data policy %s", this.dataPolicy)); } }
@Override @SuppressWarnings("deprecation") public MirrorType getMirrorType() { if (this.dataPolicy.isNormal() || this.dataPolicy.isPreloaded() || this.dataPolicy.isEmpty() || this.dataPolicy.withPartitioning()) { return MirrorType.NONE; } else if (this.dataPolicy.withReplication()) { return MirrorType.KEYS_VALUES; } else { throw new IllegalStateException( String.format("No mirror type corresponds to data policy %s.", this.dataPolicy)); } }
@Override public MirrorType getMirrorType() { // checkReadiness(); if (this.dataPolicy.isNormal() || this.dataPolicy.isPreloaded() || this.dataPolicy.isEmpty() || this.dataPolicy.withPartitioning()) { return MirrorType.NONE; } else if (this.dataPolicy.withReplication()) { return MirrorType.KEYS_VALUES; } else { throw new IllegalStateException( String.format("No mirror type corresponds to data policy %s", this.dataPolicy)); } }
@Override void basicLocalClear(RegionEventImpl rEvent) { if (getScope().isDistributed() && getDataPolicy().withReplication()) { throw new UnsupportedOperationException( "localClear is not supported on distributed replicated regions."); } super.basicLocalClear(rEvent); }
protected void checkIfReplicatedAndLocalDestroy(EntryEventImpl event) { // disallow local invalidation for replicated regions if (getScope().isDistributed() && getDataPolicy().withReplication() && !event.isDistributed() && !isUsedForSerialGatewaySenderQueue()) { throw new IllegalStateException( "Not allowed to do a local destroy on a replicated region"); } }
void cmnClearRegion(RegionEventImpl regionEvent, boolean cacheWrite, boolean useRVV) { RegionVersionVector rvv = null; if (useRVV && this.getDataPolicy().withReplication() && this.getConcurrencyChecksEnabled()) { rvv = this.versionVector.getCloneForTransmission(); } clearRegionLocally(regionEvent, cacheWrite, rvv); }
/** * Returns true if region subscribes to all events or is a replicate. * * @since GemFire 5.0 */ @Override public boolean isAllEvents() { return getDataPolicy().withReplication() || getSubscriptionAttributes().getInterestPolicy().isAll(); }
private TombstoneSweeper getSweeper(LocalRegion r) { if (r.getScope().isDistributed() && r.getServerProxy() == null && r.getDataPolicy().withReplication()) { return this.replicatedTombstoneSweeper; } else { return this.nonReplicatedTombstoneSweeper; } }
@Override public MirrorType getMirrorType() { if (this.getDataPolicy().isNormal() || this.getDataPolicy().isPreloaded() || this.getDataPolicy().isEmpty() || this.getDataPolicy().withPartitioning()) { return MirrorType.NONE; } else if (this.getDataPolicy().withReplication()) { return MirrorType.KEYS_VALUES; } else { throw new IllegalStateException( String.format("No mirror type corresponds to data policy %s", this.getDataPolicy())); } }
/** 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()); } }
@Override void basicInvalidateRegion(RegionEventImpl event) { // disallow local invalidation for replicated regions if (!event.getOperation().isDistributed() && getScope().isDistributed() && getDataPolicy().withReplication()) { throw new IllegalStateException( "Not allowed to do a local invalidation on a replicated region"); } if (shouldDistributeInvalidateRegion(event)) { distributeInvalidateRegion(event); } super.basicInvalidateRegion(event); }
private void unlockRVVForBulkOp() { ARMLockTestHook testHook = getRegionMap().getARMLockTestHook(); if (testHook != null) { testHook.beforeBulkRelease(this); } if (this.versionVector != null && this.getDataPolicy().withReplication()) { this.versionVector.releaseCacheModificationLock(this); } if (testHook != null) { testHook.afterBulkRelease(this); } }
/** release version-generation permission from the region's version vector */ @Override public void releaseCacheModificationLock(InternalRegion owner, EntryEventImpl event) { boolean lockedByBulkOp = event.isBulkOpInProgress() && owner.getDataPolicy().withReplication(); if (armLockTestHook != null) armLockTestHook.beforeRelease(owner, event); if (!event.isOriginRemote() && !lockedByBulkOp && !owner.hasServerProxy()) { RegionVersionVector vector = owner.getVersionVector(); if (vector != null) { vector.releaseCacheModificationLock(); } } if (armLockTestHook != null) armLockTestHook.afterRelease(owner, event); }