mnemonic-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject [2/2] incubator-mnemonic git commit: MNEMONIC-69: Support discrete addressing for address translate interface MNEMONIC-68: Refactor GType to DurableType and move it to top level MNEMONIC-67: Return array of handler from perform() invocation MNEMONIC-66:
Date Fri, 24 Jun 2016 21:26:22 GMT
MNEMONIC-69: Support discrete addressing for address translate interface
MNEMONIC-68: Refactor GType to DurableType and move it to top level
MNEMONIC-67: Return array of handler from perform() invocation
MNEMONIC-66: Convert parameters class into an array of native parameter structure.
MNEMONIC-65: Pass an array of parameter classes to native computing service
MNEMONIC-64: Add a new parameter to specify the type of value
MNEMONIC-63: Pack native computing parameters into a class
MNEMONIC-62: Handle portable address for durable native computing services (DNCS)


Project: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/commit/27ae5996
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/tree/27ae5996
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/diff/27ae5996

Branch: refs/heads/master
Commit: 27ae599620cad752e2dc0d52d18e124927fa66ad
Parents: 9b601f9
Author: Wang, Gang(Gary) <gang1.wang@intel.com>
Authored: Thu Jun 23 15:50:37 2016 -0700
Committer: Wang, Gang(Gary) <gang1.wang@intel.com>
Committed: Fri Jun 24 14:23:31 2016 -0700

----------------------------------------------------------------------
 .../mnemonic/collections/DurableNodeValue.java  |  6 +--
 .../collections/DurableNodeValueNGTest.java     | 22 ++++-----
 .../org/apache/mnemonic/collections/Person.java |  4 +-
 .../internal/PrintServiceImpl.java              | 11 +++--
 ...computingservice_internal_PrintServiceImpl.c | 51 +++++++++++++-------
 .../DurableNodeValueNGPrintTest.java            | 37 ++++++++------
 .../service/computingservice/Person.java        |  4 +-
 .../apache/mnemonic/AddressTranslateError.java  | 35 ++++++++++++++
 .../org/apache/mnemonic/AddressTranslator.java  | 15 +++---
 .../mnemonic/AnnotatedDurableEntityClass.java   |  6 +--
 .../main/java/org/apache/mnemonic/Durable.java  |  2 +-
 .../java/org/apache/mnemonic/DurableType.java   | 47 ++++++++++++++++++
 .../org/apache/mnemonic/EntityFactoryProxy.java |  2 +-
 .../java/org/apache/mnemonic/GenericField.java  | 21 +++-----
 .../apache/mnemonic/MemoryDurableEntity.java    |  6 +--
 .../mnemonic/NonVolatileMemAllocator.java       | 51 ++++++++++++--------
 .../main/java/org/apache/mnemonic/Utils.java    |  1 +
 .../VolatileMemoryAllocatorService.java         |  5 ++
 .../GeneralComputingService.java                | 12 ++---
 .../service/computingservice/ValueInfo.java     | 44 +++++++++++++++++
 .../test/java/org/apache/mnemonic/Person.java   |  2 +-
 .../internal/VMemServiceImpl.java               | 16 +++++-
 ..._allocatorservice_internal_VMemServiceImpl.c |  7 +++
 .../internal/PMallocServiceImpl.java            |  7 +++
 ...locatorservice_internal_PMallocServiceImpl.c | 12 +++++
 25 files changed, 312 insertions(+), 114 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableNodeValue.java
----------------------------------------------------------------------
diff --git a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableNodeValue.java b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableNodeValue.java
index 91084a2..996fbe0 100644
--- a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableNodeValue.java
+++ b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableNodeValue.java
@@ -22,7 +22,7 @@ import java.util.NoSuchElementException;
 
 import org.apache.mnemonic.Durable;
 import org.apache.mnemonic.EntityFactoryProxy;
-import org.apache.mnemonic.GenericField;
+import org.apache.mnemonic.DurableType;
 import org.apache.mnemonic.DurableEntity;
 import org.apache.mnemonic.DurableGetter;
 import org.apache.mnemonic.DurableSetter;
@@ -35,7 +35,7 @@ import org.apache.mnemonic.DurableSetter;
 @DurableEntity
 public abstract class DurableNodeValue<E> implements Durable, Iterable<E> {
   protected transient EntityFactoryProxy[] m_node_efproxies;
-  protected transient GenericField.GType[] m_node_gftypes;
+  protected transient DurableType[] m_node_gftypes;
 
   /**
    * creation callback for initialization
@@ -67,7 +67,7 @@ public abstract class DurableNodeValue<E> implements Durable, Iterable<E> {
    *          specify a array of types corresponding to efproxies
    */
   @Override
-  public void setupGenericInfo(EntityFactoryProxy[] efproxies, GenericField.GType[] gftypes) {
+  public void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] gftypes) {
     m_node_efproxies = efproxies;
     m_node_gftypes = gftypes;
   }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableNodeValueNGTest.java
----------------------------------------------------------------------
diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableNodeValueNGTest.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableNodeValueNGTest.java
index bbb9ccc..35ec692 100644
--- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableNodeValueNGTest.java
+++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/DurableNodeValueNGTest.java
@@ -28,9 +28,9 @@ import org.apache.mnemonic.NonVolatileMemAllocator;
 import org.apache.mnemonic.RestorableAllocator;
 import org.apache.mnemonic.Durable;
 import org.apache.mnemonic.EntityFactoryProxy;
