Add LithiumSR1 input/output support 29/84729/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 9 Sep 2019 08:29:57 +0000 (10:29 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 26 Sep 2019 07:23:29 +0000 (09:23 +0200)
commit33b722cd658659dce4f0ef2d57704b39709e0590
tree1ed022fb3a86532c9f5da0ab8097887bd12ea21b
parentd250ac02439472cc36b07f1d30510ef2ae467407
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>
(cherry picked from commit 43ab81083ba4ffdbf6999df1e6fe8750ce2c76ac)
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactory.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataInput.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataOutput.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputOutput.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamVersion.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SodiumSR1DataInput.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SodiumSR1DataOutput.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/TokenTypes.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/VersionedNormalizedNodeDataInput.java