12 months agoRework PathArgumentTypes lookup 90/84090/19
Robert Varga [Fri, 30 Aug 2019 09:08:37 +0000 (11:08 +0200)]
Rework PathArgumentTypes lookup

This lookup relying on final methods, which is not a correct
assumption, with NodeIdentifierWithPredicates having at least two
properly-hidden implementations.

Rework the lookup in terms of instanceof checks, which saves a table
lookup and unboxing operation.

Change-Id: Ia6b272715d19e432e7e0839b6294035e12b1d293
Signed-off-by: Robert Varga <>
12 months agoAdd more serialization assertions 22/84622/3
Robert Varga [Mon, 23 Sep 2019 06:23:29 +0000 (08:23 +0200)]
Add more serialization assertions

This adds a few more assertions to ensure our serialization format
does not move without us knowing.

Change-Id: Ieed326e9e57fb15ea46cd7a088d713222963e2e5
Signed-off-by: Robert Varga <>
12 months agoMove Neon SR2 tokens into its own class 63/84563/3
Robert Varga [Fri, 20 Sep 2019 17:42:15 +0000 (19:42 +0200)]
Move Neon SR2 tokens into its own class

Same as with base Lithium tokens, these can create confusion about
where they are used. Make sure we encapsulate them in their own
class, so no confusion ensues.

Change-Id: I197b9118a5d9a09562db0a899bb6b8dc0dfae28b
Signed-off-by: Robert Varga <>
12 months agoRename ValueTypes to LithiumValue 62/84562/3
Robert Varga [Fri, 20 Sep 2019 17:59:04 +0000 (19:59 +0200)]
Rename ValueTypes to LithiumValue

These constants are only used in Lithium-based streams, make sure
we reflect that in the name of the class, so they do not end up
being confused.

Change-Id: I2e880b825d82b8a9b76008248d7663eab4bc1d71
Signed-off-by: Robert Varga <>
12 months agoRename PathArgumentTypes to LithiumPathArgument 61/84561/3
Robert Varga [Fri, 20 Sep 2019 17:55:39 +0000 (19:55 +0200)]
Rename PathArgumentTypes to LithiumPathArgument

These tokens are only used in Lithium-based streams, but the global
name is slightly confusing. Rename to LithiumPathArgument, which
makes the context more obvious.

Change-Id: I2b92be4c469de8dffba6e071449b5ae947b9ace8
Signed-off-by: Robert Varga <>
12 months agoRename NodeTypes to LithiumNode 60/84560/3
Robert Varga [Fri, 20 Sep 2019 17:54:04 +0000 (19:54 +0200)]
Rename NodeTypes to LithiumNode

This makes it clear these constants are only used in Lithium

Change-Id: I1fb44f49d3409fdd007fe58dc6ce92b0eb6744b8
Signed-off-by: Robert Varga <>
12 months agoMove Lithium tokens to their own class 59/84559/3
Robert Varga [Fri, 20 Sep 2019 17:36:10 +0000 (19:36 +0200)]
Move Lithium tokens to their own class

TokenTypes assumes singularity, which can create confusion, as we
have multiple multiple distinct sets. This separates out
Lithium-specific tokens into their own class.

Change-Id: Id8c47be7c432b44980dbeac8ef41d430c64e5490
Signed-off-by: Robert Varga <>
12 months agoMigrate from YangInstanceIdentifier.EMPTY 91/84091/17
Robert Varga [Fri, 30 Aug 2019 09:10:53 +0000 (11:10 +0200)]
Migrate from YangInstanceIdentifier.EMPTY

This migrates to the replacement empty() method.

Change-Id: I32ca026a33835edb16f8e1e6142e9192c880076b
Signed-off-by: Robert Varga <>
12 months agoBump mdsal to 4.0.6 20/84420/7
Robert Varga [Fri, 13 Sep 2019 18:56:56 +0000 (20:56 +0200)]
Bump mdsal to 4.0.6

This picks up latest fixes.

Change-Id: I64e1f277bd00e132f40647eb0a2e7fc00eb56705
Signed-off-by: Robert Varga <>
12 months agoBump yangtools to 3.0.5 85/84385/8
Robert Varga [Fri, 13 Sep 2019 14:13:53 +0000 (16:13 +0200)]
Bump yangtools to 3.0.5

This picks up the latest fixes and improvements.

Change-Id: Icb9c44cd6f8206e78e7d50322dde3356405721c8
Signed-off-by: Robert Varga <>
12 months agoBump odlparent to 5.0.2 01/83801/24
Robert Varga [Tue, 20 Aug 2019 13:59:12 +0000 (15:59 +0200)]
Bump odlparent to 5.0.2

This bumps odlparent to pick up latest references.

Change-Id: I73af7ad69f686cb5bacc6ccfe0f57d226a43994b
Signed-off-by: Robert Varga <>
12 months agoAdd a 100K-entry test 52/84552/2
Robert Varga [Thu, 19 Sep 2019 21:59:24 +0000 (23:59 +0200)]
Add a 100K-entry test

This adds a test for serialization of a Map of 100K entries,
each of which has the key leaf and a simple constant non-key leaf.
Unlike other tests, this quantifies how well the encoding works
when faced with large maps.

Change-Id: I306e5175ba595a0967432393766f8317e7205492
Signed-off-by: Robert Varga <>
12 months agoAdd encoding size asserts 50/84550/1
Robert Varga [Thu, 19 Sep 2019 19:20:16 +0000 (21:20 +0200)]
Add encoding size asserts

There is a number of places where we check serialize/deserialize
operations through ByteArrayOutputStream. In order to check stability
(and evolution) of our serialization formats, it is useful to check
the sizes of the intermediate bytes.

Change-Id: I171894ba3791245a53fe39c2d3238d2341d8ffc4
Signed-off-by: Robert Varga <>
12 months agoSeparate out AbstractNormalizedNodeDataInput 14/84514/2
Robert Varga [Tue, 17 Sep 2019 21:35:14 +0000 (23:35 +0200)]
Separate out AbstractNormalizedNodeDataInput

