geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [09/16] incubator-geode git commit: removed unused ChunkFactory
Date Fri, 19 Feb 2016 01:05:52 GMT
removed unused ChunkFactory


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

Branch: refs/heads/feature/GEODE-831
Commit: 34936a45c567c747a09755f65da599b14553a9ca
Parents: a1a7027
Author: Darrel Schneider <dschneider@pivotal.io>
Authored: Thu Feb 18 15:36:49 2016 -0800
Committer: Darrel Schneider <dschneider@pivotal.io>
Committed: Thu Feb 18 15:36:49 2016 -0800

----------------------------------------------------------------------
 .../gemfire/internal/offheap/ChunkFactory.java  | 36 ---------
 .../internal/offheap/GemFireChunkFactory.java   | 33 ---------
 .../offheap/GemFireChunkFactoryJUnitTest.java   | 78 --------------------
 .../internal/offheap/StoredObjectTestSuite.java |  1 -
 4 files changed, 148 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/34936a45/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/ChunkFactory.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/ChunkFactory.java
b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/ChunkFactory.java
deleted file mode 100644
index 3e38d22..0000000
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/ChunkFactory.java
+++ /dev/null
@@ -1,36 +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;
-
-
-/**
- * ChunkFactory can be used to create Chunk instances.
- * It can also be used to determine the ChunkType given a Chunk address
- * or the object header bits from an existing Chunk.
- */
-public interface ChunkFactory  {
-  /**
-   * Create a new chunk of the given size and type at the given address.
-   */
-  Chunk newChunk(long address, int chunkSize);
-  /**
-   * Create a new chunk for a block of memory (identified by address)
-   * that has already been allocated.
-   * The size and type are derived from the existing object header.
-   */
-  Chunk newChunk(long address);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/34936a45/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
deleted file mode 100644
index 8da2180..0000000
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactory.java
+++ /dev/null
@@ -1,33 +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;
-
-
-/**
- * A ChunkFactory that produces chunks of type GemFireChunk.
- */
-public class GemFireChunkFactory implements ChunkFactory {
-  @Override
-  public Chunk newChunk(long address, int chunkSize) {
-    return new GemFireChunk(address,chunkSize);
-  }
-
-  @Override
-  public Chunk newChunk(long address) {
-    return new GemFireChunk(address);
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/34936a45/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactoryJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactoryJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactoryJUnitTest.java
deleted file mode 100644
index 8442a39..0000000
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/GemFireChunkFactoryJUnitTest.java
+++ /dev/null
@@ -1,78 +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.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.mock;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.experimental.categories.Category;
-
-import com.gemstone.gemfire.LogWriter;
-import com.gemstone.gemfire.internal.cache.EntryEventImpl;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
-
-@Category(UnitTest.class)
-public class GemFireChunkFactoryJUnitTest {
-
-  private MemoryAllocator ma;
-
-  @Before
-  public void setUp() {
-    OutOfOffHeapMemoryListener ooohml = mock(OutOfOffHeapMemoryListener.class);
-    OffHeapMemoryStats stats = mock(OffHeapMemoryStats.class);
-    LogWriter lw = mock(LogWriter.class);
-
-    ma = SimpleMemoryAllocatorImpl.create(ooohml, stats, lw, 1, OffHeapStorage.MIN_SLAB_SIZE
* 1, OffHeapStorage.MIN_SLAB_SIZE);
-  }
-
-  @After
-  public void tearDown() {
-    SimpleMemoryAllocatorImpl.freeOffHeapMemory();
-  }
-
-  private GemFireChunk createChunk(Object value) {
-    byte[] v = EntryEventImpl.serialize(value);
-
-    boolean isSerialized = true;
-    boolean isCompressed = false;
-
-    GemFireChunk chunk = (GemFireChunk) ma.allocateAndInitialize(v, isSerialized, isCompressed);
-
-    return chunk;
-  }
-
-  @Test
-  public void factoryShouldCreateNewChunkWithGivenAddress() {
-    GemFireChunk chunk = createChunk(Long.MAX_VALUE);
-
-    ChunkFactory factory = new GemFireChunkFactory();
-    Chunk newChunk = factory.newChunk(chunk.getMemoryAddress());
-
-    assertNotNull(newChunk);
-    assertEquals(GemFireChunk.class, newChunk.getClass());
-
-    assertThat(newChunk.getMemoryAddress()).isEqualTo(chunk.getMemoryAddress());
-
-    chunk.release();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/34936a45/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
index d4f9e97..d24bc97 100644
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/StoredObjectTestSuite.java
@@ -25,7 +25,6 @@ import org.junit.runners.Suite;
 	GemFireChunkJUnitTest.class,
 	ChunkWithHeapFormJUnitTest.class,
 	GemFireChunkSliceJUnitTest.class,
-	GemFireChunkFactoryJUnitTest.class
 })
 @RunWith(Suite.class)
 public class StoredObjectTestSuite {


Mime
View raw message