You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by la...@apache.org on 2017/04/29 00:12:44 UTC
[14/18] geode git commit: GEODE-2723: Removed localCacheEnabled field,
and associated dead code. This closes #440
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/8dd87ed9
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/8dd87ed9
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/8dd87ed9
Branch: refs/heads/feature/GEODE-2852
Commit: 8dd87ed9b7449c77b751689ebf19f8ff5f025157
Parents: e5549c8
Author: adongre <ad...@apache.org>
Authored: Tue Apr 4 23:58:53 2017 +0530
Committer: Lynn Hughes-Godfrey <lh...@pivotal.io>
Committed: Fri Apr 28 17:06:33 2017 -0700
----------------------------------------------------------------------
.../geode/internal/cache/PartitionedRegion.java | 66 +-------------------
1 file changed, 1 insertion(+), 65 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/8dd87ed9/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) {