public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile)profile; if (cp.dataPolicy.withReplication()) { return true; } return false; } });
public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile)profile; if (cp.dataPolicy.withReplication()) { return true; } return false; } });
public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile)profile; if (cp.dataPolicy.withReplication() && cp.regionInitialized && !cp.memberUnInitialized) { return true; } return false; } });
public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile)profile; if (cp.dataPolicy.withReplication() && !cp.memberUnInitialized && !oldRecipients.contains(cp.getDistributedMember())) { return true; } return false; } });
/** * bug #46924 - putAll can be partially applied when a clear() occurs, leaving * the cache in an inconsistent state. Set the RVV to "cache op in progress" * so clear() will block until the putAll completes. This won't work for * non-replicate regions though since they uses one-hop during basicPutPart2 * to get a valid version tag. */ private void lockRVVForPutAll() { if (this.versionVector != null && this.dataPolicy.withReplication()) { this.versionVector.lockForCacheModification(this); } }
void checkEntryTimeoutAction(String mode, ExpirationAction ea) { if ((this.dataPolicy.withReplication() || this.dataPolicy.withPartitioning()) && (ea == ExpirationAction.LOCAL_DESTROY || ea == ExpirationAction.LOCAL_INVALIDATE)) { throw new IllegalArgumentException(LocalizedStrings.AbstractRegion_0_ACTION_IS_INCOMPATIBLE_WITH_THIS_REGIONS_DATA_POLICY.toLocalizedString(mode)); } }
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 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(LocalizedStrings.RegionAttributesCreation_NO_MIRROR_TYPE_CORRESPONDS_TO_DATA_POLICY_0.toLocalizedString(this.dataPolicy)); } }
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(LocalizedStrings.RegionAttributesCreation_NO_MIRROR_TYPE_CORRESPONDS_TO_DATA_POLICY_0.toLocalizedString(this.dataPolicy)); } }
@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 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(LocalizedStrings.RemoteRegionAttributes_NO_MIRROR_TYPE_CORRESPONDS_TO_DATA_POLICY_0.toLocalizedString(this.dataPolicy)); } } public DataPolicy getDataPolicy() {
/** * Returns true if region subscribes to all events or is a replicate. * * @since 5.0 */ final boolean isAllEvents() { return getDataPolicy().withReplication() || getSubscriptionAttributes().getInterestPolicy().isAll(); }
/** release version-generation permission from the region's version vector */ private void releaseCacheModificationLock(LocalRegion owner, EntryEventImpl event) { boolean lockedByPutAll = event.getPutAllOperation() != null && owner.dataPolicy.withReplication(); if (!event.isOriginRemote() && !lockedByPutAll) { RegionVersionVector vector = owner.getVersionVector(); if (vector != null) { vector.releaseCacheModificationLock(owner); } } }
/** get version-generation permission from the region's version vector */ private void lockForCacheModification(LocalRegion owner, EntryEventImpl event) { boolean lockedByBulkOp = event.isBulkOpInProgress() && owner.dataPolicy.withReplication(); if (!event.isOriginRemote() && !lockedByBulkOp) { RegionVersionVector vector = owner.getVersionVector(); if (vector != null) { vector.lockForCacheModification(owner); } } }
/** * Returns true if region subscribes to all events or is a replicate. * * @since 5.0 */ final boolean isAllEvents() { return getDataPolicy().withReplication() || getSubscriptionAttributes().getInterestPolicy().isAll(); }
protected void checkIfReplicatedAndLocalDestroy(EntryEventImpl event) { // Actiual: disallow local invalidation for replicated regions if (getScope().isDistributed() && getDataPolicy().withReplication() && (!event.isDistributed()) && !isUsedForSerialGatewaySenderQueue()) { throw new IllegalStateException(LocalizedStrings.LocalRegion_NOT_ALLOWED_TO_DO_A_LOCAL_DESTROY_ON_A_REPLICATED_REGION.toLocalizedString()); } }
protected void checkIfReplicatedAndLocalDestroy(EntryEventImpl event) { // Actiual: disallow local invalidation for replicated regions if (getScope().isDistributed() && getDataPolicy().withReplication() && (!event.isDistributed()) && !isUsedForSerialGatewaySenderQueue()) { throw new IllegalStateException(LocalizedStrings.LocalRegion_NOT_ALLOWED_TO_DO_A_LOCAL_DESTROY_ON_A_REPLICATED_REGION.toLocalizedString()); } }
public void run2() throws CacheException { Region region = getRootRegion().getSubregion(name); Region.Entry entry = region.getEntry(key); if (getRegionAttributes().getDataPolicy().withReplication() || getRegionAttributes().getPartitionAttributes() != null) { assertEquals(value, region.get(key)); } else { assertNull(entry); } } });
protected int getNumVMsWithListeners() { // if we don't have an AllEvents dataPolicy, only the local listener is notified RegionAttributes ra = CacheUtil.getRegion(eventTest.regionName).getAttributes(); DataPolicy dataPolicy = ra.getDataPolicy(); InterestPolicy interestPolicy = ra.getSubscriptionAttributes().getInterestPolicy(); boolean allEvents = dataPolicy.withReplication() || interestPolicy.isAll(); return (allEvents) ? TestHelper.getNumVMs()-1 : 1; }