As we are going to introduce a streaming format for Magnesium, which
uses very different token set, it is convenient to have a common
base class which does not have conotations about what the tokens are.

We provide a baseline counterpart to AbstractNormalizedNodeDataOutput
and base AbstractLithiumDataInput on it. The asymmetry of
writeYangInstanceIdentifier() is fixed by moving it to

Change-Id: I55d318349f2c89508f3834c8ca5b69e69b7171b1
Signed-off-by: Robert Varga <>
12 months agoAdd @SupressFBWarnings around Await.result() 31/84431/4
Robert Varga [Sat, 14 Sep 2019 06:27:19 +0000 (08:27 +0200)]
Add @SupressFBWarnings around Await.result()

Await.result() is throwing Exceptions we need to catch, raising
the ire of SpotBugs. Suppress that.

Change-Id: I1a880c86a8ab1759c5741dd27c8341d89452c7e8
Signed-off-by: Robert Varga <>
12 months agoMake sure we know the version we encountered 12/84512/1
Robert Varga [Wed, 18 Sep 2019 00:11:23 +0000 (02:11 +0200)]
Make sure we know the version we encountered

Hitting this exception is not providing sufficent detail as to
what the proposed version is. Add that information.

Change-Id: I44662e904774b636b351beb4c6b1f218e84f8ada
Signed-off-by: Robert Varga <>
12 months agoLost commit index when a snapshot is captured 21/83421/5
Tomas Cere [Tue, 6 Aug 2019 11:46:32 +0000 (13:46 +0200)]
Lost commit index when a snapshot is captured

When we have no journals and a snapshot is recovered and
immediately captured again, if there was no movement in the
datastore we loose the lastIndex and term from the previous snapshot.
We can safely reuse these from the previous snapshot when no
entry is present in the ReplicatedLog.

Change-Id: Iaeb71edc7ec865bec18dbcb436af76e592eea69d
Signed-off-by: Tomas Cere <>
Signed-off-by: Robert Varga <>
12 months agoOptimize anyxml output 44/84344/1
Robert Varga [Thu, 12 Sep 2019 15:33:59 +0000 (17:33 +0200)]
Optimize anyxml output

We do not need to instantiate a new factory every time we perform
encoding, keep the factory as a shared constant.

Change-Id: Ideff56076a1516784cd82f67438e5b740c4d3eeb
Signed-off-by: Robert Varga <>
12 months agoMove Lithium-specific logic from AbstractNormalizedNodeDataOutput 32/84332/5
Robert Varga [Wed, 11 Sep 2019 20:09:49 +0000 (22:09 +0200)]
Move Lithium-specific logic from AbstractNormalizedNodeDataOutput

The binding to TokenTypes and co. are really part of
AbstractLithiumDataOutput, as different serialization streams
versions can use completely different tokens and sizing.

Change-Id: I703c1da26ee2f99dee406e4de26db702beb05a06
Signed-off-by: Robert Varga <>
12 months agoRemove ensureHeaderWritten() from writeNode() 29/84329/2
Robert Varga [Wed, 11 Sep 2019 20:05:19 +0000 (22:05 +0200)]
Remove ensureHeaderWritten() from writeNode()

This updates documentation of AbstractNormalizedNodeDataOutput
to make it clear that the NormalizedNodeStreamWriter aspect of
it is an implementation detail and that the stream has been
header-initialized by the time any of those methods are called.

The clarification renders calling ensureHeaderWritten() from
writeNode() superfluous, as at that point it is guaranteed to
be a no-op.

Change-Id: I85a5c1304849fe5bc737fa51bd4b40ff2dd8c08c
Signed-off-by: Robert Varga <>
12 months agoReorganize AbstractNormalizedNodeDataOutput 27/84327/2
Robert Varga [Wed, 11 Sep 2019 15:44:47 +0000 (17:44 +0200)]
Reorganize AbstractNormalizedNodeDataOutput

This reorganizes AbstractNormalizedNodeDataOutput so that it
implements all NormalizedNodeDataOutput with final methods,
deferring implementation as need to abstract methods.

This way we have precisely one implementation of public methods,
making it easy to audit for correctness. Furthermore it eliminates
writeAugmentationIdentifier() override in NeonSR2 writer.

It also introduces writeQNameInternal(), which skips header checks,
as the call sites have already performed those checks.

Change-Id: Icb4a7e994c04e3d52bd561d99c7743dfdfd88738
Signed-off-by: Robert Varga <>
12 months agoSplit out AbstractLithiumDataInput 72/84272/5
Robert Varga [Sun, 8 Sep 2019 18:26:18 +0000 (20:26 +0200)]
Split out AbstractLithiumDataInput

This splits out AbstractLithiumDataInput and disconnects Lithium
and NeonSR2 reader implementations. This allows Neon SR2 to be loaded
without Lithium, thus reducing the number of actual possible
implementations at runtime.

Change-Id: I90863c342d7bbea4946fd27d25dfb822efb4ed6e
Signed-off-by: Robert Varga <>
12 months agoCleanup PathArgumentTypes 23/84323/2
Robert Varga [Wed, 11 Sep 2019 13:09:13 +0000 (15:09 +0200)]
Cleanup PathArgumentTypes

Do not use long qualifiers for individual types, preferring
importing them. Also drop public modifiers, as this class is
package-private. Finally import static checkArgument().

Change-Id: I267d0f5675911b2d9990e8f7c3fdd49265c10d8b
Signed-off-by: Robert Varga <>
12 months agoAbstractNormalizedNodeDataOutput fails to write out header 24/84324/1
Robert Varga [Wed, 11 Sep 2019 14:06:59 +0000 (16:06 +0200)]
AbstractNormalizedNodeDataOutput fails to write out header

In case AbstractNormalizedNodeDataOutput is used in a way, where
NormalizedNodeDataOutput.writePathArgument() is the first method
invoked, the stream header would not be output, leading to it
being unreadable.

Change-Id: I4ababb360129b2ef673d0546333599dd10fbdd9e
Signed-off-by: Robert Varga <>
12 months agoTighten AbstractLithiumDataOutput.writeString() 69/84269/2
Robert Varga [Sat, 7 Sep 2019 09:55:28 +0000 (11:55 +0200)]
Tighten AbstractLithiumDataOutput.writeString()