-import org.apache.mnemonic.GenericField;
 import org.apache.mnemonic.Reclaim;
 import org.apache.mnemonic.Utils;
+import org.apache.mnemonic.DurableType;
 import org.testng.AssertJUnit;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -82,7 +82,7 @@ public class DurableNodeValueNGTest {
   @Test(enabled = false)
   public void testSingleNodeValueWithInteger() {
     int val = m_rand.nextInt();
-    GenericField.GType gtypes[] = {GenericField.GType.INTEGER};
+    DurableType gtypes[] = {DurableType.INTEGER};
     DurableNodeValue<Integer> plln = DurableNodeValueFactory.create(m_act, null, gtypes, false);
     plln.setItem(val, false);
     Long handler = plln.getHandler();
@@ -94,7 +94,7 @@ public class DurableNodeValueNGTest {
   @Test(enabled = false)
   public void testNodeValueWithString() {
     String val = Utils.genRandomString();
-    GenericField.GType gtypes[] = {GenericField.GType.STRING};
+    DurableType gtypes[] = {DurableType.STRING};
     DurableNodeValue<String> plln = DurableNodeValueFactory.create(m_act, null, gtypes, false);
     plln.setItem(val, false);
     Long handler = plln.getHandler();
@@ -109,11 +109,11 @@ public class DurableNodeValueNGTest {
     Person<Long> person = PersonFactory.create(m_act);
     person.setAge((short) 31);
 
-    GenericField.GType gtypes[] = {GenericField.GType.DURABLE};
+    DurableType gtypes[] = {DurableType.DURABLE};
     EntityFactoryProxy efproxies[] = {new EntityFactoryProxy() {
       @Override
       public <A extends RestorableAllocator<A>> Durable restore(A allocator, EntityFactoryProxy[] factoryproxys,
-          GenericField.GType[] gfields, long phandler, boolean autoreclaim) {
+          DurableType[] gfields, long phandler, boolean autoreclaim) {
         return PersonFactory.restore(allocator, factoryproxys, gfields, phandler, autoreclaim);
       }
     } };
@@ -134,11 +134,11 @@ public class DurableNodeValueNGTest {
     int elem_count = 10;
     List<Long> referlist = new ArrayList();
 
-    GenericField.GType listgftypes[] = {GenericField.GType.DURABLE};
+    DurableType listgftypes[] = {DurableType.DURABLE};
     EntityFactoryProxy listefproxies[] = {new EntityFactoryProxy() {
       @Override
       public <A extends RestorableAllocator<A>> Durable restore(A allocator, EntityFactoryProxy[] factoryproxys,
-          GenericField.GType[] gfields, long phandler, boolean autoreclaim) {
+          DurableType[] gfields, long phandler, boolean autoreclaim) {
         return PersonFactory.restore(allocator, factoryproxys, gfields, phandler, autoreclaim);
       }
     } };
@@ -194,16 +194,16 @@ public class DurableNodeValueNGTest {
     int elem_count = 10;
     long slotKeyId = 10;
 
-    GenericField.GType[] elem_gftypes = {GenericField.GType.DOUBLE};
+    DurableType[] elem_gftypes = {DurableType.DOUBLE};
     EntityFactoryProxy[] elem_efproxies = null;
 
-    GenericField.GType linkedgftypes[] = {GenericField.GType.DURABLE, GenericField.GType.DOUBLE};
+    DurableType linkedgftypes[] = {DurableType.DURABLE, DurableType.DOUBLE};
     EntityFactoryProxy linkedefproxies[] = {new EntityFactoryProxy() {
       @Override
       public <A extends RestorableAllocator<A>> Durable restore(A allocator, EntityFactoryProxy[] factoryproxys,
-          GenericField.GType[] gfields, long phandler, boolean autoreclaim) {
+          DurableType[] gfields, long phandler, boolean autoreclaim) {
         EntityFactoryProxy[] val_efproxies = null;
-        GenericField.GType[] val_gftypes = null;
+        DurableType[] val_gftypes = null;
         if (null != factoryproxys && factoryproxys.length >= 2) {
           val_efproxies = Arrays.copyOfRange(factoryproxys, 1, factoryproxys.length);
         }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/Person.java
----------------------------------------------------------------------
diff --git a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/Person.java b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/Person.java
index 5210847..dc68354 100644
--- a/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/Person.java
+++ b/mnemonic-collections/src/test/java/org/apache/mnemonic/collections/Person.java
@@ -19,10 +19,10 @@ package org.apache.mnemonic.collections;
 
 import org.apache.mnemonic.Durable;
 import org.apache.mnemonic.EntityFactoryProxy;
-import org.apache.mnemonic.GenericField;
 import org.apache.mnemonic.DurableEntity;
 import org.apache.mnemonic.DurableGetter;
 import org.apache.mnemonic.DurableSetter;
+import org.apache.mnemonic.DurableType;
 import org.apache.mnemonic.OutOfHybridMemory;
 import org.apache.mnemonic.RetrieveDurableEntityError;
 import org.testng.annotations.Test;
@@ -47,7 +47,7 @@ public abstract class Person<E> implements Durable, Comparable<Person<E>> {
   }
 
   @Override
-  public void setupGenericInfo(EntityFactoryProxy[] efproxies, GenericField.GType[] gftypes) {
+  public void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] gftypes) {
 
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computingservice/internal/PrintServiceImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computingservice/internal/PrintServiceImpl.java b/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computingservice/internal/PrintServiceImpl.java
index d92a93e..1a32b9f 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computingservice/internal/PrintServiceImpl.java
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/main/java/org/apache/mnemonic/service/computingservice/internal/PrintServiceImpl.java
@@ -18,6 +18,7 @@
 package org.apache.mnemonic.service.computingservice.internal;
 
 import org.apache.mnemonic.service.computingservice.GeneralComputingService;
+import org.apache.mnemonic.service.computingservice.ValueInfo;
 import org.flowcomputing.commons.primitives.NativeLibraryLoader;
 
 public class PrintServiceImpl implements GeneralComputingService {
@@ -41,14 +42,14 @@ public class PrintServiceImpl implements GeneralComputingService {
    * {@inheritDoc}
    */
   @Override
-  public long perform(long handler, long[][] npf) {
-    long ret = 0L;
-    if (0L != handler && null != npf) {
-      nperformPrint(handler, npf);
+  public long[] perform(ValueInfo[] valinfos) {
+    long[] ret = null;
+    if (null != valinfos) {
+      ret = nperformPrint(valinfos);
     }
     return ret;
   }
 
-  protected native long nperformPrint(long handler, long[][] npf);
+  protected native long[] nperformPrint(ValueInfo[] valinfos);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computingservice_internal_PrintServiceImpl.c
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computingservice_internal_PrintServiceImpl.c b/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computingservice_internal_PrintServiceImpl.c
index 824f1c4..37badd3 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computingservice_internal_PrintServiceImpl.c
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computingservice_internal_PrintServiceImpl.c
@@ -23,27 +23,42 @@
  *****************************************************************************/
 
 JNIEXPORT
-jlong JNICALL Java_org_apache_mnemonic_service_computingservice_internal_PrintServiceImpl_nperformPrint(JNIEnv* env,
-    jobject this, jlong hdr, jobjectArray arr) {
+jlongArray JNICALL Java_org_apache_mnemonic_service_computingservice_internal_PrintServiceImpl_nperformPrint(JNIEnv* env,
+    jobject this, jobjectArray vinfos) {
+  jlongArray ret = NULL;
+  jsize retsz = 1;
+  jsize idx;
+  jlong nret[retsz];
+  for(idx = 0; idx < retsz; ++idx) {
+    nret[idx] = 0L;
+  }
+  ret = (*env)->NewLongArray(env, retsz);
+  if (NULL == ret) {
+    return NULL;
+  }
   printf("----Service Native Parameters----\n");
-  printf("Handler --> %p \n", addr_from_java(hdr));
-  jsize i, j; jlong *vals;
-  jlongArray *larr;
-  jsize len1 = (*env)->GetArrayLength(env, arr);
-  jsize len2;
-  for (i = 0; i < len1; ++i) {
-    larr = (jlongArray)((*env)->GetObjectArrayElement(env, arr, i));
-    len2 = (*env)->GetArrayLength(env, larr);
-    vals = (*env)->GetLongArrayElements(env, larr, 0);
-    printf("Stack Row %d - ", i);
-    for (j = 0; j < len2; ++j) {
-      printf("[%d]:%p ", j, vals[j]);
-    }
-    printf("\n");
-    (*env)->ReleaseLongArrayElements(env, larr, vals, 0);
+  for(idx = 0; idx < (*env)->GetArrayLength(env, vinfos); ++idx) {
+
+//    printf("Handler --> %p \n", addr_from_java(hdr));
+//    jsize i, j; jlong *vals;
+//    jlongArray *larr;
+//    jsize len1 = (*env)->GetArrayLength(env, arr);
+//    jsize len2;
+//    for (i = 0; i < len1; ++i) {
+//      larr = (jlongArray)((*env)->GetObjectArrayElement(env, arr, i));
+//      len2 = (*env)->GetArrayLength(env, larr);
+//      vals = (*env)->GetLongArrayElements(env, larr, 0);
+//      printf("Stack Row %d - ", i);
+//      for (j = 0; j < len2; ++j) {
+//        printf("[%d]:%p ", j, vals[j]);
+//      }
+//      printf("\n");
+//      (*env)->ReleaseLongArrayElements(env, larr, vals, 0);
+//    }
   }
 
-  return 0L;
+  (*env)->SetIntArrayRegion(env, ret, 0, retsz, nret);
+  return ret;
 }
 
 __attribute__((destructor)) void fini(void) {

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/DurableNodeValueNGPrintTest.java
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/DurableNodeValueNGPrintTest.java b/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/DurableNodeValueNGPrintTest.java
index 5b1cfee..47b4bb2 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/DurableNodeValueNGPrintTest.java
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/DurableNodeValueNGPrintTest.java
@@ -25,13 +25,12 @@ import java.util.List;
 import java.util.Random;
 import java.nio.file.Files;
 import java.nio.file.Paths;
-
 import org.apache.mnemonic.NonVolatileMemAllocator;
 import org.apache.mnemonic.RestorableAllocator;
 import org.apache.mnemonic.Durable;
 import org.apache.mnemonic.EntityFactoryProxy;
-import org.apache.mnemonic.GenericField;
 import org.apache.mnemonic.Utils;
+import org.apache.mnemonic.DurableType;
 import org.apache.mnemonic.collections.DurableNodeValue;
 import org.apache.mnemonic.collections.DurableNodeValueFactory;
 
@@ -72,11 +71,11 @@ public class DurableNodeValueNGPrintTest {
 
     int elem_count = 10;
 
-    GenericField.GType listgftypes[] = {GenericField.GType.DURABLE};
+    DurableType listgftypes[] = {DurableType.DURABLE};
     EntityFactoryProxy listefproxies[] = {new EntityFactoryProxy() {
       @Override
       public <A extends RestorableAllocator<A>> Durable restore(A allocator, EntityFactoryProxy[] factoryproxys,
-          GenericField.GType[] gfields, long phandler, boolean autoreclaim) {
+          DurableType[] gfields, long phandler, boolean autoreclaim) {
         return PersonFactory.restore(allocator, factoryproxys, gfields, phandler, autoreclaim);
       }
     } };
@@ -123,15 +122,20 @@ public class DurableNodeValueNGPrintTest {
     }
 
     GeneralComputingService gcsvr = Utils.getGeneralComputingService("print");
+    ValueInfo vinfo = new ValueInfo();
     List<long[][]> objstack = new ArrayList<long[][]>();
     objstack.add(firstnv.getNativeFieldInfo());
     objstack.add(person.getNativeFieldInfo());
     long[][] fidinfostack = {{2L, 1L}, {0L, 1L}};
-    long[][] npf = Utils.genNativeParamForm(objstack, fidinfostack);
-    gcsvr.perform(handler, npf);
+    vinfo.handler = handler;
+    vinfo.transtable = m_act.getTranslateTable();
+    vinfo.type = DurableType.INTEGER;
+    vinfo.frames = Utils.genNativeParamForm(objstack, fidinfostack);
+    ValueInfo[] vinfos = {vinfo};
+    gcsvr.perform(vinfos);
     System.out.printf("ObjStack: %s \n", Arrays.deepToString(objstack.toArray()));
     System.out.printf("FidStack: %s \n", Arrays.deepToString(fidinfostack));
-    System.out.printf("ParamFrame: %s \n", Arrays.deepToString(npf));
+    System.out.printf("ParamFrame: %s \n", Arrays.deepToString(vinfo.frames));
 
   }
 
@@ -141,16 +145,16 @@ public class DurableNodeValueNGPrintTest {
     int elem_count = 10;
     long slotKeyId = 10;
 
-    GenericField.GType[] elem_gftypes = {GenericField.GType.DOUBLE};
+    DurableType[] elem_gftypes = {DurableType.DOUBLE};
     EntityFactoryProxy[] elem_efproxies = null;
 
-    GenericField.GType linkedgftypes[] = {GenericField.GType.DURABLE, GenericField.GType.DOUBLE};
+    DurableType linkedgftypes[] = {DurableType.DURABLE, DurableType.DOUBLE};
     EntityFactoryProxy linkedefproxies[] = {new EntityFactoryProxy() {
       @Override
       public <A extends RestorableAllocator<A>> Durable restore(A allocator, EntityFactoryProxy[] factoryproxys,
-          GenericField.GType[] gfields, long phandler, boolean autoreclaim) {
+          DurableType[] gfields, long phandler, boolean autoreclaim) {
         EntityFactoryProxy[] val_efproxies = null;
-        GenericField.GType[] val_gftypes = null;
+        DurableType[] val_gftypes = null;
         if (null != factoryproxys && factoryproxys.length >= 2) {
           val_efproxies = Arrays.copyOfRange(factoryproxys, 1, factoryproxys.length);
         }
@@ -215,15 +219,20 @@ public class DurableNodeValueNGPrintTest {
     }
 
     GeneralComputingService gcsvr = Utils.getGeneralComputingService("print");
+    ValueInfo vinfo = new ValueInfo();
     List<long[][]> objstack = new ArrayList<long[][]>();
     objstack.add(linkedvals.getNativeFieldInfo());
     objstack.add(linkedvals.getNativeFieldInfo());
     long[][] fidinfostack = {{2L, 1L}, {2L, 1L}};
-    long[][] npf = Utils.genNativeParamForm(objstack, fidinfostack);
-    gcsvr.perform(handler, npf);
+    vinfo.handler = handler;
+    vinfo.transtable = m_act.getTranslateTable();
+    vinfo.type = DurableType.DOUBLE;
+    vinfo.frames = Utils.genNativeParamForm(objstack, fidinfostack);
+    ValueInfo[] vinfos = {vinfo};
+    gcsvr.perform(vinfos);
     System.out.printf("ObjStack: %s \n", Arrays.deepToString(objstack.toArray()));
     System.out.printf("FidStack: %s \n", Arrays.deepToString(fidinfostack));
-    System.out.printf("ParamFrame: %s \n", Arrays.deepToString(npf));
+    System.out.printf("ParamFrame: %s \n", Arrays.deepToString(vinfo.frames));
 
     // Assert.assert, expected);(plist, plist2);
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/Person.java
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/Person.java b/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/Person.java
index f7d53d4..b3f990d 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/Person.java
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/test/java/org/apache/mnemonic/service/computingservice/Person.java
@@ -19,12 +19,12 @@ package org.apache.mnemonic.service.computingservice;
 
 import org.apache.mnemonic.Durable;
 import org.apache.mnemonic.EntityFactoryProxy;
-import org.apache.mnemonic.GenericField;
 import org.apache.mnemonic.DurableEntity;
 import org.apache.mnemonic.DurableGetter;
 import org.apache.mnemonic.DurableSetter;
 import org.apache.mnemonic.OutOfHybridMemory;
 import org.apache.mnemonic.RetrieveDurableEntityError;
+import org.apache.mnemonic.DurableType;
 import org.testng.annotations.Test;
 
 /**
@@ -47,7 +47,7 @@ public abstract class Person<E> implements Durable, Comparable<Person<E>> {
   }
 
   @Override
-  public void setupGenericInfo(EntityFactoryProxy[] efproxies, GenericField.GType[] gftypes) {
+  public void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] gftypes) {
 
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslateError.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslateError.java b/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslateError.java
new file mode 100644
index 0000000..f512896
--- /dev/null
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslateError.java
@@ -0,0 +1,35 @@
+/*
+ * 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 org.apache.mnemonic;
+
+public class AddressTranslateError extends RuntimeException {
+
+  /**
+   * 
+   */
+  private static final long serialVersionUID = 1L;
+
+  /**
+   *
+   */
+
+  public AddressTranslateError(String s) {
+    super(s);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslator.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslator.java b/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslator.java
index 89d4708..2c20887 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslator.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/AddressTranslator.java
@@ -44,18 +44,17 @@ public interface AddressTranslator {
   long getEffectiveAddress(long addr);
 
   /**
-   * get the base address
+   * set address translate table
    *
-   * @return the base address
+   * @param tbl
+   *         specify a translate table
    */
-  long getBaseAddress();
+  void setTranslateTable(long[][] tbl);
 
   /**
-   * set the base address for calculation
-   *
-   * @param addr
-   *          the base address
+   * get the address translate table
    *
+   * @return the translate table
    */
-  long setBaseAddress(long addr);
+  long[][] getTranslateTable();
 }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java b/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
index 4f2099e..66a240f 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
@@ -103,7 +103,7 @@ public class AnnotatedDurableEntityClass {
 
   private TypeName m_alloctypename = TypeVariableName.get(cALLOCTYPENAME);
   private TypeName m_factoryproxystypename = TypeName.get(EntityFactoryProxy[].class);
-  private TypeName m_gfieldstypename = TypeName.get(GenericField.GType[].class);
+  private TypeName m_gfieldstypename = TypeName.get(DurableType[].class);
   private TypeVariableName m_alloctypevarname = TypeVariableName.get(cALLOCTYPENAME,
       ParameterizedTypeName.get(ClassName.get(RestorableAllocator.class), TypeVariableName.get(cALLOCTYPENAME)));
 
@@ -498,7 +498,7 @@ public class AnnotatedDurableEntityClass {
         } else if (dynfieldinfo.type.toString().startsWith(GenericField.class.getCanonicalName())) {
           code.beginControlFlow("if (null == $1N)", dynfieldinfo.name);
           code.addStatement("$1T proxy = null", TypeName.get(EntityFactoryProxy.class));
-          code.addStatement("$1T gftype = null", TypeName.get(GenericField.GType.class));
+          code.addStatement("$1T gftype = null", TypeName.get(DurableType.class));
           code.addStatement("int gfpidx = $1L", getFactoryProxyIndex(methodinfo.rettype));
           code.beginControlFlow("if (null != $1N && $1N.length > gfpidx)", factoryproxyname);
           code.addStatement("proxy = $1L[gfpidx]", factoryproxyname);
@@ -601,7 +601,7 @@ public class AnnotatedDurableEntityClass {
         } else if (dynfieldinfo.type.toString().startsWith(GenericField.class.getCanonicalName())) {
           code.beginControlFlow("if (null == $1N)", dynfieldinfo.name);
           code.addStatement("$1T proxy = null", TypeName.get(EntityFactoryProxy.class));
-          code.addStatement("$1T gftype = null", TypeName.get(GenericField.GType.class));
+          code.addStatement("$1T gftype = null", TypeName.get(DurableType.class));
           code.addStatement("int gfpidx = $1L", getFactoryProxyIndex(valtname));
           code.beginControlFlow("if (null != $1N && $1N.length > gfpidx)", factoryproxyname);
           code.addStatement("proxy = $1L[gfpidx]", factoryproxyname);

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/Durable.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/Durable.java b/mnemonic-core/src/main/java/org/apache/mnemonic/Durable.java
index 56f9ac1..a38e7f3 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/Durable.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/Durable.java
@@ -50,7 +50,7 @@ public interface Durable {
    * @param gftypes
    *          specify a array of types corresponding to efproxies
    */
-  void setupGenericInfo(EntityFactoryProxy[] efproxies, GenericField.GType[] gftypes);
+  void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] gftypes);
 
   /**
    * this function could be called by user code to disable auto-reclaim for this

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/DurableType.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/DurableType.java b/mnemonic-core/src/main/java/org/apache/mnemonic/DurableType.java
new file mode 100644
index 0000000..4ec22f0
--- /dev/null
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/DurableType.java
@@ -0,0 +1,47 @@
+/*
+ * 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 org.apache.mnemonic;
+
+/**
+ * defines the types of generic field
+ *
+ */
+public enum DurableType {
+
+  BOOLEAN(1),
+  CHARACTER(2),
+  BYTE(3),
+  SHORT(4),
+  INTEGER(5),
+  LONG(6),
+  FLOAT(7),
+  DOUBLE(8),
+  STRING(9),
+  DURABLE(10);
+
+  private int value;
+
+  DurableType(int val) {
+    this.value = val;
+  }
+
+  public int getValue() {
+    return value;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/EntityFactoryProxy.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/EntityFactoryProxy.java b/mnemonic-core/src/main/java/org/apache/mnemonic/EntityFactoryProxy.java
index 4711d2c..df638cb 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/EntityFactoryProxy.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/EntityFactoryProxy.java
@@ -49,5 +49,5 @@ public interface EntityFactoryProxy {
    *
    */
   <A extends RestorableAllocator<A>> Durable restore(A allocator, EntityFactoryProxy[] factoryproxys,
-      GenericField.GType[] gfields, long phandler, boolean autoreclaim);
+      DurableType[] gfields, long phandler, boolean autoreclaim);
 }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/GenericField.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/GenericField.java b/mnemonic-core/src/main/java/org/apache/mnemonic/GenericField.java
index 37c507b..01f8b58 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/GenericField.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/GenericField.java
@@ -17,34 +17,26 @@
 
 package org.apache.mnemonic;
 
+import sun.misc.Unsafe;
+
 /**
  * this class defines generic field for non-volatile entity
  *
  */
 
-import sun.misc.Unsafe;
-
 @SuppressWarnings("restriction")
 public class GenericField<A extends RestorableAllocator<A>, E> implements Durable {
 
-  /**
-   * defines the types of generic field
-   *
-   */
-  public enum GType {
-    BOOLEAN, CHARACTER, BYTE, SHORT, INTEGER, LONG, FLOAT, DOUBLE, STRING, DURABLE
-  };
-
   private Unsafe m_unsafe;
   private long m_fpos;
-  private GType m_dgftype = null;
+  private DurableType m_dgftype = null;
   private Durable m_field = null;
   private MemBufferHolder<A> m_strfield = null;
   private A m_allocator;
   private boolean m_autoreclaim;
   private EntityFactoryProxy m_defproxy = null;
   private EntityFactoryProxy[] m_efproxies;
-  private GType[] m_gftypes;
+  private DurableType[] m_gftypes;
 
   /**
    * Constructor: initialize this generic field
@@ -74,7 +66,8 @@ public class GenericField<A extends RestorableAllocator<A>, E> implements Durabl
    *          specify the field position
    *
    */
-  public GenericField(EntityFactoryProxy defproxy, GType dgftype, EntityFactoryProxy[] efproxies, GType[] gftypes,
+  public GenericField(EntityFactoryProxy defproxy, DurableType dgftype,
+      EntityFactoryProxy[] efproxies, DurableType[] gftypes,
       A allocator, Unsafe unsafe, boolean autoreclaim, Long fpos) {
     m_unsafe = unsafe;
     m_fpos = fpos;
@@ -291,7 +284,7 @@ public class GenericField<A extends RestorableAllocator<A>, E> implements Durabl
    * {@inheritDoc}
    */
   @Override
-  public void setupGenericInfo(EntityFactoryProxy[] efproxies, GType[] gftypes) {
+  public void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] gftypes) {
     throw new UnsupportedOperationException("GenericField.setupGenericInfo()");
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/MemoryDurableEntity.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/MemoryDurableEntity.java b/mnemonic-core/src/main/java/org/apache/mnemonic/MemoryDurableEntity.java
index 8df7140..97e5fe9 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/MemoryDurableEntity.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/MemoryDurableEntity.java
@@ -25,12 +25,12 @@ package org.apache.mnemonic;
 public interface MemoryDurableEntity<ALLOC_PMem3C93D24F59 extends RestorableAllocator<ALLOC_PMem3C93D24F59>> {
 
   void initializeDurableEntity(ALLOC_PMem3C93D24F59 allocator, EntityFactoryProxy[] efproxys,
-      GenericField.GType[] gfields, boolean autoreclaim);
+      DurableType[] gfields, boolean autoreclaim);
 
   void createDurableEntity(ALLOC_PMem3C93D24F59 allocator, EntityFactoryProxy[] efproxys,
-      GenericField.GType[] gfields, boolean autoreclaim) throws OutOfHybridMemory;
+      DurableType[] gfields, boolean autoreclaim) throws OutOfHybridMemory;
 
   void restoreDurableEntity(ALLOC_PMem3C93D24F59 allocator, EntityFactoryProxy[] efproxys,
-      GenericField.GType[] gfields, long phandler, boolean autoreclaim) throws RestoreDurableEntityError;
+      DurableType[] gfields, long phandler, boolean autoreclaim) throws RestoreDurableEntityError;
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/NonVolatileMemAllocator.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/NonVolatileMemAllocator.java b/mnemonic-core/src/main/java/org/apache/mnemonic/NonVolatileMemAllocator.java
index 580f057..43447ba 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/NonVolatileMemAllocator.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/NonVolatileMemAllocator.java
@@ -18,7 +18,6 @@
 package org.apache.mnemonic;
 
 import java.nio.ByteBuffer;
-
 import org.apache.mnemonic.service.allocatorservice.NonVolatileMemoryAllocatorService;
 import org.flowcomputing.commons.resgc.ResCollector;
 import org.flowcomputing.commons.resgc.ResReclaim;
@@ -35,7 +34,7 @@ public class NonVolatileMemAllocator extends RestorableAllocator<NonVolatileMemA
   private boolean m_activegc = true;
   private long m_gctimeout = 100;
   private long m_nid = -1;
-  private long b_addr = 0;
+  private long[][] m_ttable;
   private NonVolatileMemoryAllocatorService m_nvmasvc = null;
 
   /**
@@ -65,7 +64,10 @@ public class NonVolatileMemAllocator extends RestorableAllocator<NonVolatileMemA
     m_nvmasvc = nvmasvc;
 
     m_nid = m_nvmasvc.init(capacity, uri, isnew);
-    b_addr = m_nvmasvc.getBaseAddress(m_nid);
+    m_ttable = new long[1][3];
+    m_ttable[0][0] = 0L;
+    m_ttable[0][1] = m_nvmasvc.capacity(m_nid);
+    m_ttable[0][2] = m_nvmasvc.getBaseAddress(m_nid);
 
     /**
      * create a resource collector to release specified chunk that backed by
@@ -447,51 +449,62 @@ public class NonVolatileMemAllocator extends RestorableAllocator<NonVolatileMemA
   }
 
   /**
-   * calculate the portable address
+   * translate the portable address
    *
    * @param addr
-   *          the address to be calculated
+   *          the address to be translated
    *
    * @return the portable address
    */
   @Override
   public long getPortableAddress(long addr) {
-    return addr - b_addr;
+    int i;
+    for (i = 0; i < m_ttable.length; ++i) {
+      if (addr >= m_ttable[i][2] && addr < m_ttable[i][1] + m_ttable[i][2]) {
+        return addr - m_ttable[i][2];
+      }
+    }
+    throw new AddressTranslateError("Portable Address Translate Error");
   }
 
   /**
-   * calculate the effective address
+   * translate the effective address
    *
    * @param addr
-   *          the address to be calculated
+   *          the address to be translated
    *
    * @return the effective address
    */
   @Override
   public long getEffectiveAddress(long addr) {
-    return addr + b_addr;
+    int i;
+    for (i = 0; i < m_ttable.length; ++i) {
+      if (addr >= m_ttable[i][0] && addr < m_ttable[i][1]) {
+        return addr + m_ttable[i][2];
+      }
+    }
+    throw new AddressTranslateError("Effective Address Translate Error");
   }
 
   /**
-   * get the base address
+   * get the address translate table
    *
-   * @return the base address
+   * @return the translate table
    */
   @Override
-  public long getBaseAddress() {
-    return b_addr;
+  public long[][] getTranslateTable() {
+    return m_ttable;
   }
 
   /**
-   * set the base address for calculation
-   *
-   * @param addr
-   *          the base address
+   * set address translate table
    *
+   * @param tbl
+   *         specify a translate table
    */
   @Override
-  public long setBaseAddress(long addr) {
-    return b_addr = addr;
+  public void setTranslateTable(long[][] tbl) {
+    m_ttable = tbl;
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java b/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java
index ebd4f38..aace424 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/Utils.java
@@ -42,6 +42,7 @@ import org.apache.mnemonic.service.allocatorservice.NonVolatileMemoryAllocatorSe
  */
 @SuppressWarnings("restriction")
 public class Utils {
+
   public static final String ANSI_RESET = "\u001B[0m";
   public static final String ANSI_BLACK = "\u001B[30m";
   public static final String ANSI_RED = "\u001B[31m";

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/service/allocatorservice/VolatileMemoryAllocatorService.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/service/allocatorservice/VolatileMemoryAllocatorService.java b/mnemonic-core/src/main/java/org/apache/mnemonic/service/allocatorservice/VolatileMemoryAllocatorService.java
index 4c04bab..cc5fd4e 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/service/allocatorservice/VolatileMemoryAllocatorService.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/service/allocatorservice/VolatileMemoryAllocatorService.java
@@ -57,6 +57,11 @@ public interface VolatileMemoryAllocatorService {
   void sync(long id);
 
   /**
+   * get the capacity of its managed memory space
+   */
+  long capacity(long id);
+
+  /**
    * allocate specified size of memory block from backed memory pool.
    * 
    * @param id

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/GeneralComputingService.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/GeneralComputingService.java b/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/GeneralComputingService.java
index 2f37f76..e05fec6 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/GeneralComputingService.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/GeneralComputingService.java
@@ -38,15 +38,11 @@ public interface GeneralComputingService {
   /**
    * perform native functionalities according to prepared computing parameters
    *
-   * @param handler
-   *         a handler to a object graph
+   * @param valinfos
+   *         an array of value info
    *
-   * @param npf
-   *         a list of native parameters
-   *
-   * @return the handler to updated object graph if any
+   * @return the array of handler about updated object graphs if any
    */
-  long perform(long handler, long[][] npf);
-
+  long[] perform(ValueInfo[] valinfos);
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/ValueInfo.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/ValueInfo.java b/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/ValueInfo.java
new file mode 100644
index 0000000..d88d5db
--- /dev/null
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/service/computingservice/ValueInfo.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 org.apache.mnemonic.service.computingservice;
+
+import org.apache.mnemonic.DurableType;
+
+public class ValueInfo {
+
+  /**
+   * a handler to a object graph
+   */
+  public long handler;
+  
+  /**
+   * a table for native address mapping
+   */
+  public long[][] transtable;
+  
+  /**
+   * a list of frame of native parameter
+   */
+  public long[][] frames;
+
+  /**
+   * a type of this specified value
+   */
+  public DurableType type;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-core/src/test/java/org/apache/mnemonic/Person.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/test/java/org/apache/mnemonic/Person.java b/mnemonic-core/src/test/java/org/apache/mnemonic/Person.java
index 7d5942e..fa2b564 100644
--- a/mnemonic-core/src/test/java/org/apache/mnemonic/Person.java
+++ b/mnemonic-core/src/test/java/org/apache/mnemonic/Person.java
@@ -37,7 +37,7 @@ public abstract class Person<E> implements Durable, Comparable<Person<E>> {
   }
 
   @Override
-  public void setupGenericInfo(EntityFactoryProxy[] efproxies, GenericField.GType[] gftypes) {
+  public void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] gftypes) {
 
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java b/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java
index d7084c0..1717bf1 100644
--- a/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java
+++ b/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/VMemServiceImpl.java
@@ -21,6 +21,9 @@ import org.apache.mnemonic.service.allocatorservice.VolatileMemoryAllocatorServi
 import org.flowcomputing.commons.primitives.NativeLibraryLoader;
 
 import java.nio.ByteBuffer;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 
 public class VMemServiceImpl implements VolatileMemoryAllocatorService {
   static {
@@ -31,6 +34,8 @@ public class VMemServiceImpl implements VolatileMemoryAllocatorService {
     }
   }
 
+  protected Map<Long, Long> m_info = Collections.synchronizedMap(new HashMap<Long, Long>());
+
   @Override
   public String getServiceId() {
     return "vmem";
@@ -38,7 +43,9 @@ public class VMemServiceImpl implements VolatileMemoryAllocatorService {
 
   @Override
   public long init(long capacity, String uri, boolean isnew) {
-    return ninit(capacity, uri, isnew);
+    long ret = ninit(capacity, uri, isnew);
+    m_info.put(ret, capacity);
+    return ret;
   }
 
   @Override
@@ -52,6 +59,11 @@ public class VMemServiceImpl implements VolatileMemoryAllocatorService {
   }
 
   @Override
+  public long capacity(long id) {
+    return m_info.get(id);
+  }
+
+  @Override
   public long allocate(long id, long size, boolean initzero) {
     return nallocate(id, size, initzero);
   }
@@ -87,6 +99,8 @@ public class VMemServiceImpl implements VolatileMemoryAllocatorService {
 
   protected native void nsync(long id);
 
+  protected native long ncapacity(long id);
+
   protected native long nallocate(long id, long size, boolean initzero);
 
   protected native long nreallocate(long id, long address, long size, boolean initzero);

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c b/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c
index eb02fe2..450edd5 100644
--- a/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c
+++ b/mnemonic-memory-services/mnemonic-nvml-vmem-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl.c
@@ -80,6 +80,13 @@ void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServ
 }
 
 JNIEXPORT
+void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_ncapacity(
+    JNIEnv* env,
+    jobject this, jlong id)
+{
+}
+
+JNIEXPORT
 jobject JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_VMemServiceImpl_ncreateByteBuffer(
     JNIEnv *env, jobject this, jlong id, jlong size) {
   pthread_rwlock_rdlock(&g_vmem_rwlock);

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java
index adfa40b..e42e45c 100644
--- a/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java
+++ b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/java/org/apache/mnemonic/service/allocatorservice/internal/PMallocServiceImpl.java
@@ -52,6 +52,11 @@ public class PMallocServiceImpl implements NonVolatileMemoryAllocatorService {
   }
 
   @Override
+  public long capacity(long id) {
+    return ncapacity(id);
+  }
+
+  @Override
   public long allocate(long id, long size, boolean initzero) {
     return nallocate(id, size, initzero);
   }
@@ -122,6 +127,8 @@ public class PMallocServiceImpl implements NonVolatileMemoryAllocatorService {
 
   protected native void nsync(long id);
 
+  protected native long ncapacity(long id);
+
   protected native long nallocate(long id, long size, boolean initzero);
 
   protected native long nreallocate(long id, long address, long size, boolean initzero);

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/27ae5996/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_PMallocServiceImpl.c
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_PMallocServiceImpl.c b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_PMallocServiceImpl.c
index b3bf391..eef58cb 100644
--- a/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_PMallocServiceImpl.c
+++ b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_allocatorservice_internal_PMallocServiceImpl.c
@@ -108,6 +108,18 @@ void JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_PMallocS
 }
 
 JNIEXPORT
+jlong JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_PMallocServiceImpl_ncapacity(
+    JNIEnv* env,
+    jobject this, jlong id)
+{
+  pthread_rwlock_rdlock(&g_pmp_rwlock);
+  void *md = *(g_pmp_ptr + id);
+  jlong ret = pmcapacity(md);
+  pthread_rwlock_unlock(&g_pmp_rwlock);
+  return ret;
+}
+
+JNIEXPORT
 jobject JNICALL Java_org_apache_mnemonic_service_allocatorservice_internal_PMallocServiceImpl_ncreateByteBuffer(
     JNIEnv *env, jobject this, jlong id, jlong size) {
   pthread_rwlock_rdlock(&g_pmp_rwlock);


Mime
View raw message