Cache full datastore context 71/87071/2 master
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 21 Jan 2020 22:31:31 +0000 (23:31 +0100)
committerRobert Varga <nite@hq.sk>
Tue, 28 Jan 2020 17:21:29 +0000 (17:21 +0000)
While the context is small, it is also invariant across a number of
test cases, each of which is instantiating it. Just share one
instance across all tests to speed them up.

While we are at it, we switch to using EffectiveModelContext to
ease our future migration.

Change-Id: I29a89e93903e7582bde4984828405aa2a8e45c27
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
211 files changed:
benchmark/api/pom.xml
benchmark/artifacts/pom.xml
benchmark/dsbenchmark/pom.xml
benchmark/ntfbenchmark/pom.xml
benchmark/pom.xml
benchmark/rpcbenchmark/pom.xml
docs/pom.xml
features/benchmark/features-mdsal-benchmark/pom.xml
features/benchmark/odl-benchmark-api/pom.xml
features/benchmark/odl-dsbenchmark/pom.xml
features/benchmark/odl-mdsal-benchmark/pom.xml
features/benchmark/odl-ntfbenchmark/pom.xml
features/benchmark/pom.xml
features/config-netty/features-config-netty/pom.xml
features/config-netty/odl-config-netty/pom.xml
features/config-netty/pom.xml
features/extras/features-extras/pom.xml
features/extras/odl-extras-all/pom.xml
features/extras/odl-jolokia/pom.xml
features/extras/pom.xml
features/mdsal/features-mdsal/pom.xml
features/mdsal/odl-clustering-test-app/pom.xml
features/mdsal/odl-controller-binding-api/pom.xml
features/mdsal/odl-controller-blueprint/pom.xml
features/mdsal/odl-controller-dom-api/pom.xml
features/mdsal/odl-controller-mdsal-common/pom.xml
features/mdsal/odl-controller-model-topology/pom.xml
features/mdsal/odl-mdsal-broker-local/pom.xml
features/mdsal/odl-mdsal-broker/pom.xml
features/mdsal/odl-mdsal-clustering-commons/pom.xml
features/mdsal/odl-mdsal-clustering-commons/src/main/feature/feature.xml
features/mdsal/odl-mdsal-clustering/pom.xml
features/mdsal/odl-mdsal-distributed-datastore/pom.xml
features/mdsal/odl-mdsal-model-inventory/pom.xml
features/mdsal/odl-mdsal-remoterpc-connector/pom.xml
features/mdsal/odl-message-bus-collector/pom.xml
features/mdsal/odl-toaster/pom.xml
features/mdsal/pom.xml
features/pom.xml
karaf/pom.xml
opendaylight/archetypes/opendaylight-startup/src/main/resources/archetype-resources/pom.xml
opendaylight/archetypes/pom.xml
opendaylight/blueprint/pom.xml
opendaylight/commons/jolokia/pom.xml
opendaylight/config/config-artifacts/pom.xml
opendaylight/config/pom.xml
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/ABIVersion.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/AbstractReadPathTransactionRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ModifyTransactionRequestProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ReadTransactionSuccessProxyV1.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionDataModification.java
opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/TransactionModification.java
opendaylight/md-sal/mdsal-artifacts/pom.xml
opendaylight/md-sal/mdsal-it-base/pom.xml
opendaylight/md-sal/mdsal-it-base/src/main/java/org/opendaylight/controller/mdsal/it/base/AbstractMdsalTestBase.java
opendaylight/md-sal/mdsal-it-parent/pom.xml
opendaylight/md-sal/mdsal-trace/features/features-mdsal-trace/pom.xml
opendaylight/md-sal/mdsal-trace/features/odl-mdsal-trace/pom.xml
opendaylight/md-sal/mdsal-trace/features/pom.xml
opendaylight/md-sal/mdsal-trace/pom.xml
opendaylight/md-sal/parent/pom.xml
opendaylight/md-sal/pom.xml
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractLeader.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/AbstractRaftActorBehavior.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Candidate.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Follower.java
opendaylight/md-sal/sal-akka-segmented-journal/src/main/java/org/opendaylight/controller/akka/segjournal/SegmentedJournalActor.java
opendaylight/md-sal/sal-binding-api/pom.xml
opendaylight/md-sal/sal-binding-broker/pom.xml
opendaylight/md-sal/sal-binding-dom-it/pom.xml
opendaylight/md-sal/sal-clustering-commons/pom.xml
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/AbstractLithiumDataInput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataOutput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataInput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataOutput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataInput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/CompatNormalizedNodeDataInput.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/CompatNormalizedNodeDataOutput.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ForwardingDataInput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ForwardingNormalizedNodeDataInput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/InvalidNormalizedNodeStreamException.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNode.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNormalizedNodeInputStreamReader.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNormalizedNodeOutputStreamWriter.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumPathArgument.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumTokens.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumValue.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumDataInput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumDataOutput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumNode.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumPathArgument.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumValue.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NeonSR2NormalizedNodeInputStreamReader.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NeonSR2NormalizedNodeOutputStreamWriter.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NeonSR2Tokens.java [deleted file]
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/NormalizedNodeDataOutput.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/NormalizedNodeStreamVersion.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SerializationUtils.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SodiumSR1DataInput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/SodiumSR1DataOutput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/TokenTypes.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/VersionedNormalizedNodeDataInput.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/AbstractNormalizedNodePruner.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/ReusableNormalizedNodePruner.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/UintAdaptingPruner.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/raft/protobuff/client/messages/IdentifiablePayload.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/raft/protobuff/client/messages/Payload.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/QNameFactoryTest.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumWriteObjectMappingTest.java [deleted file]
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeStreamReaderWriterTest.java
opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/transformer/UintAdaptingPrunerTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/test/resources/odl-ctlr1923.yang [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-config/pom.xml
opendaylight/md-sal/sal-distributed-datastore/pom.xml
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandle.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientSnapshot.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/ClientTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTree.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardRecoveryCoordinator.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/AbstractModuleShardConfigProvider.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/ConfigurationImpl.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/FileModuleShardConfigProvider.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/config/HybridModuleShardConfigProvider.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/VersionedExternalizableMessage.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/DeleteModification.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/MergeModification.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/Modification.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/MutableCompositeModification.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/modification/WriteModification.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/AbstractIdentifiablePayload.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayload.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/DataTreeCandidateInputOutput.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/MetadataShardDataTreeSnapshot.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/PayloadVersion.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/ShardSnapshotState.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardInformation.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/shardmanager/ShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModification.java
opendaylight/md-sal/sal-distributed-datastore/src/main/resources/OSGI-INF/blueprint/clustered-datastore.xml
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/TestClientBackedDataStore.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHandleTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreRemotingIntegrationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/LocalShardStore.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TestDistributedDataStore.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/TestShard.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/config/ConfigurationImplBaseTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/config/ConfigurationImplFileTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/config/ConfigurationImplHybridTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/config/ConfigurationImplTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/persisted/CommitTransactionPayloadTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/shardmanager/TestShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/PruningDataTreeModificationTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/md/cluster/datastore/model/SchemaContextHelper.java
opendaylight/md-sal/sal-distributed-eos/pom.xml [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/AbstractEntityOwnerChangeListener.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractEntityOwnerChangeListener.java with 77% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/CandidateListChangeListener.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/CandidateListChangeListener.java with 88% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/DistributedEntityOwnershipCandidateRegistration.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipCandidateRegistration.java with 94% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/DistributedEntityOwnershipListenerRegistration.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipListenerRegistration.java with 96% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/DistributedEntityOwnershipService.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipService.java with 91% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/EntityOwnerChangeListener.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnerChangeListener.java with 94% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/EntityOwnersModel.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnersModel.java with 99% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipChangePublisher.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipChangePublisher.java with 90% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipListenerActor.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipListenerActor.java with 97% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipListenerSupport.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipListenerSupport.java with 99% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipShard.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShard.java with 92% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipShardCommitCoordinator.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardCommitCoordinator.java with 98% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipStatistics.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipStatistics.java with 94% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/messages/CandidateAdded.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/messages/CandidateAdded.java with 85% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/messages/CandidateRemoved.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/messages/CandidateRemoved.java with 85% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/messages/RegisterCandidateLocal.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/messages/RegisterCandidateLocal.java with 85% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/messages/RegisterListenerLocal.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/messages/RegisterListenerLocal.java with 94% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/messages/RemoveAllCandidates.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/messages/RemoveAllCandidates.java with 87% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/messages/SelectOwner.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/messages/SelectOwner.java with 89% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/messages/UnregisterCandidateLocal.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/messages/UnregisterCandidateLocal.java with 85% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/messages/UnregisterListenerLocal.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/messages/UnregisterListenerLocal.java with 85% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/AbstractEntityOwnerSelectionStrategy.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/AbstractEntityOwnerSelectionStrategy.java with 79% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/EntityOwnerSelectionStrategy.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategy.java with 92% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfig.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfig.java with 97% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReader.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReader.java with 94% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/FirstCandidateSelectionStrategy.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/FirstCandidateSelectionStrategy.java with 76% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategy.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategy.java with 86% similarity]
opendaylight/md-sal/sal-distributed-eos/src/main/resources/OSGI-INF/blueprint/distributed-eos.xml [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-eos/src/main/yang/entity-owners.yang [moved from opendaylight/md-sal/sal-distributed-datastore/src/main/yang/entity-owners.yang with 100% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/AbstractClusterRefEntityOwnershipTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractClusterRefEntityOwnershipTest.java with 93% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/AbstractEntityOwnershipTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/AbstractEntityOwnershipTest.java with 93% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/CandidateListChangeListenerTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/CandidateListChangeListenerTest.java with 85% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/DistributedEntityOwnershipIntegrationTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipIntegrationTest.java with 92% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/DistributedEntityOwnershipServiceTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/DistributedEntityOwnershipServiceTest.java with 88% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/EOSTestUtils.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/EntityOwnerChangeListenerTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnerChangeListenerTest.java with 91% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipListenerActorTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipListenerActorTest.java with 98% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipListenerSupportTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipListenerSupportTest.java with 99% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipShardTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipShardTest.java with 97% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/EntityOwnershipStatisticsTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/EntityOwnershipStatisticsTest.java with 91% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/EntityOwnerSelectionStrategyConfigReaderTest.java with 77% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/LastCandidateSelectionStrategy.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LastCandidateSelectionStrategy.java with 90% similarity]
opendaylight/md-sal/sal-distributed-eos/src/test/java/org/opendaylight/controller/cluster/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java [moved from opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/entityownership/selectionstrategy/LeastLoadedCandidateSelectionStrategyTest.java with 97% similarity]
opendaylight/md-sal/sal-dom-api/pom.xml
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteAction.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/ActionRoutingTable.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RoutingTable.java
opendaylight/model/model-inventory/pom.xml
opendaylight/model/model-topology/pom.xml
opendaylight/model/pom.xml
pom.xml

index a5ae1d8..b86d88c 100644 (file)
@@ -10,7 +10,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.4</version>
+    <version>5.0.9</version>
     <relativePath/>
   </parent>
 
index d339ee4..ab1c6aa 100644 (file)
@@ -13,7 +13,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
index adbefe0..c7182a1 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.4</version>
+    <version>5.0.9</version>
     <relativePath/>
   </parent>
 
index c4734b4..79c8424 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.4</version>
+    <version>5.0.9</version>
     <relativePath/>
   </parent>
 
index 76e9b6a..93c3eb9 100644 (file)
@@ -9,7 +9,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
   <groupId>org.opendaylight.controller</groupId>
index 9da5bf2..d2f4330 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.4</version>
+    <version>5.0.9</version>
     <relativePath/>
   </parent>
 
index 2db06f2..265c43f 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
                         <link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.9/</link>
                         <link>https://commons.apache.org/proper/commons-codec/apidocs/</link>
 
-                        <link>https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/4.0.2/</link>
-                        <link>https://www.javadoc.io/doc/org.opendaylight.mdsal/mdsal-docs/5.0.4/</link>
+                        <link>https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/4.0.6/</link>
+                        <link>https://www.javadoc.io/doc/org.opendaylight.mdsal/mdsal-docs/5.0.9/</link>
                     </links>
                     <groups>
                         <group>
index c666b0a..808d5fc 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 045605e..8c55ae6 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -27,7 +27,7 @@
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>odl-mdsal-binding-base</artifactId>
-            <version>5.0.4</version>
+            <version>5.0.9</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index 142ef9d..0380244 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index d16f38a..50ce6a1 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 1fc8c90..511497c 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 7bc6f4f..ca92b23 100644 (file)
@@ -10,7 +10,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
     <groupId>org.opendaylight.controller</groupId>
index c935ea1..45925bf 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 734bff5..7df7de7 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 12cd79e..2f81b8c 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 4286880..4b9b387 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 3c79b20..30f35c8 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 0e36f94..253d16c 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 189a711..01d41aa 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 9daf2af..e1b6571 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index decd092..aa6957b 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -26,7 +26,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <scope>import</scope>
                 <type>pom</type>
             </dependency>
index d7c4d2b..256ecfd 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -29,7 +29,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 757d633..336230d 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -33,7 +33,7 @@
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>4.0.2</version>
+                <version>4.0.6</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 1d31ec0..e17150b 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -29,7 +29,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index cfc2110..f8d2cfa 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -28,7 +28,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index f3be83b..cce56ec 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -27,7 +27,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
@@ -44,7 +44,7 @@
     <dependencies>
         <dependency>
             <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01</artifactId>
+            <artifactId>odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index 0dc819d..c980749 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>4.0.2</version>
+                <version>4.0.6</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index c58b402..280f542 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -29,7 +29,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 7006bfc..c297ae1 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -29,7 +29,7 @@
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>4.0.2</version>
+                <version>4.0.6</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>odl-yangtools-codec</artifactId>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
 
         <dependency>
             <groupId>${project.groupId}</groupId>
index bf6fbbe..c9627c5 100644 (file)
@@ -15,5 +15,6 @@
         <feature version="[6,7)">odl-dropwizard-metrics</feature>
         <feature version="[6,7)">odl-servlet-api</feature>
         <feature version="[4,5)">odl-yangtools-data</feature>
+        <feature version="[4,5)">odl-yangtools-codec</feature>
     </feature>
 </features>
index 1911fd3..bf103cd 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 362715b..f30119d 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
             <dependency>
                 <groupId>org.opendaylight.yangtools</groupId>
                 <artifactId>yangtools-artifacts</artifactId>
-                <version>4.0.2</version>
+                <version>4.0.6</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sal-distributed-datastore</artifactId>
         </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>sal-distributed-eos</artifactId>
+        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>sal-cluster-admin-api</artifactId>
index a826a56..fd62e36 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -28,7 +28,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
index 9589586..137cb5b 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 63123ba..82a0682 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -37,7 +37,7 @@
             <dependency>
                 <groupId>org.opendaylight.mdsal</groupId>
                 <artifactId>mdsal-artifacts</artifactId>
-                <version>5.0.4</version>
+                <version>5.0.9</version>
                 <type>pom</type>
                 <scope>import</scope>
             </dependency>
@@ -54,7 +54,7 @@
         </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal.model</groupId>
-            <artifactId>odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01</artifactId>
+            <artifactId>odl-mdsal-model-draft-clemm-netmod-yang-network-topo-01-minimal</artifactId>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index 7a04609..c3359b6 100644 (file)
@@ -12,7 +12,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
@@ -27,7 +27,7 @@
         <dependency>
             <groupId>org.opendaylight.mdsal</groupId>
             <artifactId>odl-mdsal-binding-runtime</artifactId>
-            <version>5.0.4</version>
+            <version>5.0.9</version>
             <type>xml</type>
             <classifier>features</classifier>
         </dependency>
index 8002333..0a848b9 100644 (file)
@@ -11,7 +11,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index ab54081..a6579b1 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
index 66f8b88..36bf76f 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>karaf4-parent</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
@@ -55,7 +55,7 @@
     <dependency>
       <groupId>org.opendaylight.mdsal</groupId>
       <artifactId>features-mdsal</artifactId>
-      <version>5.0.4</version>
+      <version>5.0.9</version>
       <classifier>features</classifier>
       <type>xml</type>
       <scope>runtime</scope>
index 718de81..2515638 100644 (file)
@@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
index 93b9fea..2e193bb 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
index b96a85a..de8f9aa 100644 (file)
@@ -12,7 +12,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
@@ -27,7 +27,7 @@
       <dependency>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>5.0.4</version>
+        <version>5.0.9</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
@@ -41,7 +41,7 @@
       <dependency>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-artifacts</artifactId>
-        <version>4.0.2</version>
+        <version>4.0.6</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
index 06a663a..acb6ad1 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
index d43bdab..9052eeb 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 6df327d..b6bf758 100644 (file)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.4</version>
+    <version>5.0.9</version>
     <relativePath/>
   </parent>
 
index 26093c1..cfaf477 100644 (file)
@@ -15,8 +15,8 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeStreamVersion;
 import org.opendaylight.yangtools.concepts.WritableObject;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 16049fb..2cd4ec9 100644 (file)
@@ -12,10 +12,10 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataOutput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeInputOutput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeStreamVersion;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion;
 
 /**
  * Abstract base class for serialization proxies associated with {@link AbstractReadTransactionRequest}s. It implements
@@ -45,7 +45,7 @@ abstract class AbstractReadPathTransactionRequestProxyV1<T extends AbstractReadP
     @Override
     public final void writeExternal(final ObjectOutput out) throws IOException {
         super.writeExternal(out);
-        try (NormalizedNodeDataOutput nnout = NormalizedNodeInputOutput.newDataOutput(out, streamVersion)) {
+        try (NormalizedNodeDataOutput nnout = streamVersion.newDataOutput(out)) {
             nnout.writeYangInstanceIdentifier(path);
         }
     }
@@ -53,7 +53,7 @@ abstract class AbstractReadPathTransactionRequestProxyV1<T extends AbstractReadP
     @Override
     public final void readExternal(final ObjectInput in) throws ClassNotFoundException, IOException {
         super.readExternal(in);
-        path = NormalizedNodeInputOutput.newDataInput(in).readYangInstanceIdentifier();
+        path = NormalizedNodeDataInput.newDataInput(in).readYangInstanceIdentifier();
     }
 
     @Override
index d6fc4e5..384c889 100644 (file)
@@ -18,10 +18,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataInput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataOutput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeInputOutput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeStreamVersion;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion;
 import org.opendaylight.yangtools.yang.data.impl.schema.ReusableImmutableNormalizedNodeStreamWriter;
 
 /**
@@ -32,6 +31,7 @@ import org.opendaylight.yangtools.yang.data.impl.schema.ReusableImmutableNormali
  */
 final class ModifyTransactionRequestProxyV1 extends AbstractTransactionRequestProxy<ModifyTransactionRequest> {
     private static final long serialVersionUID = 1L;
+
     private List<TransactionModification> modifications;
     private Optional<PersistenceProtocol> protocol;
     private transient NormalizedNodeStreamVersion streamVersion;
@@ -59,7 +59,7 @@ final class ModifyTransactionRequestProxyV1 extends AbstractTransactionRequestPr
         final int size = in.readInt();
         if (size != 0) {
             modifications = new ArrayList<>(size);
-            final NormalizedNodeDataInput nnin = NormalizedNodeInputOutput.newDataInput(in);
+            final NormalizedNodeDataInput nnin = NormalizedNodeDataInput.newDataInput(in);
             final ReusableImmutableNormalizedNodeStreamWriter writer =
                     ReusableImmutableNormalizedNodeStreamWriter.create();
             for (int i = 0; i < size; ++i) {
@@ -77,7 +77,7 @@ final class ModifyTransactionRequestProxyV1 extends AbstractTransactionRequestPr
         out.writeByte(PersistenceProtocol.byteValue(protocol.orElse(null)));
         out.writeInt(modifications.size());
         if (!modifications.isEmpty()) {
-            try (NormalizedNodeDataOutput nnout = NormalizedNodeInputOutput.newDataOutput(out, streamVersion)) {
+            try (NormalizedNodeDataOutput nnout = streamVersion.newDataOutput(out)) {
                 for (TransactionModification op : modifications) {
                     op.writeTo(nnout);
                 }
index f755d3e..357c3d9 100644 (file)
@@ -12,10 +12,10 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Optional;
 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataOutput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeInputOutput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeStreamVersion;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion;
 
 /**
  * Externalizable proxy for use with {@link ReadTransactionSuccess}. It implements the initial (Boron) serialization
@@ -48,7 +48,7 @@ final class ReadTransactionSuccessProxyV1 extends AbstractTransactionSuccessProx
 
         if (data.isPresent()) {
             out.writeBoolean(true);
-            try (NormalizedNodeDataOutput nnout = NormalizedNodeInputOutput.newDataOutput(out, streamVersion)) {
+            try (NormalizedNodeDataOutput nnout = streamVersion.newDataOutput(out)) {
                 nnout.writeNormalizedNode(data.get());
             }
         } else {
@@ -61,7 +61,7 @@ final class ReadTransactionSuccessProxyV1 extends AbstractTransactionSuccessProx
         super.readExternal(in);
 
         if (in.readBoolean()) {
-            data = Optional.of(NormalizedNodeInputOutput.newDataInput(in).readNormalizedNode());
+            data = Optional.of(NormalizedNodeDataInput.newDataInput(in).readNormalizedNode());
         } else {
             data = Optional.empty();
         }
index cc901d6..eb2b308 100644 (file)
@@ -11,9 +11,9 @@ import static java.util.Objects.requireNonNull;
 
 import com.google.common.annotations.Beta;
 import java.io.IOException;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataOutput;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput;
 
 /**
  * A {@link TransactionModification} which has a data component.
index a67886b..a4e0194 100644 (file)
@@ -12,10 +12,10 @@ import static java.util.Objects.requireNonNull;
 import com.google.common.annotations.Beta;
 import com.google.common.base.MoreObjects;
 import java.io.IOException;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataInput;
-import org.opendaylight.controller.cluster.datastore.node.utils.stream.NormalizedNodeDataOutput;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.stream.ReusableStreamReceiver;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
+import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput;
 
 /**
  * An individual modification of a transaction's state. This class and its subclasses are not serializable, but rather
index b9c05e1..2726517 100644 (file)
@@ -14,7 +14,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>odlparent-lite</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
                 <artifactId>sal-distributed-datastore</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>sal-distributed-eos</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
                 <artifactId>sal-remoterpc-connector</artifactId>
index daca57c..9d855f7 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
   <modelVersion>4.0.0</modelVersion>
index b8cabad..e937f99 100644 (file)
@@ -24,7 +24,6 @@ import org.ops4j.pax.exam.Configuration;
 import org.ops4j.pax.exam.MavenUtils;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.OptionUtils;
-import org.ops4j.pax.exam.karaf.container.internal.JavaVersionUtil;
 import org.ops4j.pax.exam.karaf.options.KarafDistributionOption;
 import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
 import org.ops4j.pax.exam.options.MavenUrlReference;
@@ -38,7 +37,6 @@ public abstract class AbstractMdsalTestBase {
 
     private static final Logger LOG = LoggerFactory.getLogger(AbstractMdsalTestBase.class);
     private static final String MAVEN_REPO_LOCAL = "maven.repo.local";
-    private static final String ORG_OPS4J_PAX_URL_MVN_LOCAL_REPOSITORY = "org.ops4j.pax.url.mvn.localRepository";
     private static final String ETC_ORG_OPS4J_PAX_URL_MVN_CFG = "etc/org.ops4j.pax.url.mvn.cfg";
     private static final String ETC_ORG_OPS4J_PAX_LOGGING_CFG = "etc/org.ops4j.pax.logging.cfg";
 
@@ -117,8 +115,8 @@ public abstract class AbstractMdsalTestBase {
     protected Option mvnLocalRepoOption() {
         String mvnRepoLocal = System.getProperty(MAVEN_REPO_LOCAL, "");
         LOG.info("mvnLocalRepo \"{}\"", mvnRepoLocal);
-        return editConfigurationFilePut(ETC_ORG_OPS4J_PAX_URL_MVN_CFG, ORG_OPS4J_PAX_URL_MVN_LOCAL_REPOSITORY,
-                mvnRepoLocal);
+        return editConfigurationFilePut(ETC_ORG_OPS4J_PAX_URL_MVN_CFG,
+            "org.ops4j.pax.url.mvn.localRepository", mvnRepoLocal);
     }
 
     @Configuration
@@ -130,41 +128,43 @@ public abstract class AbstractMdsalTestBase {
                         .unpackDirectory(new File(PAX_EXAM_UNPACK_DIRECTORY)).useDeployFolder(false),
                 when(Boolean.getBoolean(KEEP_UNPACK_DIRECTORY_PROP)).useOptions(keepRuntimeFolder()),
                 features(getFeatureRepo(), getFeatureName()),
-                //mavenBundle("org.apache.aries.quiesce", "org.apache.aries.quiesce.api", "1.0.0"), getLoggingOption(),
                 mvnLocalRepoOption(),
+
+                // Make sure karaf's default repository is consulted before anything else
+                editConfigurationFilePut(ETC_ORG_OPS4J_PAX_URL_MVN_CFG, "org.ops4j.pax.url.mvn.defaultRepositories",
+                        "file:${karaf.home}/${karaf.default.repository}@id=system.repository"),
+
                 configureConsole().ignoreLocalConsole().ignoreRemoteShell(),
                 editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j2.rootLogger.level", "INFO") };
 
-        if (JavaVersionUtil.getMajorVersion() >= 9) {
-            final String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf.features",
+        final String karafVersion = MavenUtils.getArtifactVersion("org.apache.karaf.features",
                 "org.apache.karaf.features.core");
-            options = OptionUtils.combine(options, new VMOption[] {
-                new VMOption("--add-reads=java.xml=java.logging"),
-                new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
-                new VMOption("--patch-module"),
-                new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-" + karafVersion + ".jar"),
-                new VMOption("--patch-module"),
-                new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-" + karafVersion + ".jar"),
-                new VMOption("--add-opens"),
-                new VMOption("java.base/java.security=ALL-UNNAMED"),
-                new VMOption("--add-opens"),
-                new VMOption("java.base/java.net=ALL-UNNAMED"),
-                new VMOption("--add-opens"),
-                new VMOption("java.base/java.lang=ALL-UNNAMED"),
-                new VMOption("--add-opens"),
-                new VMOption("java.base/java.util=ALL-UNNAMED"),
-                new VMOption("--add-opens"),
-                new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
-                new VMOption("--add-opens"),
-                new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
-                new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
-                new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
-                new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
-                new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
-                new VMOption("-classpath"),
-                new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
-            });
-        }
+        options = OptionUtils.combine(options, new VMOption[] {
+            new VMOption("--add-reads=java.xml=java.logging"),
+            new VMOption("--add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED"),
+            new VMOption("--patch-module"),
+            new VMOption("java.base=lib/endorsed/org.apache.karaf.specs.locator-" + karafVersion + ".jar"),
+            new VMOption("--patch-module"),
+            new VMOption("java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-" + karafVersion + ".jar"),
+            new VMOption("--add-opens"),
+            new VMOption("java.base/java.security=ALL-UNNAMED"),
+            new VMOption("--add-opens"),
+            new VMOption("java.base/java.net=ALL-UNNAMED"),
+            new VMOption("--add-opens"),
+            new VMOption("java.base/java.lang=ALL-UNNAMED"),
+            new VMOption("--add-opens"),
+            new VMOption("java.base/java.util=ALL-UNNAMED"),
+            new VMOption("--add-opens"),
+            new VMOption("java.naming/javax.naming.spi=ALL-UNNAMED"),
+            new VMOption("--add-opens"),
+            new VMOption("java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED"),
+            new VMOption("--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED"),
+            new VMOption("--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED"),
+            new VMOption("--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"),
+            new VMOption("--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED"),
+            new VMOption("-classpath"),
+            new VMOption("lib/jdk9plus/*" + File.pathSeparator + "lib/boot/*")
+        });
 
         return OptionUtils.combine(options, getAdditionalOptions());
     }
index d8878e0..04daf39 100644 (file)
@@ -13,7 +13,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>bundle-parent</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
index c383a40..f4f8933 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>feature-repo-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index 201bf7f..6c76693 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>single-feature-parent</artifactId>
-        <version>6.0.1</version>
+        <version>6.0.4</version>
         <relativePath/>
     </parent>
 
index f6d002a..49b752d 100644 (file)
@@ -12,7 +12,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
index faaacb1..f366d61 100644 (file)
@@ -11,7 +11,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
index 73689a4..4968c3a 100644 (file)
@@ -11,7 +11,7 @@
   <parent>
     <groupId>org.opendaylight.mdsal</groupId>
     <artifactId>binding-parent</artifactId>
-    <version>5.0.4</version>
+    <version>5.0.9</version>
     <relativePath/>
   </parent>
 
index 9421af2..aee2a2a 100644 (file)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent-lite</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
@@ -58,6 +58,7 @@
     <module>sal-dummy-distributed-datastore</module>
     <module>sal-cluster-admin-api</module>
     <module>sal-cluster-admin-impl</module>
+    <module>sal-distributed-eos</module>
 
     <!-- Yang Test Models for MD-SAL -->
     <module>sal-test-model</module>
index 32e2e09..6560ad7 100644 (file)
@@ -41,6 +41,7 @@ import org.opendaylight.controller.cluster.raft.RaftActorContext;
 import org.opendaylight.controller.cluster.raft.RaftState;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.controller.cluster.raft.VotingState;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
 import org.opendaylight.controller.cluster.raft.base.messages.CheckConsensusReached;
 import org.opendaylight.controller.cluster.raft.base.messages.Replicate;
 import org.opendaylight.controller.cluster.raft.base.messages.SendHeartBeat;
@@ -55,6 +56,8 @@ import org.opendaylight.controller.cluster.raft.messages.RequestVoteReply;
 import org.opendaylight.controller.cluster.raft.messages.UnInitializedFollowerSnapshotReply;
 import org.opendaylight.controller.cluster.raft.persisted.ServerConfigurationPayload;
 import org.opendaylight.controller.cluster.raft.persisted.Snapshot;
+import org.opendaylight.controller.cluster.raft.protobuff.client.messages.IdentifiablePayload;
+import org.opendaylight.controller.cluster.raft.protobuff.client.messages.Payload;
 import scala.concurrent.duration.FiniteDuration;
 
 /**
@@ -433,8 +436,12 @@ public abstract class AbstractLeader extends AbstractRaftActorBehavior {
         super.performSnapshotWithoutCapture(minReplicatedToAllIndex);
     }
 
-    @Override
-    protected ClientRequestTracker removeClientRequestTracker(final long logIndex) {
+    /**
+     * Removes and returns the ClientRequestTracker for the specified log index.
+     * @param logIndex the log index
+     * @return the ClientRequestTracker or null if none available
+     */
+    private ClientRequestTracker removeClientRequestTracker(final long logIndex) {
         final Iterator<ClientRequestTracker> it = trackers.iterator();
         while (it.hasNext()) {
             final ClientRequestTracker t = it.next();
@@ -447,6 +454,28 @@ public abstract class AbstractLeader extends AbstractRaftActorBehavior {
         return null;
     }
 
+    @Override
+    final ApplyState getApplyStateFor(final ReplicatedLogEntry entry) {
+        // first check whether a ClientRequestTracker exists for this entry.
+        // If it does that means the leader wasn't dropped before the transaction applied.
+        // That means that this transaction can be safely applied as a local transaction since we
+        // have the ClientRequestTracker.
+        final ClientRequestTracker tracker = removeClientRequestTracker(entry.getIndex());
+        if (tracker != null) {
+            return new ApplyState(tracker.getClientActor(), tracker.getIdentifier(), entry);
+        }
+
+        // Tracker is missing, this means that we switched behaviours between replicate and applystate
+        // and became the leader again,. We still want to apply this as a local modification because
+        // we have resumed leadership with that log entry having been committed.
+        final Payload payload = entry.getData();
+        if (payload instanceof IdentifiablePayload) {
+            return new ApplyState(null, ((IdentifiablePayload<?>) payload).getIdentifier(), entry);
+        }
+
+        return new ApplyState(null, null, entry);
+    }
+
     @Override
     protected RaftActorBehavior handleRequestVoteReply(final ActorRef sender, final RequestVoteReply requestVoteReply) {
         return this;
index 3440de9..fd2fbd3 100644 (file)
@@ -18,7 +18,6 @@ import java.util.Optional;
 import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import org.opendaylight.controller.cluster.raft.ClientRequestTracker;
 import org.opendaylight.controller.cluster.raft.RaftActorContext;
 import org.opendaylight.controller.cluster.raft.RaftState;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
@@ -324,15 +323,6 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
         return context.getReplicatedLog().lastIndex();
     }
 
-    /**
-     * Removes and returns the ClientRequestTracker for the specified log index.
-     * @param logIndex the log index
-     * @return the ClientRequestTracker or null if none available
-     */
-    protected ClientRequestTracker removeClientRequestTracker(final long logIndex) {
-        return null;
-    }
-
     /**
      * Returns the actual index of the entry in replicated log for the given index or -1 if not found.
      *
@@ -397,13 +387,7 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
                 // Send a local message to the local RaftActor (it's derived class to be
                 // specific to apply the log to it's index)
 
-                final ApplyState applyState;
-                final ClientRequestTracker tracker = removeClientRequestTracker(i);
-                if (tracker != null) {
-                    applyState = new ApplyState(tracker.getClientActor(), tracker.getIdentifier(), replicatedLogEntry);
-                } else {
-                    applyState = new ApplyState(null, null, replicatedLogEntry);
-                }
+                final ApplyState applyState = getApplyStateFor(replicatedLogEntry);
 
                 log.debug("{}: Setting last applied to {}", logName(), i);
 
@@ -425,6 +409,14 @@ public abstract class AbstractRaftActorBehavior implements RaftActorBehavior {
         actor().tell(new ApplyJournalEntries(context.getLastApplied()), actor());
     }
 
+    /**
+     * Create an ApplyState message for a particular log entry so we can determine how to apply this entry.
+     *
+     * @param entry the log entry
+     * @return ApplyState for this entry
+     */
+    abstract ApplyState getApplyStateFor(ReplicatedLogEntry entry);
+
     @Override
     public RaftActorBehavior handleMessage(final ActorRef sender, final Object message) {
         if (message instanceof AppendEntries) {
index afa4689..a8762ec 100644 (file)
@@ -15,6 +15,8 @@ import java.util.Collection;
 import org.opendaylight.controller.cluster.raft.PeerInfo;
 import org.opendaylight.controller.cluster.raft.RaftActorContext;
 import org.opendaylight.controller.cluster.raft.RaftState;
+import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
 import org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntriesReply;
@@ -50,7 +52,7 @@ public class Candidate extends AbstractRaftActorBehavior {
 
     private final Collection<String> votingPeers = new ArrayList<>();
 
-    public Candidate(RaftActorContext context) {
+    public Candidate(final RaftActorContext context) {
         super(context, RaftState.Candidate);
 
         for (PeerInfo peer: context.getPeers()) {
@@ -83,7 +85,7 @@ public class Candidate extends AbstractRaftActorBehavior {
     }
 
     @Override
-    protected RaftActorBehavior handleAppendEntries(ActorRef sender, AppendEntries appendEntries) {
+    protected RaftActorBehavior handleAppendEntries(final ActorRef sender, final AppendEntries appendEntries) {
 
         log.debug("{}: handleAppendEntries: {}", logName(), appendEntries);
 
@@ -99,12 +101,13 @@ public class Candidate extends AbstractRaftActorBehavior {
     }
 
     @Override
-    protected RaftActorBehavior handleAppendEntriesReply(ActorRef sender, AppendEntriesReply appendEntriesReply) {
+    protected RaftActorBehavior handleAppendEntriesReply(final ActorRef sender,
+            final AppendEntriesReply appendEntriesReply) {
         return this;
     }
 
     @Override
-    protected RaftActorBehavior handleRequestVoteReply(ActorRef sender, RequestVoteReply requestVoteReply) {
+    protected RaftActorBehavior handleRequestVoteReply(final ActorRef sender, final RequestVoteReply requestVoteReply) {
         log.debug("{}: handleRequestVoteReply: {}, current voteCount: {}", logName(), requestVoteReply, voteCount);
 
         if (requestVoteReply.isVoteGranted()) {
@@ -129,8 +132,14 @@ public class Candidate extends AbstractRaftActorBehavior {
         return super.electionDuration().$div(context.getConfigParams().getCandidateElectionTimeoutDivisor());
     }
 
+
+    @Override
+    final ApplyState getApplyStateFor(final ReplicatedLogEntry entry) {
+        throw new IllegalStateException("A candidate should never attempt to apply " + entry);
+    }
+
     @Override
-    public RaftActorBehavior handleMessage(ActorRef sender, Object message) {
+    public RaftActorBehavior handleMessage(final ActorRef sender, final Object message) {
         if (message instanceof ElectionTimeout) {
             log.debug("{}: Received ElectionTimeout", logName());
 
@@ -178,10 +187,7 @@ public class Candidate extends AbstractRaftActorBehavior {
         return super.handleMessage(sender, message);
     }
 
-
     private void startNewTerm() {
-
-
         // set voteCount back to 1 (that is voting for self)
         voteCount = 1;
 
index d88c30d..b642ee4 100644 (file)
@@ -30,6 +30,7 @@ import org.opendaylight.controller.cluster.raft.RaftActorContext;
 import org.opendaylight.controller.cluster.raft.RaftState;
 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
 import org.opendaylight.controller.cluster.raft.base.messages.ApplySnapshot;
+import org.opendaylight.controller.cluster.raft.base.messages.ApplyState;
 import org.opendaylight.controller.cluster.raft.base.messages.ElectionTimeout;
 import org.opendaylight.controller.cluster.raft.base.messages.TimeoutNow;
 import org.opendaylight.controller.cluster.raft.messages.AppendEntries;
@@ -435,6 +436,11 @@ public class Follower extends AbstractRaftActorBehavior {
         return this;
     }
 
+    @Override
+    final ApplyState getApplyStateFor(final ReplicatedLogEntry entry) {
+        return new ApplyState(null, null, entry);
+    }
+
     @Override
     public RaftActorBehavior handleMessage(final ActorRef sender, final Object message) {
         if (message instanceof ElectionTimeout || message instanceof TimeoutNow) {
index 1739b25..3b85a23 100644 (file)
@@ -255,7 +255,6 @@ final class SegmentedJournalActor extends AbstractActor {
         message.promise.success(null);
     }
 
-    @SuppressWarnings("checkstyle:illegalCatch")
     private void handleReadHighestSequenceNr(final ReadHighestSequenceNr message) {
         LOG.debug("{}: looking for highest sequence on {}", persistenceId, message);
         final Long sequence;
index b892219..ed34345 100644 (file)
   <version>1.11.0-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
-  <properties>
-    <!-- FIXME: Workaround for https://issues.apache.org/jira/browse/ARIES-1923 -->
-    <maven.compiler.release>10</maven.compiler.release>
-  </properties>
-
   <dependencies>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
index dc8ded6..1f834a1 100644 (file)
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yang-model-util</artifactId>
     </dependency>
+
+    <dependency>
+      <!-- Required because BindingToNormalizedNodeCodec extends an annotated class and annotation
+           processors have a hard time with that. -->
+      <groupId>javax.inject</groupId>
+      <artifactId>javax.inject</artifactId>
+      <scope>provided</scope>
+      <optional>true</optional>
+    </dependency>
+
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>sal-inmemory-datastore</artifactId>
       <artifactId>slf4j-simple</artifactId>
       <scope>test</scope>
     </dependency>
-
-    <dependency>
-      <groupId>org.javassist</groupId>
-      <artifactId>javassist</artifactId>
-      <scope>test</scope>
-    </dependency>
   </dependencies>
 
   <build>
index 32212bd..6942c9b 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
     <artifactId>odlparent</artifactId>
-    <version>6.0.1</version>
+    <version>6.0.4</version>
     <relativePath/>
   </parent>
 
       <dependency>
         <groupId>org.opendaylight.yangtools</groupId>
         <artifactId>yangtools-artifacts</artifactId>
-        <version>4.0.2</version>
+        <version>4.0.6</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
       <dependency>
         <groupId>org.opendaylight.mdsal</groupId>
         <artifactId>mdsal-artifacts</artifactId>
-        <version>5.0.4</version>
+        <version>5.0.9</version>
         <type>pom</type>
         <scope>import</scope>
       </dependency>
index 8caa7d0..824bd61 100644 (file)
       <groupId>org.opendaylight.yangtools</groupId>
       <artifactId>yang-model-util</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.yangtools</groupId>
+      <artifactId>yang-data-codec-binfmt</artifactId>
+    </dependency>
   </dependencies>
 
   <build>
index a0d8a31..21ad302 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 
+@Deprecated(forRemoval = true)
 public final class QNameFactory {
     private static final class StringQName implements Immutable {
         private final @NonNull String localName;
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataInput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataInput.java
deleted file mode 100644 (file)
index d921076..0000000
+++ /dev/null
@@ -1,448 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import static java.util.Objects.requireNonNull;
-
-import com.google.common.base.Strings;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableList.Builder;
-import com.google.common.collect.Sets;
-import java.io.DataInput;
-import java.io.IOException;
-import java.io.StringReader;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.dom.DOMSource;
-import org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory;
-import org.opendaylight.yangtools.util.ImmutableOffsetMapTemplate;
-import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * NormalizedNodeInputStreamReader reads the byte stream and constructs the normalized node including its children
- * nodes. This process goes in recursive manner, where each NodeTypes object signifies the start of the object, except
- * END_NODE. If a node can have children, then that node's end is calculated based on appearance of END_NODE.
- */
-abstract class AbstractLithiumDataInput extends AbstractNormalizedNodeDataInput {
-
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractLithiumDataInput.class);
-
-    private final List<String> codedStringMap = new ArrayList<>();
-
-    private QName lastLeafSetQName;
-
-    AbstractLithiumDataInput(final DataInput input) {
-        super(input);
-    }
-
-    @Override
-    public final void streamNormalizedNode(final NormalizedNodeStreamWriter writer) throws IOException {
-        streamNormalizedNode(requireNonNull(writer), input.readByte());
-    }
-
-    private void streamNormalizedNode(final NormalizedNodeStreamWriter writer, final byte nodeType) throws IOException {
-        switch (nodeType) {
-            case LithiumNode.ANY_XML_NODE:
-                streamAnyxml(writer);
-                break;
-            case LithiumNode.AUGMENTATION_NODE:
-                streamAugmentation(writer);
-                break;
-            case LithiumNode.CHOICE_NODE:
-                streamChoice(writer);
-                break;
-            case LithiumNode.CONTAINER_NODE:
-                streamContainer(writer);
-                break;
-            case LithiumNode.LEAF_NODE:
-                streamLeaf(writer);
-                break;
-            case LithiumNode.LEAF_SET:
-                streamLeafSet(writer);
-                break;
-            case LithiumNode.ORDERED_LEAF_SET:
-                streamOrderedLeafSet(writer);
-                break;
-            case LithiumNode.LEAF_SET_ENTRY_NODE:
-                streamLeafSetEntry(writer);
-                break;
-            case LithiumNode.MAP_ENTRY_NODE:
-                streamMapEntry(writer);
-                break;
-            case LithiumNode.MAP_NODE:
-                streamMap(writer);
-                break;
-            case LithiumNode.ORDERED_MAP_NODE:
-                streamOrderedMap(writer);
-                break;
-            case LithiumNode.UNKEYED_LIST:
-                streamUnkeyedList(writer);
-                break;
-            case LithiumNode.UNKEYED_LIST_ITEM:
-                streamUnkeyedListItem(writer);
-                break;
-            default:
-                throw new InvalidNormalizedNodeStreamException("Unexpected node " + nodeType);
-        }
-    }
-
-    private void streamAnyxml(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming anyxml node {}", identifier);
-
-        final DOMSource value = readDOMSource();
-        if (writer.startAnyxmlNode(identifier, DOMSource.class)) {
-            writer.domSourceValue(value);
-            writer.endNode();
-        }
-    }
-
-    private void streamAugmentation(final NormalizedNodeStreamWriter writer) throws IOException {
-        final AugmentationIdentifier augIdentifier = readAugmentationIdentifier();
-        LOG.trace("Streaming augmentation node {}", augIdentifier);
-        writer.startAugmentationNode(augIdentifier);
-        commonStreamContainer(writer);
-    }
-
-    private void streamChoice(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming choice node {}", identifier);
-        writer.startChoiceNode(identifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-        commonStreamContainer(writer);
-    }
-
-    private void streamContainer(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming container node {}", identifier);
-        writer.startContainerNode(identifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-        commonStreamContainer(writer);
-    }
-
-    private void streamLeaf(final NormalizedNodeStreamWriter writer) throws IOException {
-        startLeaf(writer);
-        endLeaf(writer, readObject());
-    }
-
-    // Leaf inside a MapEntryNode, it can potentially be a key leaf, in which case we want to de-duplicate values.
-    private void streamLeaf(final NormalizedNodeStreamWriter writer, final NodeIdentifierWithPredicates entryId)
-            throws IOException {
-        final NodeIdentifier identifier = startLeaf(writer);
-        final Object value = readObject();
-        final Object entryValue = entryId.getValue(identifier.getNodeType());
-        endLeaf(writer, entryValue == null ? value : entryValue);
-    }
-
-    private NodeIdentifier startLeaf(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming leaf node {}", identifier);
-        writer.startLeafNode(identifier);
-        return identifier;
-    }
-
-    private static void endLeaf(final NormalizedNodeStreamWriter writer, final Object value) throws IOException {
-        writer.scalarValue(value);
-        writer.endNode();
-    }
-
-    private void streamLeafSet(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming leaf set node {}", identifier);
-        writer.startLeafSet(identifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-        commonStreamLeafSet(writer, identifier);
-    }
-
-    private void streamOrderedLeafSet(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming ordered leaf set node {}", identifier);
-        writer.startOrderedLeafSet(identifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-        commonStreamLeafSet(writer, identifier);
-    }
-
-    private void commonStreamLeafSet(final NormalizedNodeStreamWriter writer, final NodeIdentifier identifier)
-            throws IOException {
-        lastLeafSetQName = identifier.getNodeType();
-        try {
-            commonStreamContainer(writer);
-        } finally {
-            // Make sure we never leak this
-            lastLeafSetQName = null;
-        }
-    }
-
-    private void streamLeafSetEntry(final NormalizedNodeStreamWriter writer) throws IOException {
-        final QName name = lastLeafSetQName != null ? lastLeafSetQName : readQName();
-        final Object value = readObject();
-        final NodeWithValue<Object> leafIdentifier = new NodeWithValue<>(name, value);
-        LOG.trace("Streaming leaf set entry node {}, value {}", leafIdentifier, value);
-        writer.startLeafSetEntryNode(leafIdentifier);
-        writer.scalarValue(value);
-        writer.endNode();
-    }
-
-    private void streamMap(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming map node {}", identifier);
-        writer.startMapNode(identifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-        commonStreamContainer(writer);
-    }
-
-    private void streamOrderedMap(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming ordered map node {}", identifier);
-        writer.startOrderedMapNode(identifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-        commonStreamContainer(writer);
-    }
-
-    private void streamMapEntry(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifierWithPredicates entryIdentifier = readNormalizedNodeWithPredicates();
-        LOG.trace("Streaming map entry node {}", entryIdentifier);
-        writer.startMapEntryNode(entryIdentifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-
-        // Same loop as commonStreamContainer(), but ...
-        for (byte nodeType = input.readByte(); nodeType != LithiumNode.END_NODE; nodeType = input.readByte()) {
-            if (nodeType == LithiumNode.LEAF_NODE) {
-                // ... leaf nodes may need de-duplication
-                streamLeaf(writer, entryIdentifier);
-            } else {
-                streamNormalizedNode(writer, nodeType);
-            }
-        }
-        writer.endNode();
-    }
-
-    private void streamUnkeyedList(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming unkeyed list node {}", identifier);
-        writer.startUnkeyedList(identifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-        commonStreamContainer(writer);
-    }
-
-    private void streamUnkeyedListItem(final NormalizedNodeStreamWriter writer) throws IOException {
-        final NodeIdentifier identifier = readNodeIdentifier();
-        LOG.trace("Streaming unkeyed list item node {}", identifier);
-        writer.startUnkeyedListItem(identifier, NormalizedNodeStreamWriter.UNKNOWN_SIZE);
-        commonStreamContainer(writer);
-    }
-
-    private void commonStreamContainer(final NormalizedNodeStreamWriter writer) throws IOException {
-        for (byte nodeType = input.readByte(); nodeType != LithiumNode.END_NODE; nodeType = input.readByte()) {
-            streamNormalizedNode(writer, nodeType);
-        }
-        writer.endNode();
-    }
-
-    private DOMSource readDOMSource() throws IOException {
-        String xml = readObject().toString();
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-            factory.setNamespaceAware(true);
-            Element node = factory.newDocumentBuilder().parse(
-                    new InputSource(new StringReader(xml))).getDocumentElement();
-            return new DOMSource(node);
-        } catch (SAXException | ParserConfigurationException e) {
-            throw new IOException("Error parsing XML: " + xml, e);
-        }
-    }
-
-    final QName defaultReadQName() throws IOException {
-        // Read in the same sequence of writing
-        String localName = readCodedString();
-        String namespace = readCodedString();
-        String revision = Strings.emptyToNull(readCodedString());
-
-        return QNameFactory.create(localName, namespace, revision);
-    }
-
-    final String readCodedString() throws IOException {
-        final byte valueType = input.readByte();
-        switch (valueType) {
-            case LithiumTokens.IS_NULL_VALUE:
-                return null;
-            case LithiumTokens.IS_CODE_VALUE:
-                final int code = input.readInt();
-                try {
-                    return codedStringMap.get(code);
-                } catch (IndexOutOfBoundsException e) {
-                    throw new IOException("String code " + code + " was not found", e);
-                }
-            case LithiumTokens.IS_STRING_VALUE:
-                final String value = input.readUTF().intern();
-                codedStringMap.add(value);
-                return value;
-            default:
-                throw new IOException("Unhandled string value type " + valueType);
-        }
-    }
-
-    private Set<QName> readQNameSet() throws IOException {
-        // Read the children count
-        final int count = input.readInt();
-        final Set<QName> children = Sets.newHashSetWithExpectedSize(count);
-        for (int i = 0; i < count; i++) {
-            children.add(readQName());
-        }
-        return children;
-    }
-
-    abstract AugmentationIdentifier readAugmentationIdentifier() throws IOException;
-
-    abstract NodeIdentifier readNodeIdentifier() throws IOException;
-
-    final AugmentationIdentifier defaultReadAugmentationIdentifier() throws IOException {
-        return AugmentationIdentifier.create(readQNameSet());
-    }
-
-    private NodeIdentifierWithPredicates readNormalizedNodeWithPredicates() throws IOException {
-        final QName qname = readQName();
-        final int count = input.readInt();
-        switch (count) {
-            case 0:
-                return NodeIdentifierWithPredicates.of(qname);
-            case 1:
-                return NodeIdentifierWithPredicates.of(qname, readQName(), readObject());
-            default:
-                // ImmutableList is used by ImmutableOffsetMapTemplate for lookups, hence we use that.
-                final Builder<QName> keys = ImmutableList.builderWithExpectedSize(count);
-                final Object[] values = new Object[count];
-                for (int i = 0; i < count; i++) {
-                    keys.add(readQName());
-                    values[i] = readObject();
-                }
-
-                return NodeIdentifierWithPredicates.of(qname, ImmutableOffsetMapTemplate.ordered(keys.build())
-                    .instantiateWithValues(values));
-        }
-    }
-
-    private Object readObject() throws IOException {
-        byte objectType = input.readByte();
-        switch (objectType) {
-            case LithiumValue.BITS_TYPE:
-                return readObjSet();
-
-            case LithiumValue.BOOL_TYPE:
-                return input.readBoolean();
-
-            case LithiumValue.BYTE_TYPE:
-                return input.readByte();
-
-            case LithiumValue.INT_TYPE:
-                return input.readInt();
-
-            case LithiumValue.LONG_TYPE:
-                return input.readLong();
-
-            case LithiumValue.QNAME_TYPE:
-                return readQName();
-
-            case LithiumValue.SHORT_TYPE:
-                return input.readShort();
-
-            case LithiumValue.STRING_TYPE:
-                return input.readUTF();
-
-            case LithiumValue.STRING_BYTES_TYPE:
-                return readStringBytes();
-
-            case LithiumValue.BIG_DECIMAL_TYPE:
-                return new BigDecimal(input.readUTF());
-
-            case LithiumValue.BIG_INTEGER_TYPE:
-                return new BigInteger(input.readUTF());
-
-            case LithiumValue.BINARY_TYPE:
-                byte[] bytes = new byte[input.readInt()];
-                input.readFully(bytes);
-                return bytes;
-
-            case LithiumValue.YANG_IDENTIFIER_TYPE:
-                return readYangInstanceIdentifierInternal();
-
-            case LithiumValue.EMPTY_TYPE:
-            // Leaf nodes no longer allow null values and thus we no longer emit null values. Previously, the "empty"
-            // yang type was represented as null so we translate an incoming null value to Empty. It was possible for
-            // a BI user to set a string leaf to null and we're rolling the dice here but the chances for that are
-            // very low. We'd have to know the yang type but, even if we did, we can't let a null value pass upstream
-            // so we'd have to drop the leaf which might cause other issues.
-            case LithiumValue.NULL_TYPE:
-                return Empty.getInstance();
-
-            default:
-                return null;
-        }
-    }
-
-    private String readStringBytes() throws IOException {
-        byte[] bytes = new byte[input.readInt()];
-        input.readFully(bytes);
-        return new String(bytes, StandardCharsets.UTF_8);
-    }
-
-    @Override
-    public final YangInstanceIdentifier readYangInstanceIdentifier() throws IOException {
-        return readYangInstanceIdentifierInternal();
-    }
-
-    private YangInstanceIdentifier readYangInstanceIdentifierInternal() throws IOException {
-        int size = input.readInt();
-        final Builder<PathArgument> pathArguments = ImmutableList.builderWithExpectedSize(size);
-        for (int i = 0; i < size; i++) {
-            pathArguments.add(readPathArgument());
-        }
-        return YangInstanceIdentifier.create(pathArguments.build());
-    }
-
-    private Set<String> readObjSet() throws IOException {
-        int count = input.readInt();
-        Set<String> children = new HashSet<>(count);
-        for (int i = 0; i < count; i++) {
-            children.add(readCodedString());
-        }
-        return children;
-    }
-
-    @Override
-    public final PathArgument readPathArgument() throws IOException {
-        // read Type
-        int type = input.readByte();
-
-        switch (type) {
-            case LithiumPathArgument.AUGMENTATION_IDENTIFIER:
-                return readAugmentationIdentifier();
-            case LithiumPathArgument.NODE_IDENTIFIER:
-                return readNodeIdentifier();
-            case LithiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES:
-                return readNormalizedNodeWithPredicates();
-            case LithiumPathArgument.NODE_IDENTIFIER_WITH_VALUE:
-                return new NodeWithValue<>(readQName(), readObject());
-            default:
-                // FIXME: throw hard error
-                return null;
-        }
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataOutput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractLithiumDataOutput.java
deleted file mode 100644 (file)
index 25e14b1..0000000
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.base.Verify.verifyNotNull;
-import static java.util.Objects.requireNonNull;
-
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.ImmutableMap;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.common.Revision;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * "original" type mapping. Baseline is Lithium but it really was introduced in Oxygen, where {@code type empty} was
- * remapped from null.
- *
- * <p>
- * {@code uint8}, {@code uint16}, {@code uint32} use java.lang types with widening, hence their value types overlap with
- * mapping of {@code int16}, {@code int32} and {@code int64}, making that difference indiscernible without YANG schema
- * knowledge.
- */
-abstract class AbstractLithiumDataOutput extends AbstractNormalizedNodeDataOutput {
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractLithiumDataOutput.class);
-    private static final TransformerFactory TF = TransformerFactory.newInstance();
-    private static final ImmutableMap<Class<?>, Byte> KNOWN_TYPES = ImmutableMap.<Class<?>, Byte>builder()
-            .put(String.class, LithiumValue.STRING_TYPE)
-            .put(Byte.class, LithiumValue.BYTE_TYPE)
-            .put(Integer.class, LithiumValue.INT_TYPE)
-            .put(Long.class, LithiumValue.LONG_TYPE)
-            .put(Boolean.class, LithiumValue.BOOL_TYPE)
-            .put(QName.class, LithiumValue.QNAME_TYPE)
-            .put(Short.class, LithiumValue.SHORT_TYPE)
-            .put(BigInteger.class, LithiumValue.BIG_INTEGER_TYPE)
-            .put(BigDecimal.class, LithiumValue.BIG_DECIMAL_TYPE)
-            .put(byte[].class, LithiumValue.BINARY_TYPE)
-            .put(Empty.class, LithiumValue.EMPTY_TYPE)
-            .build();
-
-    private final Map<String, Integer> stringCodeMap = new HashMap<>();
-
-    private QName lastLeafSetQName;
-    private boolean inSimple;
-
-    AbstractLithiumDataOutput(final DataOutput output) {
-        super(output);
-    }
-
-    @Override
-    public final void startLeafNode(final NodeIdentifier name) throws IOException {
-        LOG.trace("Starting a new leaf node");
-        startNode(name, LithiumNode.LEAF_NODE);
-        inSimple = true;
-    }
-
-    @Override
-    public final void startLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        LOG.trace("Starting a new leaf set");
-        commonStartLeafSet(name, LithiumNode.LEAF_SET);
-    }
-
-    @Override
-    public final void startOrderedLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        LOG.trace("Starting a new ordered leaf set");
-        commonStartLeafSet(name, LithiumNode.ORDERED_LEAF_SET);
-    }
-
-    private void commonStartLeafSet(final NodeIdentifier name, final byte nodeType) throws IOException {
-        startNode(name, nodeType);
-        lastLeafSetQName = name.getNodeType();
-    }
-
-    @Override
-    public final void startLeafSetEntryNode(final NodeWithValue<?> name) throws IOException {
-        LOG.trace("Starting a new leaf set entry node");
-
-        output.writeByte(LithiumNode.LEAF_SET_ENTRY_NODE);
-
-        // lastLeafSetQName is set if the parent LeafSetNode was previously written. Otherwise this is a
-        // stand alone LeafSetEntryNode so write out it's name here.
-        if (lastLeafSetQName == null) {
-            writeQNameInternal(name.getNodeType());
-        }
-        inSimple = true;
-    }
-
-    @Override
-    public final void startContainerNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        LOG.trace("Starting a new container node");
-        startNode(name, LithiumNode.CONTAINER_NODE);
-    }
-
-    @Override
-    public final void startYangModeledAnyXmlNode(final NodeIdentifier name, final int childSizeHint)
-            throws IOException {
-        LOG.trace("Starting a new yang modeled anyXml node");
-        startNode(name, LithiumNode.YANG_MODELED_ANY_XML_NODE);
-    }
-
-    @Override
-    public final void startUnkeyedList(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        LOG.trace("Starting a new unkeyed list");
-        startNode(name, LithiumNode.UNKEYED_LIST);
-    }
-
-    @Override
-    public final void startUnkeyedListItem(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        LOG.trace("Starting a new unkeyed list item");
-        startNode(name, LithiumNode.UNKEYED_LIST_ITEM);
-    }
-
-    @Override
-    public final void startMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        LOG.trace("Starting a new map node");
-        startNode(name, LithiumNode.MAP_NODE);
-    }
-
-    @Override
-    public final void startMapEntryNode(final NodeIdentifierWithPredicates identifier, final int childSizeHint)
-            throws IOException {
-        LOG.trace("Starting a new map entry node");
-        startNode(identifier, LithiumNode.MAP_ENTRY_NODE);
-        writeKeyValueMap(identifier.entrySet());
-    }
-
-    @Override
-    public final void startOrderedMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        LOG.trace("Starting a new ordered map node");
-        startNode(name, LithiumNode.ORDERED_MAP_NODE);
-    }
-
-    @Override
-    public final void startChoiceNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        LOG.trace("Starting a new choice node");
-        startNode(name, LithiumNode.CHOICE_NODE);
-    }
-
-    @Override
-    public final void startAugmentationNode(final AugmentationIdentifier identifier) throws IOException {
-        requireNonNull(identifier, "Node identifier should not be null");
-        LOG.trace("Starting a new augmentation node");
-
-        output.writeByte(LithiumNode.AUGMENTATION_NODE);
-        writeAugmentationIdentifier(identifier);
-    }
-
-    @Override
-    public final boolean startAnyxmlNode(final NodeIdentifier name, final Class<?> objectModel) throws IOException {
-        if (DOMSource.class.isAssignableFrom(objectModel)) {
-            LOG.trace("Starting anyxml node");
-            startNode(name, LithiumNode.ANY_XML_NODE);
-            inSimple = true;
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    public final void scalarValue(final Object value) throws IOException {
-        writeObject(value);
-    }
-
-    @Override
-    public final void domSourceValue(final DOMSource value) throws IOException {
-        final StringWriter writer = new StringWriter();
-        try {
-            TF.newTransformer().transform(value, new StreamResult(writer));
-        } catch (TransformerException e) {
-            throw new IOException("Error writing anyXml", e);
-        }
-        writeObject(writer.toString());
-    }
-
-    @Override
-    public final void endNode() throws IOException {
-        LOG.trace("Ending the node");
-        if (!inSimple) {
-            lastLeafSetQName = null;
-            output.writeByte(LithiumNode.END_NODE);
-        }
-        inSimple = false;
-    }
-
-    @Override
-    @SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST",
-            justification = "The casts in the switch clauses are indirectly confirmed via the determination of 'type'.")
-    final void writePathArgumentInternal(final PathArgument pathArgument) throws IOException {
-        final byte type = LithiumPathArgument.getSerializablePathArgumentType(pathArgument);
-        output.writeByte(type);
-
-        switch (type) {
-            case LithiumPathArgument.NODE_IDENTIFIER:
-                NodeIdentifier nodeIdentifier = (NodeIdentifier) pathArgument;
-                writeQNameInternal(nodeIdentifier.getNodeType());
-                break;
-            case LithiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES:
-                NodeIdentifierWithPredicates nodeIdentifierWithPredicates =
-                    (NodeIdentifierWithPredicates) pathArgument;
-                writeQNameInternal(nodeIdentifierWithPredicates.getNodeType());
-                writeKeyValueMap(nodeIdentifierWithPredicates.entrySet());
-                break;
-            case LithiumPathArgument.NODE_IDENTIFIER_WITH_VALUE:
-                NodeWithValue<?> nodeWithValue = (NodeWithValue<?>) pathArgument;
-                writeQNameInternal(nodeWithValue.getNodeType());
-                writeObject(nodeWithValue.getValue());
-                break;
-            case LithiumPathArgument.AUGMENTATION_IDENTIFIER:
-                // No Qname in augmentation identifier
-                writeAugmentationIdentifier((AugmentationIdentifier) pathArgument);
-                break;
-            default:
-                throw new IllegalStateException("Unknown node identifier type is found : "
-                        + pathArgument.getClass().toString());
-        }
-    }
-
-    @Override
-    final void writeYangInstanceIdentifierInternal(final YangInstanceIdentifier identifier) throws IOException {
-        List<PathArgument> pathArguments = identifier.getPathArguments();
-        output.writeInt(pathArguments.size());
-
-        for (PathArgument pathArgument : pathArguments) {
-            writePathArgumentInternal(pathArgument);
-        }
-    }
-
-    final void defaultWriteAugmentationIdentifier(final @NonNull AugmentationIdentifier aid) throws IOException {
-        final Set<QName> qnames = aid.getPossibleChildNames();
-        // Write each child's qname separately, if list is empty send count as 0
-        if (!qnames.isEmpty()) {
-            output.writeInt(qnames.size());
-            for (QName qname : qnames) {
-                writeQNameInternal(qname);
-            }
-        } else {
-            LOG.debug("augmentation node does not have any child");
-            output.writeInt(0);
-        }
-    }
-
-    final void defaultWriteQName(final QName qname) throws IOException {
-        writeString(qname.getLocalName());
-        writeModule(qname.getModule());
-    }
-
-    final void defaultWriteModule(final QNameModule module) throws IOException {
-        writeString(module.getNamespace().toString());
-        final Optional<Revision> revision = module.getRevision();
-        if (revision.isPresent()) {
-            writeString(revision.get().toString());
-        } else {
-            writeByte(LithiumTokens.IS_NULL_VALUE);
-        }
-    }
-
-    abstract void writeModule(QNameModule module) throws IOException;
-
-    abstract void writeAugmentationIdentifier(@NonNull AugmentationIdentifier aid) throws IOException;
-
-    private void startNode(final PathArgument arg, final byte nodeType) throws IOException {
-        requireNonNull(arg, "Node identifier should not be null");
-        checkState(!inSimple, "Attempted to start a child in a simple node");
-
-        // First write the type of node
-        output.writeByte(nodeType);
-        // Write Start Tag
-        writeQNameInternal(arg.getNodeType());
-    }
-
-    private void writeObjSet(final Set<?> set) throws IOException {
-        output.writeInt(set.size());
-        for (Object o : set) {
-            checkArgument(o instanceof String, "Expected value type to be String but was %s (%s)", o.getClass(), o);
-            writeString((String) o);
-        }
-    }
-
-    private void writeObject(final Object value) throws IOException {
-        byte type = getSerializableType(value);
-        // Write object type first
-        output.writeByte(type);
-
-        switch (type) {
-            case LithiumValue.BOOL_TYPE:
-                output.writeBoolean((Boolean) value);
-                break;
-            case LithiumValue.QNAME_TYPE:
-                writeQNameInternal((QName) value);
-                break;
-            case LithiumValue.INT_TYPE:
-                output.writeInt((Integer) value);
-                break;
-            case LithiumValue.BYTE_TYPE:
-                output.writeByte((Byte) value);
-                break;
-            case LithiumValue.LONG_TYPE:
-                output.writeLong((Long) value);
-                break;
-            case LithiumValue.SHORT_TYPE:
-                output.writeShort((Short) value);
-                break;
-            case LithiumValue.BITS_TYPE:
-                writeObjSet((Set<?>) value);
-                break;
-            case LithiumValue.BINARY_TYPE:
-                byte[] bytes = (byte[]) value;
-                output.writeInt(bytes.length);
-                output.write(bytes);
-                break;
-            case LithiumValue.YANG_IDENTIFIER_TYPE:
-                writeYangInstanceIdentifierInternal((YangInstanceIdentifier) value);
-                break;
-            case LithiumValue.EMPTY_TYPE:
-                break;
-            case LithiumValue.STRING_BYTES_TYPE:
-                final byte[] valueBytes = value.toString().getBytes(StandardCharsets.UTF_8);
-                output.writeInt(valueBytes.length);
-                output.write(valueBytes);
-                break;
-            default:
-                output.writeUTF(value.toString());
-                break;
-        }
-    }
-
-    private void writeKeyValueMap(final Set<Entry<QName, Object>> entrySet) throws IOException {
-        if (!entrySet.isEmpty()) {
-            output.writeInt(entrySet.size());
-            for (Entry<QName, Object> entry : entrySet) {
-                writeQNameInternal(entry.getKey());
-                writeObject(entry.getValue());
-            }
-        } else {
-            output.writeInt(0);
-        }
-    }
-
-    private void writeString(final @NonNull String string) throws IOException {
-        final Integer value = stringCodeMap.get(verifyNotNull(string));
-        if (value == null) {
-            stringCodeMap.put(string, stringCodeMap.size());
-            writeByte(LithiumTokens.IS_STRING_VALUE);
-            writeUTF(string);
-        } else {
-            writeByte(LithiumTokens.IS_CODE_VALUE);
-            writeInt(value);
-        }
-    }
-
-    @VisibleForTesting
-    static final byte getSerializableType(final Object node) {
-        final Byte type = KNOWN_TYPES.get(requireNonNull(node).getClass());
-        if (type != null) {
-            if (type == LithiumValue.STRING_TYPE
-                    && ((String) node).length() >= LithiumValue.STRING_BYTES_LENGTH_THRESHOLD) {
-                return LithiumValue.STRING_BYTES_TYPE;
-            }
-            return type;
-        }
-
-        if (node instanceof Set) {
-            return LithiumValue.BITS_TYPE;
-        }
-
-        if (node instanceof YangInstanceIdentifier) {
-            return LithiumValue.YANG_IDENTIFIER_TYPE;
-        }
-
-        throw new IllegalArgumentException("Unknown value type " + node.getClass().getSimpleName());
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataInput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataInput.java
deleted file mode 100644 (file)
index a51b121..0000000
+++ /dev/null
@@ -1,856 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import static com.google.common.base.Verify.verifyNotNull;
-import static java.util.Objects.requireNonNull;
-import static org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter.UNKNOWN_SIZE;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableList.Builder;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.util.concurrent.UncheckedExecutionException;
-import java.io.DataInput;
-import java.io.IOException;
-import java.io.StringReader;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-import javax.xml.transform.dom.DOMSource;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory;
-import org.opendaylight.yangtools.rfc8528.data.api.MountPointIdentifier;
-import org.opendaylight.yangtools.util.xml.UntrustedXML;
-import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.common.Uint16;
-import org.opendaylight.yangtools.yang.common.Uint32;
-import org.opendaylight.yangtools.yang.common.Uint64;
-import org.opendaylight.yangtools.yang.common.Uint8;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Abstract base class for NormalizedNodeDataInput based on {@link MagnesiumNode}, {@link MagnesiumPathArgument} and
- * {@link MagnesiumValue}.
- */
-abstract class AbstractMagnesiumDataInput extends AbstractNormalizedNodeDataInput {
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractMagnesiumDataInput.class);
-
-    // Known singleton objects
-    private static final @NonNull Byte INT8_0 = 0;
-    private static final @NonNull Short INT16_0 = 0;
-    private static final @NonNull Integer INT32_0 = 0;
-    private static final @NonNull Long INT64_0 = 0L;
-    private static final byte @NonNull[] BINARY_0 = new byte[0];
-    private static final @NonNull AugmentationIdentifier EMPTY_AID = AugmentationIdentifier.create(ImmutableSet.of());
-
-    // FIXME: these should be available as constants
-    private static final @NonNull Uint8 UINT8_0 = Uint8.valueOf(0);
-    private static final @NonNull Uint16 UINT16_0 = Uint16.valueOf(0);
-    private static final @NonNull Uint32 UINT32_0 = Uint32.valueOf(0);
-    private static final @NonNull Uint64 UINT64_0 = Uint64.valueOf(0);
-
-    private final List<AugmentationIdentifier> codedAugments = new ArrayList<>();
-    private final List<NodeIdentifier> codedNodeIdentifiers = new ArrayList<>();
-    private final List<QNameModule> codedModules = new ArrayList<>();
-    private final List<String> codedStrings = new ArrayList<>();
-
-    AbstractMagnesiumDataInput(final DataInput input) {
-        super(input);
-    }
-
-    @Override
-    public final void streamNormalizedNode(final NormalizedNodeStreamWriter writer) throws IOException {
-        streamNormalizedNode(requireNonNull(writer), null, input.readByte());
-    }
-
-    private void streamNormalizedNode(final NormalizedNodeStreamWriter writer, final PathArgument parent,
-            final byte nodeHeader) throws IOException {
-        switch (nodeHeader & MagnesiumNode.TYPE_MASK) {
-            case MagnesiumNode.NODE_LEAF:
-                streamLeaf(writer, parent, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_CONTAINER:
-                streamContainer(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_LIST:
-                streamList(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_MAP:
-                streamMap(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_MAP_ORDERED:
-                streamMapOrdered(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_LEAFSET:
-                streamLeafset(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_LEAFSET_ORDERED:
-                streamLeafsetOrdered(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_CHOICE:
-                streamChoice(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_AUGMENTATION:
-                streamAugmentation(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_ANYXML:
-                streamAnyxml(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_ANYXML_MODELED:
-                streamAnyxmlModeled(writer, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_LIST_ENTRY:
-                streamListEntry(writer, parent, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_LEAFSET_ENTRY:
-                streamLeafsetEntry(writer, parent, nodeHeader);
-                break;
-            case MagnesiumNode.NODE_MAP_ENTRY:
-                streamMapEntry(writer, parent, nodeHeader);
-                break;
-            default:
-                throw new InvalidNormalizedNodeStreamException("Unexpected node header " + nodeHeader);
-        }
-    }
-
-    private void streamAnyxml(final NormalizedNodeStreamWriter writer, final byte nodeHeader) throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        LOG.trace("Streaming anyxml node {}", identifier);
-
-        final DOMSource value = readDOMSource();
-        if (writer.startAnyxmlNode(identifier, DOMSource.class)) {
-            writer.domSourceValue(value);
-            writer.endNode();
-        }
-    }
-
-    private void streamAnyxmlModeled(final NormalizedNodeStreamWriter writer, final byte nodeHeader)
-            throws IOException {
-        // TODO: decide how to deal with these
-        throw new UnsupportedOperationException("Reading YANG-modeled anyxml was never supported");
-    }
-
-    private void streamAugmentation(final NormalizedNodeStreamWriter writer, final byte nodeHeader) throws IOException {
-        final AugmentationIdentifier augIdentifier = decodeAugmentationIdentifier(nodeHeader);
-        LOG.trace("Streaming augmentation node {}", augIdentifier);
-        writer.startAugmentationNode(augIdentifier);
-        commonStreamContainer(writer, augIdentifier);
-    }
-
-    private void streamChoice(final NormalizedNodeStreamWriter writer, final byte nodeHeader) throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        LOG.trace("Streaming choice node {}", identifier);
-        writer.startChoiceNode(identifier, UNKNOWN_SIZE);
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void streamContainer(final NormalizedNodeStreamWriter writer, final byte nodeHeader) throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        LOG.trace("Streaming container node {}", identifier);
-        writer.startContainerNode(identifier, UNKNOWN_SIZE);
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void streamLeaf(final NormalizedNodeStreamWriter writer, final PathArgument parent, final byte nodeHeader)
-            throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        LOG.trace("Streaming leaf node {}", identifier);
-        writer.startLeafNode(identifier);
-
-        final Object value;
-        if ((nodeHeader & MagnesiumNode.PREDICATE_ONE) == MagnesiumNode.PREDICATE_ONE) {
-            if (!(parent instanceof NodeIdentifierWithPredicates)) {
-                throw new InvalidNormalizedNodeStreamException("Invalid predicate leaf " + identifier + " in parent "
-                        + parent);
-            }
-
-            value = ((NodeIdentifierWithPredicates) parent).getValue(identifier.getNodeType());
-            if (value == null) {
-                throw new InvalidNormalizedNodeStreamException("Failed to find predicate leaf " + identifier
-                    + " in parent " + parent);
-            }
-        } else {
-            value = readLeafValue();
-        }
-
-        writer.scalarValue(value);
-        writer.endNode();
-    }
-
-    private void streamLeafset(final NormalizedNodeStreamWriter writer, final byte nodeHeader) throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        LOG.trace("Streaming leaf set node {}", identifier);
-        writer.startLeafSet(identifier, UNKNOWN_SIZE);
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void streamLeafsetOrdered(final NormalizedNodeStreamWriter writer, final byte nodeHeader)
-            throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        LOG.trace("Streaming ordered leaf set node {}", identifier);
-        writer.startOrderedLeafSet(identifier, UNKNOWN_SIZE);
-
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void streamLeafsetEntry(final NormalizedNodeStreamWriter writer, final PathArgument parent,
-            final byte nodeHeader) throws IOException {
-        final NodeIdentifier nodeId = decodeNodeIdentifier(nodeHeader, parent);
-        final Object value = readLeafValue();
-        final NodeWithValue<Object> leafIdentifier = new NodeWithValue<>(nodeId.getNodeType(), value);
-        LOG.trace("Streaming leaf set entry node {}", leafIdentifier);
-        writer.startLeafSetEntryNode(leafIdentifier);
-        writer.scalarValue(value);
-        writer.endNode();
-    }
-
-    private void streamList(final NormalizedNodeStreamWriter writer, final byte nodeHeader) throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        writer.startUnkeyedList(identifier, UNKNOWN_SIZE);
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void streamListEntry(final NormalizedNodeStreamWriter writer, final PathArgument parent,
-            final byte nodeHeader) throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader, parent);
-        LOG.trace("Streaming unkeyed list item node {}", identifier);
-        writer.startUnkeyedListItem(identifier, UNKNOWN_SIZE);
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void streamMap(final NormalizedNodeStreamWriter writer, final byte nodeHeader) throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        LOG.trace("Streaming map node {}", identifier);
-        writer.startMapNode(identifier, UNKNOWN_SIZE);
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void streamMapOrdered(final NormalizedNodeStreamWriter writer, final byte nodeHeader) throws IOException {
-        final NodeIdentifier identifier = decodeNodeIdentifier(nodeHeader);
-        LOG.trace("Streaming ordered map node {}", identifier);
-        writer.startOrderedMapNode(identifier, UNKNOWN_SIZE);
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void streamMapEntry(final NormalizedNodeStreamWriter writer, final PathArgument parent,
-            final byte nodeHeader) throws IOException {
-        final NodeIdentifier nodeId = decodeNodeIdentifier(nodeHeader, parent);
-
-        final int size;
-        switch (mask(nodeHeader, MagnesiumNode.PREDICATE_MASK)) {
-            case MagnesiumNode.PREDICATE_ZERO:
-                size = 0;
-                break;
-            case MagnesiumNode.PREDICATE_ONE:
-                size = 1;
-                break;
-            case MagnesiumNode.PREDICATE_1B:
-                size = input.readUnsignedByte();
-                break;
-            case MagnesiumNode.PREDICATE_4B:
-                size = input.readInt();
-                break;
-            default:
-                // ISE on purpose: this should never ever happen
-                throw new IllegalStateException("Failed to decode NodeIdentifierWithPredicates size from header "
-                        + nodeHeader);
-        }
-
-        final NodeIdentifierWithPredicates identifier = readNodeIdentifierWithPredicates(nodeId.getNodeType(), size);
-        LOG.trace("Streaming map entry node {}", identifier);
-        writer.startMapEntryNode(identifier, UNKNOWN_SIZE);
-        commonStreamContainer(writer, identifier);
-    }
-
-    private void commonStreamContainer(final NormalizedNodeStreamWriter writer, final PathArgument parent)
-            throws IOException {
-        for (byte nodeType = input.readByte(); nodeType != MagnesiumNode.NODE_END; nodeType = input.readByte()) {
-            streamNormalizedNode(writer, parent, nodeType);
-        }
-        writer.endNode();
-    }
-
-    private @NonNull NodeIdentifier decodeNodeIdentifier() throws IOException {
-        final QNameModule module = decodeQNameModule();
-        final String localName = readRefString();
-        final NodeIdentifier nodeId;
-        try {
-            nodeId = QNameFactory.getNodeIdentifier(module, localName);
-        } catch (ExecutionException e) {
-            throw new InvalidNormalizedNodeStreamException("Illegal QName module=" + module + " localName="
-                    + localName, e);
-        }
-
-        codedNodeIdentifiers.add(nodeId);
-        return nodeId;
-    }
-
-    private NodeIdentifier decodeNodeIdentifier(final byte nodeHeader) throws IOException {
-        return decodeNodeIdentifier(nodeHeader, null);
-    }
-
-    private NodeIdentifier decodeNodeIdentifier(final byte nodeHeader, final PathArgument parent) throws IOException {
-        final int index;
-        switch (nodeHeader & MagnesiumNode.ADDR_MASK) {
-            case MagnesiumNode.ADDR_DEFINE:
-                return readNodeIdentifier();
-            case MagnesiumNode.ADDR_LOOKUP_1B:
-                index = input.readUnsignedByte();
-                break;
-            case MagnesiumNode.ADDR_LOOKUP_4B:
-                index = input.readInt();
-                break;
-            case MagnesiumNode.ADDR_PARENT:
-                if (parent instanceof NodeIdentifier) {
-                    return (NodeIdentifier) parent;
-                }
-                throw new InvalidNormalizedNodeStreamException("Invalid node identifier reference to parent " + parent);
-            default:
-                throw new InvalidNormalizedNodeStreamException("Unexpected node identifier addressing in header "
-                        + nodeHeader);
-        }
-
-        try {
-            return codedNodeIdentifiers.get(index);
-        } catch (IndexOutOfBoundsException e) {
-            throw new InvalidNormalizedNodeStreamException("Invalid QName reference " + index, e);
-        }
-    }
-
-    private AugmentationIdentifier decodeAugmentationIdentifier(final byte nodeHeader) throws IOException {
-        final int index;
-        switch (nodeHeader & MagnesiumNode.ADDR_MASK) {
-            case MagnesiumNode.ADDR_DEFINE:
-                return readAugmentationIdentifier();
-            case MagnesiumNode.ADDR_LOOKUP_1B:
-                index = input.readUnsignedByte();
-                break;
-            case MagnesiumNode.ADDR_LOOKUP_4B:
-                index = input.readInt();
-                break;
-            default:
-                throw new InvalidNormalizedNodeStreamException(
-                    "Unexpected augmentation identifier addressing in header " + nodeHeader);
-        }
-
-        try {
-            return codedAugments.get(index);
-        } catch (IndexOutOfBoundsException e) {
-            throw new InvalidNormalizedNodeStreamException("Invalid augmentation identifier reference " + index, e);
-        }
-    }
-
-    @Override
-    public final YangInstanceIdentifier readYangInstanceIdentifier() throws IOException {
-        final byte type = input.readByte();
-        if (type == MagnesiumValue.YIID) {
-            return readYangInstanceIdentifier(input.readInt());
-        } else if (type >= MagnesiumValue.YIID_0) {
-            // Note 'byte' is range limited, so it is always '&& type <= MagnesiumValue.YIID_31'
-            return readYangInstanceIdentifier(type - MagnesiumValue.YIID_0);
-        } else {
-            throw new InvalidNormalizedNodeStreamException("Unexpected YangInstanceIdentifier type " + type);
-        }
-    }
-
-    private @NonNull YangInstanceIdentifier readYangInstanceIdentifier(final int size) throws IOException {
-        if (size > 0) {
-            final Builder<PathArgument> builder = ImmutableList.builderWithExpectedSize(size);
-            for (int i = 0; i < size; ++i) {
-                builder.add(readPathArgument());
-            }
-            return YangInstanceIdentifier.create(builder.build());
-        } else if (size == 0) {
-            return YangInstanceIdentifier.empty();
-        } else {
-            throw new InvalidNormalizedNodeStreamException("Invalid YangInstanceIdentifier size " + size);
-        }
-    }
-
-    @Override
-    public final QName readQName() throws IOException {
-        final byte type = input.readByte();
-        switch (type) {
-            case MagnesiumValue.QNAME:
-                return decodeQName();
-            case MagnesiumValue.QNAME_REF_1B:
-                return decodeQNameRef1();
-            case MagnesiumValue.QNAME_REF_2B:
-                return decodeQNameRef2();
-            case MagnesiumValue.QNAME_REF_4B:
-                return decodeQNameRef4();
-            default:
-                throw new InvalidNormalizedNodeStreamException("Unexpected QName type " + type);
-        }
-    }
-
-    @Override
-    public final PathArgument readPathArgument() throws IOException {
-        final byte header = input.readByte();
-        switch (header & MagnesiumPathArgument.TYPE_MASK) {
-            case MagnesiumPathArgument.AUGMENTATION_IDENTIFIER:
-                return readAugmentationIdentifier(header);
-            case MagnesiumPathArgument.NODE_IDENTIFIER:
-                verifyPathIdentifierOnly(header);
-                return readNodeIdentifier(header);
-            case MagnesiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES:
-                return readNodeIdentifierWithPredicates(header);
-            case MagnesiumPathArgument.NODE_WITH_VALUE:
-                verifyPathIdentifierOnly(header);
-                return readNodeWithValue(header);
-            case MagnesiumPathArgument.MOUNTPOINT_IDENTIFIER:
-                verifyPathIdentifierOnly(header);
-                return MountPointIdentifier.create(readNodeIdentifier(header).getNodeType());
-            default:
-                throw new InvalidNormalizedNodeStreamException("Unexpected PathArgument header " + header);
-        }
-    }
-
-    private AugmentationIdentifier readAugmentationIdentifier() throws IOException {
-        final AugmentationIdentifier result = readAugmentationIdentifier(input.readInt());
-        codedAugments.add(result);
-        return result;
-    }
-
-    private AugmentationIdentifier readAugmentationIdentifier(final byte header) throws IOException {
-        final byte count = mask(header, MagnesiumPathArgument.AID_COUNT_MASK);
-        switch (count) {
-            case MagnesiumPathArgument.AID_COUNT_1B:
-                return readAugmentationIdentifier(input.readUnsignedByte());
-            case MagnesiumPathArgument.AID_COUNT_2B:
-                return readAugmentationIdentifier(input.readUnsignedShort());
-            case MagnesiumPathArgument.AID_COUNT_4B:
-                return readAugmentationIdentifier(input.readInt());
-            default:
-                return readAugmentationIdentifier(rshift(count, MagnesiumPathArgument.AID_COUNT_SHIFT));
-        }
-    }
-
-    private AugmentationIdentifier readAugmentationIdentifier(final int size) throws IOException {
-        if (size > 0) {
-            final List<QName> qnames = new ArrayList<>(size);
-            for (int i = 0; i < size; ++i) {
-                qnames.add(readQName());
-            }
-            return AugmentationIdentifier.create(ImmutableSet.copyOf(qnames));
-        } else if (size == 0) {
-            return EMPTY_AID;
-        } else {
-            throw new InvalidNormalizedNodeStreamException("Invalid augmentation identifier size " + size);
-        }
-    }
-
-    private NodeIdentifier readNodeIdentifier() throws IOException {
-        return decodeNodeIdentifier();
-    }
-
-    private NodeIdentifier readNodeIdentifier(final byte header) throws IOException {
-        switch (header & MagnesiumPathArgument.QNAME_MASK) {
-            case MagnesiumPathArgument.QNAME_DEF:
-                return decodeNodeIdentifier();
-            case MagnesiumPathArgument.QNAME_REF_1B:
-                return decodeNodeIdentifierRef1();
-            case MagnesiumPathArgument.QNAME_REF_2B:
-                return decodeNodeIdentifierRef2();
-            case MagnesiumPathArgument.QNAME_REF_4B:
-                return decodeNodeIdentifierRef4();
-            default:
-                throw new InvalidNormalizedNodeStreamException("Invalid QName coding in " + header);
-        }
-    }
-
-    private NodeIdentifierWithPredicates readNodeIdentifierWithPredicates(final byte header) throws IOException {
-        final QName qname = readNodeIdentifier(header).getNodeType();
-        switch (mask(header, MagnesiumPathArgument.SIZE_MASK)) {
-            case MagnesiumPathArgument.SIZE_1B:
-                return readNodeIdentifierWithPredicates(qname, input.readUnsignedByte());
-            case MagnesiumPathArgument.SIZE_2B:
-                return readNodeIdentifierWithPredicates(qname, input.readUnsignedShort());
-            case MagnesiumPathArgument.SIZE_4B:
-                return readNodeIdentifierWithPredicates(qname, input.readInt());
-            default:
-                return readNodeIdentifierWithPredicates(qname, rshift(header, MagnesiumPathArgument.SIZE_SHIFT));
-        }
-    }
-
-    private NodeIdentifierWithPredicates readNodeIdentifierWithPredicates(final QName qname, final int size)
-            throws IOException {
-        if (size == 1) {
-            return NodeIdentifierWithPredicates.of(qname, readQName(), readLeafValue());
-        } else if (size > 1) {
-            final ImmutableMap.Builder<QName, Object> builder = ImmutableMap.builderWithExpectedSize(size);
-            for (int i = 0; i < size; ++i) {
-                builder.put(readQName(), readLeafValue());
-            }
-            return NodeIdentifierWithPredicates.of(qname, builder.build());
-        } else if (size == 0) {
-            return NodeIdentifierWithPredicates.of(qname);
-        } else {
-            throw new InvalidNormalizedNodeStreamException("Invalid predicate count " + size);
-        }
-    }
-
-    private NodeWithValue<?> readNodeWithValue(final byte header) throws IOException {
-        final QName qname = readNodeIdentifier(header).getNodeType();
-        return new NodeWithValue<>(qname, readLeafValue());
-    }
-
-    private static void verifyPathIdentifierOnly(final byte header) throws InvalidNormalizedNodeStreamException {
-        if (mask(header, MagnesiumPathArgument.SIZE_MASK) != 0) {
-            throw new InvalidNormalizedNodeStreamException("Invalid path argument header " + header);
-        }
-    }
-
-    private @NonNull NodeIdentifier decodeNodeIdentifierRef1() throws IOException {
-        return lookupNodeIdentifier(input.readUnsignedByte());
-    }
-
-    private @NonNull NodeIdentifier decodeNodeIdentifierRef2() throws IOException {
-        return lookupNodeIdentifier(input.readUnsignedShort() + 256);
-    }
-
-    private @NonNull NodeIdentifier decodeNodeIdentifierRef4() throws IOException {
-        return lookupNodeIdentifier(input.readInt());
-    }
-
-    private @NonNull QName decodeQName() throws IOException {
-        return decodeNodeIdentifier().getNodeType();
-    }
-
-    private @NonNull QName decodeQNameRef1() throws IOException {
-        return lookupQName(input.readUnsignedByte());
-    }
-
-    private @NonNull QName decodeQNameRef2() throws IOException {
-        return lookupQName(input.readUnsignedShort() + 256);
-    }
-
-    private @NonNull QName decodeQNameRef4() throws IOException {
-        return lookupQName(input.readInt());
-    }
-
-    private @NonNull QNameModule decodeQNameModule() throws IOException {
-        final byte type = input.readByte();
-        final int index;
-        switch (type) {
-            case MagnesiumValue.MODREF_1B:
-                index = input.readUnsignedByte();
-                break;
-            case MagnesiumValue.MODREF_2B:
-                index = input.readUnsignedShort() + 256;
-                break;
-            case MagnesiumValue.MODREF_4B:
-                index = input.readInt();
-                break;
-            default:
-                return decodeQNameModuleDef(type);
-        }
-
-        try {
-            return codedModules.get(index);
-        } catch (IndexOutOfBoundsException e) {
-            throw new InvalidNormalizedNodeStreamException("Invalid QNameModule reference " + index, e);
-        }
-    }
-
-    // QNameModule definition, i.e. two encoded strings
-    private @NonNull QNameModule decodeQNameModuleDef(final byte type) throws IOException {
-        final String namespace = readRefString(type);
-
-        final byte refType = input.readByte();
-        final String revision = refType == MagnesiumValue.STRING_EMPTY ? null : readRefString(refType);
-        final QNameModule module;
-        try {
-            module = QNameFactory.createModule(namespace, revision);
-        } catch (UncheckedExecutionException e) {
-            throw new InvalidNormalizedNodeStreamException("Illegal QNameModule ns=" + namespace + " rev=" + revision,
-                e);
-        }
-
-        codedModules.add(module);
-        return module;
-    }
-
-    private @NonNull String readRefString() throws IOException {
-        return readRefString(input.readByte());
-    }
-
-    private @NonNull String readRefString(final byte type) throws IOException {
-        final String str;
-        switch (type) {
-            case MagnesiumValue.STRING_REF_1B:
-                return lookupString(input.readUnsignedByte());
-            case MagnesiumValue.STRING_REF_2B:
-                return lookupString(input.readUnsignedShort() + 256);
-            case MagnesiumValue.STRING_REF_4B:
-                return lookupString(input.readInt());
-            case MagnesiumValue.STRING_EMPTY:
-                return "";
-            case MagnesiumValue.STRING_2B:
-                str = readString2();
-                break;
-            case MagnesiumValue.STRING_4B:
-                str = readString4();
-                break;
-            case MagnesiumValue.STRING_CHARS:
-                str = readCharsString();
-                break;
-            case MagnesiumValue.STRING_UTF:
-                str = input.readUTF();
-                break;
-            default:
-                throw new InvalidNormalizedNodeStreamException("Unexpected String type " + type);
-        }
-
-        // TODO: consider interning Strings -- that would help with bits, but otherwise it's probably not worth it
-        codedStrings.add(verifyNotNull(str));
-        return str;
-    }
-
-    private @NonNull String readString() throws IOException {
-        final byte type = input.readByte();
-        switch (type) {
-            case MagnesiumValue.STRING_EMPTY:
-                return "";
-            case MagnesiumValue.STRING_UTF:
-                return input.readUTF();
-            case MagnesiumValue.STRING_2B:
-                return readString2();
-            case MagnesiumValue.STRING_4B:
-                return readString4();
-            case MagnesiumValue.STRING_CHARS:
-                return readCharsString();
-            default:
-                throw new InvalidNormalizedNodeStreamException("Unexpected String type " + type);
-        }
-    }
-
-    private @NonNull String readString2() throws IOException {
-        return readByteString(input.readUnsignedShort());
-    }
-
-    private @NonNull String readString4() throws IOException {
-        return readByteString(input.readInt());
-    }
-
-    private @NonNull String readByteString(final int size) throws IOException {
-        if (size > 0) {
-            final byte[] bytes = new byte[size];
-            input.readFully(bytes);
-            return new String(bytes, StandardCharsets.UTF_8);
-        } else if (size == 0) {
-            return "";
-        } else {
-            throw new InvalidNormalizedNodeStreamException("Invalid String bytes length " + size);
-        }
-    }
-
-    private @NonNull String readCharsString() throws IOException {
-        final int size = input.readInt();
-        if (size > 0) {
-            final char[] chars = new char[size];
-            for (int i = 0; i < size; ++i) {
-                chars[i] = input.readChar();
-            }
-            return String.valueOf(chars);
-        } else if (size == 0) {
-            return "";
-        } else {
-            throw new InvalidNormalizedNodeStreamException("Invalid String chars length " + size);
-        }
-    }
-
-    private @NonNull NodeIdentifier lookupNodeIdentifier(final int index) throws InvalidNormalizedNodeStreamException {
-        try {
-            return codedNodeIdentifiers.get(index);
-        } catch (IndexOutOfBoundsException e) {
-            throw new InvalidNormalizedNodeStreamException("Invalid QName reference " + index, e);
-        }
-    }
-
-    private @NonNull QName lookupQName(final int index) throws InvalidNormalizedNodeStreamException {
-        return lookupNodeIdentifier(index).getNodeType();
-    }
-
-    private @NonNull String lookupString(final int index) throws InvalidNormalizedNodeStreamException {
-        try {
-            return codedStrings.get(index);
-        } catch (IndexOutOfBoundsException e) {
-            throw new InvalidNormalizedNodeStreamException("Invalid String reference " + index, e);
-        }
-    }
-
-    private @NonNull DOMSource readDOMSource() throws IOException {
-        final String str = readString();
-        try {
-            return new DOMSource(UntrustedXML.newDocumentBuilder().parse(new InputSource(new StringReader(str)))
-                .getDocumentElement());
-        } catch (SAXException e) {
-            throw new IOException("Error parsing XML: " + str, e);
-        }
-    }
-
-    private @NonNull Object readLeafValue() throws IOException {
-        final byte type = input.readByte();
-        switch (type) {
-            case MagnesiumValue.BOOLEAN_FALSE:
-                return Boolean.FALSE;
-            case MagnesiumValue.BOOLEAN_TRUE:
-                return Boolean.TRUE;
-            case MagnesiumValue.EMPTY:
-                return Empty.getInstance();
-            case MagnesiumValue.INT8:
-                return input.readByte();
-            case MagnesiumValue.INT8_0:
-                return INT8_0;
-            case MagnesiumValue.INT16:
-                return input.readShort();
-            case MagnesiumValue.INT16_0:
-                return INT16_0;
-            case MagnesiumValue.INT32:
-                return input.readInt();
-            case MagnesiumValue.INT32_0:
-                return INT32_0;
-            case MagnesiumValue.INT32_2B:
-                return input.readShort() & 0xFFFF;
-            case MagnesiumValue.INT64:
-                return input.readLong();
-            case MagnesiumValue.INT64_0:
-                return INT64_0;
-            case MagnesiumValue.INT64_4B:
-                return input.readInt() & 0xFFFFFFFFL;
-            case MagnesiumValue.UINT8:
-                return Uint8.fromByteBits(input.readByte());
-            case MagnesiumValue.UINT8_0:
-                return UINT8_0;
-            case MagnesiumValue.UINT16:
-                return Uint16.fromShortBits(input.readShort());
-            case MagnesiumValue.UINT16_0:
-                return UINT16_0;
-            case MagnesiumValue.UINT32:
-                return Uint32.fromIntBits(input.readInt());
-            case MagnesiumValue.UINT32_0:
-                return UINT32_0;
-            case MagnesiumValue.UINT32_2B:
-                return Uint32.fromIntBits(input.readShort() & 0xFFFF);
-            case MagnesiumValue.UINT64:
-                return Uint64.fromLongBits(input.readLong());
-            case MagnesiumValue.UINT64_0:
-                return UINT64_0;
-            case MagnesiumValue.UINT64_4B:
-                return Uint64.fromLongBits(input.readInt() & 0xFFFFFFFFL);
-            case MagnesiumValue.BIGDECIMAL:
-                // FIXME: use string -> BigDecimal cache
-                return new BigDecimal(input.readUTF());
-            case MagnesiumValue.BIGINTEGER:
-                return readBigInteger();
-            case MagnesiumValue.STRING_EMPTY:
-                return "";
-            case MagnesiumValue.STRING_UTF:
-                return input.readUTF();
-            case MagnesiumValue.STRING_2B:
-                return readString2();
-            case MagnesiumValue.STRING_4B:
-                return readString4();
-            case MagnesiumValue.STRING_CHARS:
-                return readCharsString();
-            case MagnesiumValue.BINARY_0:
-                return BINARY_0;
-            case MagnesiumValue.BINARY_1B:
-                return readBinary(128 + input.readUnsignedByte());
-            case MagnesiumValue.BINARY_2B:
-                return readBinary(384 + input.readUnsignedShort());
-            case MagnesiumValue.BINARY_4B:
-                return readBinary(input.readInt());
-            case MagnesiumValue.YIID_0:
-                return YangInstanceIdentifier.empty();
-            case MagnesiumValue.YIID:
-                return readYangInstanceIdentifier(input.readInt());
-            case MagnesiumValue.QNAME:
-                return decodeQName();
-            case MagnesiumValue.QNAME_REF_1B:
-                return decodeQNameRef1();
-            case MagnesiumValue.QNAME_REF_2B:
-                return decodeQNameRef2();
-            case MagnesiumValue.QNAME_REF_4B:
-                return decodeQNameRef4();
-            case MagnesiumValue.BITS_0:
-                return ImmutableSet.of();
-            case MagnesiumValue.BITS_1B:
-                return readBits(input.readUnsignedByte() + 29);
-            case MagnesiumValue.BITS_2B:
-                return readBits(input.readUnsignedShort() + 285);
-            case MagnesiumValue.BITS_4B:
-                return readBits(input.readInt());
-
-            default:
-                if (type > MagnesiumValue.BINARY_0 && type <= MagnesiumValue.BINARY_127) {
-                    return readBinary(type - MagnesiumValue.BINARY_0);
-                } else if (type > MagnesiumValue.BITS_0 && type < MagnesiumValue.BITS_1B) {
-                    return readBits(type - MagnesiumValue.BITS_0);
-                } else if (type > MagnesiumValue.YIID_0) {
-                    // Note 'byte' is range limited, so it is always '&& type <= MagnesiumValue.YIID_31'
-                    return readYangInstanceIdentifier(type - MagnesiumValue.YIID_0);
-                } else {
-                    throw new InvalidNormalizedNodeStreamException("Invalid value type " + type);
-                }
-        }
-    }
-
-    abstract @NonNull BigInteger readBigInteger() throws IOException;
-
-    private byte @NonNull [] readBinary(final int size) throws IOException {
-        if (size > 0) {
-            final byte[] ret = new byte[size];
-            input.readFully(ret);
-            return ret;
-        } else if (size == 0) {
-            return BINARY_0;
-        } else {
-            throw new InvalidNormalizedNodeStreamException("Invalid binary length " + size);
-        }
-    }
-
-    private @NonNull ImmutableSet<String> readBits(final int size) throws IOException {
-        if (size > 0) {
-            final ImmutableSet.Builder<String> builder = ImmutableSet.builder();
-            for (int i = 0; i < size; ++i) {
-                builder.add(readRefString());
-            }
-            return builder.build();
-        } else if (size == 0) {
-            return ImmutableSet.of();
-        } else {
-            throw new InvalidNormalizedNodeStreamException("Invalid bits length " + size);
-        }
-    }
-
-    private static byte mask(final byte header, final byte mask) {
-        return (byte) (header & mask);
-    }
-
-    private static int rshift(final byte header, final byte shift) {
-        return (header & 0xFF) >>> shift;
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataOutput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractMagnesiumDataOutput.java
deleted file mode 100644 (file)
index 3f28f06..0000000
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import static com.google.common.base.Preconditions.checkArgument;
-
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayDeque;
-import java.util.Deque;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Optional;
-import java.util.Set;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.rfc8528.data.api.MountPointIdentifier;
-import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.common.Revision;
-import org.opendaylight.yangtools.yang.common.Uint16;
-import org.opendaylight.yangtools.yang.common.Uint32;
-import org.opendaylight.yangtools.yang.common.Uint64;
-import org.opendaylight.yangtools.yang.common.Uint8;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Abstract base class for NormalizedNodeDataOutput based on {@link MagnesiumNode}, {@link MagnesiumPathArgument} and
- * {@link MagnesiumValue}.
- */
-abstract class AbstractMagnesiumDataOutput extends AbstractNormalizedNodeDataOutput {
-    private static final Logger LOG = LoggerFactory.getLogger(AbstractMagnesiumDataOutput.class);
-
-    // Marker for encoding state when we have entered startLeafNode() within a startMapEntry() and that leaf corresponds
-    // to a key carried within NodeIdentifierWithPredicates.
-    private static final Object KEY_LEAF_STATE = new Object();
-    // Marker for nodes which have simple content and do not use END_NODE marker to terminate
-    private static final Object NO_ENDNODE_STATE = new Object();
-
-    private static final TransformerFactory TF = TransformerFactory.newInstance();
-
-    /**
-     * Stack tracking encoding state. In general we track the node identifier of the currently-open element, but there
-     * are a few other circumstances where we push other objects. See {@link #KEY_LEAF_STATE} and
-     * {@link #NO_ENDNODE_STATE}.
-     */
-    private final Deque<Object> stack = new ArrayDeque<>();
-
-    // Coding maps
-    private final Map<AugmentationIdentifier, Integer> aidCodeMap = new HashMap<>();
-    private final Map<QNameModule, Integer> moduleCodeMap = new HashMap<>();
-    private final Map<String, Integer> stringCodeMap = new HashMap<>();
-    private final Map<QName, Integer> qnameCodeMap = new HashMap<>();
-
-    AbstractMagnesiumDataOutput(final DataOutput output) {
-        super(output);
-    }
-
-    @Override
-    public final void startLeafNode(final NodeIdentifier name) throws IOException {
-        final Object current = stack.peek();
-        if (current instanceof NodeIdentifierWithPredicates) {
-            final QName qname = name.getNodeType();
-            if (((NodeIdentifierWithPredicates) current).containsKey(qname)) {
-                writeQNameNode(MagnesiumNode.NODE_LEAF | MagnesiumNode.PREDICATE_ONE, qname);
-                stack.push(KEY_LEAF_STATE);
-                return;
-            }
-        }
-
-        startSimpleNode(MagnesiumNode.NODE_LEAF, name);
-    }
-
-    @Override
-    public final void startLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        startQNameNode(MagnesiumNode.NODE_LEAFSET, name);
-    }
-
-    @Override
-    public final void startOrderedLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        startQNameNode(MagnesiumNode.NODE_LEAFSET_ORDERED, name);
-    }
-
-    @Override
-    public final void startLeafSetEntryNode(final NodeWithValue<?> name) throws IOException {
-        if (matchesParentQName(name.getNodeType())) {
-            output.writeByte(MagnesiumNode.NODE_LEAFSET_ENTRY);
-            stack.push(NO_ENDNODE_STATE);
-        } else {
-            startSimpleNode(MagnesiumNode.NODE_LEAFSET_ENTRY, name);
-        }
-    }
-
-    @Override
-    public final void startContainerNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        startQNameNode(MagnesiumNode.NODE_CONTAINER, name);
-    }
-
-    @Override
-    public final void startUnkeyedList(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        startQNameNode(MagnesiumNode.NODE_LIST, name);
-    }
-
-    @Override
-    public final void startUnkeyedListItem(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        startInheritedNode(MagnesiumNode.NODE_LIST_ENTRY, name);
-    }
-
-    @Override
-    public final void startMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        startQNameNode(MagnesiumNode.NODE_MAP, name);
-    }
-
-    @Override
-    public final void startMapEntryNode(final NodeIdentifierWithPredicates identifier, final int childSizeHint)
-            throws IOException {
-        final int size = identifier.size();
-        if (size == 1) {
-            startInheritedNode((byte) (MagnesiumNode.NODE_MAP_ENTRY | MagnesiumNode.PREDICATE_ONE), identifier);
-        } else if (size == 0) {
-            startInheritedNode((byte) (MagnesiumNode.NODE_MAP_ENTRY | MagnesiumNode.PREDICATE_ZERO), identifier);
-        } else if (size < 256) {
-            startInheritedNode((byte) (MagnesiumNode.NODE_MAP_ENTRY | MagnesiumNode.PREDICATE_1B), identifier);
-            output.writeByte(size);
-        } else {
-            startInheritedNode((byte) (MagnesiumNode.NODE_MAP_ENTRY | MagnesiumNode.PREDICATE_4B), identifier);
-            output.writeInt(size);
-        }
-
-        writePredicates(identifier);
-    }
-
-    @Override
-    public final void startOrderedMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        startQNameNode(MagnesiumNode.NODE_MAP_ORDERED, name);
-    }
-
-    @Override
-    public final void startChoiceNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
-        startQNameNode(MagnesiumNode.NODE_CHOICE, name);
-    }
-
-    @Override
-    public final void startAugmentationNode(final AugmentationIdentifier identifier) throws IOException {
-        final Integer code = aidCodeMap.get(identifier);
-        if (code == null) {
-            aidCodeMap.put(identifier, aidCodeMap.size());
-            output.writeByte(MagnesiumNode.NODE_AUGMENTATION | MagnesiumNode.ADDR_DEFINE);
-            final Set<QName> qnames = identifier.getPossibleChildNames();
-            output.writeInt(qnames.size());
-            for (QName qname : qnames) {
-                writeQNameInternal(qname);
-            }
-        } else {
-            writeNodeType(MagnesiumNode.NODE_AUGMENTATION, code);
-        }
-        stack.push(identifier);
-    }
-
-    @Override
-    public final boolean startAnyxmlNode(final NodeIdentifier name, final Class<?> objectModel) throws IOException {
-        if (DOMSource.class.isAssignableFrom(objectModel)) {
-            startSimpleNode(MagnesiumNode.NODE_ANYXML, name);
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    public final void domSourceValue(final DOMSource value) throws IOException {
-        final StringWriter writer = new StringWriter();
-        try {
-            TF.newTransformer().transform(value, new StreamResult(writer));
-        } catch (TransformerException e) {
-            throw new IOException("Error writing anyXml", e);
-        }
-        writeValue(writer.toString());
-    }
-
-    @Override
-    public final void startYangModeledAnyXmlNode(final NodeIdentifier name, final int childSizeHint)
-            throws IOException {
-        // FIXME: implement this
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public final void endNode() throws IOException {
-        if (stack.pop() instanceof PathArgument) {
-            output.writeByte(MagnesiumNode.NODE_END);
-        }
-    }
-
-    @Override
-    public final void scalarValue(final Object value) throws IOException {
-        if (KEY_LEAF_STATE.equals(stack.peek())) {
-            LOG.trace("Inside a map entry key leaf, not emitting value {}", value);
-        } else {
-            writeObject(value);
-        }
-    }
-
-    @Override
-    final void writeQNameInternal(final QName qname) throws IOException {
-        final Integer code = qnameCodeMap.get(qname);
-        if (code == null) {
-            output.writeByte(MagnesiumValue.QNAME);
-            encodeQName(qname);
-        } else {
-            writeQNameRef(code);
-        }
-    }
-
-    @Override
-    final void writePathArgumentInternal(final PathArgument pathArgument) throws IOException {
-        if (pathArgument instanceof NodeIdentifier) {
-            writeNodeIdentifier((NodeIdentifier) pathArgument);
-        } else if (pathArgument instanceof NodeIdentifierWithPredicates) {
-            writeNodeIdentifierWithPredicates((NodeIdentifierWithPredicates) pathArgument);
-        } else if (pathArgument instanceof AugmentationIdentifier) {
-            writeAugmentationIdentifier((AugmentationIdentifier) pathArgument);
-        } else if (pathArgument instanceof NodeWithValue) {
-            writeNodeWithValue((NodeWithValue<?>) pathArgument);
-        } else if (pathArgument instanceof MountPointIdentifier) {
-            writeMountPointIdentifier((MountPointIdentifier) pathArgument);
-        } else {
-            throw new IOException("Unhandled PathArgument " + pathArgument);
-        }
-    }
-
-    private void writeAugmentationIdentifier(final AugmentationIdentifier identifier) throws IOException {
-        final Set<QName> qnames = identifier.getPossibleChildNames();
-        final int size = qnames.size();
-        if (size < 29) {
-            output.writeByte(MagnesiumPathArgument.AUGMENTATION_IDENTIFIER
-                | size << MagnesiumPathArgument.AID_COUNT_SHIFT);
-        } else if (size < 256) {
-            output.writeByte(MagnesiumPathArgument.AUGMENTATION_IDENTIFIER | MagnesiumPathArgument.AID_COUNT_1B);
-            output.writeByte(size);
-        } else if (size < 65536) {
-            output.writeByte(MagnesiumPathArgument.AUGMENTATION_IDENTIFIER | MagnesiumPathArgument.AID_COUNT_2B);
-            output.writeShort(size);
-        } else {
-            output.writeByte(MagnesiumPathArgument.AUGMENTATION_IDENTIFIER | MagnesiumPathArgument.AID_COUNT_4B);
-            output.writeInt(size);
-        }
-
-        for (QName qname : qnames) {
-            writeQNameInternal(qname);
-        }
-    }
-
-    private void writeNodeIdentifier(final NodeIdentifier identifier) throws IOException {
-        writePathArgumentQName(identifier.getNodeType(), MagnesiumPathArgument.NODE_IDENTIFIER);
-    }
-
-    private void writeMountPointIdentifier(final MountPointIdentifier identifier) throws IOException {
-        writePathArgumentQName(identifier.getNodeType(), MagnesiumPathArgument.MOUNTPOINT_IDENTIFIER);
-    }
-
-    private void writeNodeIdentifierWithPredicates(final NodeIdentifierWithPredicates identifier) throws IOException {
-        final int size = identifier.size();
-        if (size < 5) {
-            writePathArgumentQName(identifier.getNodeType(),
-                (byte) (MagnesiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES
-                        | size << MagnesiumPathArgument.SIZE_SHIFT));
-        } else if (size < 256) {
-            writePathArgumentQName(identifier.getNodeType(),
-                (byte) (MagnesiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES | MagnesiumPathArgument.SIZE_1B));
-            output.writeByte(size);
-        } else if (size < 65536) {
-            writePathArgumentQName(identifier.getNodeType(),
-                (byte) (MagnesiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES | MagnesiumPathArgument.SIZE_2B));
-            output.writeShort(size);
-        } else {
-            writePathArgumentQName(identifier.getNodeType(),
-                (byte) (MagnesiumPathArgument.NODE_IDENTIFIER_WITH_PREDICATES | MagnesiumPathArgument.SIZE_4B));
-            output.writeInt(size);
-        }
-
-        writePredicates(identifier);
-    }
-
-    private void writePredicates(final NodeIdentifierWithPredicates identifier) throws IOException {
-        for (Entry<QName, Object> e : identifier.entrySet()) {
-            writeQNameInternal(e.getKey());
-            writeObject(e.getValue());
-        }
-    }
-
-    private void writeNodeWithValue(final NodeWithValue<?> identifier) throws IOException {
-        writePathArgumentQName(identifier.getNodeType(), MagnesiumPathArgument.NODE_WITH_VALUE);
-        writeObject(identifier.getValue());
-    }
-
-    private void writePathArgumentQName(final QName qname, final byte typeHeader) throws IOException {
-        final Integer code = qnameCodeMap.get(qname);
-        if (code != null) {
-            final int val = code;
-            if (val < 256) {
-                output.writeByte(typeHeader | MagnesiumPathArgument.QNAME_REF_1B);
-                output.writeByte(val);
-            } else if (val < 65792) {
-                output.writeByte(typeHeader | MagnesiumPathArgument.QNAME_REF_2B);
-                output.writeShort(val - 256);
-            } else {
-                output.writeByte(typeHeader | MagnesiumPathArgument.QNAME_REF_4B);
-                output.writeInt(val);
-            }
-        } else {
-            // implied '| MagnesiumPathArgument.QNAME_DEF'
-            output.writeByte(typeHeader);
-            encodeQName(qname);
-        }
-    }
-
-    @Override
-    final void writeYangInstanceIdentifierInternal(final YangInstanceIdentifier identifier) throws IOException {
-        writeValue(identifier);
-    }
-
-    private void writeObject(final @NonNull Object value) throws IOException {
-        if (value instanceof String) {
-            writeValue((String) value);
-        } else if (value instanceof Boolean) {
-            writeValue((Boolean) value);
-        } else if (value instanceof Byte) {
-            writeValue((Byte) value);
-        } else if (value instanceof Short) {
-            writeValue((Short) value);
-        } else if (value instanceof Integer) {
-            writeValue((Integer) value);
-        } else if (value instanceof Long) {
-            writeValue((Long) value);
-        } else if (value instanceof Uint8) {
-            writeValue((Uint8) value);
-        } else if (value instanceof Uint16) {
-            writeValue((Uint16) value);
-        } else if (value instanceof Uint32) {
-            writeValue((Uint32) value);
-        } else if (value instanceof Uint64) {
-            writeValue((Uint64) value);
-        } else if (value instanceof QName) {
-            writeQNameInternal((QName) value);
-        } else if (value instanceof YangInstanceIdentifier) {
-            writeValue((YangInstanceIdentifier) value);
-        } else if (value instanceof byte[]) {
-            writeValue((byte[]) value);
-        } else if (value instanceof Empty) {
-            output.writeByte(MagnesiumValue.EMPTY);
-        } else if (value instanceof Set) {
-            writeValue((Set<?>) value);
-        } else if (value instanceof BigDecimal) {
-            writeValue((BigDecimal) value);
-        } else if (value instanceof BigInteger) {
-            writeValue((BigInteger) value);
-        } else {
-            throw new IOException("Unhandled value type " + value.getClass());
-        }
-    }
-
-    private void writeValue(final boolean value) throws IOException {
-        output.writeByte(value ? MagnesiumValue.BOOLEAN_TRUE : MagnesiumValue.BOOLEAN_FALSE);
-    }
-
-    private void writeValue(final byte value) throws IOException {
-        if (value != 0) {
-            output.writeByte(MagnesiumValue.INT8);
-            output.writeByte(value);
-        } else {
-            output.writeByte(MagnesiumValue.INT8_0);
-        }
-    }
-
-    private void writeValue(final short value) throws IOException {
-        if (value != 0) {
-            output.writeByte(MagnesiumValue.INT16);
-            output.writeShort(value);
-        } else {
-            output.writeByte(MagnesiumValue.INT16_0);
-        }
-    }
-
-    private void writeValue(final int value) throws IOException {
-        if ((value & 0xFFFF0000) != 0) {
-            output.writeByte(MagnesiumValue.INT32);
-            output.writeInt(value);
-        } else if (value != 0) {
-            output.writeByte(MagnesiumValue.INT32_2B);
-            output.writeShort(value);
-        } else {
-            output.writeByte(MagnesiumValue.INT32_0);
-        }
-    }
-
-    private void writeValue(final long value) throws IOException {
-        if ((value & 0xFFFFFFFF00000000L) != 0) {
-            output.writeByte(MagnesiumValue.INT64);
-            output.writeLong(value);
-        } else if (value != 0) {
-            output.writeByte(MagnesiumValue.INT64_4B);
-            output.writeInt((int) value);
-        } else {
-            output.writeByte(MagnesiumValue.INT64_0);
-        }
-    }
-
-    private void writeValue(final Uint8 value) throws IOException {
-        final byte b = value.byteValue();
-        if (b != 0) {
-            output.writeByte(MagnesiumValue.UINT8);
-            output.writeByte(b);
-        } else {
-            output.writeByte(MagnesiumValue.UINT8_0);
-        }
-    }
-
-    private void writeValue(final Uint16 value) throws IOException {
-        final short s = value.shortValue();
-        if (s != 0) {
-            output.writeByte(MagnesiumValue.UINT16);
-            output.writeShort(s);
-        } else {
-            output.writeByte(MagnesiumValue.UINT16_0);
-        }
-    }
-
-    private void writeValue(final Uint32 value) throws IOException {
-        final int i = value.intValue();
-        if ((i & 0xFFFF0000) != 0) {
-            output.writeByte(MagnesiumValue.UINT32);
-            output.writeInt(i);
-        } else if (i != 0) {
-            output.writeByte(MagnesiumValue.UINT32_2B);
-            output.writeShort(i);
-        } else {
-            output.writeByte(MagnesiumValue.UINT32_0);
-        }
-    }
-
-    private void writeValue(final Uint64 value) throws IOException {
-        final long l = value.longValue();
-        if ((l & 0xFFFFFFFF00000000L) != 0) {
-            output.writeByte(MagnesiumValue.UINT64);
-            output.writeLong(l);
-        } else if (l != 0) {
-            output.writeByte(MagnesiumValue.UINT64_4B);
-            output.writeInt((int) l);
-        } else {
-            output.writeByte(MagnesiumValue.UINT64_0);
-        }
-    }
-
-    private void writeValue(final BigDecimal value) throws IOException {
-        output.writeByte(MagnesiumValue.BIGDECIMAL);
-        output.writeUTF(value.toString());
-    }
-
-    abstract void writeValue(BigInteger value) throws IOException;
-
-    private void writeValue(final String value) throws IOException {
-        if (value.isEmpty()) {
-            output.writeByte(MagnesiumValue.STRING_EMPTY);
-        } else if (value.length() <= Short.MAX_VALUE / 2) {
-            output.writeByte(MagnesiumValue.STRING_UTF);
-            output.writeUTF(value);
-        } else if (value.length() <= 1048576) {
-            final byte[] bytes = value.getBytes(StandardCharsets.UTF_8);
-            if (bytes.length < 65536) {
-                output.writeByte(MagnesiumValue.STRING_2B);
-                output.writeShort(bytes.length);
-            } else {
-                output.writeByte(MagnesiumValue.STRING_4B);
-                output.writeInt(bytes.length);
-            }
-            output.write(bytes);
-        } else {
-            output.writeByte(MagnesiumValue.STRING_CHARS);
-            output.writeInt(value.length());
-            output.writeChars(value);
-        }
-    }
-
-    private void writeValue(final byte[] value) throws IOException {
-        if (value.length < 128) {
-            output.writeByte(MagnesiumValue.BINARY_0 + value.length);
-        } else if (value.length < 384) {
-            output.writeByte(MagnesiumValue.BINARY_1B);
-            output.writeByte(value.length - 128);
-        } else if (value.length < 65920) {
-            output.writeByte(MagnesiumValue.BINARY_2B);
-            output.writeShort(value.length - 384);
-        } else {
-            output.writeByte(MagnesiumValue.BINARY_4B);
-            output.writeInt(value.length);
-        }
-        output.write(value);
-    }
-
-    private void writeValue(final YangInstanceIdentifier value) throws IOException {
-        final List<PathArgument> args = value.getPathArguments();
-        final int size = args.size();
-        if (size > 31) {
-            output.writeByte(MagnesiumValue.YIID);
-            output.writeInt(size);
-        } else {
-            output.writeByte(MagnesiumValue.YIID_0 + size);
-        }
-        for (PathArgument arg : args) {
-            writePathArgumentInternal(arg);
-        }
-    }
-
-    private void writeValue(final Set<?> value) throws IOException {
-        final int size = value.size();
-        if (size < 29) {
-            output.writeByte(MagnesiumValue.BITS_0 + size);
-        } else if (size < 285) {
-            output.writeByte(MagnesiumValue.BITS_1B);
-            output.writeByte(size - 29);
-        } else if (size < 65821) {
-            output.writeByte(MagnesiumValue.BITS_2B);
-            output.writeShort(size - 285);
-        } else {
-            output.writeByte(MagnesiumValue.BITS_4B);
-            output.writeInt(size);
-        }
-
-        for (Object bit : value) {
-            checkArgument(bit instanceof String, "Expected value type to be String but was %s", bit);
-            encodeString((String) bit);
-        }
-    }
-
-    // Check if the proposed QName matches the parent. This is only effective if the parent is identified by
-    // NodeIdentifier -- which is typically true
-    private boolean matchesParentQName(final QName qname) {
-        final Object current = stack.peek();
-        return current instanceof NodeIdentifier && qname.equals(((NodeIdentifier) current).getNodeType());
-    }
-
-    // Start an END_NODE-terminated node, which typically has a QName matching the parent. If that is the case we emit
-    // a parent reference instead of an explicit QName reference -- saving at least one byte
-    private void startInheritedNode(final byte type, final PathArgument name) throws IOException {
-        final QName qname = name.getNodeType();
-        if (matchesParentQName(qname)) {
-            output.write(type);
-        } else {
-            writeQNameNode(type, qname);
-        }
-        stack.push(name);
-    }
-
-    // Start an END_NODE-terminated node, which needs its QName encoded
-    private void startQNameNode(final byte type, final PathArgument name) throws IOException {
-        writeQNameNode(type, name.getNodeType());
-        stack.push(name);
-    }
-
-    // Start a simple node, which is not terminated through END_NODE and encode its QName
-    private void startSimpleNode(final byte type, final PathArgument name) throws IOException {
-        writeQNameNode(type, name.getNodeType());
-        stack.push(NO_ENDNODE_STATE);
-    }
-
-    // Encode a QName-based (i.e. NodeIdentifier*) node with a particular QName. This will either result in a QName
-    // definition, or a reference, where this is encoded along with the node type.
-    private void writeQNameNode(final int type, final @NonNull QName qname) throws IOException {
-        final Integer code = qnameCodeMap.get(qname);
-        if (code == null) {
-            output.writeByte(type | MagnesiumNode.ADDR_DEFINE);
-            encodeQName(qname);
-        } else {
-            writeNodeType(type, code);
-        }
-    }
-
-    // Write a node type + lookup
-    private void writeNodeType(final int type, final int code) throws IOException {
-        if (code <= 255) {
-            output.writeByte(type | MagnesiumNode.ADDR_LOOKUP_1B);
-            output.writeByte(code);
-        } else {
-            output.writeByte(type | MagnesiumNode.ADDR_LOOKUP_4B);
-            output.writeInt(code);
-        }
-    }
-
-    // Encode a QName using lookup tables, resuling either in a reference to an existing entry, or emitting two
-    // String values.
-    private void encodeQName(final @NonNull QName qname) throws IOException {
-        final Integer prev = qnameCodeMap.put(qname, qnameCodeMap.size());
-        if (prev != null) {
-            throw new IOException("Internal coding error: attempted to re-encode " + qname + "%s already encoded as "
-                    + prev);
-        }
-
-        final QNameModule module = qname.getModule();
-        final Integer code = moduleCodeMap.get(module);
-        if (code == null) {
-            moduleCodeMap.put(module, moduleCodeMap.size());
-            encodeString(module.getNamespace().toString());
-            final Optional<Revision> rev = module.getRevision();
-            if (rev.isPresent()) {
-                encodeString(rev.get().toString());
-            } else {
-                output.writeByte(MagnesiumValue.STRING_EMPTY);
-            }
-        } else {
-            writeModuleRef(code);
-        }
-        encodeString(qname.getLocalName());
-    }
-
-    // Encode a String using lookup tables, resulting either in a reference to an existing entry, or emitting as
-    // a literal value
-    private void encodeString(final @NonNull String str) throws IOException {
-        final Integer code = stringCodeMap.get(str);
-        if (code != null) {
-            writeRef(code);
-        } else {
-            stringCodeMap.put(str, stringCodeMap.size());
-            writeValue(str);
-        }
-    }
-
-    // Write a QName with a lookup table reference. This is a combination of asserting the value is a QName plus
-    // the effects of writeRef()
-    private void writeQNameRef(final int code) throws IOException {
-        final int val = code;
-        if (val < 256) {
-            output.writeByte(MagnesiumValue.QNAME_REF_1B);
-            output.writeByte(val);
-        } else if (val < 65792) {
-            output.writeByte(MagnesiumValue.QNAME_REF_2B);
-            output.writeShort(val - 256);
-        } else {
-            output.writeByte(MagnesiumValue.QNAME_REF_4B);
-            output.writeInt(val);
-        }
-    }
-
-    // Write a lookup table reference, which table is being referenced is implied by the caller
-    private void writeRef(final int code) throws IOException {
-        final int val = code;
-        if (val < 256) {
-            output.writeByte(MagnesiumValue.STRING_REF_1B);
-            output.writeByte(val);
-        } else if (val < 65792) {
-            output.writeByte(MagnesiumValue.STRING_REF_2B);
-            output.writeShort(val - 256);
-        } else {
-            output.writeByte(MagnesiumValue.STRING_REF_4B);
-            output.writeInt(val);
-        }
-    }
-
-    // Write a lookup module table reference, which table is being referenced is implied by the caller
-    private void writeModuleRef(final int code) throws IOException {
-        final int val = code;
-        if (val < 256) {
-            output.writeByte(MagnesiumValue.MODREF_1B);
-            output.writeByte(val);
-        } else if (val < 65792) {
-            output.writeByte(MagnesiumValue.MODREF_2B);
-            output.writeShort(val - 256);
-        } else {
-            output.writeByte(MagnesiumValue.MODREF_4B);
-            output.writeInt(val);
-        }
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataInput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataInput.java
deleted file mode 100644 (file)
index f6ab760..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import static java.util.Objects.requireNonNull;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableList.Builder;
-import java.io.DataInput;
-import java.io.IOException;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-
-abstract class AbstractNormalizedNodeDataInput extends ForwardingDataInput implements NormalizedNodeDataInput {
-    // Visible for subclasses
-    final @NonNull DataInput input;
-
-    AbstractNormalizedNodeDataInput(final DataInput input) {
-        this.input = requireNonNull(input);
-    }
-
-    @Override
-    final DataInput delegate() {
-        return input;
-    }
-
-    @Override
-    public final SchemaPath readSchemaPath() throws IOException {
-        final boolean absolute = input.readBoolean();
-        final int size = input.readInt();
-
-        final Builder<QName> qnames = ImmutableList.builderWithExpectedSize(size);
-        for (int i = 0; i < size; ++i) {
-            qnames.add(readQName());
-        }
-        return SchemaPath.create(qnames.build(), absolute);
-    }
-
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/AbstractNormalizedNodeDataOutput.java
deleted file mode 100755 (executable)
index d8e021f..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import static java.util.Objects.requireNonNull;
-
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.List;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeWriter;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-
-/**
- * Abstract base class for implementing {@link NormalizedNodeDataOutput} contract. This class uses
- * {@link NormalizedNodeStreamWriter} as an internal interface for performing the actual NormalizedNode writeout,
- * i.e. it will defer to a {@link NormalizedNodeWriter} instance.
- *
- * <p>
- * As such, this is an implementation detail not exposed from this package, hence implementations can rely on the
- * stream being initialized with a header and version.
- */
-abstract class AbstractNormalizedNodeDataOutput implements NormalizedNodeDataOutput, NormalizedNodeStreamWriter {
-    // Visible for subclasses
-    final DataOutput output;
-
-    private NormalizedNodeWriter normalizedNodeWriter;
-    private boolean headerWritten;
-
-    AbstractNormalizedNodeDataOutput(final DataOutput output) {
-        this.output = requireNonNull(output);
-    }
-
-
-    private void ensureHeaderWritten() throws IOException {
-        if (!headerWritten) {
-            output.writeByte(TokenTypes.SIGNATURE_MARKER);
-            output.writeShort(streamVersion());
-            headerWritten = true;
-        }
-    }
-
-    @Override
-    public final void write(final int value) throws IOException {
-        ensureHeaderWritten();
-        output.write(value);
-    }
-
-    @Override
-    public final void write(final byte[] bytes) throws IOException {
-        ensureHeaderWritten();
-        output.write(bytes);
-    }
-
-    @Override
-    public final void write(final byte[] bytes, final int off, final int len) throws IOException {
-        ensureHeaderWritten();
-        output.write(bytes, off, len);
-    }
-
-    @Override
-    public final void writeBoolean(final boolean value) throws IOException {
-        ensureHeaderWritten();
-        output.writeBoolean(value);
-    }
-
-    @Override
-    public final void writeByte(final int value) throws IOException {
-        ensureHeaderWritten();
-        output.writeByte(value);
-    }
-
-    @Override
-    public final void writeShort(final int value) throws IOException {
-        ensureHeaderWritten();
-        output.writeShort(value);
-    }
-
-    @Override
-    public final void writeChar(final int value) throws IOException {
-        ensureHeaderWritten();
-        output.writeChar(value);
-    }
-
-    @Override
-    public final void writeInt(final int value) throws IOException {
-        ensureHeaderWritten();
-        output.writeInt(value);
-    }
-
-    @Override
-    public final void writeLong(final long value) throws IOException {
-        ensureHeaderWritten();
-        output.writeLong(value);
-    }
-
-    @Override
-    public final void writeFloat(final float value) throws IOException {
-        ensureHeaderWritten();
-        output.writeFloat(value);
-    }
-
-    @Override
-    public final void writeDouble(final double value) throws IOException {
-        ensureHeaderWritten();
-        output.writeDouble(value);
-    }
-
-    @Override
-    public final void writeBytes(final String str) throws IOException {
-        ensureHeaderWritten();
-        output.writeBytes(str);
-    }
-
-    @Override
-    public final void writeChars(final String str) throws IOException {
-        ensureHeaderWritten();
-        output.writeChars(str);
-    }
-
-    @Override
-    public final void writeUTF(final String str) throws IOException {
-        ensureHeaderWritten();
-        output.writeUTF(str);
-    }
-
-    @Override
-    public final void writeQName(final QName qname) throws IOException {
-        ensureHeaderWritten();
-        writeQNameInternal(qname);
-    }
-
-    @Override
-    public final void writeNormalizedNode(final NormalizedNode<?, ?> node) throws IOException {
-        ensureHeaderWritten();
-        if (normalizedNodeWriter == null) {
-            normalizedNodeWriter = NormalizedNodeWriter.forStreamWriter(this);
-        }
-        normalizedNodeWriter.write(node);
-    }
-
-    @Override
-    public final void writePathArgument(final PathArgument pathArgument) throws IOException {
-        ensureHeaderWritten();
-        writePathArgumentInternal(pathArgument);
-    }
-
-    @Override
-    public final void writeYangInstanceIdentifier(final YangInstanceIdentifier identifier) throws IOException {
-        ensureHeaderWritten();
-        writeYangInstanceIdentifierInternal(identifier);
-    }
-
-    @Override
-    public final void writeSchemaPath(final SchemaPath path) throws IOException {
-        ensureHeaderWritten();
-
-        output.writeBoolean(path.isAbsolute());
-        final List<QName> qnames = path.getPath();
-        output.writeInt(qnames.size());
-        for (QName qname : qnames) {
-            writeQNameInternal(qname);
-        }
-    }
-
-    @Override
-    public final void close() throws IOException {
-        flush();
-    }
-
-    @Override
-    public void flush() throws IOException {
-        if (output instanceof OutputStream) {
-            ((OutputStream)output).flush();
-        }
-    }
-
-    @Override
-    public final boolean startAnydataNode(final NodeIdentifier name, final Class<?> objectModel) throws IOException {
-        // FIXME: We do not support anydata nodes of any kind, yet
-        return false;
-    }
-
-    abstract short streamVersion();
-
-    abstract void writeQNameInternal(@NonNull QName qname) throws IOException;
-
-    abstract void writePathArgumentInternal(PathArgument pathArgument) throws IOException;
-
-    abstract void writeYangInstanceIdentifierInternal(YangInstanceIdentifier identifier) throws IOException;
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/CompatNormalizedNodeDataInput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/CompatNormalizedNodeDataInput.java
new file mode 100644 (file)
index 0000000..63d253c
--- /dev/null
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.datastore.node.utils.stream;
+
+import static java.util.Objects.requireNonNull;
+
+import com.google.common.collect.ForwardingObject;
+import java.io.IOException;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+
+@Deprecated
+final class CompatNormalizedNodeDataInput extends ForwardingObject implements NormalizedNodeDataInput {
+    private final org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput delegate;
+
+    CompatNormalizedNodeDataInput(
+        final org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput delegate) {
+        this.delegate = requireNonNull(delegate);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void readFully(final byte[] b) throws IOException {
+        try {
+            delegate.readFully(b);
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void readFully(final byte[] b, final int off, final int len) throws IOException {
+        try {
+            delegate.readFully(b, off, len);
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public int skipBytes(final int n) throws IOException {
+        try {
+            return delegate.skipBytes(n);
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public boolean readBoolean() throws IOException {
+        try {
+            return delegate.readBoolean();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public byte readByte() throws IOException {
+        try {
+            return delegate.readByte();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public int readUnsignedByte() throws IOException {
+        try {
+            return delegate.readUnsignedByte();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public short readShort() throws IOException {
+        try {
+            return delegate.readShort();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public int readUnsignedShort() throws IOException {
+        try {
+            return delegate.readUnsignedShort();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public char readChar() throws IOException {
+        try {
+            return delegate.readChar();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public int readInt() throws IOException {
+        try {
+            return delegate.readInt();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public long readLong() throws IOException {
+        try {
+            return delegate.readLong();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public float readFloat() throws IOException {
+        try {
+            return delegate.readFloat();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public double readDouble() throws IOException {
+        try {
+            return delegate.readDouble();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public String readLine() throws IOException {
+        try {
+            return delegate.readLine();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public String readUTF() throws IOException {
+        try {
+            return delegate.readUTF();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public void streamNormalizedNode(final NormalizedNodeStreamWriter writer) throws IOException {
+        try {
+            delegate.streamNormalizedNode(writer);
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public YangInstanceIdentifier readYangInstanceIdentifier() throws IOException {
+        try {
+            return delegate.readYangInstanceIdentifier();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public QName readQName() throws IOException {
+        try {
+            return delegate.readQName();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public PathArgument readPathArgument() throws IOException {
+        try {
+            return delegate.readPathArgument();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public SchemaPath readSchemaPath() throws IOException {
+        try {
+            return delegate.readSchemaPath();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public NormalizedNodeStreamVersion getVersion() throws IOException {
+        final org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion version;
+        try {
+            version = delegate.getVersion();
+        } catch (org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException e) {
+            throw new InvalidNormalizedNodeStreamException(e.getMessage(), e);
+        }
+
+        switch (version) {
+            case LITHIUM:
+                return NormalizedNodeStreamVersion.LITHIUM;
+            case MAGNESIUM:
+                return NormalizedNodeStreamVersion.MAGNESIUM;
+            case NEON_SR2:
+                return NormalizedNodeStreamVersion.NEON_SR2;
+            case SODIUM_SR1:
+                return NormalizedNodeStreamVersion.SODIUM_SR1;
+            default:
+                throw new IOException("Unhandled version " + delegate.getVersion());
+        }
+    }
+
+    @Override
+    protected org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput delegate() {
+        return delegate;
+    }
+}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/CompatNormalizedNodeDataOutput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/CompatNormalizedNodeDataOutput.java
new file mode 100644 (file)
index 0000000..f80012a
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.controller.cluster.datastore.node.utils.stream;
+
+import static java.util.Objects.requireNonNull;
+
+import com.google.common.collect.ForwardingObject;
+import java.io.IOException;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
+import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+
+@Deprecated
+final class CompatNormalizedNodeDataOutput extends ForwardingObject implements NormalizedNodeDataOutput {
+    private final org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput delegate;
+
+    CompatNormalizedNodeDataOutput(
+        final org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput delegate) {
+        this.delegate = requireNonNull(delegate);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void write(final int b) throws IOException {
+        delegate.write(b);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void write(final byte[] b) throws IOException {
+        delegate.write(b);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void write(final byte[] b, final int off, final int len) throws IOException {
+        delegate.write(b, off, len);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeBoolean(final boolean v) throws IOException {
+        delegate.writeBoolean(v);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeByte(final int v) throws IOException {
+        delegate.writeByte(v);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeShort(final int v) throws IOException {
+        delegate.writeShort(v);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeChar(final int v) throws IOException {
+        delegate.writeChar(v);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeInt(final int v) throws IOException {
+        delegate.writeInt(v);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeLong(final long v) throws IOException {
+        delegate.writeLong(v);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeFloat(final float v) throws IOException {
+        delegate.writeFloat(v);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeDouble(final double v) throws IOException {
+        delegate.writeDouble(v);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeBytes(final String s) throws IOException {
+        delegate.writeBytes(s);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeChars(final String s) throws IOException {
+        delegate.writeChars(s);
+    }
+
+    @Override
+    @SuppressWarnings("checkstyle:parameterName")
+    public void writeUTF(final String s) throws IOException {
+        delegate.writeUTF(s);
+    }
+
+    @Override
+    public void writeQName(final QName qname) throws IOException {
+        delegate.writeQName(qname);
+    }
+
+    @Override
+    public void writeNormalizedNode(final NormalizedNode<?, ?> normalizedNode) throws IOException {
+        delegate.writeNormalizedNode(normalizedNode);
+    }
+
+    @Override
+    public void writePathArgument(final PathArgument pathArgument) throws IOException {
+        delegate.writePathArgument(pathArgument);
+    }
+
+    @Override
+    public void writeYangInstanceIdentifier(final YangInstanceIdentifier identifier) throws IOException {
+        delegate.writeYangInstanceIdentifier(identifier);
+    }
+
+    @Override
+    public void writeSchemaPath(final SchemaPath path) throws IOException {
+        delegate.writeSchemaPath(path);
+    }
+
+    @Override
+    public void close() throws IOException {
+        delegate.close();
+    }
+
+    @Override
+    protected Object delegate() {
+        return delegate;
+    }
+}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ForwardingDataInput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ForwardingDataInput.java
deleted file mode 100644 (file)
index 0ec7fbe..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import java.io.DataInput;
-import java.io.IOException;
-import org.eclipse.jdt.annotation.NonNull;
-
-// Not a ForwardingObject because delegate() can legally throw and we do not want redirect toString()
-abstract class ForwardingDataInput implements DataInput {
-
-    abstract @NonNull DataInput delegate() throws IOException;
-
-    @Override
-    @SuppressWarnings("checkstyle:parameterName")
-    public final void readFully(final byte[] b) throws IOException {
-        delegate().readFully(b);
-    }
-
-    @Override
-    @SuppressWarnings("checkstyle:parameterName")
-    public final void readFully(final byte[] b, final int off, final int len) throws IOException {
-        delegate().readFully(b, off, len);
-    }
-
-    @Override
-    @SuppressWarnings("checkstyle:parameterName")
-    public final int skipBytes(final int n) throws IOException {
-        return delegate().skipBytes(n);
-    }
-
-    @Override
-    public final boolean readBoolean() throws IOException {
-        return delegate().readBoolean();
-    }
-
-    @Override
-    public final byte readByte() throws IOException {
-        return delegate().readByte();
-    }
-
-    @Override
-    public final int readUnsignedByte() throws IOException {
-        return delegate().readUnsignedByte();
-    }
-
-    @Override
-    public final short readShort() throws IOException {
-        return delegate().readShort();
-    }
-
-    @Override
-    public final int readUnsignedShort() throws IOException {
-        return delegate().readUnsignedShort();
-    }
-
-    @Override
-    public final char readChar() throws IOException {
-        return delegate().readChar();
-    }
-
-    @Override
-    public final int readInt() throws IOException {
-        return delegate().readInt();
-    }
-
-    @Override
-    public final long readLong() throws IOException {
-        return delegate().readLong();
-    }
-
-    @Override
-    public final float readFloat() throws IOException {
-        return delegate().readFloat();
-    }
-
-    @Override
-    public final double readDouble() throws IOException {
-        return delegate().readDouble();
-    }
-
-    @Override
-    public final String readLine() throws IOException {
-        return delegate().readLine();
-    }
-
-    @Override
-    public final String readUTF() throws IOException {
-        return delegate().readUTF();
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ForwardingNormalizedNodeDataInput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ForwardingNormalizedNodeDataInput.java
deleted file mode 100644 (file)
index 72073c6..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import java.io.IOException;
-import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter;
-import org.opendaylight.yangtools.yang.data.api.schema.stream.ReusableStreamReceiver;
-import org.opendaylight.yangtools.yang.model.api.SchemaPath;
-
-abstract class ForwardingNormalizedNodeDataInput extends ForwardingDataInput implements NormalizedNodeDataInput {
-
-    @Override
-    abstract @NonNull NormalizedNodeDataInput delegate() throws IOException;
-
-    @Override
-    public final void streamNormalizedNode(final NormalizedNodeStreamWriter writer) throws IOException {
-        delegate().streamNormalizedNode(writer);
-    }
-
-    @Override
-    public final NormalizedNode<?, ?> readNormalizedNode() throws IOException {
-        return delegate().readNormalizedNode();
-    }
-
-    @Override
-    public final NormalizedNode<?, ?> readNormalizedNode(final ReusableStreamReceiver receiver) throws IOException {
-        return delegate().readNormalizedNode(receiver);
-    }
-
-    @Override
-    public final YangInstanceIdentifier readYangInstanceIdentifier() throws IOException {
-        return delegate().readYangInstanceIdentifier();
-    }
-
-    @Override
-    public final QName readQName() throws IOException {
-        return delegate().readQName();
-    }
-
-    @Override
-    public final PathArgument readPathArgument() throws IOException {
-        return delegate().readPathArgument();
-    }
-
-    @Override
-    public final SchemaPath readSchemaPath() throws IOException {
-        return delegate().readSchemaPath();
-    }
-
-    @Override
-    public final NormalizedNodeStreamVersion getVersion() throws IOException {
-        return delegate().getVersion();
-    }
-}
index 2099e3d..5d83d51 100644 (file)
@@ -14,7 +14,10 @@ import java.io.IOException;
  * valid serialized data.
  *
  * @author Thomas Pantelis
+ * @deprecated Use {@link org.opendaylight.yangtools.yang.data.codec.binfmt.InvalidNormalizedNodeStreamException}
+ *             instead.
  */
+@Deprecated(forRemoval = true)
 public class InvalidNormalizedNodeStreamException extends IOException {
     private static final long serialVersionUID = 1L;
 
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNode.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNode.java
deleted file mode 100644 (file)
index fbc2fe8..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-/**
- * Stream constants identifying individual node types.
- */
-final class LithiumNode {
-    static final byte LEAF_NODE = 1;
-    static final byte LEAF_SET = 2;
-    static final byte LEAF_SET_ENTRY_NODE = 3;
-    static final byte CONTAINER_NODE = 4;
-    static final byte UNKEYED_LIST = 5;
-    static final byte UNKEYED_LIST_ITEM = 6;
-    static final byte MAP_NODE = 7;
-    static final byte MAP_ENTRY_NODE = 8;
-    static final byte ORDERED_MAP_NODE = 9;
-    static final byte CHOICE_NODE = 10;
-    static final byte AUGMENTATION_NODE = 11;
-    static final byte ANY_XML_NODE = 12;
-    static final byte END_NODE = 13;
-    static final byte ORDERED_LEAF_SET = 14;
-    static final byte YANG_MODELED_ANY_XML_NODE = 15;
-
-    private LithiumNode() {
-        throw new UnsupportedOperationException("utility class");
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNormalizedNodeInputStreamReader.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNormalizedNodeInputStreamReader.java
deleted file mode 100755 (executable)
index 871f371..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import com.google.common.base.Strings;
-import java.io.DataInput;
-import java.io.IOException;
-import org.opendaylight.controller.cluster.datastore.node.utils.QNameFactory;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-
-/**
- * Lithium (or Oxygen really) specialization of AbstractLithiumDataInput.
- */
-final class LithiumNormalizedNodeInputStreamReader extends AbstractLithiumDataInput {
-    LithiumNormalizedNodeInputStreamReader(final DataInput input) {
-        super(input);
-    }
-
-    @Override
-    public NormalizedNodeStreamVersion getVersion() {
-        return NormalizedNodeStreamVersion.LITHIUM;
-    }
-
-    @Override
-    public QName readQName() throws IOException {
-        // Read in the same sequence of writing
-        String localName = readCodedString();
-        String namespace = readCodedString();
-        String revision = Strings.emptyToNull(readCodedString());
-
-        return QNameFactory.create(localName, namespace, revision);
-    }
-
-    @Override
-    AugmentationIdentifier readAugmentationIdentifier() throws IOException {
-        return defaultReadAugmentationIdentifier();
-    }
-
-    @Override
-    NodeIdentifier readNodeIdentifier() throws IOException {
-        return new NodeIdentifier(readQName());
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNormalizedNodeOutputStreamWriter.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumNormalizedNodeOutputStreamWriter.java
deleted file mode 100644 (file)
index b14bc19..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import java.io.DataOutput;
-import java.io.IOException;
-import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
-
-/**
- * NormalizedNodeOutputStreamWriter will be used by distributed datastore to send normalized node in
- * a stream.
- * A stream writer wrapper around this class will write node objects to stream in recursive manner.
- * for example - If you have a ContainerNode which has a two LeafNode as children, then
- * you will first call
- * {@link #startContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)},
- * then will call
- * {@link #leafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, Object)} twice
- * and then, {@link #endNode()} to end container node.
- *
- * <p>Based on the each node, the node type is also written to the stream, that helps in reconstructing the object,
- * while reading.
- */
-final class LithiumNormalizedNodeOutputStreamWriter extends AbstractLithiumDataOutput {
-    LithiumNormalizedNodeOutputStreamWriter(final DataOutput output) {
-        super(output);
-    }
-
-    @Override
-    short streamVersion() {
-        return TokenTypes.LITHIUM_VERSION;
-    }
-
-    @Override
-    void writeQNameInternal(final QName qname) throws IOException {
-        defaultWriteQName(qname);
-    }
-
-    @Override
-    void writeModule(final QNameModule module) throws IOException {
-        defaultWriteModule(module);
-    }
-
-    @Override
-    void writeAugmentationIdentifier(final AugmentationIdentifier aid) throws IOException {
-        defaultWriteAugmentationIdentifier(aid);
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumPathArgument.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumPathArgument.java
deleted file mode 100644 (file)
index 660e0a7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
-
-final class LithiumPathArgument {
-    static final byte AUGMENTATION_IDENTIFIER = 1;
-    static final byte NODE_IDENTIFIER = 2;
-    static final byte NODE_IDENTIFIER_WITH_VALUE = 3;
-    static final byte NODE_IDENTIFIER_WITH_PREDICATES = 4;
-
-    private LithiumPathArgument() {
-        throw new UnsupportedOperationException("Utility class");
-    }
-
-    static byte getSerializablePathArgumentType(final PathArgument pathArgument) {
-        if (pathArgument instanceof NodeIdentifier) {
-            return NODE_IDENTIFIER;
-        } else if (pathArgument instanceof NodeIdentifierWithPredicates) {
-            return NODE_IDENTIFIER_WITH_PREDICATES;
-        } else if (pathArgument instanceof AugmentationIdentifier) {
-            return AUGMENTATION_IDENTIFIER;
-        } else if (pathArgument instanceof NodeWithValue) {
-            return NODE_IDENTIFIER_WITH_VALUE;
-        } else {
-            throw new IllegalArgumentException("Unknown type of PathArgument = " + pathArgument);
-        }
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumTokens.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumTokens.java
deleted file mode 100644 (file)
index 27241e9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-/**
- * Tokens related to Lithium/NeonSR2 encoding.
- */
-final class LithiumTokens {
-    /**
-     * The value is a reference to a previously-defined entity, typically through {@link #IS_STRING_VALUE}.
-     */
-    static final byte IS_CODE_VALUE = 1;
-    /**
-     * The value is a String, which needs to be kept memoized for the purposes for being referenced by
-     * {@link #IS_CODE_VALUE}.
-     */
-    static final byte IS_STRING_VALUE = 2;
-    /**
-     * The value is an explicit null.
-     */
-    static final byte IS_NULL_VALUE = 3;
-
-    private LithiumTokens() {
-
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumValue.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/LithiumValue.java
deleted file mode 100644 (file)
index cd118ea..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-final class LithiumValue {
-    // The String length threshold beyond which a String should be encoded as bytes
-    static final int STRING_BYTES_LENGTH_THRESHOLD = Short.MAX_VALUE / 4;
-
-    static final byte SHORT_TYPE = 1;
-    static final byte BYTE_TYPE = 2;
-    static final byte INT_TYPE = 3;
-    static final byte LONG_TYPE = 4;
-    static final byte BOOL_TYPE = 5;
-    static final byte QNAME_TYPE = 6;
-    static final byte BITS_TYPE = 7;
-    static final byte YANG_IDENTIFIER_TYPE = 8;
-    static final byte STRING_TYPE = 9;
-    static final byte BIG_INTEGER_TYPE = 10;
-    static final byte BIG_DECIMAL_TYPE = 11;
-    static final byte BINARY_TYPE = 12;
-    // Leaf nodes no longer allow null values. The "empty" type is now represented as
-    // org.opendaylight.yangtools.yang.common.Empty. This is kept for backwards compatibility.
-    @Deprecated
-    static final byte NULL_TYPE = 13;
-    static final byte STRING_BYTES_TYPE = 14;
-    static final byte EMPTY_TYPE = 15;
-
-    private LithiumValue() {
-        throw new UnsupportedOperationException("Utility class");
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumDataInput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumDataInput.java
deleted file mode 100644 (file)
index 74c8a69..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import java.io.DataInput;
-import java.io.IOException;
-import java.math.BigInteger;
-
-final class MagnesiumDataInput extends AbstractMagnesiumDataInput {
-    MagnesiumDataInput(final DataInput input) {
-        super(input);
-    }
-
-    @Override
-    public NormalizedNodeStreamVersion getVersion() {
-        return NormalizedNodeStreamVersion.MAGNESIUM;
-    }
-
-    @Override
-    BigInteger readBigInteger() throws IOException {
-        throw new InvalidNormalizedNodeStreamException("BigInteger coding is not supported");
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumDataOutput.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumDataOutput.java
deleted file mode 100644 (file)
index a438268..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import java.io.DataOutput;
-import java.io.IOException;
-import java.math.BigInteger;
-
-final class MagnesiumDataOutput extends AbstractMagnesiumDataOutput {
-    MagnesiumDataOutput(final DataOutput output) {
-        super(output);
-    }
-
-    @Override
-    short streamVersion() {
-        return TokenTypes.MAGNESIUM_VERSION;
-    }
-
-    @Override
-    void writeValue(final BigInteger value) throws IOException {
-        throw new IOException("BigInteger values are not supported");
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumNode.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumNode.java
deleted file mode 100644 (file)
index 30a35ab..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-/**
- * Magnesium encoding Node types. Encoded as a single byte, split as follows:
- * <pre>
- *   7 6 5 4 3 2 1 0
- *  +-+-+-+-+-+-+-+-+
- *  | P | A |  Type |
- *  +-+-+-+-+-+-+-+-+
- * </pre>
- * The fields being:
- * <ul>
- *   <li>Bits 7 and 6 (most significant): predicate presence. Only valid for NODE_MAP_ENTRY and NODE_LEAF</li>
- *   <li>Bits 5 and 4: addressing mode</li>
- *   <li>Bits 3-0 (least significant) node type</li>
- * </ul>
- */
-// TODO: restructure this into some concrete examples
-//- a leaf referencing a previously-encoded NodeIdentifier would take
-//6 bytes:
-//  (byte)    NodeTypes.LEAF_NODE
-//  (byte)    TokenTypes.IS_QNAME_CODE
-//  (int)     code value
-//where as new tokens can do that in as few as 2 bytes:
-//  (byte)    NodeType.(NODE_LEAF | ADDR_LOOKUP_1B)
-//  (byte)    code value
-//with worst-case being 5 bytes:
-//  (byte)    NodeType.(NODE_LEAF | ADDR_LOOKUP_4B)
-//  (int)     code value
-//- a map entry node referencing previously-encoded QNames and a single
-//predicate would take a base of 15 bytes (not counting value object):
-//  (byte)    NodeTypes.MAP_ENTRY_NODE
-//  (byte)    TokenTypes.IS_QNAME_CODE
-//  (int)     code value
-//  (int)     size of predicates
-//  (byte)    TokenTypes.IS_QNAME_CODE
-//  (int)     code value
-//whereas new tokens can do that in as few as 3 bytes:
-//  (byte)    NodeType.(NODE_MAP_ENTRY | ADDR_LOOKUP_1B | PREDICATE_ONE)
-//  (byte)    code value
-//  (byte)    code value
-//this ability is maintained for up to 255 predicates with:
-//  (byte)    NodeType.(NODE_MAP_ENTRY | ADDR_LOOKUP_1B | PREDICATE_1B)
-//  (byte)    code value
-//  (byte)    size of predicates
-//  (byte)    code value [0-255]
-//- a leaf representing a key inside a map entry has the ability to skip
-//value encoding by being as simple as:
-//  (byte)    NodeTYpe.(NODE_LEAF | ADDR_LOOKUP_1B | PREDICATE_ONE)
-//  (byte)    code value
-//
-final class MagnesiumNode {
-    /**
-     * End of node marker. Does not support addressing modes.
-     */
-    static final byte NODE_END             = 0x00; // N/A
-    /**
-     * A leaf node. Encoding can specify {@link #PREDICATE_ONE}, which indicates the value is skipped as the encoder
-     * has emitted a parent MapNode, whose identifier contains the value.
-     */
-    static final byte NODE_LEAF            = 0x01;
-    static final byte NODE_CONTAINER       = 0x02;
-    static final byte NODE_LIST            = 0x03;
-    static final byte NODE_MAP             = 0x04;
-    static final byte NODE_MAP_ORDERED     = 0x05;
-    static final byte NODE_LEAFSET         = 0x06;
-    static final byte NODE_LEAFSET_ORDERED = 0x07;
-    static final byte NODE_CHOICE          = 0x08;
-    static final byte NODE_AUGMENTATION    = 0x09;
-    static final byte NODE_ANYXML          = 0x0A;
-    static final byte NODE_LIST_ENTRY      = 0x0B;
-    static final byte NODE_LEAFSET_ENTRY   = 0x0C;
-    static final byte NODE_MAP_ENTRY       = 0x0D;
-
-    // TODO: either implement or remove this coding. While Lithium has emit code, it lacks the code do read such nodes,
-    //       which most probably means we do not need to bother ...
-    static final byte NODE_ANYXML_MODELED  = 0x0E;
-    // 0x0F reserved for anydata
-    static final byte TYPE_MASK            = 0x0F;
-
-
-    /**
-     * Inherit identifier from parent. This addressing mode is applicable in:
-     * <ul>
-     *   <li>{@link #NODE_END}, where an identifier is not applicable
-     *   <li>{@link #NODE_LIST_ENTRY}, where the NodeIdentifier is inherited from parent {@link #NODE_LIST}</li>
-     *   <li>{@link #NODE_MAP_ENTRY}, where the NodeIdentifier is inherited from parent {@link #NODE_MAP} or
-     *       {@link #NODE_MAP_ORDERED}</li>
-     *   <li>{@link #NODE_LEAFSET_ENTRY}, where the QName inherited from parent and the value is inferred from the
-     *       next {@link MagnesiumValue} encoded</li>
-     * </ul>
-     */
-    static final byte ADDR_PARENT     = 0x00;
-    /**
-     * Define a new QName-based identifier constant. For {@link #NODE_AUGMENTATION} this is a set of QNames. Assign
-     * a new linear key to this constant.
-     */
-    static final byte ADDR_DEFINE     = 0x10;
-    /**
-     * Reference a previously {@link #ADDR_DEFINE}d identifier constant. This node byte is followed by an unsigned
-     * byte, which holds the linear key previously defined (i.e. 0-255).
-     */
-    static final byte ADDR_LOOKUP_1B  = 0x20;
-    /**
-     * Reference a previously {@link #ADDR_DEFINE}d identifier constant. This node byte is followed by a signed int,
-     * which holds the linear key previously defined.
-     */
-    static final byte ADDR_LOOKUP_4B  = 0x30;
-    static final byte ADDR_MASK       = ADDR_LOOKUP_4B;
-
-    /**
-     * Predicate encoding: no predicates are present in a {@link #NODE_MAP_ENTRY}.
-     */
-    static final byte PREDICATE_ZERO = 0x00;
-
-    /**
-     * Predicate encoding: a single predicate is present in a {@link #NODE_MAP_ENTRY}. In case of {@link #NODE_LEAF}
-     * encoded as part of a {@link #NODE_MAP_ENTRY} this bit indicates the <strong>value</strong> is not encoded and
-     * should be looked up from the map entry's predicates.
-     *
-     * <p>
-     * The predicate is encoded as a {@link #ADDR_DEFINE} or {@link #ADDR_LOOKUP_1B}/{@link #ADDR_LOOKUP_4B},
-     * followed by an encoded {@link MagnesiumValue}.
-     */
-    static final byte PREDICATE_ONE   = 0x40;
-
-    /**
-     * Predicate encoding: 0-255 predicates are present, as specified by the following {@code unsigned byte}. This
-     * encoding is expected to be exceedingly rare. This should not be used to encode 0 or 1 predicate, those cases
-     * should be encoded as:
-     * <ul>
-     *   <li>no PREDICATE_* set when there are no predicates (probably not valid anyway)</li>
-     *   <li><{@link #PREDICATE_ONE} if there is only one predicate</li>
-     * </ul>
-     */
-    static final byte PREDICATE_1B    = (byte) 0x80;
-
-    /**
-     * Predicate encoding 0 - {@link Integer#MAX_VALUE} predicates are present, as specified by the following
-     * {@code int}. This should not be used where 0-255 predicates are present.
-     */
-    static final byte PREDICATE_4B    = (byte) (PREDICATE_ONE | PREDICATE_1B);
-    static final byte PREDICATE_MASK  = PREDICATE_4B;
-
-    private MagnesiumNode() {
-
-    }
-}
\ No newline at end of file
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumPathArgument.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumPathArgument.java
deleted file mode 100644 (file)
index e1022e0..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-/**
- * Path Argument types used in Magnesium encoding. These are encoded as a single byte, three bits of which are reserved
- * for PathArgument type itself:
- * <pre>
- *   7 6 5 4 3 2 1 0
- *  +-+-+-+-+-+-+-+-+
- *  |         | Type|
- *  +-+-+-+-+-+-+-+-+
- * </pre>
- * There are five type defined:
- * <ul>
- *   <li>{@link #AUGMENTATION_IDENTIFIER}, which additionally holds the number of QName elements encoded:
- *     <pre>
- *        7 6 5 4 3 2 1 0
- *       +-+-+-+-+-+-+-+-+
- *       |  Count  |0 0 0|
- *       +-+-+-+-+-+-+-+-+
- *     </pre>
- *     Where count is coded as an unsigned integer, with {@link #AID_COUNT_1B} and {@link #AID_COUNT_2B} and
- *     {@link #AID_COUNT_4B} indicating extended coding with up to 4 additional bytes. This byte is followed by
- *     {@code count} {@link MagnesiumValue} QNames.
- *     <pre>
- *       7 6 5 4 3 2 1 0
- *      +-+-+-+-+-+-+-+-+
- *      |0 0 0| Q |0 0 1|
- *      +-+-+-+-+-+-+-+-+
- *     </pre>
- *     Where QName coding is achieved via {@link #QNAME_DEF}, {@link #QNAME_REF_1B}, {@link #QNAME_REF_2B} and
- *     {@link #QNAME_REF_4B}.
- *   </li>
- *   <li>{@link #NODE_IDENTIFIER_WITH_PREDICATES}, which encodes a QName same way NodeIdentifier does:
- *     <pre>
- *       7 6 5 4 3 2 1 0
- *      +-+-+-+-+-+-+-+-+
- *      | Size| Q |0 1 0|
- *      +-+-+-+-+-+-+-+-+
- *      </pre>
- *      but additionally encodes number of predicates contained using {@link #SIZE_0} through {@link #SIZE_4}. If that
- *      number cannot be expressed, {@link #SIZE_1B}, {@value #SIZE_2B} and {@link #SIZE_4B} indicate number and format
- *      of additional bytes that hold number of predicates.
- *
- *      <p>
- *      This is then followed by the specified number of QName/Object key/value pairs based on {@link MagnesiumValue}
- *      encoding.
- *   </li>
- *   <li>{@link #NODE_WITH_VALUE}, which encodes a QName same way NodeIdentifier does:
- *     <pre>
- *       7 6 5 4 3 2 1 0
- *      +-+-+-+-+-+-+-+-+
- *      |0 0 0| Q |0 1 1|
- *      +-+-+-+-+-+-+-+-+
- *     </pre>
- *     but is additionally followed by a single encoded value, as per {@link MagnesiumValue}.
- *   </li>
- *   <li>{@link #MOUNTPOINT_IDENTIFIER}, which encodes a QName same way NodeIdentifier does:
- *     <pre>
- *       7 6 5 4 3 2 1 0
- *      +-+-+-+-+-+-+-+-+
- *      |0 0 0| Q |1 0 0|
- *      +-+-+-+-+-+-+-+-+
- *     </pre>
- *   </li>
- * </ul>
- */
-final class MagnesiumPathArgument {
-    // 3 bits reserved for type...
-    static final byte AUGMENTATION_IDENTIFIER         = 0x00;
-    static final byte NODE_IDENTIFIER                 = 0x01;
-    static final byte NODE_IDENTIFIER_WITH_PREDICATES = 0x02;
-    static final byte NODE_WITH_VALUE                 = 0x03;
-    static final byte MOUNTPOINT_IDENTIFIER           = 0x04;
-
-    // ... leaving three values currently unused
-    // 0x05 reserved
-    // 0x06 reserved
-    // 0x07 reserved
-
-    static final byte TYPE_MASK                       = 0x07;
-
-    // In case of AUGMENTATION_IDENTIFIER, top 5 bits are used to encode the number of path arguments, except last three
-    // values. This means that up to AugmentationIdentifiers with up to 28 components have this length encoded inline,
-    // otherwise we encode them in following 1 (unsigned), 2 (unsigned) or 4 (signed) bytes
-    static final byte AID_COUNT_1B                    = (byte) 0xE8;
-    static final byte AID_COUNT_2B                    = (byte) 0xF0;
-    static final byte AID_COUNT_4B                    = (byte) 0xF8;
-    static final byte AID_COUNT_MASK                  = AID_COUNT_4B;
-    static final byte AID_COUNT_SHIFT                 = 3;
-
-    // For normal path path arguments we can either define a QName reference or follow a 1-4 byte reference.
-    static final byte QNAME_DEF                       = 0x00;
-    static final byte QNAME_REF_1B                    = 0x08; // Unsigned
-    static final byte QNAME_REF_2B                    = 0x10; // Unsigned
-    static final byte QNAME_REF_4B                    = 0x18; // Signed
-    static final byte QNAME_MASK                      = QNAME_REF_4B;
-
-    // For NodeIdentifierWithPredicates we also carry the number of subsequent path arguments. The case of 0-4 arguments
-    // is indicated directly, otherwise there is 1-4 bytes carrying the reference.
-    static final byte SIZE_0                          = 0x00;
-    static final byte SIZE_1                          = 0x20;
-    static final byte SIZE_2                          = 0x40;
-    static final byte SIZE_3                          = 0x60;
-    static final byte SIZE_4                          = (byte) 0x80;
-    static final byte SIZE_1B                         = (byte) 0xA0;
-    static final byte SIZE_2B                         = (byte) 0xC0;
-    static final byte SIZE_4B                         = (byte) 0xE0;
-    static final byte SIZE_MASK                       = SIZE_4B;
-    static final byte SIZE_SHIFT                      = 5;
-
-    private MagnesiumPathArgument() {
-
-    }
-}
diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumValue.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/MagnesiumValue.java
deleted file mode 100644 (file)
index 403578d..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.controller.cluster.datastore.node.utils.stream;
-
-import java.io.DataOutput;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.common.Uint16;
-import org.opendaylight.yangtools.yang.common.Uint32;
-import org.opendaylight.yangtools.yang.common.Uint64;
-import org.opendaylight.yangtools.yang.common.Uint8;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-
-/**
- * Magnesium encoding value types. Serialized as a single byte.
- */
-/*
- * Note these constants are organized by their absolute value, which is slightly counter-intuitive when trying to make
- * sense of what is going on.
- *
- * TODO: create some sort of facility which would provide symbolic names for debugging and documentation purposes.
- */
-final class MagnesiumValue {
-    /**
-     * {@link Boolean#FALSE} value.
-     */
-    static final byte BOOLEAN_FALSE  = 0x00;
-    /**
-     * {@link Boolean#TRUE} value.
-     */
-    static final byte BOOLEAN_TRUE   = 0x01;
-    /**
-     * An {@link Empty} value.
-     */
-    static final byte EMPTY          = 0x02;
-    /**
-     * A Byte, followed by a byte holding the value.
-     */
-    static final byte INT8           = 0x03;
-    /**
-     * A Short, followed by a {@code short} holding the value.
-     */
-    static final byte INT16          = 0x04;
-    /**
-     * An Integer, followed by an {@code int} holding the value.
-     */
-    static final byte INT32          = 0x05;
-    /**
-     * A Long, followed by an {@code long} holding the value.
-     */
-    static final byte INT64          = 0x06;
-    /**
-     * A Uint8, followed by an {@code unsigned byte} holding the value.
-     */
-    static final byte UINT8          = 0x07;
-    /**
-     * A Uint16, followed by a {@code unsigned short} holding the value.
-     */
-    static final byte UINT16         = 0x08;
-    /**
-     * A Uint32, followed by an {@code unsigned int} holding the value.
-     */
-    static final byte UINT32         = 0x09;
-    /**
-     * A Uint64, followed by an {@code unsigned long} holding the value.
-     */
-    static final byte UINT64         = 0x0A;
-    /**
-     * A {@link String}, encoded through {@link DataOutput#writeUTF(String)}. Note this is generally true of any
-     * string with less then 16384 characters.
-     */
-    static final byte STRING_UTF     = 0x0B;
-    /**
-     * A {@link String}, encoded as an {@code unsigned short} followed by that many UTF8-encoded bytes.
-     */
-    static final byte STRING_2B      = 0x0C;
-    /**
-     * A {@link String}, encoded as an {@code int >= 0} followed by that many UTF8-encoded bytes.
-     */
-    static final byte STRING_4B      = 0x0D;
-    /**
-     * A {@link String}, encoded as an {@code int >= 0} followed by that many UTF16 characters, i.e. as produced by
-     * {@link DataOutput#writeChars(String)}.
-     */
-    static final byte STRING_CHARS   = 0x0E;
-    /**
-     * Utility 'reference coding' codepoint with {@code unsigned byte} offset. This is not a value type, but is used in
-     * context of various schema-related encodings like constant strings, QNameModule and similar.
-     */
-    static final byte STRING_REF_1B  = 0x0F;
-    /**
-     * Utility 'reference coding' codepoint with {@code unsigned short} offset. This is not a value type, but is used in
-     * context of various schema-related encodings like constant strings, QNameModule and similar.
-     */
-    static final byte STRING_REF_2B  = 0x10;
-    /**
-     * Utility 'reference coding' codepoint with {@code int} offset. This is not a value type, but is used in context of
-     * various schema-related encodings like constant strings, QNameModule and similar.
-     */
-    static final byte STRING_REF_4B  = 0x11;
-    /**
-     * A {@code byte[])}, encoded as a single {@code unsigned byte} followed by 128-383 bytes. Note that smaller
-     * arrays are encoded via {@link #BINARY_0} - {@link #BINARY_127} range.
-     */
-    static final byte BINARY_1B      = 0x12;
-    /**
-     * A {@code byte[])}, encoded as a single {@code unsigned short} followed by 384-65919 bytes. See also
-     * {@link #BINARY_1B}.