We can only ever pass nulls from Revision encoding, refactor to
make that clear (and enforced) in code. This more clearly defines
the context of TokenTypes.IS_NULL_VALUE and where it can be emitted.

Change-Id: I14045c9fc3eaf04b4bde858d322de45d3160de26
Signed-off-by: Robert Varga <>
12 months agoRemove NormalizedNodeOutputStreamWriter 68/84268/1
Robert Varga [Sat, 7 Sep 2019 09:22:39 +0000 (11:22 +0200)]
Remove NormalizedNodeOutputStreamWriter

This class is tied to NeonSR2 serialization format through subclassing,
where it really is a package-private detail. This leads to two concrete
classes being in existence for a particular format, which simply does
not make sense.

Eliminating this subclass allows us to make Neon SR2 final, thus arriving
and monomorphic or bimorphic invocation of all methods based on whether
we have seen Lithium (well, Oxygen) format at runtime.

Change-Id: I9e0463ec4879900e82cf757006dccfdbeb0d7297
Signed-off-by: Robert Varga <>
12 months agoDisconnect {Lithium,NeonSR2} implementations 67/84267/2
Robert Varga [Sat, 7 Sep 2019 07:54:32 +0000 (09:54 +0200)]
Disconnect {Lithium,NeonSR2} implementations

We will need to define two new serialization formats: one
sharing object value serialization (for NeonSR3) and one
disconnected from it (for Magnesium).

In order to maintain scalability with so many formats, we want
to avoid JIT considering implementations which were not referenced
at runtime. This should make CHA and method dispatch more

Since we are isolating things, we also pull ValueTypes lookups
and keep it in the same class for easier understanding.

Change-Id: I3db4e9633db4a75016e17ac31bb38452bcb9f42a
Signed-off-by: Robert Varga <>
12 months agoLower ValueTypes constant visibility 66/84266/1
Robert Varga [Sat, 7 Sep 2019 07:01:43 +0000 (09:01 +0200)]
Lower ValueTypes constant visibility

This is a package-private class, hence 'public' is superfluous.

Change-Id: I4dd03b3ff1ae0cc4cc11f823cbd9538e6932d6b3
Signed-off-by: Robert Varga <>
12 months agoFixup chunk offset movement on resend 17/83317/7
Tomas Cere [Tue, 30 Jul 2019 09:48:06 +0000 (11:48 +0200)]
Fixup chunk offset movement on resend

Since we are moving the offset backwards on failures, it doesnt
matter whether we have seen a failure or success when incrementing
offset. We always need to move it to indicate a chunk is in flight,
otherwise canSendNextChunk() will allow us to send the same chunk
again and again even when it is already inflight.

Change-Id: If5dfd1913bda4328c5dfab0869f2df697bbd3cfc
Signed-off-by: Tomas Cere <>
12 months agoClean up opendaylight-inventory model 10/84210/2
Robert Varga [Thu, 5 Sep 2019 06:52:10 +0000 (08:52 +0200)]
Clean up opendaylight-inventory model

This is just a formatting change, cleaning up descriptions and

Change-Id: I2757280371851e2586221b01de143e8b987ed1ad
Signed-off-by: Robert Varga <>
12 months agoRevert "Bug 3871: Deprecate opendaylight-inventory model." 09/84209/2
Robert Varga [Thu, 5 Sep 2019 06:34:00 +0000 (08:34 +0200)]
Revert "Bug 3871: Deprecate opendaylight-inventory model."

This reverts commit 973bde38d5f02b4e65f20363ef03d17587433a21,
as the migration is not coming along and deprecated constructs
are causing massive number of warnings, hiding more important

Change-Id: I1e3d27374ffba0e584f194d468cebcfa9cecfe81
Signed-off-by: Robert Varga <>
12 months agoFix checkstyle/spotbugs violations 64/84164/1
Robert Varga [Tue, 3 Sep 2019 07:34:01 +0000 (09:34 +0200)]
Fix checkstyle/spotbugs violations

Enabling checkstyle/spotbugs by default finds these, fix them up.

Change-Id: Ib407830f0a15cb4c04492f3c694fb463cdb30bad
Signed-off-by: Robert Varga <>
13 months agoCleanup ValueTypes lookup 36/84036/1
Robert Varga [Wed, 28 Aug 2019 12:56:04 +0000 (14:56 +0200)]
Cleanup ValueTypes lookup

Change type of TYPES to ImmutableMap, so we are binding to a concrete
class when looking up. Also clean up initialization to follow fluent
builder pattern.

Finally inline requireNonNull() call into the invocation, so that its
return value is not wasted.

Change-Id: I4487bd43232131ca548441f4c8901a8c5dc60efa
Signed-off-by: Robert Varga <>
13 months agoDeduplicate MapNode key leaf values 98/83998/9
Robert Varga [Mon, 26 Aug 2019 20:44:30 +0000 (22:44 +0200)]
Deduplicate MapNode key leaf values

When we are encountering a leaf node inside a MapEntryNode, it can
be a leaf corresponding to a key -- in which case its value is
already present in NodeIdentifierWithPredicates and we do want to
de-duplicate those objects.

Change-Id: I2ed65c311f9921aa77c9f23bd1f7681d7f11355a
Signed-off-by: Robert Varga <>
13 months agoMove common code to startNode() 08/84008/4
Robert Varga [Tue, 27 Aug 2019 09:34:34 +0000 (11:34 +0200)]
Move common code to startNode()

We are duplicating null checks in all entrypoints which lead to
startNode(). We can centralize these in startNode(), leading to
denser code and fixing Sonar warnings.

Change-Id: I3f2a0c53216179e9d25624a3e3139340eff551fa
Signed-off-by: Robert Varga <>
13 months agoRename SodiumNormalizedNode* classes 01/84001/2
Robert Varga [Mon, 26 Aug 2019 22:08:05 +0000 (00:08 +0200)]
Rename SodiumNormalizedNode* classes

