You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mnemonic.apache.org by yz...@apache.org on 2021/02/05 19:15:42 UTC

[mnemonic] branch master updated: MNEMONIC-605: Replace the Utils.getVolatileMemoryAllocatorService from Benches

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 15150fe  MNEMONIC-605: Replace the Utils.getVolatileMemoryAllocatorService from Benches
15150fe is described below

commit 15150fea35af02a2747bb4108afd9fe286d54ae3
Author: Xiaojin Jiao <xj...@gmail.com>
AuthorDate: Wed Feb 3 21:34:56 2021 -0800

    MNEMONIC-605: Replace the Utils.getVolatileMemoryAllocatorService from Benches
    
    Signed-off-by: Xiaojin Jiao <xj...@gmail.com>
---
 mnemonic-benches/mnemonic-sort-bench/build.gradle                    | 1 +
 .../src/main/java/org/apache/mnemonic/bench/DNCSTextFileSort.java    | 3 ++-
 mnemonic-benches/pom.xml                                             | 5 +++++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/mnemonic-benches/mnemonic-sort-bench/build.gradle b/mnemonic-benches/mnemonic-sort-bench/build.gradle
index 29978f0..552c6b2 100644
--- a/mnemonic-benches/mnemonic-sort-bench/build.gradle
+++ b/mnemonic-benches/mnemonic-sort-bench/build.gradle
@@ -27,6 +27,7 @@ dependencies {
   annotationProcessor project(':mnemonic-core')
   api project(':mnemonic-collections')
   api project(':mnemonic-computing-services:mnemonic-utilities-service')
+  api project(':mnemonic-memory-services:mnemonic-sys-vmem-service')
   api 'commons-cli:commons-cli'
   api 'org.apache.commons:commons-lang3'
   api 'org.flowcomputing.commons:commons-primitives'
diff --git a/mnemonic-benches/mnemonic-sort-bench/src/main/java/org/apache/mnemonic/bench/DNCSTextFileSort.java b/mnemonic-benches/mnemonic-sort-bench/src/main/java/org/apache/mnemonic/bench/DNCSTextFileSort.java
index d796368..098dcfb 100644
--- a/mnemonic-benches/mnemonic-sort-bench/src/main/java/org/apache/mnemonic/bench/DNCSTextFileSort.java
+++ b/mnemonic-benches/mnemonic-sort-bench/src/main/java/org/apache/mnemonic/bench/DNCSTextFileSort.java
@@ -21,6 +21,7 @@ import org.apache.mnemonic.DurableType;
 import org.apache.mnemonic.EntityFactoryProxy;
 import org.apache.mnemonic.Utils;
 import org.apache.mnemonic.VolatileMemAllocator;
+import org.apache.mnemonic.service.memory.internal.SysVMemServiceImpl;
 import org.apache.mnemonic.collections.DurableSinglyLinkedList;
 import org.apache.mnemonic.collections.DurableSinglyLinkedListFactory;
 import org.apache.mnemonic.collections.SinglyLinkedNode;
@@ -52,7 +53,7 @@ public class DNCSTextFileSort implements TextFileSort {
     if (null != m_act) {
       clear();
     }
-    m_act = new VolatileMemAllocator(Utils.getVolatileMemoryAllocatorService("sysvmem"), 1024 * 1024 * 1024 * 5,
+    m_act = new VolatileMemAllocator(new SysVMemServiceImpl(), 1024 * 1024 * 1024 * 5,
         uri);
     String text = null;
     SinglyLinkedNode<Long> curnode = null, prvnode = null, node = null;
diff --git a/mnemonic-benches/pom.xml b/mnemonic-benches/pom.xml
index a7d3bee..32584fb 100644
--- a/mnemonic-benches/pom.xml
+++ b/mnemonic-benches/pom.xml
@@ -51,6 +51,11 @@
     </dependency>
     <dependency>
       <groupId>org.apache.mnemonic</groupId>
+      <artifactId>mnemonic-sys-vmem-service</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.mnemonic</groupId>
       <artifactId>mnemonic-spark-core</artifactId>
       <version>${project.version}</version>
     </dependency>