From 81d25b3c5f4a040b5f11475752a26712b46f5c0b Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sun, 19 Apr 2015 03:03:10 +0200 Subject: [PATCH] Clustering: Expose PathArgument writer 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 --- .../node/utils/stream/NormalizedNodeInputStreamReader.java | 2 +- .../node/utils/stream/NormalizedNodeOutputStreamWriter.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java index 59cc03625a..2246b51a3e 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java @@ -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(); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java index 055ccfe0ce..1ea94e9862 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java @@ -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); -- 2.36.6