mnemonic-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject mnemonic git commit: MNEMONIC-481: Add reference breaking operation in Durable class
Date Thu, 17 May 2018 04:43:09 GMT
Repository: mnemonic
Updated Branches:
  refs/heads/master 9749f2a60 -> adef72a21


MNEMONIC-481: Add reference breaking operation in Durable class


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

Branch: refs/heads/master
Commit: adef72a219245aefd3858a3ec24ee1b42f1225b2
Parents: 9749f2a
Author: Yanhui Zhao <yzhao@apache.org>
Authored: Wed May 16 19:55:53 2018 -0700
Committer: Yanhui Zhao <yzhao@apache.org>
Committed: Wed May 16 19:55:53 2018 -0700

----------------------------------------------------------------------
 .../java/org/apache/mnemonic/collections/DurableArrayImpl.java | 5 +++++
 .../org/apache/mnemonic/collections/DurableHashMapImpl.java    | 5 +++++
 .../org/apache/mnemonic/collections/DurableHashSetImpl.java    | 5 +++++
 .../mnemonic/collections/DurableSinglyLinkedListImpl.java      | 5 +++++
 .../java/org/apache/mnemonic/collections/DurableTreeImpl.java  | 5 +++++
 .../java/org/apache/mnemonic/AnnotatedDurableEntityClass.java  | 4 ++++
 mnemonic-core/src/main/java/org/apache/mnemonic/Durable.java   | 6 ++++++
 .../src/main/java/org/apache/mnemonic/DurableBuffer.java       | 5 +++++
 .../src/main/java/org/apache/mnemonic/DurableChunk.java        | 5 +++++
 .../src/main/java/org/apache/mnemonic/GenericField.java        | 5 +++++
 10 files changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableArrayImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableArrayImpl.java
b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableArrayImpl.java
index 549ad3b..24b6741 100644
--- a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableArrayImpl.java
+++ b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableArrayImpl.java
@@ -167,6 +167,11 @@ public class DurableArrayImpl<A extends RestorableAllocator<A>,
E>
   }
 
   @Override
+  public void refbreak() {
+    return;
+  }
+
+  @Override
   public void destroy() throws RetrieveDurableEntityError {
     long startAddr = holder.get();
     long endAddr = startAddr + MAX_OBJECT_SIZE * arraySize;

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashMapImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashMapImpl.java
b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashMapImpl.java
index 6ad2746..fc2033b 100644
--- a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashMapImpl.java
+++ b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashMapImpl.java
@@ -406,6 +406,11 @@ public class DurableHashMapImpl<A extends RestorableAllocator<A>,
K, V>
   }
 
   @Override
+  public void refbreak() {
+    return;
+  }
+
+  @Override
   public void destroy() throws RetrieveDurableEntityError {
     long bucketAddr = holder.get();
     long maxbucketAddr = bucketAddr + MAX_OBJECT_SIZE * totalCapacity;

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashSetImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashSetImpl.java
b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashSetImpl.java
index 8e84b77..837f2a9 100644
--- a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashSetImpl.java
+++ b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableHashSetImpl.java
@@ -125,6 +125,11 @@ public class DurableHashSetImpl<A extends RestorableAllocator<A>,
E>
   }
 
   @Override
+  public void refbreak() {
+    return;
+  }
+
+  @Override
   public void destroy() throws RetrieveDurableEntityError {
     map.destroy();
   }

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedListImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedListImpl.java
b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedListImpl.java
index 7413ba0..d898625 100644
--- a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedListImpl.java
+++ b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableSinglyLinkedListImpl.java
@@ -123,6 +123,11 @@ public class DurableSinglyLinkedListImpl<A extends RestorableAllocator<A>,
E>
   }
 
   @Override
