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/03/05 01:51:37 UTC
[37/38] incubator-geode git commit: renamed ObjectChunkSlize to
OffHeapStoredObjectSlice
renamed ObjectChunkSlize to OffHeapStoredObjectSlice
Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/344c64fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/344c64fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/344c64fd
Branch: refs/heads/feature/GEODE-982
Commit: 344c64fd228d068fcf8f98e37d7e3b8f7667124e
Parents: 164c256
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Fri Mar 4 16:22:52 2016 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Fri Mar 4 16:22:52 2016 -0800
----------------------------------------------------------------------
.../internal/offheap/ObjectChunkSlice.java | 44 ------------
.../internal/offheap/OffHeapStoredObject.java | 2 +-
.../offheap/OffHeapStoredObjectSlice.java | 44 ++++++++++++
.../offheap/ObjectChunkSliceJUnitTest.java | 72 --------------------
.../offheap/OffHeapStoredObjectJUnitTest.java | 2 +-
.../OffHeapStoredObjectSliceJUnitTest.java | 72 ++++++++++++++++++++
.../internal/offheap/StoredObjectTestSuite.java | 2 +-
7 files changed, 119 insertions(+), 119 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/344c64fd/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectChunkSlice.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectChunkSlice.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectChunkSlice.java
deleted file mode 100644
index b4e435b..0000000
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/ObjectChunkSlice.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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 an ObjectChunk.
- * A slice is a subsequence of the bytes stored in an ObjectChunk.
- */
-public class ObjectChunkSlice extends OffHeapStoredObject {
- private final int offset;
- private final int capacity;
- public ObjectChunkSlice(OffHeapStoredObject objectChunk, int position, int limit) {
- super(objectChunk);
- this.offset = objectChunk.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/344c64fd/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java
index 50e1449..68c9bdd 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObject.java
@@ -709,7 +709,7 @@ import com.gemstone.gemfire.internal.offheap.annotations.Unretained;
return null;
}
public StoredObject slice(int position, int limit) {
- return new ObjectChunkSlice(this, position, limit);
+ return new OffHeapStoredObjectSlice(this, position, limit);
}
@Override
public boolean hasRefCount() {
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/344c64fd/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectSlice.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectSlice.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectSlice.java
new file mode 100644
index 0000000..4e4d3e4
--- /dev/null
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectSlice.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 an OffHeapStoredObject.
+ * A slice is a subsequence of the bytes stored in an OffHeapStoredObject.
+ */
+public class OffHeapStoredObjectSlice extends OffHeapStoredObject {
+ private final int offset;
+ private final int capacity;
+ public OffHeapStoredObjectSlice(OffHeapStoredObject objectChunk, int position, int limit) {
+ super(objectChunk);
+ this.offset = objectChunk.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/344c64fd/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectChunkSliceJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectChunkSliceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectChunkSliceJUnitTest.java
deleted file mode 100644
index cea0fd6..0000000
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/ObjectChunkSliceJUnitTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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 static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
-
-@Category(UnitTest.class)
-public class ObjectChunkSliceJUnitTest extends OffHeapStoredObjectJUnitTest {
-
- @Test
- public void sliceShouldHaveAValidDataSize() {
- int position = 1;
- int end = 2;
-
- OffHeapStoredObject chunk = createValueAsUnserializedStoredObject(getValue());
- ObjectChunkSlice slice = (ObjectChunkSlice) chunk.slice(position, end);
-
- assertNotNull(slice);
- assertEquals(ObjectChunkSlice.class, slice.getClass());
-
- assertEquals(end - position, slice.getDataSize());
- }
-
- @Test
- public void sliceShouldHaveAValidBaseDataAddress() {
- int position = 1;
- int end = 2;
-
- OffHeapStoredObject chunk = createValueAsUnserializedStoredObject(getValue());
- ObjectChunkSlice slice = (ObjectChunkSlice) chunk.slice(position, end);
-
- assertNotNull(slice);
- assertEquals(ObjectChunkSlice.class, slice.getClass());
-
- assertEquals(chunk.getBaseDataAddress() + position, slice.getBaseDataAddress());
- }
-
- @Test
- public void sliceShouldHaveAValidBaseOffset() {
- int position = 1;
- int end = 2;
-
- OffHeapStoredObject chunk = createValueAsUnserializedStoredObject(getValue());
- ObjectChunkSlice slice = (ObjectChunkSlice) chunk.slice(position, end);
-
- assertNotNull(slice);
- assertEquals(ObjectChunkSlice.class, slice.getClass());
-
- assertEquals(chunk.getBaseDataOffset() + position, slice.getBaseDataOffset());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/344c64fd/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectJUnitTest.java
index e17e5be..2f6b32c 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectJUnitTest.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectJUnitTest.java
@@ -161,7 +161,7 @@ public class OffHeapStoredObjectJUnitTest extends AbstractStoredObjectTestBase {
OffHeapStoredObject newChunk = (OffHeapStoredObject) chunk.slice(position, end);
assertNotNull(newChunk);
- assertThat(newChunk.getClass()).isEqualTo(ObjectChunkSlice.class);
+ assertThat(newChunk.getClass()).isEqualTo(OffHeapStoredObjectSlice.class);
assertThat(newChunk.getAddress()).isEqualTo(chunk.getAddress());
chunk.release();
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/344c64fd/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectSliceJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectSliceJUnitTest.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectSliceJUnitTest.java
new file mode 100644
index 0000000..1b5bf26
--- /dev/null
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/OffHeapStoredObjectSliceJUnitTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+
+@Category(UnitTest.class)
+public class OffHeapStoredObjectSliceJUnitTest extends OffHeapStoredObjectJUnitTest {
+
+ @Test
+ public void sliceShouldHaveAValidDataSize() {
+ int position = 1;
+ int end = 2;
+
+ OffHeapStoredObject chunk = createValueAsUnserializedStoredObject(getValue());
+ OffHeapStoredObjectSlice slice = (OffHeapStoredObjectSlice) chunk.slice(position, end);
+
+ assertNotNull(slice);
+ assertEquals(OffHeapStoredObjectSlice.class, slice.getClass());
+
+ assertEquals(end - position, slice.getDataSize());
+ }
+
+ @Test
+ public void sliceShouldHaveAValidBaseDataAddress() {
+ int position = 1;
+ int end = 2;
+
+ OffHeapStoredObject chunk = createValueAsUnserializedStoredObject(getValue());
+ OffHeapStoredObjectSlice slice = (OffHeapStoredObjectSlice) chunk.slice(position, end);
+
+ assertNotNull(slice);
+ assertEquals(OffHeapStoredObjectSlice.class, slice.getClass());
+
+ assertEquals(chunk.getBaseDataAddress() + position, slice.getBaseDataAddress());
+ }
+
+ @Test
+ public void sliceShouldHaveAValidBaseOffset() {
+ int position = 1;
+ int end = 2;
+
+ OffHeapStoredObject chunk = createValueAsUnserializedStoredObject(getValue());
+ OffHeapStoredObjectSlice slice = (OffHeapStoredObjectSlice) chunk.slice(position, end);
+
+ assertNotNull(slice);
+ assertEquals(OffHeapStoredObjectSlice.class, slice.getClass());
+
+ assertEquals(chunk.getBaseDataOffset() + position, slice.getBaseDataOffset());
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/344c64fd/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
index 789c0fa..48a0e25 100644
--- a/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
+++ b/geode-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
@@ -24,7 +24,7 @@ import org.junit.runners.Suite;
TinyStoredObjectJUnitTest.class,
OffHeapStoredObjectJUnitTest.class,
OffHeapStoredObjectWithHeapFormJUnitTest.class,
- ObjectChunkSliceJUnitTest.class,
+ OffHeapStoredObjectSliceJUnitTest.class,
})
@RunWith(Suite.class)
public class StoredObjectTestSuite {