Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
BUG-4626: Split out stream token types
[controller.git]
/
opendaylight
/
md-sal
/
sal-clustering-commons
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
cluster
/
datastore
/
node
/
utils
/
stream
/
NormalizedNodeOutputStreamWriter.java
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 9ff7457298ef3c43745d0b76ed21c6b19e1f3314..a266a2f2202904c190ca873fa7764709a767ecac 100644
(file)
--- 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);
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<String, Integer> stringCodeMap = new HashMap<>();
private final DataOutput output;
private final Map<String, Integer> stringCodeMap = new HashMap<>();
@@
-87,8
+80,8
@@
public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri
private void writeSignatureMarkerAndVersionIfNeeded() throws IOException {
if(!wroteSignatureMarker) {
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;
}
}
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) {
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.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 {
stringCodeMap.put(key, Integer.valueOf(stringCodeMap.size()));
output.writeUTF(key);
} else {
- output.writeByte(IS_NULL_VALUE);
+ output.writeByte(
TokenTypes.
IS_NULL_VALUE);
}
}
}
}
}
}