+  public void refbreak() {
+    return;
+  }
+
+  @Override
   public void syncToVolatileMemory() {
     holder.syncToVolatileMemory();
   }

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableTreeImpl.java
----------------------------------------------------------------------
diff --git a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableTreeImpl.java
b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableTreeImpl.java
index a7359b0..268ac4a 100644
--- a/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableTreeImpl.java
+++ b/mnemonic-collections/src/main/java/org/apache/mnemonic/collections/DurableTreeImpl.java
@@ -523,6 +523,11 @@ public class DurableTreeImpl<A extends RestorableAllocator<A>,
E extends Compara
   }
 
   @Override
+  public void refbreak() {
+    return;
+  }
+
+  @Override
   public void destroy() throws RetrieveDurableEntityError {
     destroy(root);
     holder.destroy();

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/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 bcfa596..856667e 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/AnnotatedDurableEntityClass.java
@@ -194,6 +194,7 @@ public class AnnotatedDurableEntityClass {
     m_durablemtdinfo.put("syncToNonVolatileMemory", new ArrayList<MethodInfo>());
     m_durablemtdinfo.put("syncToLocal", new ArrayList<MethodInfo>());
     m_durablemtdinfo.put("getNativeFieldInfo", new ArrayList<MethodInfo>());
+    m_durablemtdinfo.put("refbreak", new ArrayList<MethodInfo>());
 
     m_entitymtdinfo.put("initializeDurableEntity", new MethodInfo());
     m_entitymtdinfo.put("createDurableEntity", new MethodInfo());
@@ -859,6 +860,9 @@ public class AnnotatedDurableEntityClass {
           case "getNativeFieldInfo":
             code.addStatement("return $1N", m_fieldsinfo.get("nfieldinfo").name);
             break;
+          case "refbreak":
+            code.addStatement("return");
+            break;
           default:
             throw new AnnotationProcessingException(null, "Method %s is not supported.",
name);
         }

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/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 236d0f1..61886c6 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/Durable.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/Durable.java
@@ -117,4 +117,10 @@ public interface Durable {
    *
    */
   long[][] getNativeFieldInfo();
+
+  /**
+   * break all marked live references
+   */
+  void refbreak();
+
 }

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/mnemonic-core/src/main/java/org/apache/mnemonic/DurableBuffer.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/DurableBuffer.java b/mnemonic-core/src/main/java/org/apache/mnemonic/DurableBuffer.java
index 27f4215..640785c 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/DurableBuffer.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/DurableBuffer.java
@@ -86,4 +86,9 @@ public class DurableBuffer<A extends RetrievableAllocator<A>>
extends MemBufferH
     return null;
   }
 
+  @Override
+  public void refbreak() {
+    return;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/mnemonic-core/src/main/java/org/apache/mnemonic/DurableChunk.java
----------------------------------------------------------------------
diff --git a/mnemonic-core/src/main/java/org/apache/mnemonic/DurableChunk.java b/mnemonic-core/src/main/java/org/apache/mnemonic/DurableChunk.java
index d1d6aac..9b4c12e 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/DurableChunk.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/DurableChunk.java
@@ -84,6 +84,11 @@ public class DurableChunk<A extends RetrievableAllocator<A>>
extends MemChunkHol
     return null;
   }
 
+  @Override
+  public void refbreak() {
+    return;
+  }
+
   /**
    * Get a buffer backed by a region of DurableChunk
    * @param offset

http://git-wip-us.apache.org/repos/asf/mnemonic/blob/adef72a2/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 bd6a61c..aec727f 100644
--- a/mnemonic-core/src/main/java/org/apache/mnemonic/GenericField.java
+++ b/mnemonic-core/src/main/java/org/apache/mnemonic/GenericField.java
@@ -571,4 +571,9 @@ public class GenericField<A extends RestorableAllocator<A>, E>
implements Durabl
   public long[][] getNativeFieldInfo() {
     throw new UnsupportedOperationException("getNativeFieldInfo() on Generic Field.");
   }
+
+  @Override
+  public void refbreak() {
+    return;
+  }
 }


Mime
View raw message