mnemonic-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject incubator-mnemonic git commit: MNEMONIC-241: Expose allocator from ObjectCreator for creating auxiliary durable objects
Date Mon, 24 Apr 2017 16:34:01 GMT
Repository: incubator-mnemonic
Updated Branches:
  refs/heads/master cc4ed3fa1 -> 954cba610


MNEMONIC-241: Expose allocator from ObjectCreator for creating auxiliary durable objects


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

Branch: refs/heads/master
Commit: 954cba6108b8aa4dc55485c3c4c81c972b33c6cd
Parents: cc4ed3f
Author: Wang, Gang(Gary) <gang1.wang@intel.com>
Authored: Mon Apr 24 09:32:44 2017 -0700
Committer: Wang, Gang(Gary) <gang1.wang@intel.com>
Committed: Mon Apr 24 09:32:44 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/mnemonic/sessions/DurableOutputSession.java | 2 +-
 .../main/java/org/apache/mnemonic/sessions/ObjectCreator.java   | 5 ++++-
 .../main/java/org/apache/mnemonic/sessions/OutputSession.java   | 5 ++++-
 .../main/scala/org/apache/mnemonic/spark/rdd/DurableRDD.scala   | 2 +-
 .../org/apache/mnemonic/spark/rdd/DurableRDDFunctions.scala     | 2 +-
 5 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/954cba61/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/DurableOutputSession.java
----------------------------------------------------------------------
diff --git a/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/DurableOutputSession.java
b/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/DurableOutputSession.java
index e8bb17d..71f8e58 100644
--- a/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/DurableOutputSession.java
+++ b/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/DurableOutputSession.java
@@ -31,7 +31,7 @@ import java.util.Map;
 import org.apache.commons.lang3.tuple.Pair;
 
 public abstract class DurableOutputSession<V, A extends RestorableAllocator<A>>
-    implements OutputSession<V>, DurableComputable<A> {
+    implements OutputSession<V, A>, DurableComputable<A> {
 
   private long poolSize;
   private String serviceName;

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/954cba61/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/ObjectCreator.java
----------------------------------------------------------------------
diff --git a/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/ObjectCreator.java
b/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/ObjectCreator.java
index 71f8774..662e716 100644
--- a/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/ObjectCreator.java
+++ b/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/ObjectCreator.java
@@ -18,11 +18,14 @@
 
 package org.apache.mnemonic.sessions;
 
-public interface ObjectCreator<V> {
+import org.apache.mnemonic.RestorableAllocator;
+
+public interface ObjectCreator<V, A extends RestorableAllocator<A>> {
 
   V newDurableObjectRecord();
 
   V newDurableObjectRecord(long size);
 
+  A getAllocator();
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/954cba61/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/OutputSession.java
----------------------------------------------------------------------
diff --git a/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/OutputSession.java
b/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/OutputSession.java
index dcc0ab3..f092a5f 100644
--- a/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/OutputSession.java
+++ b/mnemonic-sessions/src/main/java/org/apache/mnemonic/sessions/OutputSession.java
@@ -20,7 +20,10 @@ package org.apache.mnemonic.sessions;
 
 import java.io.Closeable;
 
-public interface OutputSession<V> extends ObjectCreator<V>, Closeable {
+import org.apache.mnemonic.RestorableAllocator;
+
+public interface OutputSession<V, A extends RestorableAllocator<A>>
+    extends ObjectCreator<V, A>, Closeable {
 
   void post(V v);
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/954cba61/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDD.scala
----------------------------------------------------------------------
diff --git a/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDD.scala
b/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDD.scala
index 40e94b7..c77709f 100644
--- a/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDD.scala
+++ b/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDD.scala
@@ -40,7 +40,7 @@ class DurableRDD[D: ClassTag, T: ClassTag](
   serviceName: String, durableTypes: Array[DurableType],
   entityFactoryProxies: Array[EntityFactoryProxy], slotKeyId: Long,
   partitionPoolSize: Long, baseDir: Path,
-  f: (T, ObjectCreator[D]) => Option[D],
+  f: (T, ObjectCreator[D, _]) => Option[D],
   preservesPartitioning: Boolean = false)
     extends RDD[D](prev) {
 

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/954cba61/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDDFunctions.scala
----------------------------------------------------------------------
diff --git a/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDDFunctions.scala
b/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDDFunctions.scala
index e86d7f8..c06b05b 100644
--- a/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDDFunctions.scala
+++ b/mnemonic-spark/mnemonic-spark-core/src/main/scala/org/apache/mnemonic/spark/rdd/DurableRDDFunctions.scala
@@ -35,7 +35,7 @@ class DurableRDDFunctions[T: ClassTag](rdd: RDD[T]) extends Serializable
{
     slotKeyId: Long,
     partitionPoolSize: Long,
     baseDir: Path,
-    f: (T, ObjectCreator[D]) => Option[D],
+    f: (T, ObjectCreator[D, _]) => Option[D],
     preservesPartitioning: Boolean = false) =
     new DurableRDD[D, T](rdd,
       serviceName, durableTypes, entityFactoryProxies, slotKeyId,


Mime
View raw message