You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ad...@apache.org on 2017/04/28 02:58:27 UTC

geode git commit: GEODE-2723: Removed localCacheEnabled field, and associated dead code. This closes #440

Repository: geode
Updated Branches:
  refs/heads/develop f1b14b0dd -> a5af40569


GEODE-2723: Removed localCacheEnabled field, and associated dead code.
This closes #440

Signed-off-by: adongre <ad...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/a5af4056
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/a5af4056
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/a5af4056

Branch: refs/heads/develop
Commit: a5af405693a6ccd0e7124a9d9b912f1a653d79f9
Parents: f1b14b0
Author: adongre <ad...@apache.org>
Authored: Tue Apr 4 23:58:53 2017 +0530
Committer: adongre <ad...@apache.org>
Committed: Fri Apr 28 08:20:17 2017 +0530

----------------------------------------------------------------------
 .../geode/internal/cache/PartitionedRegion.java | 66 +-------------------
 1 file changed, 1 insertion(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/a5af4056/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
----------------------------------------------------------------------
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 e0aae5d..da80fa6 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
@@ -243,11 +243,6 @@ public class PartitionedRegion extends LocalRegion
   /** Number of initial buckets */
   private final int totalNumberOfBuckets;
 
-  /**
-   * To check if local cache is enabled.
-   */
-  private static final boolean localCacheEnabled = false;
-
   // private static final boolean throwIfNoNodesLeft = true;
 
   public static final int DEFAULT_RETRY_ITERATIONS = 3;
@@ -3922,15 +3917,7 @@ public class PartitionedRegion extends LocalRegion
           obj = this.dataStore.getLocally(bucketId, key, aCallbackArgument, disableCopyOnRead,
               preferCD, requestingClient, clientEvent, returnTombstones, false);
         } else {
-          if (localCacheEnabled && null != (obj = localCacheGet(key))) { // OFFHEAP: copy into heap
-                                                                         // cd; TODO optimize for
-                                                                         // preferCD case
-            if (logger.isTraceEnabled()) {
-              logger.trace("getFromBucket: Getting key {} ({}) from local cache", key,
-                  key.hashCode());
-            }
-            return obj;
-          } else if (this.haveCacheLoader) {
+          if (this.haveCacheLoader) {
             // If the region has a cache loader,
             // the target node is the primary server of the bucket. But, if the
             // value can be found in a local bucket, we should first try there.
@@ -4876,19 +4863,6 @@ public class PartitionedRegion extends LocalRegion
     if (logger.isDebugEnabled()) {
       logger.debug("getRemotely: got value {} for key {}", value, key);
     }
-
-    // Here even if we can not cache the value, it should return value to
-    // user.
-    try {
-      if (localCacheEnabled && value != null) {
-        super.put(key, value);
-      }
-    } catch (Exception e) {
-      if (logger.isDebugEnabled()) {
-        logger.debug("getRemotely: Can not cache value = {} for key = {} in local cache", value,
-            key, e);
-      }
-    }
     return value;
   }
 
@@ -5389,22 +5363,6 @@ public class PartitionedRegion extends LocalRegion
             setNetworkHopType(bucketId, currentTarget);
           }
           destroyRemotely(currentTarget, bucketId, event, expectedOldValue);
-          if (localCacheEnabled) {
-            try {
-              // only destroy in local cache if successfully destroyed remotely
-              final boolean cacheWrite = true;
-              super.basicDestroy(event, cacheWrite, null); // pass null as expectedOldValue,
-                                                           // since if successfully destroyed
-                                                           // remotely we always want to succeed
-                                                           // locally
-            } catch (EntryNotFoundException enf) {
-              if (logger.isDebugEnabled()) {
-                logger.debug(
-                    "destroyInBucket: Failed to invalidate from local cache because of EntryNotFoundException.",
-                    enf);
-              }
-            }
-          }
         }
         return;
 
@@ -5900,17 +5858,6 @@ public class PartitionedRegion extends LocalRegion
           this.dataStore.invalidateLocally(bucketId, event);
         } else {
           invalidateRemotely(retryNode, bucketId, event);
-          if (localCacheEnabled) {
-            try {
-              super.basicInvalidate(event);
-            } catch (EntryNotFoundException enf) {
-              if (isDebugEnabled) {
-                logger.debug(
-                    "invalidateInBucket: Failed to invalidate from local cache because of EntryNotFoundException.",
-                    enf);
-              }
-            }
-          }
         }
         return;
       } catch (ConcurrentCacheModificationException e) {
@@ -10248,17 +10195,6 @@ public class PartitionedRegion extends LocalRegion
           this.dataStore.updateEntryVersionLocally(bucketId, event);
         } else {
           updateEntryVersionRemotely(retryNode, bucketId, event);
-          if (localCacheEnabled) {
-            try {
-              super.basicUpdateEntryVersion(event);
-            } catch (EntryNotFoundException enf) {
-              if (isDebugEnabled) {
-                logger.debug(
-                    "updateEntryVersionInBucket: Failed to update entry version timestamp from local cache because of EntryNotFoundException.",
-                    enf);
-              }
-            }
-          }
         }
         return;
       } catch (ConcurrentCacheModificationException e) {