You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2016/11/10 01:22:10 UTC
[1/3] incubator-geode git commit: removed unneeded OffHeapRegionEntry
references
Repository: incubator-geode
Updated Branches:
refs/heads/feature/GEODE-1895 293a56eb9 -> 2162effc8
removed unneeded OffHeapRegionEntry references
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/0db1dc88
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/0db1dc88
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/0db1dc88
Branch: refs/heads/feature/GEODE-1895
Commit: 0db1dc885ebc2dd66c55a86d4e68df716d7e0e28
Parents: 293a56e
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Wed Nov 9 16:52:32 2016 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Wed Nov 9 16:52:32 2016 -0800
----------------------------------------------------------------------
.../geode/internal/cache/AbstractRegionEntry.java | 8 +++-----
.../geode/internal/cache/AbstractRegionMap.java | 17 +++++------------
.../geode/internal/cache/EntryEventImpl.java | 2 +-
3 files changed, 9 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0db1dc88/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java
index 41ca8d0..27848e1 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionEntry.java
@@ -452,7 +452,7 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
public void releaseOffHeapRefIfRegionBeingClosedOrDestroyed(RegionEntryContext context,
Object ref) {
if (isOffHeapReference(ref) && isThisRegionBeingClosedOrDestroyed(context)) {
- ((OffHeapRegionEntry) this).release();
+ release();
}
}
@@ -462,8 +462,8 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
}
private boolean isOffHeapReference(Object ref) {
- return ref != Token.REMOVED_PHASE1 && this instanceof OffHeapRegionEntry
- && ref instanceof StoredObject && ((StoredObject) ref).hasRefCount();
+ return ref != Token.REMOVED_PHASE1 && ref instanceof StoredObject
+ && ((StoredObject) ref).hasRefCount();
}
/**
@@ -1180,8 +1180,6 @@ public abstract class AbstractRegionEntry implements RegionEntry, HashEntry<Obje
if (v instanceof DiskEntry.RecoveredEntry)
return false; // The disk layer has special logic that ends up storing the nested value in the
// RecoveredEntry off heap
- if (!(e instanceof OffHeapRegionEntry))
- return false;
// TODO should we check for deltas here or is that a user error?
return true;
}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0db1dc88/geode-core/src/main/java/org/apache/geode/internal/cache/AbstractRegionMap.java
----------------------------------------------------------------------
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 de05b0d..86c25c0 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
@@ -234,14 +234,14 @@ public abstract class AbstractRegionMap implements RegionMap {
public final RegionEntry putEntryIfAbsent(Object key, RegionEntry re) {
RegionEntry oldRe = (RegionEntry) _getMap().putIfAbsent(key, re);
- if (oldRe == null && (re instanceof OffHeapRegionEntry) && _isOwnerALocalRegion()
+ if (oldRe == null && _isOwnerALocalRegion() && _getOwner().getOffHeap()
&& _getOwner().isThisRegionBeingClosedOrDestroyed()) {
// prevent orphan during concurrent destroy (#48068)
Object v = re._getValue();
if (v != Token.REMOVED_PHASE1 && v != Token.REMOVED_PHASE2 && v instanceof StoredObject
&& ((StoredObject) v).hasRefCount()) {
if (_getMap().remove(key, re)) {
- ((OffHeapRegionEntry) re).release();
+ re.release();
}
}
}
@@ -573,9 +573,7 @@ public abstract class AbstractRegionMap implements RegionMap {
lruEntryUpdate(newRe);
} finally {
OffHeapHelper.release(value);
- if (oldRe instanceof OffHeapRegionEntry) {
- ((OffHeapRegionEntry) oldRe).release();
- }
+ oldRe.release();
}
lruUpdateCallback();
}
@@ -647,10 +645,7 @@ public abstract class AbstractRegionMap implements RegionMap {
* and throw an exception.
*/
else {
- if (newRe instanceof OffHeapRegionEntry) {
- ((OffHeapRegionEntry) newRe).release();
- }
-
+ newRe.release();
throw new IllegalStateException(
"Could not recover entry for key " + key + ". The entry already exists!");
}
@@ -2632,9 +2627,7 @@ public abstract class AbstractRegionMap implements RegionMap {
retVal = getEntryFactory().createEntry((RegionEntryContext) ownerRegion, key, value);
RegionEntry oldRe = putEntryIfAbsent(key, retVal);
if (oldRe != null) {
- if (retVal instanceof OffHeapRegionEntry) {
- ((OffHeapRegionEntry) retVal).release();
- }
+ retVal.release();
return oldRe;
}
return retVal;
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/0db1dc88/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java
index 02c0422..ea95b73 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java
@@ -1630,7 +1630,7 @@ public class EntryEventImpl
reentry.setValueWithTombstoneCheck(v, this); // already called prepareValueForCache
success = true;
} finally {
- if (!success && reentry instanceof OffHeapRegionEntry && v instanceof StoredObject) {
+ if (!success && owner.getOffHeap() && v instanceof StoredObject) {
OffHeapRegionEntryHelper.releaseEntry((OffHeapRegionEntry) reentry, (StoredObject) v);
}
}
[3/3] incubator-geode git commit: Merge branch 'feature/GEODE-1785'
into feature/GEODE-1895
Posted by ds...@apache.org.
Merge branch 'feature/GEODE-1785' into feature/GEODE-1895
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/2162effc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/2162effc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/2162effc
Branch: refs/heads/feature/GEODE-1895
Commit: 2162effc8fd23b2c4648ef6f30545777bc3388e3
Parents: 0db1dc8 4020683
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Wed Nov 9 17:04:28 2016 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Wed Nov 9 17:04:28 2016 -0800
----------------------------------------------------------------------
dev-tools/generateRegionEntryClasses.sh | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
[2/3] incubator-geode git commit: changed gradle to gradlew added
apache license
Posted by ds...@apache.org.
changed gradle to gradlew
added apache license
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/40206834
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/40206834
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/40206834
Branch: refs/heads/feature/GEODE-1895
Commit: 402068349d09ed0d208d5c31e4f63ebe2daf27bf
Parents: 48808a9
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Wed Nov 9 16:58:50 2016 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Wed Nov 9 16:58:50 2016 -0800
----------------------------------------------------------------------
dev-tools/generateRegionEntryClasses.sh | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/40206834/dev-tools/generateRegionEntryClasses.sh
----------------------------------------------------------------------
diff --git a/dev-tools/generateRegionEntryClasses.sh b/dev-tools/generateRegionEntryClasses.sh
index ea0fe83..23a8a02 100755
--- a/dev-tools/generateRegionEntryClasses.sh
+++ b/dev-tools/generateRegionEntryClasses.sh
@@ -1,11 +1,24 @@
#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+# agreements. See the NOTICE file distributed with this work for additional information regarding
+# copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License. You may obtain a
+# copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License
+# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+# or implied. See the License for the specific language governing permissions and limitations under
+# the License.
+#
# This script should only be run from the top level build directory
# (the one that contains the "dev-tools" subdirectory).
# It reads LeafRegionEntry.cpp, preprocesses it and generates all the leaf
# class source files that subclass AbstractRegionEntry.
# It executes cpp. It has been tested with gnu's cpp on linux.
# After using it to generate new java files, make sure and
-# run 'gradle spotlessApply' to format these generated files.
+# run './gradlew spotlessApply' to format these generated files.
# Then use 'git diff' to validate the changes you made to the
# generated java files before committing them.
@@ -48,4 +61,4 @@ do
done
done
done
-echo now run \'./gradle spotlessApply\' to format the generated files
+echo now run \'./gradlew spotlessApply\' to format the generated files