geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [17/38] incubator-geode git commit: moved Releasable from StoredObject to ObjectStoredOffHeap
Date Sat, 05 Mar 2016 00:51:17 GMT
moved Releasable from StoredObject to ObjectStoredOffHeap


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

Branch: refs/heads/feature/GEODE-982
Commit: 58df731e9b8b20c912be314f0f6e9d89eec50a8d
Parents: ec522f5
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Tue Mar 1 15:21:01 2016 -0800
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Tue Mar 1 15:21:01 2016 -0800

----------------------------------------------------------------------
 .../java/com/gemstone/gemfire/internal/cache/DiskEntry.java    | 4 ----
 .../gemfire/internal/offheap/ObjectStoredAsAddress.java        | 5 -----
 .../gemstone/gemfire/internal/offheap/ObjectStoredOffHeap.java | 2 +-
 .../com/gemstone/gemfire/internal/offheap/OffHeapHelper.java   | 2 +-
 .../com/gemstone/gemfire/internal/offheap/StoredObject.java    | 2 +-
 .../internal/offheap/ObjectStoredAsAddressJUnitTest.java       | 6 ------
 .../gemstone/gemfire/internal/offheap/OffHeapRegionBase.java   | 4 ++--
 7 files changed, 5 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58df731e/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java
index 5d4af90..dcedc1f 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/DiskEntry.java
@@ -1161,10 +1161,6 @@ public interface DiskEntry extends RegionEntry {
       if (result instanceof CachedDeserializable) {
         result = ((CachedDeserializable)result).getDeserializedValue(null, null);
       }
-      if (result instanceof StoredObject) {
-        ((StoredObject) result).release();
-        throw new IllegalStateException("sqlf tried to use getValueInVMOrDiskWithoutFaultIn");
-      }
       return result;
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58df731e/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddress.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddress.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddress.java
index 44b8634..d4f59d0 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddress.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddress.java
@@ -125,9 +125,4 @@ public class ObjectStoredAsAddress extends AbstractStoredObject {
   public boolean isCompressed() {
     return OffHeapRegionEntryHelper.isCompressed(this.address);
   }
-  
-  @Override
-  public void release() {
-    // nothing needed
-  }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58df731e/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredOffHeap.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredOffHeap.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredOffHeap.java
index 272bb8d..f108a7c 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredOffHeap.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectStoredOffHeap.java
@@ -29,7 +29,7 @@ import com.gemstone.gemfire.internal.offheap.annotations.Retained;
  * @author darrel
  * @since 9.0
  */
-public interface ObjectStoredOffHeap extends StoredObject {
+public interface ObjectStoredOffHeap extends StoredObject, Releasable {
   
   /**
    * Returns the off-heap address at which the data is stored.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58df731e/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapHelper.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapHelper.java
index 6a8783b..3c9c297 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapHelper.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapHelper.java
@@ -60,7 +60,7 @@ public class OffHeapHelper {
         return ohv.getDeserializedForReading();
       }
       } finally {
-        ohv.release();
+        release(ohv);
       }
     } else {
       return v;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58df731e/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/StoredObject.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/StoredObject.java
b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/StoredObject.java
index 10b33c7..be8ba65 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/StoredObject.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/StoredObject.java
@@ -31,7 +31,7 @@ import com.gemstone.gemfire.internal.offheap.annotations.Retained;
  * @author darrel
  * @since 9.0
  */
-public interface StoredObject extends Releasable, Sendable, CachedDeserializable {
+public interface StoredObject extends Sendable, CachedDeserializable {
  /**
    * Returns true if the value stored in this memory chunk is a serialized object. Returns
false if it is a byte array.
    */

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58df731e/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddressJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddressJUnitTest.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddressJUnitTest.java
index c3d365f..74964df 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddressJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectStoredAsAddressJUnitTest.java
@@ -160,12 +160,6 @@ public class ObjectStoredAsAddressJUnitTest extends AbstractStoredObjectTestBase
     }
 
     @Test
-    public void dataAsAddressShouldImplementReleaseToAdhereToStoredObject() {
-        ObjectStoredAsAddress address = new ObjectStoredAsAddress(10001L);
-        address.release();
-    }
-
-    @Test
     public void isCompressedShouldReturnTrueIfCompressed() {
         Object regionEntryValue = getValue();
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/58df731e/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
index 321446b..046f752 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapRegionBase.java
@@ -92,7 +92,7 @@ public abstract class OffHeapRegionBase {
       assertNotNull(ma);
       final long offHeapSize = ma.getFreeMemory();
       assertEquals(0, ma.getUsedMemory());
-      StoredObject mc1 = ma.allocate(64);
+      ObjectStoredOffHeap mc1 = ma.allocate(64);
       assertEquals(64+perObjectOverhead(), ma.getUsedMemory());
       assertEquals(offHeapSize-(64+perObjectOverhead()), ma.getFreeMemory());
       mc1.release();
@@ -123,7 +123,7 @@ public abstract class OffHeapRegionBase {
       assertNotNull(ma);
       final long offHeapSize = ma.getFreeMemory();
       assertEquals(0, ma.getUsedMemory());
-      StoredObject mc1 = ma.allocate(64);
+      ObjectStoredOffHeap mc1 = ma.allocate(64);
       assertEquals(64+perObjectOverhead(), ma.getUsedMemory());
       assertEquals(offHeapSize-(64+perObjectOverhead()), ma.getFreeMemory());
       mc1.release();


Mime
View raw message