Add LithiumSR1 input/output support
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 9 Sep 2019 08:29:57 +0000 (10:29 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 25 Sep 2019 08:21:16 +0000 (10:21 +0200)
commitf7acd27c0eb45b8f4b8242c8b709d90998d694b9
treec0fbc2641662a37513ce71e628db8477dde92ec6
parent732aa7e9f528da7d9eb8097b093472390e1b94e0
Add LithiumSR1 input/output support

This is a code drop of both DataInput and DataOutput for Sodium SR1
streaming format. It uses its own dedicated tokes, along with quite
a few of stateful encoding rules.

Where Lithium did encoding did not perform any look-behind except
for LeafSetEntryNodes and only maintained simple coding tables,
this coder maintains simple 'parent' state tracking.

While the state tracking is not mandated on the encoder side, some
amount of tracking is required in the decoder side to provide full
coverage of coding constructs.

Two examples of this are:
- parent QName references, which are expanded to cover not only
  LeafSet/LeafSetEntry, but also UnkeyedList/UnkeyedListEntry
  and most importantly Map/MapEntry pairs
- Map/MapEntry tracking is also important for coding leaf nodes
  which represent keys -- in those cases emitting the leaf value
  is superfluous, as it can be looked up from MapEntry's predicates

Also this state tracking is maintained on-stack, thus making issues
related with it nigh impossible (unlike the Lithium LeafSetEntry
bugs).

JIRA: CONTROLLER-1919
Change-Id: I5fcf85a76750301cd3f8bcbd505baa0f95397cb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java
java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataInput.java [new file with mode: 0644]
java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataOutput.java [new file with mode: 0644]
java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputOutput.java
java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamVersion.java
java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SodiumSR1DataInput.java [new file with mode: 0644]
java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SodiumSR1DataOutput.java [new file with mode: 0644]
java/org/opendaylight/controller/cluster/datastore/node/utils/stream/TokenTypes.java
java/org/opendaylight/controller/cluster/datastore/node/utils/stream/VersionedNormalizedNodeDataInput.java