geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [geode] branch develop updated: GEODE-4304: use the gettor method for dataPolicy (#1295)
Date Thu, 18 Jan 2018 20:18:06 GMT
This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3504d51  GEODE-4304: use the gettor method for dataPolicy (#1295)
3504d51 is described below

commit 3504d51c6be126975dcb394d3e926d0d2552a0b0
Author: Darrel Schneider <dschneider@pivotal.io>
AuthorDate: Thu Jan 18 12:18:02 2018 -0800

    GEODE-4304: use the gettor method for dataPolicy (#1295)
    
    GEODE-4304: use the gettor method for dataPolicy
---
 .../geode/internal/cache/AbstractRegion.java       | 20 +++++------
 .../geode/internal/cache/AbstractRegionMap.java    |  8 ++---
 .../internal/cache/AbstractUpdateOperation.java    |  2 +-
 .../geode/internal/cache/DistributedRegion.java    | 37 +++++++++----------
 .../org/apache/geode/internal/cache/HARegion.java  |  2 +-
 .../internal/cache/InitialImageOperation.java      |  2 +-
 .../geode/internal/cache/InvalidateOperation.java  |  2 +-
 .../apache/geode/internal/cache/LocalRegion.java   | 42 +++++++++++-----------
 .../geode/internal/cache/LocalRegionDataView.java  |  4 +--
 .../geode/internal/cache/PartitionedRegion.java    | 10 +++---
 .../geode/internal/cache/QueuedOperation.java      |  2 +-
 .../apache/geode/internal/cache/TXEntryState.java  |  7 ++--
 .../geode/internal/cache/TombstoneService.java     |  2 +-
 13 files changed, 71 insertions(+), 69 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
index c9943ce..0c15102 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegion.java
@@ -148,7 +148,7 @@ public abstract class AbstractRegion implements InternalRegion, AttributesMutato
 
   protected float loadFactor;
 
-  protected DataPolicy dataPolicy;
+  private DataPolicy dataPolicy;
 
   protected int regionIdleTimeout;
 
@@ -434,7 +434,7 @@ public abstract class AbstractRegion implements InternalRegion, AttributesMutato
     StringBuilder buf = new StringBuilder();
     buf.append(getClass().getName());
     buf.append("[path='").append(getFullPath()).append("';scope=").append(getScope())
-        .append("';dataPolicy=").append(this.dataPolicy);
+        .append("';dataPolicy=").append(this.getDataPolicy());
     if (this.getConcurrencyChecksEnabled()) {
       buf.append("; concurrencyChecksEnabled");
     }
@@ -546,15 +546,15 @@ public abstract class AbstractRegion implements InternalRegion, AttributesMutato
 
   @Override
   public MirrorType getMirrorType() {
-    if (this.dataPolicy.isNormal() || this.dataPolicy.isPreloaded() || this.dataPolicy.isEmpty()
-        || this.dataPolicy.withPartitioning()) {
+    if (this.getDataPolicy().isNormal() || this.getDataPolicy().isPreloaded()
+        || this.getDataPolicy().isEmpty() || this.getDataPolicy().withPartitioning()) {
       return MirrorType.NONE;
-    } else if (this.dataPolicy.withReplication()) {
+    } else if (this.getDataPolicy().withReplication()) {
       return MirrorType.KEYS_VALUES;
     } else {
       throw new IllegalStateException(
           LocalizedStrings.AbstractRegion_NO_MIRROR_TYPE_CORRESPONDS_TO_DATA_POLICY_0
-              .toLocalizedString(this.dataPolicy));
+              .toLocalizedString(this.getDataPolicy()));
     }
   }
 
@@ -1093,7 +1093,7 @@ public abstract class AbstractRegion implements InternalRegion, AttributesMutato
   }
 
   void checkEntryTimeoutAction(String mode, ExpirationAction ea) {
-    if ((this.dataPolicy.withReplication() || this.dataPolicy.withPartitioning())
+    if ((this.getDataPolicy().withReplication() || this.getDataPolicy().withPartitioning())
         && (ea == ExpirationAction.LOCAL_DESTROY || ea == ExpirationAction.LOCAL_INVALIDATE))
{
       throw new IllegalArgumentException(
           LocalizedStrings.AbstractRegion_0_ACTION_IS_INCOMPATIBLE_WITH_THIS_REGIONS_DATA_POLICY
@@ -1203,7 +1203,7 @@ public abstract class AbstractRegion implements InternalRegion, AttributesMutato
       validatePRRegionExpirationAttributes(idleTimeout);
     }
     if (idleTimeout.getAction() == ExpirationAction.LOCAL_INVALIDATE
-        && this.dataPolicy.withReplication()) {
+        && this.getDataPolicy().withReplication()) {
       throw new IllegalArgumentException(
           LocalizedStrings.AbstractRegion_0_ACTION_IS_INCOMPATIBLE_WITH_THIS_REGIONS_DATA_POLICY
               .toLocalizedString("idleTimeout"));
@@ -1232,7 +1232,7 @@ public abstract class AbstractRegion implements InternalRegion, AttributesMutato
       validatePRRegionExpirationAttributes(timeToLive);
     }
     if (timeToLive.getAction() == ExpirationAction.LOCAL_INVALIDATE
-        && this.dataPolicy.withReplication()) {
+        && this.getDataPolicy().withReplication()) {
       throw new IllegalArgumentException(
           LocalizedStrings.AbstractRegion_0_ACTION_IS_INCOMPATIBLE_WITH_THIS_REGIONS_DATA_POLICY
               .toLocalizedString("timeToLive"));
@@ -1628,7 +1628,7 @@ public abstract class AbstractRegion implements InternalRegion, AttributesMutato
                 .toLocalizedString(this.poolName));
       }
       cp.attach();
-      if (cp.getMultiuserAuthentication() && !this.dataPolicy.isEmpty()) {
+      if (cp.getMultiuserAuthentication() && !this.getDataPolicy().isEmpty()) {
         throw new IllegalStateException(
             "Region must have empty data-policy " + "when multiuser-authentication is true.");
       }
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
index 167552a..487c35a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
@@ -1100,7 +1100,7 @@ public abstract class AbstractRegionMap implements RegionMap {
             logger.trace(LogMarker.LRU_TOMBSTONE_COUNT,
                 "ARM.destroy() inTokenMode={}; duringRI={}; riLocalDestroy={}; withRepl={};
fromServer={}; concurrencyEnabled={}; isOriginRemote={}; isEviction={}; operation={}; re={}",
                 inTokenMode, duringRI, event.isFromRILocalDestroy(),
-                owner.dataPolicy.withReplication(), event.isFromServer(),
+                owner.getDataPolicy().withReplication(), event.isFromServer(),
                 owner.getConcurrencyChecksEnabled(), event.isOriginRemote(), isEviction,
                 event.getOperation(), re);
           }
@@ -1124,7 +1124,7 @@ public abstract class AbstractRegionMap implements RegionMap {
             // a destroy from a peer or WAN gateway and we need to retain version
             // information for concurrency checks
             boolean retainForConcurrency = (!haveTombstone
-                && (owner.dataPolicy.withReplication() || event.isFromServer())
+                && (owner.getDataPolicy().withReplication() || event.isFromServer())
                 && owner.getConcurrencyChecksEnabled()
                 && (event.isOriginRemote() /* destroy received from other must create
tombstone */
                     || event.isFromWANAndVersioned() /* wan event must create a tombstone
*/
@@ -3722,7 +3722,7 @@ public abstract class AbstractRegionMap implements RegionMap {
 
   /** get version-generation permission from the region's version vector */
   void lockForCacheModification(LocalRegion owner, EntryEventImpl event) {
-    boolean lockedByBulkOp = event.isBulkOpInProgress() && owner.dataPolicy.withReplication();
+    boolean lockedByBulkOp = event.isBulkOpInProgress() && owner.getDataPolicy().withReplication();
 
     if (armLockTestHook != null)
       armLockTestHook.beforeLock(owner, event);
@@ -3741,7 +3741,7 @@ public abstract class AbstractRegionMap implements RegionMap {
 
   /** release version-generation permission from the region's version vector */
   void releaseCacheModificationLock(LocalRegion owner, EntryEventImpl event) {
-    boolean lockedByBulkOp = event.isBulkOpInProgress() && owner.dataPolicy.withReplication();
+    boolean lockedByBulkOp = event.isBulkOpInProgress() && owner.getDataPolicy().withReplication();
 
     if (armLockTestHook != null)
       armLockTestHook.beforeRelease(owner, event);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
index 0fc7014..585e131 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractUpdateOperation.java
@@ -172,7 +172,7 @@ public abstract class AbstractUpdateOperation extends DistributedCacheOperation
               updated = true;
             } else { // key not here or blocked by DESTROYED token
               if (rgn.isUsedForPartitionedRegionBucket()
-                  || (rgn.dataPolicy.withReplication() && rgn.getConcurrencyChecksEnabled()))
{
+                  || (rgn.getDataPolicy().withReplication() && rgn.getConcurrencyChecksEnabled()))
{
                 overwriteDestroyed = true;
                 ev.makeCreate();
                 rgn.basicUpdate(ev, true /* ifNew */, false/* ifOld */, lastMod,
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
index 8a0ed38..16af9a9 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedRegion.java
@@ -311,7 +311,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
       return true;
     }
     return this.getConcurrencyChecksEnabled() && (this.serverRegionProxy == null)
&& !isTX()
-        && this.scope.isDistributed() && !this.dataPolicy.withReplication();
+        && this.scope.isDistributed() && !this.getDataPolicy().withReplication();
   }
 
 
@@ -340,7 +340,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
           // bug #45704: see if a one-hop must be done for this operation
           RegionEntry re = getRegionEntry(event.getKey());
           if (re == null /* || re.isTombstone() */ || !this.generateVersionTag) {
-            if (!event.isBulkOpInProgress() || this.dataPolicy.withStorage()) {
+            if (!event.isBulkOpInProgress() || this.getDataPolicy().withStorage()) {
               // putAll will send a single one-hop for empty regions. for other missing entries
               // we need to get a valid version number before modifying the local cache
               boolean didDistribute = RemotePutMessage.distribute(event, lastModified, false,
false,
@@ -546,9 +546,9 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
     if (logger.isTraceEnabled()) {
       logger.trace(
           "shouldGenerateVersionTag this.generateVersionTag={} ccenabled={} dataPolicy={}
event:{}",
-          this.generateVersionTag, this.getConcurrencyChecksEnabled(), this.dataPolicy, event);
+          this.generateVersionTag, this.getConcurrencyChecksEnabled(), this.getDataPolicy(),
event);
     }
-    if (!this.getConcurrencyChecksEnabled() || this.dataPolicy == DataPolicy.EMPTY
+    if (!this.getConcurrencyChecksEnabled() || this.getDataPolicy() == DataPolicy.EMPTY
         || !this.generateVersionTag) {
       return false;
     }
@@ -561,10 +561,10 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
     if (event.getOperation().isLocal()) { // bug #45402 - localDestroy generated a version
tag
       return false;
     }
-    if (!event.isOriginRemote() && this.dataPolicy.withReplication()) {
+    if (!event.isOriginRemote() && this.getDataPolicy().withReplication()) {
       return true;
     }
-    if (!this.dataPolicy.withReplication() && !this.dataPolicy.withPersistence())
{
+    if (!this.getDataPolicy().withReplication() && !this.getDataPolicy().withPersistence())
{
       if (!entry.getVersionStamp().hasValidVersion()) {
         // do not generate a version stamp in a region that has no replication if it's not
based
         // on an existing version from a replicate region
@@ -1112,7 +1112,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
     }
 
     ProfileExchangeProcessor targetProvider;
-    if (this.dataPolicy.withPersistence()) {
+    if (this.getDataPolicy().withPersistence()) {
       targetProvider =
           new CreatePersistentRegionProcessor(this, getPersistenceAdvisor(), recoverFromDisk);
     } else {
@@ -1121,7 +1121,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
     }
     imgState.setInRecovery(false);
     RegionVersionVector recovered_rvv = null;
-    if (this.dataPolicy.withPersistence()) {
+    if (this.getDataPolicy().withPersistence()) {
       recovered_rvv = this.getVersionVector() == null ? null
           : this.getVersionVector().getCloneForTransmission();
     }
@@ -1177,8 +1177,9 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
     while (!done && !isDestroyed()) {
       advice = targetProvider.getInitialImageAdvice(advice);
       boolean attemptGetFromOne = imageSrc != null // we were given a specific member
-          || this.dataPolicy.withPreloaded() && !advice.preloaded.isEmpty() // this
is a preloaded
-                                                                            // region
+          || this.getDataPolicy().withPreloaded() && !advice.preloaded.isEmpty()
// this is a
+                                                                                 // preloaded
+          // region
           || (!advice.replicates.isEmpty());
       // That is: if we have 0 or 1 giiProvider then we can do a getFromOne gii;
       // if we have 2 or more giiProviders then we must do a getFromAll gii.
@@ -1222,7 +1223,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
           }
 
           // Plan D: if this is a PRELOADED region, fetch from another PRELOADED
-          if (this.dataPolicy.isPreloaded()) {
+          if (this.getDataPolicy().isPreloaded()) {
             GIIStatus ret_preload =
                 iiop.getFromOne(advice.preloaded, false, advice, recoverFromDisk, recovered_rvv);
             if (GIIStatus.didGII(ret_preload)) {
@@ -1568,9 +1569,9 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
         if (re == null /* || re.isTombstone() */ || !this.generateVersionTag) {
           if (this.serverRegionProxy == null) {
             // only assert for non-client regions.
-            Assert.assertTrue(!this.dataPolicy.withReplication() || !this.generateVersionTag);
+            Assert.assertTrue(!this.getDataPolicy().withReplication() || !this.generateVersionTag);
           }
-          if (!event.isBulkOpInProgress() || this.dataPolicy.withStorage()) {
+          if (!event.isBulkOpInProgress() || this.getDataPolicy().withStorage()) {
             // removeAll will send a single one-hop for empty regions. for other missing
entries
             // we need to get a valid version number before modifying the local cache
             // TODO: deltaGII: verify that delegating to a peer when this region is also
a client is
@@ -1762,7 +1763,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
         if (re == null/* || re.isTombstone() */ || !this.generateVersionTag) {
           if (this.serverRegionProxy == null) {
             // only assert for non-client regions.
-            Assert.assertTrue(!this.dataPolicy.withReplication() || !this.generateVersionTag);
+            Assert.assertTrue(!this.getDataPolicy().withReplication() || !this.generateVersionTag);
           }
           // TODO: deltaGII: verify that delegating to a peer when this region is also a
client is
           // acceptable
@@ -1860,7 +1861,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
 
   @Override
   void basicClear(RegionEventImpl regionEvent, boolean cacheWrite) {
-    if (this.getConcurrencyChecksEnabled() && !this.dataPolicy.withReplication())
{
+    if (this.getConcurrencyChecksEnabled() && !this.getDataPolicy().withReplication())
{
       boolean retry = false;
       do {
         // non-replicate regions must defer to a replicate for clear/invalidate of region
@@ -1888,7 +1889,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
 
   @Override
   void cmnClearRegion(RegionEventImpl regionEvent, boolean cacheWrite, boolean useRVV) {
-    boolean enableRVV = useRVV && this.dataPolicy.withReplication()
+    boolean enableRVV = useRVV && this.getDataPolicy().withReplication()
         && this.getConcurrencyChecksEnabled() && !getDistributionManager().isLoner();
 
     // Fix for 46338 - apparently multiple threads from the same VM are allowed
@@ -2117,7 +2118,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
       cacheProfile.persistenceInitialized = getPersistenceAdvisor().isOnline();
     }
     cacheProfile.hasCacheServer = this.cache.getCacheServers().size() > 0 ? true : false;
-    cacheProfile.requiresOldValueInEvents = this.dataPolicy.withReplication()
+    cacheProfile.requiresOldValueInEvents = this.getDataPolicy().withReplication()
         && this.filterProfile != null && this.filterProfile.hasCQs();
     cacheProfile.gatewaySenderIds = getGatewaySenderIds();
     cacheProfile.asyncEventQueueIds = getVisibleAsyncEventQueueIds();
@@ -3832,7 +3833,7 @@ public class DistributedRegion extends LocalRegion implements InternalDistribute
    */
   protected VersionTag fetchRemoteVersionTag(Object key) {
     VersionTag tag = null;
-    assert this.dataPolicy != DataPolicy.REPLICATE;
+    assert this.getDataPolicy() != DataPolicy.REPLICATE;
     final TXStateProxy tx = cache.getTXMgr().pauseTransaction();
     try {
       boolean retry = true;
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/HARegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/HARegion.java
index f82aaea..4742551 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/HARegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/HARegion.java
@@ -145,7 +145,7 @@ public class HARegion extends DistributedRegion {
           LocalizedStrings.HARegion_TIMETOLIVE_MUST_NOT_BE_NULL.toLocalizedString());
     }
     if ((timeToLive.getAction() == ExpirationAction.LOCAL_DESTROY
-        && this.dataPolicy.withReplication())) {
+        && this.getDataPolicy().withReplication())) {
       throw new IllegalArgumentException(
           LocalizedStrings.HARegion_TIMETOLIVE_ACTION_IS_INCOMPATIBLE_WITH_THIS_REGIONS_MIRROR_TYPE
               .toLocalizedString());
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
index dddc45e..dca9b0b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java
@@ -569,7 +569,7 @@ public class InitialImageOperation {
             // TODO add localizedString
             logger.info("{} failed to get image from {}", this.region.getName(), recipient);
           }
-          if (this.region.dataPolicy.withPersistence()) {
+          if (this.region.getDataPolicy().withPersistence()) {
             logger.info(LocalizedMessage.create(
                 LocalizedStrings.InitialImageOperation_REGION_0_INITIALIZED_PERSISTENT_REGION_WITH_ID_1_FROM_2,
                 new Object[] {this.region.getName(), this.region.getPersistentID(), recipient}));
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InvalidateOperation.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/InvalidateOperation.java
index e7a29a5..d2c37cf 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InvalidateOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InvalidateOperation.java
@@ -84,7 +84,7 @@ public class InvalidateOperation extends DistributedCacheOperation {
           // if this is a mirrored region and we're still initializing, or
           // concurrency conflict detection is enabled (requiring version #
           // retention) then force new entry creation
-          boolean forceNewEntry = rgn.dataPolicy.withReplication()
+          boolean forceNewEntry = rgn.getDataPolicy().withReplication()
               && (!rgn.isInitialized() || rgn.getConcurrencyChecksEnabled());
           boolean invokeCallbacks = rgn.isInitialized();
           rgn.basicInvalidate(ev, invokeCallbacks, forceNewEntry);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
index 70a1a26..aca96d0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegion.java
@@ -715,12 +715,12 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   void createVersionVector() {
     this.versionVector = RegionVersionVector.create(getVersionMember(), this);
 
-    if (this.dataPolicy.withPersistence()) {
+    if (this.getDataPolicy().withPersistence()) {
       // copy the versions that we have recovered from disk into
       // the version vector.
       RegionVersionVector diskVector = this.diskRegion.getRegionVersionVector();
       this.versionVector.recordVersions(diskVector.getCloneForTransmission());
-    } else if (!this.dataPolicy.withStorage()) {
+    } else if (!this.getDataPolicy().withStorage()) {
       // version vectors are currently only necessary in empty regions for
       // tracking canonical member IDs
       this.versionVector.turnOffRecordingForEmptyRegion();
@@ -848,7 +848,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
 
   @Override
   public VersionSource getVersionMember() {
-    if (this.dataPolicy.withPersistence()) {
+    if (this.getDataPolicy().withPersistence()) {
       return getDiskStore().getDiskStoreID();
     } else {
       return this.cache.getInternalDistributedSystem().getDistributedMember();
@@ -2690,7 +2690,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       } else {
         closeAllCallbacks();
       }
-      if (this.getConcurrencyChecksEnabled() && this.dataPolicy.withReplication()
+      if (this.getConcurrencyChecksEnabled() && this.getDataPolicy().withReplication()
           && !this.cache.isClosed()) {
         this.cache.getTombstoneService().unscheduleTombstones(this);
       }
@@ -3333,13 +3333,13 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       return true;
     } else {
       return this.getConcurrencyChecksEnabled()
-          && (entry.getVersionStamp().hasValidVersion() || this.dataPolicy.withReplication());
+          && (entry.getVersionStamp().hasValidVersion() || this.getDataPolicy().withReplication());
     }
   }
 
   protected void enableConcurrencyChecks() {
     this.setConcurrencyChecksEnabled(true);
-    if (this.dataPolicy.withStorage()) {
+    if (this.getDataPolicy().withStorage()) {
       RegionEntryFactory versionedEntryFactory = this.entries.getEntryFactory().makeVersioned();
       Assert.assertTrue(this.entries.isEmpty(),
           "RegionMap should be empty but was of size:" + this.entries.size());
@@ -5624,7 +5624,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
     // for EMPTY clients, see if a concurrent map operation had an entry on the server
     ServerRegionProxy mySRP = getServerProxy();
 
-    if (mySRP != null && this.dataPolicy == DataPolicy.EMPTY) {
+    if (mySRP != null && this.getDataPolicy() == DataPolicy.EMPTY) {
       if (originalOp == Operation.PUT_IF_ABSENT) {
         return !event.hasOldValue();
       }
@@ -8950,7 +8950,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   // TODO: what does cmn refer to?
   void cmnClearRegion(RegionEventImpl regionEvent, boolean cacheWrite, boolean useRVV) {
     RegionVersionVector rvv = null;
-    if (useRVV && this.dataPolicy.withReplication() && this.getConcurrencyChecksEnabled())
{
+    if (useRVV && this.getDataPolicy().withReplication() && this.getConcurrencyChecksEnabled())
{
       rvv = this.versionVector.getCloneForTransmission();
     }
     clearRegionLocally(regionEvent, cacheWrite, rvv);
@@ -8973,7 +8973,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       // clients and local regions do not maintain a full RVV. can't use it with clear()
       rvv = null;
     }
-    if (rvv != null && this.dataPolicy.withStorage()) {
+    if (rvv != null && this.getDataPolicy().withStorage()) {
       if (isRvvDebugEnabled) {
         logger.trace(LogMarker.RVV, "waiting for my version vector to dominate{}mine={}{}
other={}",
             getLineSeparator(), getLineSeparator(), this.versionVector.fullToString(), rvv);
@@ -9076,7 +9076,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       txClearRegion();
       // Now clear the map of committed entries
       Set<VersionSource> remainingIDs = clearEntries(rvv);
-      if (!this.dataPolicy.withPersistence()) {
+      if (!this.getDataPolicy().withPersistence()) {
         // persistent regions do not reap IDs
         if (myVector != null) {
           myVector.removeOldMembers(remainingIDs);
@@ -9521,7 +9521,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
     // generated at commit
     // so treat transactional putAll as if the server is not versioned
     final boolean serverIsVersioned = proxyResult != null && proxyResult.regionIsVersioned()
-        && !isTX() && this.dataPolicy != DataPolicy.EMPTY;
+        && !isTX() && this.getDataPolicy() != DataPolicy.EMPTY;
     if (!serverIsVersioned && !partialResult) {
       // we don't need server information if it isn't versioned or if the region is empty
       proxyResult = null;
@@ -9569,7 +9569,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
                   logger.debug("putAll key {} -> {} version={}", key, value, versionTag);
                 }
                 if (versionTag == null && serverIsVersioned && getConcurrencyChecksEnabled()
-                    && dataPolicy.withStorage()) {
+                    && getDataPolicy().withStorage()) {
                   // server was unable to determine the version for this operation.
                   // I'm not sure this can still happen as described below on a pr.
                   // But it can happen on the server if NORMAL or PRELOADED. See bug 51644.
@@ -9907,7 +9907,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       testHook.beforeBulkLock(this);
     }
 
-    if (this.versionVector != null && this.dataPolicy.withReplication()) {
+    if (this.versionVector != null && this.getDataPolicy().withReplication()) {
       this.versionVector.lockForCacheModification(this);
     }
 
@@ -9922,7 +9922,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
       testHook.beforeBulkRelease(this);
     }
 
-    if (this.versionVector != null && this.dataPolicy.withReplication()) {
+    if (this.versionVector != null && this.getDataPolicy().withReplication()) {
       this.versionVector.releaseCacheModificationLock(this);
     }
 
@@ -10088,7 +10088,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   public void postPutAllFireEvents(DistributedPutAllOperation putAllOp,
       VersionedObjectList successfulPuts) {
 
-    if (!this.dataPolicy.withStorage() && this.getConcurrencyChecksEnabled()
+    if (!this.getDataPolicy().withStorage() && this.getConcurrencyChecksEnabled()
         && putAllOp.getBaseEvent().isBridgeEvent()) {
       // if there is no local storage we need to transfer version information
       // to the successfulPuts list for transmission back to the client
@@ -10122,7 +10122,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   public void postRemoveAllFireEvents(DistributedRemoveAllOperation removeAllOp,
       VersionedObjectList successfulOps) {
 
-    if (!this.dataPolicy.withStorage() && this.getConcurrencyChecksEnabled()
+    if (!this.getDataPolicy().withStorage() && this.getConcurrencyChecksEnabled()
         && removeAllOp.getBaseEvent().isBridgeEvent()) {
       // if there is no local storage we need to transfer version information
       // to the successfulOps list for transmission back to the client
@@ -10261,7 +10261,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
    * @return true if synchronization should be attempted
    */
   public boolean shouldSyncForCrashedMember(InternalDistributedMember id) {
-    return this.getConcurrencyChecksEnabled() && this.dataPolicy.withReplication()
+    return this.getConcurrencyChecksEnabled() && this.getDataPolicy().withReplication()
         && !this.isUsedForPartitionedRegionAdmin && !this.isUsedForMetaRegion
         && !this.isUsedForSerialGatewaySenderQueue;
   }
@@ -10472,7 +10472,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
    */
   @Override
   public boolean supportsConcurrencyChecks() {
-    return !isSecret() || this.dataPolicy.withPersistence();
+    return !isSecret() || this.getDataPolicy().withPersistence();
   }
 
   /**
@@ -11452,8 +11452,8 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   private void checkIfConcurrentMapOpsAllowed() {
     // This check allows NORMAL with local scope to fix bug 44856
     if (this.serverRegionProxy == null
-        && (this.dataPolicy == DataPolicy.NORMAL && this.scope.isDistributed()
-            || this.dataPolicy == DataPolicy.EMPTY)) {
+        && (this.getDataPolicy() == DataPolicy.NORMAL && this.scope.isDistributed()
+            || this.getDataPolicy() == DataPolicy.EMPTY)) {
       // the functional spec says these data policies do not support concurrent map
       // operations
       throw new UnsupportedOperationException();
@@ -11461,7 +11461,7 @@ public class LocalRegion extends AbstractRegion implements LoaderHelperFactory,
   }
 
   public boolean canStoreDataLocally() {
-    return this.dataPolicy.withStorage();
+    return this.getDataPolicy().withStorage();
   }
 
   /**
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
index 65a3616..22f5e0b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/LocalRegionDataView.java
@@ -313,7 +313,7 @@ public class LocalRegionDataView implements InternalDataView {
   @Override
   public void postPutAll(DistributedPutAllOperation putallOp, VersionedObjectList successfulPuts,
       LocalRegion region) {
-    if (!region.dataPolicy.withStorage() && region.getConcurrencyChecksEnabled()
+    if (!region.getDataPolicy().withStorage() && region.getConcurrencyChecksEnabled()
         && putallOp.getBaseEvent().isBridgeEvent()) {
       // if there is no local storage we need to transfer version information
       // to the successfulPuts list for transmission back to the client
@@ -335,7 +335,7 @@ public class LocalRegionDataView implements InternalDataView {
   @Override
   public void postRemoveAll(DistributedRemoveAllOperation op, VersionedObjectList successfulOps,
       LocalRegion region) {
-    if (!region.dataPolicy.withStorage() && region.getConcurrencyChecksEnabled()
+    if (!region.getDataPolicy().withStorage() && region.getConcurrencyChecksEnabled()
         && op.getBaseEvent().isBridgeEvent()) {
       // if there is no local storage we need to transfer version information
       // to the successfulOps list for transmission back to the client
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 46ed972..adf32b9 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -827,7 +827,7 @@ public class PartitionedRegion extends LocalRegion
     /*
      * Start persistent profile logging if we are a persistent region.
      */
-    if (dataPolicy.withPersistence()) {
+    if (getDataPolicy().withPersistence()) {
       startPersistenceProfileLogging();
     }
   }
@@ -902,7 +902,7 @@ public class PartitionedRegion extends LocalRegion
 
   private void createAndValidatePersistentConfig() {
     DiskStoreImpl dsi = this.getDiskStore();
-    if (this.dataPolicy.withPersistence() && !this.getConcurrencyChecksEnabled()
+    if (this.getDataPolicy().withPersistence() && !this.getConcurrencyChecksEnabled()
         && supportsConcurrencyChecks()) {
       logger.info(LocalizedMessage.create(
           LocalizedStrings.PartitionedRegion_ENABLING_CONCURRENCY_CHECKS_FOR_PERSISTENT_PR,
@@ -4935,7 +4935,7 @@ public class PartitionedRegion extends LocalRegion
     CacheProfile profile = (CacheProfile) p;
     // set fields on CacheProfile...
     profile.isPartitioned = true;
-    profile.isPersistent = dataPolicy.withPersistence();
+    profile.isPersistent = getDataPolicy().withPersistence();
     profile.dataPolicy = getDataPolicy();
     profile.hasCacheLoader = basicGetLoader() != null;
     profile.hasCacheWriter = basicGetWriter() != null;
@@ -4955,7 +4955,7 @@ public class PartitionedRegion extends LocalRegion
     profile.gatewaySenderIds = getGatewaySenderIds();
     profile.asyncEventQueueIds = getVisibleAsyncEventQueueIds();
 
-    if (dataPolicy.withPersistence()) {
+    if (getDataPolicy().withPersistence()) {
       profile.persistentID = getDiskStore().generatePersistentID(null);
     }
 
@@ -6919,7 +6919,7 @@ public class PartitionedRegion extends LocalRegion
   public String toString() {
     return new StringBuffer().append("Partitioned Region ").append("@")
         .append(Integer.toHexString(hashCode())).append(" [").append("path='").append(getFullPath())
-        .append("'; dataPolicy=").append(this.dataPolicy).append("; prId=")
+        .append("'; dataPolicy=").append(this.getDataPolicy()).append("; prId=")
         .append(this.partitionedRegionId).append("; isDestroyed=").append(this.isDestroyed)
         .append("; isClosed=").append(this.isClosed).append("; retryTimeout=")
         .append(this.retryTimeout).append("; serialNumber=").append(getSerialNumber())
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/QueuedOperation.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/QueuedOperation.java
index f50bac9..1c33cc8 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/QueuedOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/QueuedOperation.java
@@ -114,7 +114,7 @@ public class QueuedOperation {
           }
         } else if (this.op.isInvalidate()) {
           ee.setOldValueFromRegion();
-          boolean forceNewEntry = lr.dataPolicy.withReplication() && !lr.isInitialized();
+          boolean forceNewEntry = lr.getDataPolicy().withReplication() && !lr.isInitialized();
           boolean invokeCallbacks = lr.isInitialized();
           try {
             lr.basicInvalidate(ee, invokeCallbacks, forceNewEntry);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXEntryState.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXEntryState.java
index 33edc45..598b72f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXEntryState.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXEntryState.java
@@ -1032,7 +1032,7 @@ public class TXEntryState implements Releasable {
   private void fetchRemoteVersionTag(EntryEventImpl event) {
     if (event.getRegion() instanceof DistributedRegion) {
       DistributedRegion dr = (DistributedRegion) event.getRegion();
-      if (dr.dataPolicy == DataPolicy.NORMAL || dr.dataPolicy == DataPolicy.PRELOADED) {
+      if (dr.getDataPolicy() == DataPolicy.NORMAL || dr.getDataPolicy() == DataPolicy.PRELOADED)
{
         VersionTag tag = null;
         try {
           tag = dr.fetchRemoteVersionTag(event.getKey());
@@ -1863,8 +1863,9 @@ public class TXEntryState implements Releasable {
     if (sendVersionTag) {
       DataSerializer.writeObject(getVersionTag(), out);
       assert getVersionTag() != null || !txRegionState.getRegion().getConcurrencyChecksEnabled()
-          || txRegionState.getRegion().dataPolicy != DataPolicy.REPLICATE : "tag:" + getVersionTag()
-              + " r:" + txRegionState.getRegion() + " op:" + opToString() + " key:";
+          || txRegionState.getRegion().getDataPolicy() != DataPolicy.REPLICATE : "tag:"
+              + getVersionTag() + " r:" + txRegionState.getRegion() + " op:" + opToString()
+              + " key:";
     }
     if (sendShadowKey) {
       out.writeLong(this.tailKey);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
index 457cd7f..e73c3ef 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TombstoneService.java
@@ -164,7 +164,7 @@ public class TombstoneService {
 
   private TombstoneSweeper getSweeper(LocalRegion r) {
     if (r.getScope().isDistributed() && r.getServerProxy() == null
-        && r.dataPolicy.withReplication()) {
+        && r.getDataPolicy().withReplication()) {
       return this.replicatedTombstoneSweeper;
     } else {
       return this.nonReplicatedTombstoneSweeper;

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message