These are implementing Neon SR2 serialization format, hence they
should be named as such.

Change-Id: Iaa509e3490b420b8005a2724105bf99b53d95cf2
Signed-off-by: Robert Varga <>
13 months agoDrop public modifier from NodeTypes 99/83999/2
Robert Varga [Mon, 26 Aug 2019 21:17:51 +0000 (23:17 +0200)]
Drop public modifier from NodeTypes

The class itself is not visible outside of the package, there is no
point to declare the constants as public.

Change-Id: I4136a71c538452aba33a5abb3337e0f8fc7e8da8
Signed-off-by: Robert Varga <>
13 months agoRestore javassist dependency for tests 08/83908/1
Stephen Kitt [Thu, 22 Aug 2019 14:02:54 +0000 (16:02 +0200)]
Restore javassist dependency for tests

It’s still used in BindingBrokerTestFactory.

Change-Id: Id162dcc1c45b776644888a7bd4d0c7f603f1216f
Signed-off-by: Stephen Kitt <>
13 months agoReduce reliance on Guava Fuction/Supplier 40/83840/4
Robert Varga [Wed, 21 Aug 2019 08:55:57 +0000 (10:55 +0200)]
Reduce reliance on Guava Fuction/Supplier

We have JDK8+ equivalents, use those instead.

Change-Id: I3796c993cc7c13d3a278e1ffdffce03801be21e7
Signed-off-by: Robert Varga <>
13 months agoFix modernization issues 32/83832/8
Robert Varga [Tue, 20 Aug 2019 19:06:59 +0000 (21:06 +0200)]
Fix modernization issues

This fixes issues pointed out by Modernizer, which mostly boil
down to using Objects.requireNonNull() and direct java.util

Change-Id: Id32530a6722cd101f96c23f6a745f91b2f09e2f9
Signed-off-by: Robert Varga <>
13 months agoFinal bits of NodeIdentifier migration 47/83847/1
Robert Varga [Wed, 21 Aug 2019 10:33:36 +0000 (12:33 +0200)]
Final bits of NodeIdentifier migration

This picks up the last two callers of getKeyValues() and migrates
them to using asMap().

Change-Id: Ibb8ca4cd2ba0d97ff938d34b7e88afea213b0596
Signed-off-by: Robert Varga <>
13 months agoAnother round of checkstyle fixes 46/83846/1
Robert Varga [Wed, 21 Aug 2019 09:40:15 +0000 (11:40 +0200)]
Another round of checkstyle fixes

This fixes failures reported by upgraded checkstyle, as well as
some non-enforced violations.

Change-Id: I8b6a9667c6586bef528587d455f7a8597b4f483f
Signed-off-by: Robert Varga <>
13 months agoMigrate away from Throwables.propagate() 35/83835/2
Robert Varga [Tue, 20 Aug 2019 22:31:55 +0000 (00:31 +0200)]
Migrate away from Throwables.propagate()

This method has been deprecated, move off of it.

Change-Id: Ida34fb165dad1c0cf1786c773325e077de53a4c2
Signed-off-by: Robert Varga <>
13 months agoMove createProxy() 34/83834/2
Robert Varga [Tue, 20 Aug 2019 20:56:26 +0000 (22:56 +0200)]
Move createProxy()

This is a simple internal method, inline it.

Change-Id: I5568f95f31c2487441fb19dbf3d33e02de5ada2a
Signed-off-by: Robert Varga <>
13 months agoMove DataNormalizationOperation methods 30/83830/3
Robert Varga [Tue, 20 Aug 2019 19:20:55 +0000 (21:20 +0200)]
Move DataNormalizationOperation methods

Some these are not use in the base class, move them closer to their

Change-Id: I09a09946fb0b96ba0d2b291f74613b7f82566f41
Signed-off-by: Robert Varga <>
13 months agoMigrate NodeIdentifierWithPredicates.getKeyValues() 29/83829/3
Robert Varga [Tue, 20 Aug 2019 19:17:57 +0000 (21:17 +0200)]
Migrate NodeIdentifierWithPredicates.getKeyValues()

Change-Id: Iea47db72483111eea40374c23d7be0da33f67728
Signed-off-by: Robert Varga <>
13 months agoRefactor AbstractBrokerAwareActivator 31/83831/3
Robert Varga [Tue, 20 Aug 2019 20:19:57 +0000 (22:19 +0200)]
Refactor AbstractBrokerAwareActivator

This simplifies the implementation by encapsulating state.

Change-Id: I673e71f431026302974057af5933dba14e4c19c3
Signed-off-by: Robert Varga <>
13 months agoFixup checkstyle 28/83828/2
Robert Varga [Tue, 20 Aug 2019 19:04:19 +0000 (21:04 +0200)]
Fixup checkstyle

Updated checkstyle does not like some our docs, fix them up.

Change-Id: I2d4f608fe9c44a56cdcac511cc1e2ae75c03b413
Signed-off-by: Robert Varga <>
13 months agoPropagate action logical datastore type 54/83754/2
Robert Varga [Mon, 19 Aug 2019 12:01:27 +0000 (14:01 +0200)]
Propagate action logical datastore type

Unlike RFC7950 and related specifications, actions are generalized
in ODL to work on any datastore type, as otherwise internal cooperation
could not work on onything but operational datastore.

This patch correctly propagates the invocation datastore type, so that
invoking actions on top of config datastore becomes possible.

Change-Id: I20f340bee0321a446a07d701650d6dac57057ee6
Signed-off-by: Robert Varga <>
13 months agoChange in the version name 86/83786/1
Robert Varga [Tue, 20 Aug 2019 10:39:34 +0000 (12:39 +0200)]
Change in the version name

This catches up documentation to Magnesium.

Change-Id: I579b891baeba329d3ded6816f59e1b2da18379e1
Signed-off-by: Anushka Bhandari <>
Signed-off-by: Robert Varga <>
13 months agoRemove triemap-bom import 82/83782/2
Robert Varga [Tue, 20 Aug 2019 06:33:28 +0000 (08:33 +0200)]
Remove triemap-bom import

