geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [12/20] incubator-geode git commit: move ChunkWithHeapForm from SimpleMemoryAllocatorImpl
Date Fri, 20 Nov 2015 01:07:47 GMT
move ChunkWithHeapForm from SimpleMemoryAllocatorImpl


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

Branch: refs/heads/feature/GEODE-580
Commit: e7b29ce18d4fd244ee43a37ba00fd013b5c1d4e0
Parents: 2364dd1
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Thu Nov 19 15:55:35 2015 -0800
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Thu Nov 19 15:55:35 2015 -0800

----------------------------------------------------------------------
 .../internal/cache/AbstractRegionEntry.java     |  3 +-
 .../cache/wan/GatewaySenderEventImpl.java       |  2 +-
 .../internal/offheap/ChunkWithHeapForm.java     | 40 ++++++++++++++++++++
 .../offheap/SimpleMemoryAllocatorImpl.java      | 26 -------------
 4 files changed, 43 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7b29ce1/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java
index 55ecdb1..97c2371 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/AbstractRegionEntry.java
@@ -62,6 +62,7 @@ import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
 import com.gemstone.gemfire.internal.logging.log4j.LogMarker;
 import com.gemstone.gemfire.internal.offheap.Chunk;
+import com.gemstone.gemfire.internal.offheap.ChunkWithHeapForm;
 import com.gemstone.gemfire.internal.offheap.GemFireChunk;
 import com.gemstone.gemfire.internal.offheap.MemoryAllocator;
 import com.gemstone.gemfire.internal.offheap.OffHeapCachedDeserializable;
@@ -1347,7 +1348,7 @@ public abstract class AbstractRegionEntry implements RegionEntry,
         val = ma.allocateAndInitialize(compressedData, isSerialized, isCompressed, GemFireChunk.TYPE);
// TODO:KIRK:48068 race happens right after this line
         SimpleMemoryAllocatorImpl.setReferenceCountOwner(null);
         if (val instanceof GemFireChunk) {
-          val = new com.gemstone.gemfire.internal.offheap.SimpleMemoryAllocatorImpl.ChunkWithHeapForm((GemFireChunk)val,
data);
+          val = new com.gemstone.gemfire.internal.offheap.ChunkWithHeapForm((GemFireChunk)val,
data);
         }
 //        if (val instanceof Chunk && r instanceof LocalRegion) {
 //          Chunk c = (Chunk) val;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7b29ce1/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventImpl.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventImpl.java
index fc234e3..f7bf976 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventImpl.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/wan/GatewaySenderEventImpl.java
@@ -51,10 +51,10 @@ import com.gemstone.gemfire.internal.cache.lru.Sizeable;
 import com.gemstone.gemfire.internal.cache.tier.sockets.CacheServerHelper;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.offheap.Chunk;
+import com.gemstone.gemfire.internal.offheap.ChunkWithHeapForm;
 import com.gemstone.gemfire.internal.offheap.OffHeapHelper;
 import com.gemstone.gemfire.internal.offheap.Releasable;
 import com.gemstone.gemfire.internal.offheap.SimpleMemoryAllocatorImpl;
-import com.gemstone.gemfire.internal.offheap.SimpleMemoryAllocatorImpl.ChunkWithHeapForm;
 import com.gemstone.gemfire.internal.offheap.StoredObject;
 import com.gemstone.gemfire.internal.offheap.annotations.OffHeapIdentifier;
 import com.gemstone.gemfire.internal.offheap.annotations.Released;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7b29ce1/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/ChunkWithHeapForm.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/ChunkWithHeapForm.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/ChunkWithHeapForm.java
new file mode 100644
index 0000000..d7e65f7
--- /dev/null
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/ChunkWithHeapForm.java
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+package com.gemstone.gemfire.internal.offheap;
+
+/**
+ * Used to keep the heapForm around while an operation is still in progress.
+ * This allows the operation to access the serialized heap form instead of copying
+ * it from offheap. See bug 48135.
+ */
+public class ChunkWithHeapForm extends GemFireChunk {
+  private final byte[] heapForm;
+  
+  public ChunkWithHeapForm(GemFireChunk chunk, byte[] heapForm) {
+    super(chunk);
+    this.heapForm = heapForm;
+  }
+
+  @Override
+  protected byte[] getRawBytes() {
+    return this.heapForm;
+  }
+  
+  public Chunk getChunkWithoutHeapForm() {
+    return new GemFireChunk(this);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/e7b29ce1/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
index a5de17e..98be355 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
@@ -1424,32 +1424,6 @@ public final class SimpleMemoryAllocatorImpl implements MemoryAllocator,
MemoryI
   }
   
   
-  /**
-   * Used to keep the heapForm around while an operation is still in progress.
-   * This allows the operation to access the serialized heap form instead of copying
-   * it from offheap. See bug 48135.
-   * 
-   * @author darrel
-   *
-   */
-  public static class ChunkWithHeapForm extends GemFireChunk {
-    private final byte[] heapForm;
-    
-    public ChunkWithHeapForm(GemFireChunk chunk, byte[] heapForm) {
-      super(chunk);
-      this.heapForm = heapForm;
-    }
-
-    @Override
-    protected byte[] getRawBytes() {
-      return this.heapForm;
-    }
-    
-    public Chunk getChunkWithoutHeapForm() {
-      return new GemFireChunk(this);
-    }
-  }
-  
   public static class FakeChunk extends Chunk {
     private final int size;
     public FakeChunk(int size) {


Mime
View raw message