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:46 UTC

[11/20] incubator-geode git commit: move GemFireChunkSlice out of SimpleMemoryAllocatorImpl

move GemFireChunkSlice 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/2364dd12
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/2364dd12
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/2364dd12

Branch: refs/heads/feature/GEODE-580
Commit: 2364dd12cf5345121bfa761ebafc46ef5c2cc0b4
Parents: 84de915
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Thu Nov 19 15:54:04 2015 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Thu Nov 19 15:54:04 2015 -0800

----------------------------------------------------------------------
 .../gemfire/internal/offheap/GemFireChunk.java  |  1 -
 .../internal/offheap/GemFireChunkSlice.java     | 44 ++++++++++++++++++++
 .../offheap/SimpleMemoryAllocatorImpl.java      | 22 ----------
 3 files changed, 44 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2364dd12/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunk.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunk.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunk.java
index d0d41a6..3167613 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunk.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunk.java
@@ -16,7 +16,6 @@
  */
 package com.gemstone.gemfire.internal.offheap;
 
-import com.gemstone.gemfire.internal.offheap.SimpleMemoryAllocatorImpl.GemFireChunkSlice;
 
 /**
  * A chunk that stores a GemFire object.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2364dd12/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkSlice.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkSlice.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkSlice.java
new file mode 100644
index 0000000..0c27aa3
--- /dev/null
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkSlice.java
@@ -0,0 +1,44 @@
+/*
+ * 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;
+
+/**
+ * Represents a slice of a GemFireChunk.
+ * A slice is a subsequence of the bytes stored in a GemFireChunk.
+ */
+public class GemFireChunkSlice extends GemFireChunk {
+  private final int offset;
+  private final int capacity;
+  public GemFireChunkSlice(GemFireChunk gemFireChunk, int position, int limit) {
+    super(gemFireChunk);
+    this.offset = gemFireChunk.getBaseDataOffset() + position;
+    this.capacity = limit - position;
+  }
+  @Override
+  public int getDataSize() {
+    return this.capacity;
+  }
+  
+  @Override
+  protected long getBaseDataAddress() {
+    return super.getBaseDataAddress() + this.offset;
+  }
+  @Override
+  protected int getBaseDataOffset() {
+    return this.offset;
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/2364dd12/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 0f91803..a5de17e 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
@@ -1450,28 +1450,6 @@ public final class SimpleMemoryAllocatorImpl implements MemoryAllocator, MemoryI
     }
   }
   
-  public static class GemFireChunkSlice extends GemFireChunk {
-    private final int offset;
-    private final int capacity;
-    public GemFireChunkSlice(GemFireChunk gemFireChunk, int position, int limit) {
-      super(gemFireChunk);
-      this.offset = gemFireChunk.getBaseDataOffset() + position;
-      this.capacity = limit - position;
-    }
-    @Override
-    public int getDataSize() {
-      return this.capacity;
-    }
-    
-    @Override
-    protected long getBaseDataAddress() {
-      return super.getBaseDataAddress() + this.offset;
-    }
-    @Override
-    protected int getBaseDataOffset() {
-      return this.offset;
-    }
-  }
   public static class FakeChunk extends Chunk {
     private final int size;
     public FakeChunk(int size) {