Triemap is provided by odlparent, remove the reference to it.

Change-Id: Ib37bc9957742a7e9f4e094248b6b8129a32ccd73
Signed-off-by: Robert Varga <>
13 months agoBump mdsal to 4.0.4 23/83723/2
Robert Varga [Thu, 15 Aug 2019 08:26:16 +0000 (10:26 +0200)]
Bump mdsal to 4.0.4

This brings in latest fixes.

Change-Id: I59f89ef4fe76ef16fcdc9b59f8d9b50aa0849847
Signed-off-by: Robert Varga <>
13 months agoRemove BindingToNormalizedNodeCodec service export 86/83686/1
Robert Varga [Fri, 16 Aug 2019 10:23:43 +0000 (12:23 +0200)]
Remove BindingToNormalizedNodeCodec service export

This service is not used anywhere (not should it be), remove it.

Change-Id: I841065ff4932c4d56ca20bd3c465da4fe814216c
Signed-off-by: Robert Varga <>
13 months agoMake sure registrations are closed 30/83530/4
EmmettCox [Thu, 8 Aug 2019 11:01:42 +0000 (12:01 +0100)]
Make sure registrations are closed

This ensures registrations are closed as soon as they are not

Change-Id: I3a391f202963852f47486b78748c8e2d7e97162a
Signed-off-by: EmmettCox <>
Signed-off-by: Robert Varga <>
13 months agoBump versions by x.y.(z+1) 44/83544/1
jenkins-releng [Mon, 12 Aug 2019 16:14:12 +0000 (16:14 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <>
Change-Id: I7108fdde06e4c0d16aa2577c8a050d3567bdfbfe

14 months agoBump mdsal to 4.0.3 87/83087/9
Robert Varga [Thu, 18 Jul 2019 06:41:02 +0000 (08:41 +0200)]
Bump mdsal to 4.0.3

This bumps mdsal to 4.0.3, bringing in latest fixes and improvements.

Change-Id: Ie8e03aab1f31edf80bc9f1d7896c334c9d83be8d
Signed-off-by: Robert Varga <>
14 months agoBump yangtools to 3.0.4 86/83086/7
Robert Varga [Thu, 18 Jul 2019 06:40:17 +0000 (08:40 +0200)]
Bump yangtools to 3.0.4

This picks up latest fixes and improvements.

Change-Id: I03201927d23762acf641c1ab0ff3419ba8b94969
Signed-off-by: Robert Varga <>
14 months agoBump odlparent to 5.0.1 85/83085/5
Robert Varga [Thu, 18 Jul 2019 06:39:32 +0000 (08:39 +0200)]
Bump odlparent to 5.0.1

This picks up the latest upgrades.

Change-Id: If6006a94197839a9718cd5eae16b0a025913af93
Signed-off-by: Robert Varga <>
14 months agoAdd unit test for FrontedMetadata memory leaks 71/81971/30
Tomas Cere [Thu, 9 May 2019 09:12:34 +0000 (11:12 +0200)]
Add unit test for FrontedMetadata memory leaks

This memory leak occurs when write and read-only transactions
intertwine, leading to sparse range set.
We need to be able to request frontend metadata from shards,
so we can see whether it converges to a single range.

Also rework testing datastores, so we can inject custom testing
implementations allowing us to retrieve frontend metadata.

Change-Id: Ia8f350be7831b0c8f6846ee6fa41a665d1e191f4
Signed-off-by: Tomas Cere <>
Signed-off-by: Robert Varga <>
14 months agoDo not log the whole DataTree at debug level 32/83232/2
Tomas Cere [Wed, 24 Jul 2019 10:40:29 +0000 (12:40 +0200)]
Do not log the whole DataTree at debug level

This needs to be at trace, as its polluting logs otherwise.

Change-Id: I6141a1793402e87ab49defe40007114b40d16335
Signed-off-by: Tomas Cere <>
Signed-off-by: Robert Varga <>
14 months agoForce AbstractRaftRPC to use Externalizable proxy pattern 65/83165/2
Robert Varga [Fri, 19 Jul 2019 07:15:15 +0000 (09:15 +0200)]
Force AbstractRaftRPC to use Externalizable proxy pattern

All implementations are already using the pattern, this change
makes that official and removes the no-arg constructor, which
is not used anyway.

Change-Id: Iaea4a2f39972537907cce19551d2ca6e4b33fad6
Signed-off-by: Robert Varga <>
14 months agoUse merging transaction chains in dsbenchmark 58/83158/2
Robert Varga [Thu, 18 Jul 2019 17:21:29 +0000 (19:21 +0200)]
Use merging transaction chains in dsbenchmark

This functionality was broken, as the injection conversion done
for 4.0.0 did not take into account the fact we are dropping

Change-Id: I41244d6732216554e197ffe9b7ef6d5be41ab520
Signed-off-by: Robert Varga <>
14 months agoMake RaftVersions a final class 64/83164/1
Robert Varga [Fri, 19 Jul 2019 07:22:53 +0000 (09:22 +0200)]
Make RaftVersions a final class

RaftVersions is a simple holder of constants, not an interfaces
which would be implemented. Change it to a utility class.

Change-Id: Ie7406cf579de2e4f17e03063f492eeb73d5ecb6c
Signed-off-by: Robert Varga <>
14 months agoRaise EOS unsuccessful request reporting to error 90/82990/3
Robert Varga [Wed, 10 Jul 2019 09:54:38 +0000 (11:54 +0200)]
Raise EOS unsuccessful request reporting to error

When we fail to send a message to the backend we are entering an
inconsistent state, where our users think the candidate is registered,
but the backend knows nothing about it -- which warrants an ERROR
level output.

Also place a FIXME on operations which should be retried.

Change-Id: I0799afe2e0786468cdef5f80c1064cb08d3c1af0
Signed-off-by: Robert Varga <>
14 months agoEnforce RegisterListenerLocal arguments 89/82989/3
Robert Varga [Wed, 10 Jul 2019 09:59:42 +0000 (11:59 +0200)]
Enforce RegisterListenerLocal arguments

The fields need to be initialized to non-null, make sure the object
does that (instead of its users).

Change-Id: I545421167bd33e06ea7221a0fbcc136083bfc80d
Signed-off-by: Robert Varga <>
14 months agoChange remaining SnapshotSelectionCriteria to prioritize timestamp 17/83017/2
Tomas Cere [Thu, 11 Jul 2019 10:19:47 +0000 (12:19 +0200)]
Change remaining SnapshotSelectionCriteria to prioritize timestamp

These are also needed and were missed in the original run-through.

Change-Id: Icede0673c580f793ffe81ccecf728c15dc6e83ca
Signed-off-by: Tomas Cere <>
14 months agoFurther Guava Optional cleanups 09/83009/6
Robert Varga [Wed, 10 Jul 2019 14:37:12 +0000 (16:37 +0200)]
Further Guava Optional cleanups

This migrates most of sal-akka-raft to use java.util.Optional.

Change-Id: Iaccc760101762dc9d4d647ded80de9a76f1f067b
Signed-off-by: Robert Varga <>
14 months agoMigrate most of CDS to use java.util.Optional 07/83007/6
Robert Varga [Wed, 10 Jul 2019 14:25:37 +0000 (16:25 +0200)]
Migrate most of CDS to use java.util.Optional

This picks up some stragglers, updating them to not use Guava's

Change-Id: Id6e4c27e5bd55f19058e87f04473b859922bd441
Signed-off-by: Robert Varga <>
14 months agoUse OptionalLong to track enqueue time 06/83006/5
Robert Varga [Wed, 10 Jul 2019 14:07:59 +0000 (16:07 +0200)]
Use OptionalLong to track enqueue time

This prevents the need to box/unbox primitive longs and makes things
generally more convenient.

Change-Id: I6ca394526b09fdd469a9440c9313371e6185c135
Signed-off-by: Robert Varga <>
14 months agoUse OptionalLong in AbstractClientConnection 05/83005/5
Robert Varga [Wed, 10 Jul 2019 14:02:30 +0000 (16:02 +0200)]
Use OptionalLong in AbstractClientConnection

This removes the need for boxing longs.

Change-Id: I73a6c0be7f9a662f9e1df884f46adbc0fc121fb1
Signed-off-by: Robert Varga <>
14 months agoMigrate ShardDataTree to use OptionalLong 04/83004/5
Robert Varga [Wed, 10 Jul 2019 13:54:51 +0000 (15:54 +0200)]
Migrate ShardDataTree to use OptionalLong

This prevents boxing and is more modern than Guava's Optional<Long>.

Change-Id: Iaef3b7f18527f532ed2d775641cd855b14087fc1
Signed-off-by: Robert Varga <>
14 months agoMigrate InstallSnapshot/SnapshotTracker use of Optional 03/83003/5
Robert Varga [Wed, 10 Jul 2019 13:38:51 +0000 (15:38 +0200)]
Migrate InstallSnapshot/SnapshotTracker use of Optional

This patch migrates both classes to use Java 8 Optional and

Change-Id: Ib8e14f963b4e0db821fd8d3ab37f65b5bf5d5b54
Signed-off-by: Robert Varga <>
14 months agoConvert MessageTracker to use java.util.Optional 02/83002/3
Robert Varga [Wed, 10 Jul 2019 13:30:22 +0000 (15:30 +0200)]
Convert MessageTracker to use java.util.Optional

This migrates from Guava, using Java 8 equivalent.

Change-Id: I71d01dae05e4f426406989d240c12745149d6964
Signed-off-by: Robert Varga <>
14 months agoMigrate ActorUtils to java.util.Optional 01/83001/3
Robert Varga [Wed, 10 Jul 2019 13:20:33 +0000 (15:20 +0200)]
Migrate ActorUtils to java.util.Optional

This migrates ActorUtils to Java 8 Optional, updating its users.

Change-Id: I0ec900d16bf44b2ab8ae48d8a72f2b63fa633312
Signed-off-by: Robert Varga <>
14 months agoUse OptionalInt in FlexibleThreadPoolWrapper 00/83000/1
Robert Varga [Wed, 10 Jul 2019 13:11:09 +0000 (15:11 +0200)]
Use OptionalInt in FlexibleThreadPoolWrapper

This gets rid of Guava Optional and fixes an unboxing warning
through use of Java 8.

Change-Id: I9c22bbedfcdd08f18c5ff14283dd8f130d6020c6
Signed-off-by: Robert Varga <>
14 months agoUpgrade jmh-core 62/82962/4
Robert Varga [Mon, 8 Jul 2019 13:53:29 +0000 (15:53 +0200)]
Upgrade jmh-core

This upgrade jmh-core to the latest release.

Change-Id: I6317ad6689fb5ac6d5156c9e6ddbfb1a6a051321
Signed-off-by: Robert Varga <>
14 months agoMigrate to MD-SAL APIs 63/82963/3
Robert Varga [Mon, 8 Jul 2019 14:02:51 +0000 (16:02 +0200)]
Migrate to MD-SAL APIs

This removes controller dependencies.

Change-Id: Ic3fa0748d4e92f86899af2b8dcf73b7f1ae2560a
Signed-off-by: Robert Varga <>
14 months agoDo not depend on odl-mdsal-broker-local 59/82959/2
Robert Varga [Mon, 8 Jul 2019 13:38:03 +0000 (15:38 +0200)]
Do not depend on odl-mdsal-broker-local

odl-mdsal-trace depends on both odl-mdsal-broker (clustered) and
odl-mdsal-broker-local (non-clustered), which is not appropriate.
Remove the latter.

Change-Id: Ifdeb1c242004b6e365c133360c96af00c17c67c7
Signed-off-by: Robert Varga <>
14 months agoRemove odl-mdsal-all 58/82958/2
Robert Varga [Mon, 8 Jul 2019 13:35:29 +0000 (15:35 +0200)]
Remove odl-mdsal-all

This set of features was used for testing and does not really
contain 'all' features. Remove it in favor of explicitly listing

Change-Id: I4db4932594c17621ab2fb17f1436531ce3b7dbe5
Signed-off-by: Robert Varga <>
14 months agoTeach sal-remoterpc-connector to route actions 83/82283/13
EmmettCox [Thu, 4 Jul 2019 16:31:38 +0000 (16:31 +0000)]
Teach sal-remoterpc-connector to route actions

sal-remoterpc-connector already handles routing of RPC registrations
and invocations across a cluster. Actions are very similar to RPCs,
hence it is natural to keep both in the same component.

This patch refactors common bits that go into tracking both, so that
we share common actors and concepts.

Change-Id: I0b9005bc3560b4dd5977a280d83eceebe132bec9
Signed-off-by: EmmettCox <>
14 months agoAdd support for reusable streaming 17/82417/8
Robert Varga [Thu, 6 Jun 2019 10:26:37 +0000 (12:26 +0200)]
Add support for reusable streaming

With the actual implementations working on top of
NormalizedNodeStreamWriter, we gained the ability to flexibly
receive stream events.

This patch takes advantage of that flexibility by allowing
a ReusableImmutableNormalizedNodeStreamWriter to be the receiver
of the events -- thus allowing parts of the state involved in
building a NormalizedNode tree to be reused -- lowering GC

A number of call sites, which can safely reuse such state are
converted to use the newly-introduced facility.

Change-Id: Iaf1b3ab2b2996e7004c036fc93a80a8ca8792314
Signed-off-by: Robert Varga <>
14 months agoAdd streaming interface to NormalizedNodeDataInput 09/82009/24
Robert Varga [Mon, 13 May 2019 05:44:05 +0000 (07:44 +0200)]
Add streaming interface to NormalizedNodeDataInput

NormalizedNodeDataInput allows reading NormalizedNodes, which is
wired directly to immutable node builders, providing little

This inflexibility requires us to re-stream the data set through
NormalizedNodePruner, effectively doubling memory requirements
during recovery.

Extend NormalizedNodeDataInput to have a NormalizedNodeStreamWriter
to be plugged in, so that the byte stream becomes a source of
NormalizedNodeStreamWriter events, which can be routed through
a custom-built pipeline.

readNormalizedNode() becomes a simple default wrapper, which
pipes the stream into an ImmutableNormalizedNodeStreamWriter.

Change-Id: Ic732ba9105dd7e27d5612853b931aba66bdd83a5
Signed-off-by: Robert Varga <>
14 months agoFix multiple snapshots present after journal removal 80/82380/8
Tomas Cere [Mon, 3 Jun 2019 13:02:08 +0000 (15:02 +0200)]
Fix multiple snapshots present after journal removal

After journal removal the sequence number starts counting from 0
once again. Therefore we can have multiple snapshots present and
snapshots with higher sequence number always take priority for loading
even when a newer snapshot is present.

Change this up in 2 ways:
1. disregard sequence number while deleting snapshots(delete all
snapshots with an older timestamp)
2. while loading snapshots prioritize timestamp rather than seqNr.

Also simplify

Change-Id: I205ea0ddf48d73b0a09297a1ce4e9fd514531993
Signed-off-by: Tomas Cere <>
Signed-off-by: Robert Varga <>
14 months agoAdd transaction debugs 58/82858/2
Robert Varga [Mon, 1 Jul 2019 06:50:24 +0000 (08:50 +0200)]
Add transaction debugs

This adds a few debug messages allowing logs to be introspected
to see the timing of readying/applying transactions.

Change-Id: I1dde184023a034c6a0fa30e9a3898ab65db2decc
Signed-off-by: Robert Varga <>
14 months agoRename SODIUM versions to NEON_SR2 67/82867/2
Robert Varga [Fri, 28 Jun 2019 11:37:50 +0000 (13:37 +0200)]
Rename SODIUM versions to NEON_SR2

We are shipping these improvements in Neon SR2, which means we
should reserve this version not as Sodium.

Change-Id: If5caa0dd7510c6e1ffe3c483c74c456798ca6bb3
Signed-off-by: Robert Varga <>
14 months agoDeprecate all MD-SAL APIs 63/82863/1
Robert Varga [Mon, 1 Jul 2019 11:00:52 +0000 (13:00 +0200)]
Deprecate all MD-SAL APIs

These APIs have either been completely deprecated or have their
replacements in the mdsal project. Mark all of them as deprecated,
including their implementations.

Change-Id: I903afcef57c70c1013ab479cfcf31a42f475dc0f
Signed-off-by: Robert Varga <>
14 months agoMake private methods static 62/82862/1
Robert Varga [Mon, 1 Jul 2019 12:12:48 +0000 (14:12 +0200)]
Make private methods static

Eclipse is flagging a number of methods as potentially-static,
make sure we mark them as such.

Change-Id: I4254dd29716f4365d71f81c3f3a0e7a9590d9801
Signed-off-by: Robert Varga <>
14 months agoRemove ShardManager.configListenerReg 61/82861/1
Robert Varga [Mon, 1 Jul 2019 12:06:28 +0000 (14:06 +0200)]
Remove ShardManager.configListenerReg

This field is not used anywhere, remove it.

Change-Id: Id66143aefea072ce6d529d39e86a961aa1d551ba
Signed-off-by: Robert Varga <>
14 months agoMigrate use of AbstractDOMStoreTransaction 60/82860/1
Robert Varga [Mon, 1 Jul 2019 12:09:55 +0000 (14:09 +0200)]
Migrate use of AbstractDOMStoreTransaction

This utility class has been migrated to mdsal, use the instance
from there.

Change-Id: I9aad875f631903d4ce9dfb2779dfce6f8883a50c
Signed-off-by: Robert Varga <>
15 months agoReset replyReceivedForOffset correctly 26/82726/1
Tomas Cere [Tue, 25 Jun 2019 12:16:50 +0000 (14:16 +0200)]
Reset replyReceivedForOffset correctly

replyReceivedForOffset needs to be set to the initial -1
otherwise we can have multiple sendSnapshotChunk()'s called
before receiving any replies. Which would fail due to the already
running stopwatch.

Change-Id: Ie708f0c2454a87f77cba97e4fed8a9ffc866b624
Signed-off-by: Tomas Cere <>
15 months agoFailed chunks should move offset backwards 25/82725/1
Tomas Cere [Tue, 25 Jun 2019 08:45:15 +0000 (10:45 +0200)]
Failed chunks should move offset backwards

If a chunk has failed it needs to move the offset backwards,
otherwise this would misalign the stream, or make it possible
to call sendNextChunk() right after resend which could be
seen as the chunkTimer attempted to be started while already running.

Change-Id: I6d44195ae9bcb23075ffea9c4f1d1ab1d0540c93
Signed-off-by: Tomas Cere <>
15 months agoFix IMDS test synchronization 53/82553/1
Robert Varga [Tue, 18 Jun 2019 15:39:37 +0000 (17:39 +0200)]
Fix IMDS test synchronization

Before we close the DTCL we must make sure we flush all changes,
otherwise we could end up losing changes simply because we are no
longer interested in them.

Change-Id: I6df384c375ea1692a10c9f460d3dceb626468061
Signed-off-by: Robert Varga <>
15 months agoReset snapshot progress on IOExceptions 94/82394/6
Tomas Cere [Tue, 4 Jun 2019 09:17:10 +0000 (11:17 +0200)]
Reset snapshot progress on IOExceptions

Also log the whole LeaderInstallSnapshotState of failures.

Change-Id: I33b1c38f2277f08acbe77bcb0c16d2dfe41d8851
Signed-off-by: Tomas Cere <>
15 months agoSend commitIndex updates to followers as soon as possible 98/82498/1
Robert Varga [Tue, 11 Jun 2019 13:42:34 +0000 (15:42 +0200)]
Send commitIndex updates to followers as soon as possible

When the commitIndex gets updated when we reach consensus, we should
propagate this fact to the sender peer. Otherwise data tree change
listeners on peers may be unnecessarily delayed, as they end up
waiting for heartbeat interval (or non-batched entries) to be propagated

The results in observably-better behaviour between leader and follower,
as the leader is sending out notifications of consensus, without
delayling for heartbeat -- which is reflected in the changes to

Furthermore, DelayedMessagesElectionScenarioTest is detecting the change,
as two members may achieve asynchronous consensus -- hence the leader
would be sending two messages (request to persist, commitIndex) to push
the consensus out. This exposes a race in the test, where we do not know
the order between TimeoutNow and AppendEntries. If AppendEntries is
processed by member 2 after TimeoutNow, leader will know about the new
term due to AppendEntriesReply we send out. The cluster will still
converge, but the assert for leader will be different if it manages to
process the message. Fix this by isolating member 2.

Change-Id: I695ef25c7a4cf8799c9c5e04c2c33fbf3e2f21df
Signed-off-by: Robert Varga <>
(cherry picked from commit c2b0e92d2c3ba05abf0fefb24413c68fd1c56bea)

15 months agoSimplify recoveryTime computation 58/82458/3
Robert Varga [Fri, 7 Jun 2019 22:44:58 +0000 (00:44 +0200)]
Simplify recoveryTime computation

Stopwatch.stop() returns self, take advantage of that to shorted
the code to compute the formatting string. Also drop toString()
call, as it is implied by string concat.

Change-Id: I4fa645e42fc38b5f9f0775d986fd17aa693725b1
Signed-off-by: Robert Varga <>
15 months agoSwitch default output stream version 13/82313/27
Robert Varga [Wed, 29 May 2019 16:17:13 +0000 (18:17 +0200)]
Switch default output stream version

All versioned callers have been converted to use appropriate
stream versions, this patch bumps the default unversioned stream
to Sodium version.

Since we're changing the serialization format for ExecuteRpc,
make sure we fully embrace writer/reader, so that we get better

Change-Id: I17deeda1a49394600a5b0f93bd46d3b2c812123c
Signed-off-by: Robert Varga <>
15 months agoBump persisted PayloadVersion 14/82314/25
Robert Varga [Wed, 29 May 2019 16:23:04 +0000 (18:23 +0200)]
Bump persisted PayloadVersion

Since the NormalizedNodeStream format has changed, shard persisted
state is affected.

This patch bumps PayloadVersion and applies that bump to snapshots
and CommitTransactionPayload.

On recovery, a snapshot's need to migrate is reflected in its state,
and it is examined just as MigratedSerializables are.
CommitTransactionPayload is not examined, as understanding its
stream version would require deserializing at least its header.

Change-Id: I678527be4487ee1729123ba8b9dcd2269e6cf262
Signed-off-by: Robert Varga <>
15 months agoBump datastore version 11/82311/21
Robert Varga [Wed, 29 May 2019 14:59:01 +0000 (16:59 +0200)]
Bump datastore version

This bumps the ask-based protocol datastore version, so that
SODIUM_VERSION is using Sodium NormalizedNode{Input,Output}.

Change-Id: Ib4ad1c27566179db958ad7776f81417ab99a78cf
Signed-off-by: Robert Varga <>
15 months agoAdd QNameModule coding 26/82426/5
Robert Varga [Thu, 6 Jun 2019 17:36:06 +0000 (19:36 +0200)]
Add QNameModule coding

Coding on QNames is effective when there are a lot of same QNames,
but there are cases where QNames themeselves are not reused --
for example YangInstanceIdentifiers and small read subtrees.

These typically end up using different QNames from a small set
of modules, hence coding modules actually helps them quite a bit.

This patch adds a namespace/revision cache, so that encoding such
QNames is also efficient.

Change-Id: I6cd0885ef605e4a1bf7b768ffe215e9eb3e2fbc5
Signed-off-by: Robert Varga <>
15 months agoAdd buffering to LocalSnapshotStore 39/82439/3
Tomas Cere [Tue, 4 Jun 2019 13:32:20 +0000 (15:32 +0200)]
Add buffering to LocalSnapshotStore

These improve snapshot save/load load times by around 15-20%
on my environment.

Change-Id: I67236f7e97f519993031d462c947588004857c33
Signed-off-by: Tomas Cere <>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.