Clustering: Expose PathArgument writer 93/18593/13
authorRobert Varga <rovarga@cisco.com>
Sun, 19 Apr 2015 01:03:10 +0000 (03:03 +0200)
committerRobert Varga <rovarga@cisco.com>
Wed, 22 Apr 2015 11:42:50 +0000 (13:42 +0200)
In our upcoming clustering work we will be serializing
DataTreeCandidate, which is a PathArgument-indexed tree structure.
Expose PathArgument writer and read methods for later use. Also fix
NormalizedNodeOutputStreamWriter not calling flush() on close().

Change-Id: Ided34a8bc1bc77b5ef357346e3d5b057bffc40c1
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java

index 59cc03625ae2f450373c712a9d10f84b62a0e68a..2246b51a3e1428ddca70220c1608a368f9174956 100644 (file)
@@ -337,7 +337,7 @@ public class NormalizedNodeInputStreamReader implements NormalizedNodeStreamRead
         return children;
     }
 
-    private PathArgument readPathArgument() throws IOException {
+    public PathArgument readPathArgument() throws IOException {
         // read Type
         int type = input.readByte();
 
index 055ccfe0ceeeed6ee101b60f4dcda6d0a2a83a9d..1ea94e9862a455bf7b4b5d2fa976d2c065525aa8 100644 (file)
@@ -203,6 +203,7 @@ public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri
 
     @Override
     public void close() throws IOException {
+        flush();
     }
 
     @Override
@@ -278,7 +279,7 @@ public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri
         }
     }
 
-    private void writePathArgument(YangInstanceIdentifier.PathArgument pathArgument) throws IOException {
+    public void writePathArgument(YangInstanceIdentifier.PathArgument pathArgument) throws IOException {
 
         byte type = PathArgumentTypes.getSerializablePathArgumentType(pathArgument);