@Override public boolean include(Profile profile) { assert profile instanceof CacheProfile; CacheProfile cp = (CacheProfile) profile; if (cp.dataPolicy.isEmpty()) { return true; } return false; } });
/** * Returns true if this region has no storage * * @since GemFire 5.0 */ @Override public boolean isProxy() { return getDataPolicy().isEmpty(); }
@Override public void writeToDisk() { if (this.diskRegion == null) { DataPolicy dp = getDataPolicy(); if (dp.isEmpty()) { throw new IllegalStateException( String.format("Cannot write a region with data-policy %s to disk.", dp)); } else if (!dp.withPersistence() && !isOverflowEnabled()) { throw new IllegalStateException( "Cannot write a region that is not configured to access disks."); } } else { this.diskRegion.asynchForceFlush(); } }
@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 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 @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)); } }
if (dp.isEmpty() || dp.isNormal()) {
@Override public <K, V> Region<K, V> getRegion(String path) { preOp(); if (this.cache.getRegion(path) == null) { return null; } else { if (!this.cache.getRegion(path).getAttributes().getDataPolicy().isEmpty()) { throw new IllegalStateException( "Region's data-policy must be EMPTY when multiuser-authentication is true"); } return new ProxyRegion(this, this.cache.getRegion(path)); } }
/** * When a <code>partition-attributes</code> element is finished, the {@link PartitionAttributes} * are on top of the stack followed by the {@link RegionAttributesCreation} to which the partition * attributes are assigned. */ private void endPartitionAttributes() { PartitionAttributesImpl paf = (PartitionAttributesImpl) stack.pop(); paf.validateAttributes(); RegionAttributesCreation rattrs = peekRegionAttributesContext(PARTITION_ATTRIBUTES); // change the 5.0 default data policy (EMPTY) to the current default if (rattrs.hasDataPolicy() && rattrs.getDataPolicy().isEmpty() && (this.version.compareTo(CacheXmlVersion.GEMFIRE_5_0) == 0)) { rattrs.setDataPolicy(PartitionedRegionHelper.DEFAULT_DATA_POLICY); } rattrs.setPartitionAttributes(paf); }
@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())); } }
if (this.dataPolicy.isEmpty()) s |= PROXY_MASK; if (this.dataPolicy.isPreloaded())
String dpString; DataPolicy dp = attrs.getDataPolicy(); if (dp.isEmpty()) { dpString = EMPTY_DP; } else if (dp.isNormal()) {
if (cp.getMultiuserAuthentication() && !this.getDataPolicy().isEmpty()) { throw new IllegalStateException( "Region must have empty data-policy " + "when multiuser-authentication is true.");