You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by yu...@apache.org on 2015/06/22 17:54:19 UTC
[12/17] incubator-reef git commit: Add comments in Serializer
Add comments in Serializer
Project: http://git-wip-us.apache.org/repos/asf/incubator-reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-reef/commit/47865fd3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-reef/tree/47865fd3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-reef/diff/47865fd3
Branch: refs/heads/REEF-395
Commit: 47865fd34a97b1d4e52b55abf4d2a60032167560
Parents: 0e52a16
Author: Yunseong Lee <yu...@apache.org>
Authored: Mon Jun 22 21:08:34 2015 +0900
Committer: Yunseong Lee <yu...@apache.org>
Committed: Mon Jun 22 21:08:34 2015 +0900
----------------------------------------------------------------------
.../formats/AvroClassHierarchySerializer.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-reef/blob/47865fd3/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/AvroClassHierarchySerializer.java
----------------------------------------------------------------------
diff --git a/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/AvroClassHierarchySerializer.java b/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/AvroClassHierarchySerializer.java
index f096021..2f5c0d8 100644
--- a/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/AvroClassHierarchySerializer.java
+++ b/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/AvroClassHierarchySerializer.java
@@ -34,12 +34,22 @@ public class AvroClassHierarchySerializer implements ClassHierarchySerializer {
public AvroClassHierarchySerializer() {
}
- private static ClassHierarchy fromAvro(final AvroNode n) {
- return new AvroClassHierarchy(n);
+ /**
+ * Serialize the ClassHierarchy into the AvroNode.
+ * This method is set to be Package private for testing.
+ * @param ch ClassHierarchy to serialize
+ */
+ static AvroNode toAvro(final ClassHierarchy ch) {
+ return newAvroNode(ch.getNamespace());
}
- private static AvroNode toAvro(final ClassHierarchy ch) {
- return newAvroNode(ch.getNamespace());
+ /**
+ * Deserialize the ClassHierarchy from the AvroNode.
+ * This method is set to be Package private for testing.
+ * @param n AvroNode to deserialize
+ */
+ static ClassHierarchy fromAvro(final AvroNode n) {
+ return new AvroClassHierarchy(n);
}
private static AvroNode newAvroNode(final Node n) {