From commits-return-871-archive-asf-public=cust-asf.ponee.io@mnemonic.apache.org Fri Feb 5 02:05:46 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 48C0E18064D for ; Fri, 5 Feb 2021 03:05:46 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id A2640647A7 for ; Fri, 5 Feb 2021 02:05:45 +0000 (UTC) Received: (qmail 70318 invoked by uid 500); 5 Feb 2021 02:05:45 -0000 Mailing-List: contact commits-help@mnemonic.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mnemonic.apache.org Delivered-To: mailing list commits@mnemonic.apache.org Received: (qmail 70309 invoked by uid 99); 5 Feb 2021 02:05:44 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Feb 2021 02:05:44 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id A700F81F9F; Fri, 5 Feb 2021 02:05:44 +0000 (UTC) Date: Fri, 05 Feb 2021 02:05:44 +0000 To: "commits@mnemonic.apache.org" Subject: [mnemonic] branch master updated: MNEMONIC-603: Replace the Utils.getNonVolatileMemoryAllocatorService call from Collections MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <161249074459.4882.8831930653505985424@gitbox.apache.org> From: yzhao@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: mnemonic X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: fbb7db75c66ea6163d7049bfc4da6e20a23f9e89 X-Git-Newrev: 22d642678d62fa59fe82a1e29ce6b0b634266f25 X-Git-Rev: 22d642678d62fa59fe82a1e29ce6b0b634266f25 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. yzhao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mnemonic.git The following commit(s) were added to refs/heads/master by this push: new 22d6426 MNEMONIC-603: Replace the Utils.getNonVolatileMemoryAllocatorService call from Collections 22d6426 is described below commit 22d642678d62fa59fe82a1e29ce6b0b634266f25 Author: Xiaojin Jiao AuthorDate: Wed Feb 3 17:31:08 2021 -0800 MNEMONIC-603: Replace the Utils.getNonVolatileMemoryAllocatorService call from Collections Signed-off-by: Xiaojin Jiao --- mnemonic-collections/build.gradle | 1 + mnemonic-collections/pom.xml | 5 +++++ .../java/org/apache/mnemonic/collections/DurableArrayNGTest.java | 3 ++- .../java/org/apache/mnemonic/collections/DurableHashMapNGTest.java | 3 ++- .../java/org/apache/mnemonic/collections/DurableHashSetNGTest.java | 3 ++- .../java/org/apache/mnemonic/collections/DurablePersonNGTest.java | 5 +++-- .../apache/mnemonic/collections/DurableSinglyLinkedListNGTest.java | 3 ++- .../collections/DurableSinglyLinkedListWithParamHolderNGTest.java | 3 ++- .../test/java/org/apache/mnemonic/collections/DurableTreeNGTest.java | 3 ++- 9 files changed, 21 insertions(+), 8 deletions(-) diff --git a/mnemonic-collections/build.gradle b/mnemonic-collections/build.gradle index 8a987d2..a0a5165 100644 --- a/mnemonic-collections/build.gradle +++ b/mnemonic-collections/build.gradle @@ -33,6 +33,7 @@ compileTestJava { dependencies { annotationProcessor project(':mnemonic-core') api project(':mnemonic-core') + api project(':mnemonic-memory-services:mnemonic-pmalloc-service') api 'org.apache.commons:commons-lang3' api 'org.flowcomputing.commons:commons-primitives' api 'org.slf4j:slf4j-api' diff --git a/mnemonic-collections/pom.xml b/mnemonic-collections/pom.xml index 57b74d1..4160652 100644 --- a/mnemonic-collections/pom.xml +++ b/mnemonic-collections/pom.xml @@ -39,6 +39,11 @@ ${project.version} + org.apache.mnemonic + mnemonic-pmalloc-service + ${project.version} + + org.apache.commons commons-lang3 diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableArrayNGTest.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableArrayNGTest.java index 5bd39a5..267ebef 100644 --- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableArrayNGTest.java +++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableArrayNGTest.java @@ -27,6 +27,7 @@ import org.apache.commons.lang3.ArrayUtils; import org.apache.mnemonic.EntityFactoryProxyHelper; import org.apache.mnemonic.Utils; import org.apache.mnemonic.NonVolatileMemAllocator; +import org.apache.mnemonic.service.memory.internal.PMallocServiceImpl; import org.apache.mnemonic.OutOfHybridMemory; import org.apache.mnemonic.DurableBuffer; import org.apache.mnemonic.DurableChunk; @@ -92,7 +93,7 @@ public class DurableArrayNGTest { public void setUp() throws Exception { rand = Utils.createRandom(); unsafe = Utils.getUnsafe(); - m_act = new NonVolatileMemAllocator(Utils.getNonVolatileMemoryAllocatorService("pmalloc"), 1024 * 1024 * 1024, + m_act = new NonVolatileMemAllocator(new PMallocServiceImpl(), 1024 * 1024 * 1024, "./pobj_array.dat", true); cKEYCAPACITY = m_act.handlerCapacity(); m_act.setBufferReclaimer(new Reclaim() { diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableHashMapNGTest.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableHashMapNGTest.java index 376d739..4dd978e 100644 --- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableHashMapNGTest.java +++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableHashMapNGTest.java @@ -26,6 +26,7 @@ import java.util.zip.CRC32; import org.apache.mnemonic.EntityFactoryProxyHelper; import org.apache.mnemonic.Utils; import org.apache.mnemonic.NonVolatileMemAllocator; +import org.apache.mnemonic.service.memory.internal.PMallocServiceImpl; import org.apache.mnemonic.OutOfHybridMemory; import org.apache.mnemonic.EntityFactoryProxy; import org.apache.mnemonic.DurableType; @@ -92,7 +93,7 @@ public class DurableHashMapNGTest { public void setUp() throws Exception { rand = Utils.createRandom(); unsafe = Utils.getUnsafe(); - m_act = new NonVolatileMemAllocator(Utils.getNonVolatileMemoryAllocatorService("pmalloc"), 1024 * 1024 * 1024, + m_act = new NonVolatileMemAllocator(new PMallocServiceImpl(), 1024 * 1024 * 1024, "./pobj_hashmaps.dat", true); cKEYCAPACITY = m_act.handlerCapacity(); m_act.setBufferReclaimer(new Reclaim() { diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableHashSetNGTest.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableHashSetNGTest.java index d37c7b2..70a3a6e 100644 --- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableHashSetNGTest.java +++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableHashSetNGTest.java @@ -25,6 +25,7 @@ import java.util.zip.Checksum; import org.apache.mnemonic.EntityFactoryProxyHelper; import org.apache.mnemonic.Utils; import org.apache.mnemonic.NonVolatileMemAllocator; +import org.apache.mnemonic.service.memory.internal.PMallocServiceImpl; import org.apache.mnemonic.OutOfHybridMemory; import org.apache.mnemonic.DurableBuffer; import org.apache.mnemonic.DurableChunk; @@ -92,7 +93,7 @@ public class DurableHashSetNGTest { public void setUp() throws Exception { rand = Utils.createRandom(); unsafe = Utils.getUnsafe(); - m_act = new NonVolatileMemAllocator(Utils.getNonVolatileMemoryAllocatorService("pmalloc"), 1024 * 1024 * 1024, + m_act = new NonVolatileMemAllocator(new PMallocServiceImpl(), 1024 * 1024 * 1024, "./pobj_hashset.dat", true); cKEYCAPACITY = m_act.handlerCapacity(); m_act.setBufferReclaimer(new Reclaim() { diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurablePersonNGTest.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurablePersonNGTest.java index 7694b6d..f9e92c6 100644 --- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurablePersonNGTest.java +++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurablePersonNGTest.java @@ -22,6 +22,7 @@ import org.apache.mnemonic.OutOfHybridMemory; import org.apache.mnemonic.Reclaim; import org.apache.mnemonic.RetrieveDurableEntityError; import org.apache.mnemonic.Utils; +import org.apache.mnemonic.service.memory.internal.PMallocServiceImpl; import org.testng.annotations.Test; import java.nio.ByteBuffer; import java.util.Random; @@ -38,7 +39,7 @@ public class DurablePersonNGTest { @Test(expectedExceptions = { OutOfHybridMemory.class }) public void testGenPeople() throws OutOfHybridMemory, RetrieveDurableEntityError { Random rand = Utils.createRandom(); - NonVolatileMemAllocator act = new NonVolatileMemAllocator(Utils.getNonVolatileMemoryAllocatorService("pmalloc"), + NonVolatileMemAllocator act = new NonVolatileMemAllocator(new PMallocServiceImpl(), 1024 * 1024 * 8, "./pobj_person.dat", true); cKEYCAPACITY = act.handlerCapacity(); act.setBufferReclaimer(new Reclaim() { @@ -110,7 +111,7 @@ public class DurablePersonNGTest { @Test(dependsOnMethods = { "testGenPeople" }) public void testCheckPeople() throws RetrieveDurableEntityError { - NonVolatileMemAllocator act = new NonVolatileMemAllocator(Utils.getNonVolatileMemoryAllocatorService("pmalloc"), + NonVolatileMemAllocator act = new NonVolatileMemAllocator(new PMallocServiceImpl(), 1024 * 1024 * 8, "./pobj_person.dat", true); act.setBufferReclaimer(new Reclaim() { @Override diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableSinglyLinkedListNGTest.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableSinglyLinkedListNGTest.java index 923af07..f35a67c 100644 --- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableSinglyLinkedListNGTest.java +++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableSinglyLinkedListNGTest.java @@ -25,6 +25,7 @@ import java.util.Random; import org.apache.mnemonic.EntityFactoryProxyHelper; import org.apache.mnemonic.NonVolatileMemAllocator; +import org.apache.mnemonic.service.memory.internal.PMallocServiceImpl; import org.apache.mnemonic.EntityFactoryProxy; import org.apache.mnemonic.Reclaim; import org.apache.mnemonic.Utils; @@ -47,7 +48,7 @@ public class DurableSinglyLinkedListNGTest { @BeforeClass public void setUp() { m_rand = Utils.createRandom(); - m_act = new NonVolatileMemAllocator(Utils.getNonVolatileMemoryAllocatorService("pmalloc"), 1024 * 1024 * 1024, + m_act = new NonVolatileMemAllocator(new PMallocServiceImpl(), 1024 * 1024 * 1024, "./pobj_NodeValue.dat", true); cKEYCAPACITY = m_act.handlerCapacity(); m_act.setBufferReclaimer(new Reclaim() { diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableSinglyLinkedListWithParamHolderNGTest.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableSinglyLinkedListWithParamHolderNGTest.java index f0716e3..6736acb 100644 --- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableSinglyLinkedListWithParamHolderNGTest.java +++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableSinglyLinkedListWithParamHolderNGTest.java @@ -25,6 +25,7 @@ import java.util.Random; import org.apache.mnemonic.EntityFactoryProxyHelper; import org.apache.mnemonic.NonVolatileMemAllocator; +import org.apache.mnemonic.service.memory.internal.PMallocServiceImpl; import org.apache.mnemonic.EntityFactoryProxy; import org.apache.mnemonic.Reclaim; import org.apache.mnemonic.Utils; @@ -49,7 +50,7 @@ public class DurableSinglyLinkedListWithParamHolderNGTest { @BeforeClass public void setUp() { m_rand = Utils.createRandom(); - m_act = new NonVolatileMemAllocator(Utils.getNonVolatileMemoryAllocatorService("pmalloc"), 1024 * 1024 * 1024, + m_act = new NonVolatileMemAllocator(new PMallocServiceImpl(), 1024 * 1024 * 1024, "./pobj_NodeValue_WithParamHolder.dat", true); ph = new ParameterHolder(); diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableTreeNGTest.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableTreeNGTest.java index 7047bbb..5f0a91a 100644 --- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableTreeNGTest.java +++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableTreeNGTest.java @@ -24,6 +24,7 @@ import java.util.Random; import org.apache.mnemonic.EntityFactoryProxyHelper; import org.apache.mnemonic.Utils; import org.apache.mnemonic.NonVolatileMemAllocator; +import org.apache.mnemonic.service.memory.internal.PMallocServiceImpl; //import org.apache.mnemonic.OutOfHybridMemory; import org.apache.mnemonic.EntityFactoryProxy; import org.apache.mnemonic.DurableType; @@ -52,7 +53,7 @@ public class DurableTreeNGTest { public void setUp() throws Exception { rand = Utils.createRandom(); unsafe = Utils.getUnsafe(); - m_act = new NonVolatileMemAllocator(Utils.getNonVolatileMemoryAllocatorService("pmalloc"), 1024 * 1024 * 1024, + m_act = new NonVolatileMemAllocator(new PMallocServiceImpl(), 1024 * 1024 * 1024, "./pobj_tree.dat", true); cKEYCAPACITY = m_act.handlerCapacity(); m_act.setBufferReclaimer(new Reclaim() {