X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2Fstream%2FNormalizedNodeOutputStreamWriter.java;fp=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2Fstream%2FNormalizedNodeOutputStreamWriter.java;h=a266a2f2202904c190ca873fa7764709a767ecac;hp=9ff7457298ef3c43745d0b76ed21c6b19e1f3314;hb=3ee741416f6f67699392f8d9de9142f828d8981e;hpb=27f4b162e70c2463c1c47c03cb0f6a698b953d49 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 9ff7457298..a266a2f220 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 @@ -45,13 +45,6 @@ public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri private static final Logger LOG = LoggerFactory.getLogger(NormalizedNodeOutputStreamWriter.class); - static final byte SIGNATURE_MARKER = (byte) 0xab; - static final short CURRENT_VERSION = (short) 1; - - static final byte IS_CODE_VALUE = 1; - static final byte IS_STRING_VALUE = 2; - static final byte IS_NULL_VALUE = 3; - private final DataOutput output; private final Map stringCodeMap = new HashMap<>(); @@ -87,8 +80,8 @@ public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri private void writeSignatureMarkerAndVersionIfNeeded() throws IOException { if(!wroteSignatureMarker) { - output.writeByte(SIGNATURE_MARKER); - output.writeShort(CURRENT_VERSION); + output.writeByte(TokenTypes.SIGNATURE_MARKER); + output.writeShort(TokenTypes.LITHIUM_VERSION); wroteSignatureMarker = true; } } @@ -246,15 +239,15 @@ public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri private void writeCodedString(String key) throws IOException { Integer value = stringCodeMap.get(key); if(value != null) { - output.writeByte(IS_CODE_VALUE); + output.writeByte(TokenTypes.IS_CODE_VALUE); output.writeInt(value); } else { if(key != null) { - output.writeByte(IS_STRING_VALUE); + output.writeByte(TokenTypes.IS_STRING_VALUE); stringCodeMap.put(key, Integer.valueOf(stringCodeMap.size())); output.writeUTF(key); } else { - output.writeByte(IS_NULL_VALUE); + output.writeByte(TokenTypes.IS_NULL_VALUE); } } }