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 2015/11/20 02:07:42 UTC

[07/20] incubator-geode git commit: move GemFireChunkFactory out of SimpleMemoryAllocatorImpl

move GemFireChunkFactory out of 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/b4cbd4a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b4cbd4a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b4cbd4a6

Branch: refs/heads/feature/GEODE-580
Commit: b4cbd4a6d0d4953a5b51b8acd1f6dcabfe7bced6
Parents: 9d5905d
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Thu Nov 19 15:41:13 2015 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Thu Nov 19 15:41:13 2015 -0800

----------------------------------------------------------------------
 .../internal/offheap/GemFireChunkFactory.java   | 54 ++++++++++++++++++++
 .../offheap/SimpleMemoryAllocatorImpl.java      | 32 ------------
 2 files changed, 54 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b4cbd4a6/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactory.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactory.java
new file mode 100644
index 0000000..b60013d
--- /dev/null
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactory.java
@@ -0,0 +1,54 @@
+/*
+ * 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;
+
+import com.gemstone.gemfire.internal.offheap.SimpleMemoryAllocatorImpl.ChunkType;
+import com.gemstone.gemfire.internal.offheap.SimpleMemoryAllocatorImpl.GemFireChunk;
+
+/**
+ * A ChunkFactory that produces chunks of type GemFireChunk.
+ */
+public class GemFireChunkFactory implements ChunkFactory {
+  @Override
+  public Chunk newChunk(long address, int chunkSize, ChunkType chunkType) {
+    assert chunkType.equals(GemFireChunk.TYPE);
+    return new GemFireChunk(address,chunkSize);
+  }
+
+  @Override
+  public Chunk newChunk(long address) {
+    return new GemFireChunk(address);
+  }
+
+  @Override
+  public Chunk newChunk(long address, ChunkType chunkType) {
+    assert chunkType.equals(GemFireChunk.TYPE);
+    return new GemFireChunk(address);
+  }
+
+  @Override
+  public ChunkType getChunkTypeForAddress(long address) {
+    assert Chunk.getSrcType(address) == Chunk.SRC_TYPE_GFE;
+    return GemFireChunk.TYPE;
+  }
+
+  @Override
+  public ChunkType getChunkTypeForRawBits(int bits) {
+    assert Chunk.getSrcTypeFromRawBits(bits) == Chunk.SRC_TYPE_GFE;
+    return GemFireChunk.TYPE;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b4cbd4a6/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 86cba3b..c13842a 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,38 +1424,6 @@ public final class SimpleMemoryAllocatorImpl implements MemoryAllocator, MemoryI
   }
   
   
-  private static class GemFireChunkFactory implements ChunkFactory {
-    @Override
-    public Chunk newChunk(long address, int chunkSize, ChunkType chunkType) {
-      assert chunkType.equals(GemFireChunk.TYPE);
-      return new GemFireChunk(address,chunkSize);
-    }
-
-    @Override
-    public Chunk newChunk(long address) {
-      return new GemFireChunk(address);
-    }
-
-    @Override
-    public Chunk newChunk(long address, ChunkType chunkType) {
-      assert chunkType.equals(GemFireChunk.TYPE);
-      return new GemFireChunk(address);
-    }
-
-    @Override
-    public ChunkType getChunkTypeForAddress(long address) {
-      assert Chunk.getSrcType(address) == Chunk.SRC_TYPE_GFE;
-      return GemFireChunk.TYPE;
-    }
-
-    @Override
-    public ChunkType getChunkTypeForRawBits(int bits) {
-      assert Chunk.getSrcTypeFromRawBits(bits) == Chunk.SRC_TYPE_GFE;
-      return GemFireChunk.TYPE;
-    }
-  }
-  
-  
   /**
    * 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