Add support for coded QNames/AugmentationIdentifiers 04/82304/7
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 29 May 2019 09:27:21 +0000 (11:27 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 29 May 2019 18:05:08 +0000 (20:05 +0200)
commit657b0b025a92f9d0ad6647d79950071031d7b0b4
treeef354fbed91f4b2ceae3264544143b13a0f30da3
parent69e914b3889a82fa2f7daa8d55e1aa0de23fb454
Add support for coded QNames/AugmentationIdentifiers

Profiling is showing we are spending about 46% in readQName(),
which further breaks down to 30% in readCodedString() and 61%
in QNameFactory.create().

Out of 1.7M invocations of readQName(), we end up loading only
508 QNames -- which is understandable, as the number of QNames is
bound by the SchemaContext contents. This also applies to
AugmentationIdentifiers.

This patch defines a new streaming format version, which uses
the same linear coding approach we take for Strings, taking
hash-based lookups out of the hot path -- bringing reconstruction
time down from 36 to 19-24 seconds.

It has also the effect of reducing the snapshot size, in our testing
bringing a 388.8MiB snapshot down to 210.6MiB.

JIRA: CONTROLLER-1898
Change-Id: Ibbc96c286d52b3261b04dd7de02e13bc6b44e803
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
12 files changed:
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ForwardingNormalizedNodeDataInput.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNormalizedNodeInputStreamReader.java [moved from opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeInputStreamReader.java with 97% similarity]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNormalizedNodeOutputStreamWriter.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeDataInput.java
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/NormalizedNodeOutputStreamWriter.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamVersion.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SodiumNormalizedNodeInputStreamReader.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SodiumNormalizedNodeOutputStreamWriter.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