mdsal.git
3 years agoBump versions to 5.0.18-SNAPSHOT 02/95802/1 5.0.x
Robert Varga [Mon, 19 Apr 2021 07:19:34 +0000 (09:19 +0200)]
Bump versions to 5.0.18-SNAPSHOT

This starts the next development iteration.

Change-Id: Ic5017b4c080aa07242b5dbb1e969306ec43ca46f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix String length checker 57/95357/1
Robert Varga [Wed, 24 Feb 2021 00:11:08 +0000 (01:11 +0100)]
Fix String length checker

We are enforcing length restrictions on String.length(), which is
the wrong measure, as it returns the number of code units in the
String. We actually want to compare the number of code points, i.e.
we need to use String.codePointCount().

JIRA: MDSAL-661
Change-Id: I7291aabb67ec9d002cdeb52befd1723707113121
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 99a40d176c406d35d3d83e440a775a969e0d27d3)
(cherry picked from commit 674e3a9b75817962abf88754772d2857b1144095)

3 years agoAdd query support for decimal64 96/94796/4
Robert Varga [Sun, 24 Jan 2021 13:27:22 +0000 (14:27 +0100)]
Add query support for decimal64

As it turns out we are also missing support for leaves based on
decimal64 type. Add it.

JIRA: MDSAL-652
Change-Id: Id9c8954341492348e0fc36434336c5e522915709
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0a107ff4517877e73c9d4da7e20a32fc53abde1f)

3 years agoNested lists cannot be decoded 95/94795/4
Peter Suna [Fri, 22 Jan 2021 15:53:42 +0000 (16:53 +0100)]
Nested lists cannot be decoded

DOMQueryIterator is a bit confused about the path it is returning,
causing binding codec to fail. As it turns out, we have violated
expected invariants in various places.

JIRA: MDSAL-654
Change-Id: Ibf7466f6f390f517f1186a725c265a88e7266934
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1bf83c56c076eab7ec7cc1f9d5e24cde925cfa08)

3 years agoFix DOMQueryPredicate comparable matches 94/94794/4
Peter Suna [Fri, 22 Jan 2021 15:12:05 +0000 (16:12 +0100)]
Fix DOMQueryPredicate comparable matches

Boundary condition checking is wrong here due negation brainfart:
gte/gt and lte/lt should include/exclude 0, not the other way around.

JIRA: MDSAL-653
Change-Id: Ieaaf5b4fe0367d9e59cd03a2c177898d909e6ce8
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 14cf7ecef0d125b84406c534662c932419d9dfa7)

3 years agoAdd MatchBuilderPath.BooleanLeafReference 93/94793/4
Robert Varga [Fri, 22 Jan 2021 21:12:12 +0000 (22:12 +0100)]
Add MatchBuilderPath.BooleanLeafReference

This is a notable omission from the interface, allow users to
target Boolean types.

JIRA: MDSAL-652
Change-Id: Ie62f6419bf3db57887797f7bc88f7ec5dfd5f203
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 13a90f1ae289ce710b4dd0eca733ff45379fed9a)

3 years agoFix Javadoc deprecation links 38/94538/1
Robert Varga [Sat, 9 Jan 2021 07:33:29 +0000 (08:33 +0100)]
Fix Javadoc deprecation links

There is a typo in specification of the reference, leading to
this bit being rendered without a link. Fix that.

Change-Id: Id58978511ef601471d76e8a8f962df96f2e26a4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 40d9da9d71a301c6df20899cb6082658a4361781)

3 years agoRemove getter @Nullable annotations for non-List/Map types 47/94247/2
Iaroslav [Fri, 4 Dec 2020 10:36:44 +0000 (12:36 +0200)]
Remove getter @Nullable annotations for non-List/Map types

In generated types getter will no longer be marked @Nullable annotation
for non List and Map types.

Jira: MDSAL-603
Change-Id: I2ad00e625f652399e184fca1a7a00d3ed36d3dff
Signed-off-by: Iaroslav <iaroslav.kholiavko@pantheon.tech>
(cherry picked from commit ea81234d5429f36f687baee790fcfb884a8b96d1)

3 years agoBump yangtools to 4.0.15 45/94245/1
Robert Varga [Tue, 15 Dec 2020 08:28:31 +0000 (09:28 +0100)]
Bump yangtools to 4.0.15

Pick up latest fixes from upstream.

Change-Id: I769be2b7c63b0020fa44ef0f90df7c09ff6c44af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 5.0.17-SNAPSHOT 18/93818/2
Robert Varga [Fri, 13 Nov 2020 06:05:23 +0000 (07:05 +0100)]
Bump versions to 5.0.17-SNAPSHOT

This starts the next development iteration.

Change-Id: I3fb3e3b008547c370ed20ae8c9a3da0231a7a319
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix mdsal-binding-dom-adapter blueprint 17/93817/2
Robert Varga [Fri, 13 Nov 2020 06:04:13 +0000 (07:04 +0100)]
Fix mdsal-binding-dom-adapter blueprint

We have a wrong reference here to DefaultQueryFactory as well as
mismatching constructor. Fix that up.

Change-Id: Idfccae3ec2ef4fd1d7c0dad975cc99238126c7ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump versions to 5.0.16-SNAPSHOT 86/93786/1
Robert Varga [Wed, 11 Nov 2020 18:24:27 +0000 (19:24 +0100)]
Bump versions to 5.0.16-SNAPSHOT

This starts the next development iteration.

Change-Id: I6d89605eab185041c414e6f9ec58472bf1d34c12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd support for formatting EffectiveModelContext 17/93717/2
Robert Varga [Thu, 15 Oct 2020 18:40:35 +0000 (20:40 +0200)]
Add support for formatting EffectiveModelContext

Introduce a fluent-builder like pattern so we have the
option to override various options of the resulting output.

JIRA: MDSAL-596
Change-Id: I1929664db4262b0428e078b4712844b4bc2679b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
3 years agoBump to odlparent-6.0.12/yangtools-4.0.14 16/93716/1
Robert Varga [Tue, 10 Nov 2020 11:47:33 +0000 (12:47 +0100)]
Bump to odlparent-6.0.12/yangtools-4.0.14

Pick up latest fixes from upstream.

Change-Id: I10a5351e77d799e286ea756e990d5bc4c16cd117
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRefactor DOMQueryPredicate 43/93543/1
Robert Varga [Wed, 28 Oct 2020 16:50:24 +0000 (17:50 +0100)]
Refactor DOMQueryPredicate

Refactor aimed at allowing composite predicates without multiple
lookups. While the DOM language allows this use case, the binding
layer does not take advantage of it.

JIRA: MDSAL-617
Change-Id: Ib8a3f77ee660a8c2881d0a18bd0238c6ddce5ade
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 513eb8e5a624d9c09d9f051bbf59ac1ff856bdb7)

3 years agoUse Map.entry() instead of SimpleImmutableEntry 53/93453/1
Robert Varga [Wed, 28 Oct 2020 00:03:12 +0000 (01:03 +0100)]
Use Map.entry() instead of SimpleImmutableEntry

We are using these a dumb DTOs, hence using a value-based
non-serializable implementation is more appropriate.

JIRA: MDSAL-605
Change-Id: Ie36c397a6e265328f31b70dce05b8c72b8756584
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6ef51407a2c1731520c3a246442386093e67aeeb)

3 years agoRename LazyDOMQueryResultIterator 52/93452/1
Robert Varga [Tue, 27 Oct 2020 22:55:47 +0000 (23:55 +0100)]
Rename LazyDOMQueryResultIterator

This is an implementation-internal class, shorten its name to
DOMQueryIterator. It is shorter and matches naming of others.

JIRA: MDSAL-605
Change-Id: I8413a20c4ba533c62bf6c5c3013b4d1bf8f841e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 870ebfe9aef87e245f98bc377a8d8fb15f2b820f)

3 years agoAdd support for keyed entries 51/93451/1
Robert Varga [Mon, 26 Oct 2020 22:54:40 +0000 (23:54 +0100)]
Add support for keyed entries

When we enter a NodeIdentifierWithPredicates for a Map, we can
service that with a direct map lookup instead of iteration. As we
now have the tools to access this step, add a unit test and fix
the implementation.

These predicates add another dimension to matching, where we have
to deal with Maps, something that NormalizedNodes does not help
with.

Predicate matching is split into its own class with a clear entry
point, so as to separate it from other complex pieces. This also
solves the tension between Evaluator and Iterator by shifting
ownership to a third class.

Since a predicate now be matching multiple nodes, we have to also
introduce an explicit DOMQueryPredicate.Not, so that its effects
can be properly accounted for.

JIRA: MDSAL-612
Change-Id: I34511517c5746efc5d245a56da89083c44100752
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d0e3e6654cc79d3725263b1f0ecfa2d79c2a3e47)

3 years agoAdd support for selecting exact items from lists 50/93450/1
Robert Varga [Tue, 27 Oct 2020 19:53:23 +0000 (20:53 +0100)]
Add support for selecting exact items from lists

The query language prototype was centered around wildcard matches,
while it ignored exact matches in building up the query. Add support
for specifying a list key, as one would in normal InstanceIdentifier.

JIRA: MDSAL-612
Change-Id: I0c63d6d4990a31888f33a86c9d798b09bb10c734
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 702435f43074c05a197975e6b15c4188e4981841)

3 years agoRevert "Add support for selecting exact items from lists" 49/93449/1
Robert Varga [Wed, 28 Oct 2020 11:10:28 +0000 (12:10 +0100)]
Revert "Add support for selecting exact items from lists"

This reverts commit 9a3be773e9a134fae830f0b37a7378c2099768ce, as it
was accidentally pushed without review.

Change-Id: I89f93d54e577961adea82c5a19febc650200f3c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRevert "Add support for keyed entries" 48/93448/1
Robert Varga [Wed, 28 Oct 2020 11:10:15 +0000 (12:10 +0100)]
Revert "Add support for keyed entries"

This reverts commit afc860cd2e669832d2df5bf0d8b59faa0ff52834, as it
was accidentally pushed without review.

Change-Id: If692ea0f130e4d08846efb5ba17d62f88fc7477f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRevert "Rename LazyDOMQueryResultIterator" 47/93447/1
Robert Varga [Wed, 28 Oct 2020 11:10:05 +0000 (12:10 +0100)]
Revert "Rename LazyDOMQueryResultIterator"

This reverts commit 57091a3c275818e4bdd1fe81d8824658199a6966, as it
was accidentally pushed without review.

Change-Id: Iac2fca69d4fd26a98597be9a497ee39434e6ef0b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoRevert "Use Map.entry() instead of SimpleImmutableEntry" 46/93446/1
Robert Varga [Wed, 28 Oct 2020 11:09:48 +0000 (12:09 +0100)]
Revert "Use Map.entry() instead of SimpleImmutableEntry"

This reverts commit 5c8b35976328274cdc325a20c9205d92279ad351 as it
was accidentally pushed without review.

Change-Id: I7d6cf12222e14459d08d6d701f5266c9cde80ea5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse Map.entry() instead of SimpleImmutableEntry
Robert Varga [Wed, 28 Oct 2020 00:03:12 +0000 (01:03 +0100)]
Use Map.entry() instead of SimpleImmutableEntry

We are using these a dumb DTOs, hence using a value-based
non-serializable implementation is more appropriate.

JIRA: MDSAL-605
Change-Id: Ie36c397a6e265328f31b70dce05b8c72b8756584
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6ef51407a2c1731520c3a246442386093e67aeeb)

3 years agoRename LazyDOMQueryResultIterator
Robert Varga [Tue, 27 Oct 2020 22:55:47 +0000 (23:55 +0100)]
Rename LazyDOMQueryResultIterator

This is an implementation-internal class, shorten its name to
DOMQueryIterator. It is shorter and matches naming of others.

JIRA: MDSAL-605
Change-Id: I8413a20c4ba533c62bf6c5c3013b4d1bf8f841e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 870ebfe9aef87e245f98bc377a8d8fb15f2b820f)

3 years agoAdd support for keyed entries
Robert Varga [Mon, 26 Oct 2020 22:54:40 +0000 (23:54 +0100)]
Add support for keyed entries

When we enter a NodeIdentifierWithPredicates for a Map, we can
service that with a direct map lookup instead of iteration. As we
now have the tools to access this step, add a unit test and fix
the implementation.

These predicates add another dimension to matching, where we have
to deal with Maps, something that NormalizedNodes does not help
with.

Predicate matching is split into its own class with a clear entry
point, so as to separate it from other complex pieces. This also
solves the tension between Evaluator and Iterator by shifting
ownership to a third class.

Since a predicate now be matching multiple nodes, we have to also
introduce an explicit DOMQueryPredicate.Not, so that its effects
can be properly accounted for.

JIRA: MDSAL-612
Change-Id: I34511517c5746efc5d245a56da89083c44100752
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d0e3e6654cc79d3725263b1f0ecfa2d79c2a3e47)

3 years agoAdd support for selecting exact items from lists
Robert Varga [Tue, 27 Oct 2020 19:53:23 +0000 (20:53 +0100)]
Add support for selecting exact items from lists

The query language prototype was centered around wildcard matches,
while it ignored exact matches in building up the query. Add support
for specifying a list key, as one would in normal InstanceIdentifier.

JIRA: MDSAL-612
Change-Id: I0c63d6d4990a31888f33a86c9d798b09bb10c734
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 702435f43074c05a197975e6b15c4188e4981841)

3 years agoRefactor LazyDOMQueryResultIterator 09/93409/1
Robert Varga [Mon, 26 Oct 2020 18:29:11 +0000 (19:29 +0100)]
Refactor LazyDOMQueryResultIterator

Rework the logic to keep minimum stack allocations. Whereas we used
stack for keeping the decision state and traverse all entries, here
we keep an explicit stack with state.

We mutate the state using a "simple" sstateful dispatch, where we
are are carefully peeling the various possibilities. This logic is
one large method due to 'current' being manipulated and non-local
returns.

This improves test case performance by more than a factor-of-two,
easily beating linear search by a wide margin.

For clarity we have two classes of Frames, one dealing with MapNode's
children and the other one taking care of all the other nodes. While
this might cause bimorphic invocation of Frame.hasNext(), the overall
effect on clarity is immense.

We also change match() a bit, to take predicates, as it is all that
it should be interested in.

JIRA: MDSAL-610
Change-Id: I7136c6297cc66832539d1bb3d9f653968eb7bdb1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9cea2c0be2e893075c4ad99142e6b5d7ca511527)

3 years agoAdd LazyDOMQueryResult 08/93408/1
Robert Varga [Mon, 26 Oct 2020 14:17:55 +0000 (15:17 +0100)]
Add LazyDOMQueryResult

Rehost the evaluation logic into a dedicated iterator class. This
does not make iteration lazy, but sets the stage by giving the state
being passed around a place to live.

JIRA: MDSAL-610
Change-Id: Ic23eb38d7e5a6bd1cf1b7637dec88eff552520d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit dde3e63c454fe72ddb7e7b9689baf2618e6d1e67)

3 years agoBetter encapsulate search state 07/93407/1
Robert Varga [Mon, 26 Oct 2020 14:05:25 +0000 (15:05 +0100)]
Better encapsulate search state

'remaining' is a bit unclear, make sure to push down initialization
down a bit.

JIRA: MDSAL-610
Change-Id: Id607bd444e58eaaa288e8f0fc505d20ec31bed75
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 301b7c196bb7950f5ccc3ea1c1f4a915301e4730)

3 years agoHide EagerDOMQueryResult behind DOMQueryResult.of() 06/93406/1
Robert Varga [Mon, 26 Oct 2020 02:54:40 +0000 (03:54 +0100)]
Hide EagerDOMQueryResult behind DOMQueryResult.of()

Most users might not want to depend on dom.spi just for an immutable
holder. Add DOMQueryResult.of() methods and use them as replacements
for EagerDOMQueryResult.of().

JIRA: MDSAL-605
Change-Id: I96f81cc105b9890638769b2f2185e961c0fd1885
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit baa87cf697e8c5ba66804d68f88c469dd4cf32bc)

3 years agoQueryResults should be Iterable, Immutable 05/93405/1
Robert Varga [Mon, 26 Oct 2020 01:51:43 +0000 (02:51 +0100)]
QueryResults should be Iterable, Immutable

Each query result really is a holder of result items, in some
iteration order. Expose this by implementing Iterable, so that
we end up correctly implementing stream() et al.

JIRA: MDSAL-605
Change-Id: I4cf1cd29e74e8c640ee62126e4f1cb9efa956cce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 74bf22cda1905fee5ab6d539a8a725a81c9ff826)

3 years agoAdd DOMDataTreeQueryOperations 83/93383/1
Robert Varga [Sun, 25 Oct 2020 17:17:42 +0000 (18:17 +0100)]
Add DOMDataTreeQueryOperations

DOMDataTreeQueryOperations exposes the ability to execute queries
on the backing datastore, much like one would execute a read.

mdsal-binding-dom-adapter is taught to recognize the interface and
use it to offload execution deeper. It still falls back to its
evaluation should the backing store not support this.

DOMStoreReadTransaction gained the ability to value expressions,
using a default implementation based om DOMQueryEvaluator.

Based on that capability, mdsal-dom-broker's transactions are
retrofitted to always provide evaluation locally.

JIRA: MDSAL-607
Change-Id: Ia20acf59870f47c8a84914e239dee82e2a56c1bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bd0e40b3221325dbc96b17fef191df2245954f44)

3 years agoAdd QueryOperations 82/93382/1
Robert Varga [Sun, 25 Oct 2020 14:30:08 +0000 (15:30 +0100)]
Add QueryOperations

Introduce QueryOperations, which support execution of QueryExpressions.
We implement these in the binding/dom adapter in terms of a read/eval
supported by DOMQueryEvaluator.

This allows users to execute queries no matter what the underlying
storage engine supports. This has the upside of instantiating fewer
Binding objects, as the result set is usually a subset of the overall
tree.

TypedTransactions get these unconditionally, throwing
UnsupportedOperationException if the backend does not provide them
(which the default implementation does).

JIRA: MDSAL-606
Change-Id: If68fbb027aa72b1a4b5eef1437e92c30974a1e12
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit be0308e28d334b32485ec68d7b6593b95db728ae)

3 years agoAdd DOMQueryResult streaming interfaces 81/93381/1
Robert Varga [Sun, 25 Oct 2020 23:40:40 +0000 (00:40 +0100)]
Add DOMQueryResult streaming interfaces

Current definition is really an implementation-specific. The API
exposed from DOMQueryResult is eager, not allowing for eager
termination of searching.

Fix this by turning DOMQueryResult into an interface and add
an eager implementation to match current behavior.

Also update DefaultQueryResult to take advantage of lazy
transformations.

JIRA: MDSAL-605
Change-Id: I8375954e09ce6139aad0f83e883ed75771faceab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b620c86025390e3f86eaade9f9c0f102ce6313fa)

3 years agoPeel predicate identifiers 80/93380/1
Robert Varga [Sun, 25 Oct 2020 22:03:48 +0000 (23:03 +0100)]
Peel predicate identifiers

Most of the time we will be treated with simple predicates, peel
them off, so we do not end up iterating.

JIRA: MDSAL-605
Change-Id: I1864c33c5aa34cd3a58171f8cfbe729dd325fb35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 235b6e5b687a5b5fd9ca084f4e10758bbe400bb1)

3 years agoCreate YangInstanceIdentifier only for a match 79/93379/1
Robert Varga [Sun, 25 Oct 2020 19:19:48 +0000 (20:19 +0100)]
Create YangInstanceIdentifier only for a match

This is a classic performance tune up: do not create
YangInstanceIdentifier until we need it.

JIRA: MDSAL-605
Change-Id: Idf9f391d5e7d8080795ce3f6d9b943b5240fe21e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f21384f24a4392abc1d4ddc60bf2fd9e79a4dd60)

3 years agoAdd DOMQueryResult 78/93378/1
Robert Varga [Sun, 25 Oct 2020 16:35:02 +0000 (17:35 +0100)]
Add DOMQueryResult

Working with DOMQueryEvaluator is clunky, introduce a DOMQueryResult,
which reigns it in a bit.

JIRA: MDSAL-605
Change-Id: I83c29c56d184ff880c22154bbb8a3b2bc4f9ec3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 81e3838feb424a3fa63cd8251d7e9b2cfb26d083)

3 years agoExpose DefaultQuery class 77/93377/1
Robert Varga [Sun, 25 Oct 2020 14:43:54 +0000 (15:43 +0100)]
Expose DefaultQuery class

DefaultQuery captures the codec context, hence it is useful for
intra-implementation transforms. This includes the ability to
transform the result set from DOM.

JIRA: MDSAL-605
Change-Id: I565d1ec5070653d45bb6340e79799612fc06d61c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 770d5abb8be436769a9a1d7b80edb89e2955bf29)

3 years agoClarify DOMQueryEvaluator API 61/93361/1
Robert Varga [Sun, 25 Oct 2020 15:17:08 +0000 (16:17 +0100)]
Clarify DOMQueryEvaluator API

DOMQueryEvaluator has two modes of operation, each useful on its
own. Separate the two and document them.

JIRA: MDSAL-605
Change-Id: I6bc93b7098a18dc8d5c5886234fc0cf90772d15b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit a2592b21861882e07388f9a6ea501c9995be6665)

3 years agoAdd SimpleQueryExecutor 42/93342/3
Robert Varga [Fri, 23 Oct 2020 20:46:07 +0000 (22:46 +0200)]
Add SimpleQueryExecutor

This refactors the interace a bit and provides a basic evaluator.
The idea is that given a root object it will evaluate the query.

JIRA: MDSAL-605
Change-Id: Ifcf8880d502eed93fa243a2c1e2f50a116306fe5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 416da6503fff80cab299e727b5b8e1351daee98f)

3 years agoRename query adapter package 41/93341/3
Robert Varga [Wed, 10 Jun 2020 08:49:20 +0000 (10:49 +0200)]
Rename query adapter package

org.opendaylight.mdsal.query.binding.adapter does not match
the overall package structure of binding/DOM adapter. Fix that.

Change-Id: I30bc30856032a3fa7c0d4637dc16c0407743dd54
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d7bdb660913f7c0507d70c0433ad2cee4e698d13)

3 years agoFix DOMQueryPredicate signature 40/93340/3
Robert Varga [Sat, 24 Oct 2020 20:34:01 +0000 (22:34 +0200)]
Fix DOMQueryPredicate signature

DOMQueryPredicates need to be operating on NormalizedNodes, not
plain objects. Internal implementations, which are value-based
need to check for appropriateness of the passed NormalizedNode
and dispatch to check its value.

JIRA: MDSAL-605
Change-Id: Id17400a799b6d14612d077113ba29be4f04a7b6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3f08d6577d82437ded20a3b97867079126a76e5a)

3 years agoAdd isNull() predicate to both DOM and Binding queries 39/93339/3
Robert Varga [Sat, 24 Oct 2020 20:24:23 +0000 (22:24 +0200)]
Add isNull() predicate to both DOM and Binding queries

We have a nonnull() predicate, this adds its counterpart.

JIRA: MDSAL-605
Change-Id: I76d8ac700c8844f71cfe6e24a6fab23d6212a145
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e9bbc3f1dd175e2092abfc16edbe77e0a6ac8762)

3 years agoFix DOMQueryEvaluator bugs 38/93338/3
Robert Varga [Sat, 24 Oct 2020 16:23:12 +0000 (18:23 +0200)]
Fix DOMQueryEvaluator bugs

In case we are matching through a list node, we need to make
sure to match against all its children.

Also when evaluating a predicate, make sure to first perform
a lookup for its relative path.

JIRA: MDSAL-605
Change-Id: Iabe0f26206212a356ebae05162452d61f7c781af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 720a57a5099da2bb3595e66fe49074776776880b)

3 years agoDOMQueryEvaluator is @NonNullByDefault 29/93329/5
Robert Varga [Sat, 24 Oct 2020 16:23:12 +0000 (18:23 +0200)]
DOMQueryEvaluator is @NonNullByDefault

Clarify that we are not dealing with nullable types.

Change-Id: Ibd5d330ee7603b544b9b2033054cca900b810539
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 692e8925e76a5cd4eea709bced2d227d34975750)

3 years agoUpdate QueryResult design 28/93328/5
Robert Varga [Fri, 23 Oct 2020 19:19:20 +0000 (21:19 +0200)]
Update QueryResult design

A query needs to result in a set of path/object tuples, as we really
need to discern matches. Having a concrete path of matches helps
getting identifiers of parent objects for subquent queries.

DOMQueryResult already contains this capability, we just need to
propagate it.

JIRA: MDSAL-604
Change-Id: Iec9ad34aac105eeb45c26a31a24611c9e0f2bb82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit eb1359241f3479661b4b317c05b3b2f96e8b6717)

3 years agoFix MatchBuilderPath documentation 27/93327/5
Robert Varga [Fri, 23 Oct 2020 21:58:58 +0000 (23:58 +0200)]
Fix MatchBuilderPath documentation

We have a sentence trailing off, fix it up. Since we are introducing
a new pointer, update LambdaDecoder documentation. QueryExpression
gets a free pass on whitespace.

Change-Id: Ib5f66a80b99f5be18b5b9f41be4fd850435465f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 29dd9d03f8b4100ce0525b1b93517a50d95db0d9)

3 years agoAdd Binding/DOM Query language adapter 26/93326/6
Robert Varga [Sun, 1 Mar 2020 12:14:00 +0000 (13:14 +0100)]
Add Binding/DOM Query language adapter

Provide implementation of binding language translation on top
of its DOM counterpart.

On the DOM layer the expression can be transmitted, hence it gives
the possibility to move the execution to storage backend, thus
reducing app/backend data interchange volume.

Change-Id: I51c8ec7e34c2485f62aeb5bdbe35fe1507cabaa9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 342ef68448beb2dbf1e7705671074ce461050948)

3 years agoExpose BindingInstanceIdentifierCodec from BindingCodecTree 43/93343/1
Robert Varga [Sat, 29 Feb 2020 14:38:05 +0000 (15:38 +0100)]
Expose BindingInstanceIdentifierCodec from BindingCodecTree

This codec is in similar class as IdentityCodec -- make sure it is
available to users.

JIRA: MDSAL-522
JIRA: MDSAL-525
Change-Id: I08371dfbbb264991d6d5840838c0736b35921b8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2f25664c714829303174a18fbd960d07f101507e)

3 years agoAdd a simple Binding query language 25/93325/1
Robert Varga [Fri, 20 Mar 2020 16:22:09 +0000 (17:22 +0100)]
Add a simple Binding query language

Offloading some amount of data matching towards the storage engine
can give use two-fold improvement:

1) skip instantiation of Binding DTOs, as the query can be realized
   in terms of DOM matches
2) potentially skip transfer of large amount of data

For Binding layer we want to have something type-safe, where we are
in control of the flow the language.

This provides a first cut at the structure, which may end up being
further evolved.

Change-Id: Ica52158c889c0df9a6004227c0b64092590f67af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit ff7968eb9c85ebebdf106d5913c41a81b9a29f19)

3 years agoFix nullness errors reported by Eclipse 67/93167/3
Robert Varga [Sat, 26 Sep 2020 22:01:07 +0000 (00:01 +0200)]
Fix nullness errors reported by Eclipse

Eclipse provides a lot of noise around builders where we pass
down classes. This fixes them up by losening the contracts and
adding Class<@NonNull T> where generics are involved. Since we are
at it, also fixup the suite to generate fewer warnings.

JIRA: MDSAL-601
Change-Id: I7b21d88584a18cc1bed6ea776b22e82584484339
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1fcf6b07a764c57aff7435cffd620c4995d1db40)

3 years agoRemove trailing comments 66/93166/1
Robert Varga [Mon, 19 Oct 2020 09:41:43 +0000 (11:41 +0200)]
Remove trailing comments

Trailing comments are frowned upon, remove them.

Change-Id: I5897228a28e771551548e4c3c6d88b51ef6b32a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0b1be1cc75df9f36c31099fd1c37efdfdc02e7ae)

3 years agoProperly cache caseType class 65/93165/1
Robert Varga [Sun, 18 Oct 2020 20:21:01 +0000 (22:21 +0200)]
Properly cache caseType class

We lost this bit when we were switching annotations. Since we
require Java 11, we should no longer be exposed to the JDK issue.

Change-Id: I769686186f1b03a2bd7e00bbc9474d91278c8d91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0c711d61963257cb187ba66ff3ab3dcfa759cdee)

3 years agoAdd InstanceIdentifier.verifyTarget() 64/93164/1
Robert Varga [Sun, 3 May 2020 08:04:18 +0000 (10:04 +0200)]
Add InstanceIdentifier.verifyTarget()

There are a number of places where users are casting InstanceIdentifiers,
just to restore type-safety after a type-unsafe operation, such as
going through serialization. Add InstanceIdentifier.verifyTarget(),
which restores type safety.

Change-Id: I2bfa69eb938b4a6b86b88e4054369b3abadf7c7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d9051de0269b18ca9bbcf1ce43e29e666f94dd1b)

3 years agoAdd ForwardingYangLibSupport 71/93071/1
Robert Varga [Wed, 14 Oct 2020 14:48:23 +0000 (16:48 +0200)]
Add ForwardingYangLibSupport

OSGi wiring for YangLibSupport is using forwarding in two
implementations. Simplify both by factoring out
ForwardingYangLibSupport.

Change-Id: I05a48ebd689a47c248d79f8bdb878994098ce63f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 48000bfc57f2f974d0114df51e444f9b731b9f0f)
(cherry picked from commit b050aa9d39e5ddf99a9303a4a9f3292a00771af7)

3 years agoAdd YangLibSupport.implementedRevision() 70/93070/1
Robert Varga [Wed, 14 Oct 2020 14:41:40 +0000 (16:41 +0200)]
Add YangLibSupport.implementedRevision()

We want to decompose our services as much as possible, and RESTCONF
legally needs to know the version we are implementing. Expose that
version.

JIRA: MDSAL-595
Change-Id: Ic8dc27adf2c85658e364712af616db7ac558b595
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 74f4dd77a96fb84645892ee268a54f07491d84d2)
(cherry picked from commit bb8aa291f4edf81557c2a80a28c4bde9520234e0)

3 years agoAdd Replicator's config files to etc on startup 93/92193/1
Tibor Král [Wed, 19 Aug 2020 10:05:28 +0000 (12:05 +0200)]
Add Replicator's config files to etc on startup

Currently the configuration files don't reside inside
the etc folder when the bundle starts up. They either
have to be created manually or by editing via Karaf
Config CLI. This makes it more difficult for the
user to see the options and modify them as needed.

Add the files directly to the bundle stating all the
options and filled with default value. Then load them
inside the etc folder on bundle startup.

Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Change-Id: If55316d89dcb5570d4f9f8a5b30fd5310ad90a48

3 years agoBump versions to 5.0.15-SNAPSHOT 46/91546/2
Robert Varga [Wed, 22 Jul 2020 17:44:27 +0000 (19:44 +0200)]
Bump versions to 5.0.15-SNAPSHOT

This starts the next development iteration.

Change-Id: I3471a3d927dbf085670da9f2691190b1e477353c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump odlparent/yangtools to 6.0.11/4.0.13 42/91542/1
Robert Varga [Wed, 22 Jul 2020 15:22:59 +0000 (17:22 +0200)]
Bump odlparent/yangtools to 6.0.11/4.0.13

Pick up upgrades needed for netty and YANG parser fixes.

Change-Id: I3ea4787ec552cd85331253f3cbaec556a9718b0d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse soft values in ValueTypeCodec 96/91496/1
Robert Varga [Tue, 21 Jul 2020 08:39:32 +0000 (10:39 +0200)]
Use soft values in ValueTypeCodec

Using strong value references in STATIC_CODECS cache leads to target
classes being strongly reachable through the codec itself -- hence
they will never be weakly reachable, hence they will not be GC'd.

Use soft values, which allows the classes to be GC'd as soon as the
JVM decides they have not been used for a while -- which is what
will happen when a class becomes almost-eligible for unloading.

JIRA: MDSAL-580
Change-Id: I7956d564c46a9a1d52ba85fbe61f3a19c507a902
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 0150ddd6c4e3c61a761dacb9161e84b3f38b748a)

3 years agoBump versions to 5.0.14-SNAPSHOT 63/91363/4
Robert Varga [Fri, 17 Jul 2020 09:03:27 +0000 (11:03 +0200)]
Bump versions to 5.0.14-SNAPSHOT

This starts the next development iteration.

Change-Id: I3a1c2090f7e7b99d88d465ab77b4908b32be0a71
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoResolve generated type for leafrefs targetting unions 89/91089/11
Tomas Cere [Fri, 10 Jul 2020 11:51:54 +0000 (13:51 +0200)]
Resolve generated type for leafrefs targetting unions

We need to be able to resolve the generated type of unions
which are targeted by leafrefs during codegen.
Introduce a path that attempts this by consulting ModuleContext
for the generated types in case we are resolving a leafref.

JIRA: MDSAL-572
Change-Id: I40448a4c9f2fdf26280e0911ebb9dcc5fc60d3f1
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump to odlparent-6.0.10/yangtools-4.0.12 62/91362/2
Robert Varga [Fri, 17 Jul 2020 09:02:33 +0000 (11:02 +0200)]
Bump to odlparent-6.0.10/yangtools-4.0.12

Pick up latest upgrades from upstreams.

Change-Id: I130a9317bb186f9486deeac850298b8e65458690
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoSpeed up BuilderGenerator matcher 58/91358/1
Robert Varga [Wed, 15 Jul 2020 15:43:28 +0000 (17:43 +0200)]
Speed up BuilderGenerator matcher

We do not need to establish FQCN, as we can compare just JavaTypeNames,
which is faster.

Change-Id: I3c387e841fbf2d450195d864a928608bab8128ad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d613481dfab5abd014e36fc8f77b291743c57dbf)

3 years agoGenerate implementedInterfaces method for DataRoot 54/91354/2
Tomas Cere [Thu, 16 Jul 2020 11:34:25 +0000 (13:34 +0200)]
Generate implementedInterfaces method for DataRoot

In case we have multiple top level uses statements we also
need to generate an override of implementedInterfaces() to prevent
clashes with the return types of the extended interfaces.

JIRA: MDSAL-573
Change-Id: I07ad3f6dc5a18369f0be4bdaba03c6c17072297b
Signed-off-by: Tomas Cere <tomas.cere@pantheon.tech>
(cherry picked from commit 30794cd4999beb5a7a4902d4cf0484692cbd629b)

3 years agoInline single-use locals 10/91310/1
Robert Varga [Mon, 13 Jul 2020 20:11:22 +0000 (22:11 +0200)]
Inline single-use locals

We are storing instrumented type in a local, and use that local
only once. Just inline the getter to trim down some generator
bytecode.

Change-Id: Ibfac0c2dc1d294643cbe2619d14e1672314d8bdf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9d0e430e7f936148bf1fe23744b7190a808f09cc)

3 years agoClean up CodecDataObjectGenerator documentation 09/91309/1
Robert Varga [Mon, 13 Jul 2020 20:06:45 +0000 (22:06 +0200)]
Clean up CodecDataObjectGenerator documentation

We have a few typos and opportunities for cleanup.

Change-Id: Ibb9f5804ccc05c1b58c51d0ba1ac03fbaef7b223
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7597353c19d9b3417aac176341c2aa33087290e1)

3 years agoBump versions to 5.0.13-SNAPSHOT 32/91032/2
Robert Varga [Wed, 8 Jul 2020 20:36:10 +0000 (22:36 +0200)]
Bump versions to 5.0.13-SNAPSHOT

This starts the next development iteration.

Change-Id: I9eb7bce83da651247220a3f1ca5c4ae72c706ba8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd documentation for Netty Replication utility 38/90338/9
Tibor Král [Mon, 8 Jun 2020 17:21:11 +0000 (19:21 +0200)]
Add documentation for Netty Replication utility

Provide more information about the replication mechanism,
instalation, configuration and usage.

Change-Id: Ifcfae6853bc1946ac9e58b84219354a543e87ed8
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
3 years agoNetty Replicator - improve the reconnection and keepalive mechanisms 15/90815/11
Tibor Král [Tue, 30 Jun 2020 01:29:04 +0000 (03:29 +0200)]
Netty Replicator - improve the reconnection and keepalive mechanisms

In some cases during a network partition the disconnected
channel got closed with delay after a new channel was already created.
This started reconnection process which closed the new channel and
created yet another one.

Also improve the keepalive mechanism since some types of network
partitions left one side unaware of the issue.  It is important both
the Sink and the Source are notified about any connection issue as
soon as possible. PING-PONG messages are exchanged between the two
sides when no deltas are sent for a period of time

Configuration options keepalive-interval-seconds and
max-missed-keepalives added to both configurations.

Change-Id: Iebde72963bddb748ab97617d07cfc77cd8614da4
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump to odlparent-6.0.9/yangtools-4.0.11 31/91031/1
Robert Varga [Wed, 8 Jul 2020 20:33:22 +0000 (22:33 +0200)]
Bump to odlparent-6.0.9/yangtools-4.0.11

Pick up latest upgrades from upstreams.

Change-Id: Id26848fdeae218baab1b01701acf3e940ca417cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoProvide auto-reconnection for Sink 00/90700/5
Tibor Král [Thu, 25 Jun 2020 16:17:55 +0000 (18:17 +0200)]
Provide auto-reconnection for Sink

In case there is a network partition the Sink needs to
be aware of it and schedule reconnect. This patch adds
configuration knob keepalive-interval-seconds to tweak
how soon after network failure the Sink gets notified.

Change-Id: I1eb2880bb00d1101cd587e4a737ba2f8a485b7ed
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoImprove tests and blueprints of Netty Replication Utility 11/90611/7
Tibor Král [Tue, 23 Jun 2020 20:58:52 +0000 (22:58 +0200)]
Improve tests and blueprints of Netty Replication Utility

- Test replication of actual DataTreeChanges from Source
to Sink and fix any related issues.
- Move blueprints to /OSGI-INF/blueprint/ and fix any
related wiring issues

Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Change-Id: I89c8228538e0462bbe61ca49e1ecf09dad4d4aaf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd a unit test for netty replication 69/90569/2
Robert Varga [Mon, 22 Jun 2020 12:44:30 +0000 (14:44 +0200)]
Add a unit test for netty replication

This is a simple unit test, which we can use to validate establishment
of source connection. This flushes out a few bugs, which are also
addressed.

Change-Id: Ie8e5ae1772ed5dc544f434d7db44b2b31b54443b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit eb21f828aae0e6c2afdc8779e7824ad5abb2e879)

3 years agoBump to odlparent-6.0.8/yangtools-4.0.10 46/90546/1
Robert Varga [Mon, 22 Jun 2020 07:12:17 +0000 (09:12 +0200)]
Bump to odlparent-6.0.8/yangtools-4.0.10

Pick up latest fixes and improvements.

Change-Id: I2d30edbc98adb26d470a1b07ce64150fc6965de1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFixup mdsal-docs 05/90505/1
Robert Varga [Fri, 19 Jun 2020 08:51:02 +0000 (10:51 +0200)]
Fixup mdsal-docs

Merge job is failing, fix it up.

Change-Id: Ifc30e344bc9f6a9548b4acb385a5fbfdb6723c4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd basic netty replication utility 65/90465/5
Robert Varga [Wed, 17 Jun 2020 10:29:12 +0000 (12:29 +0200)]
Add basic netty replication utility

This adds a source/sink datastore replication component based on
Netty TCP channels. The sink (consumer) connects to source (producer)
via a channel, specifies which data tree it wants replicated and
then listens for DataTreeCandidates to arrive from the source.

Change-Id: Ib283baa9a186ae2fb4ccf909b257006d4645de37
Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoFix leafref-to-enum encoding 76/90376/2
Peter Valka [Wed, 6 May 2020 07:54:18 +0000 (09:54 +0200)]
Fix leafref-to-enum encoding

When we have a leafref pointing to an enum via an absolute path,
in and RPC, we end up using a no-op codec, whereas we should be
extracting the name (from enum constant, or SchemaContext).

This ends up being a problem not in codec itself, as it is using
reflection to acquire the return type, defaulting to no-op.

The problem lies with AbstractTypeGenerator, which ends up not
being able to look up the generated type in case of RPC. The problem
here is the order in which types are generated, as the leaf being
referenced is generated after the RPC itself -- hence we cannot
find the definition.

While this is again highlighting the problem of single-pass code
generation, we can side-step the problem by moving RPC/notification
generation after the root data generation.

As a further complication, we need to record the enum/schema mapping,
as the codec needs to be able to find them via leafref types.

JIRA: MDSAL-552
Change-Id: Ifd92807029cdb7ba92dcad5655bb34d3ff4cef9d
Signed-off-by: Peter Valka <Peter.Valka@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit f9eceb5081877db3fc3f840c44e943605f3f4335)

3 years agoBump byte-buddy to 1.10.11 36/90336/1
Robert Varga [Mon, 8 Jun 2020 14:47:44 +0000 (16:47 +0200)]
Bump byte-buddy to 1.10.11

https://github.com/raphw/byte-buddy/blob/master/release-notes.md#4-june-2020-version-11011

Change-Id: I8538ecfa410bfc8fdbdbb87926914961ba2c6f1a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1dd7ac4e041870d384cd92756d8d3a28ff3edb19)

3 years agoBump xtendbeans to 1.3.2 32/90332/1
Robert Varga [Mon, 8 Jun 2020 10:57:38 +0000 (12:57 +0200)]
Bump xtendbeans to 1.3.2

This fixes synthetic bridge method issue.

Change-Id: I3766deed8b8ed8bab5e17dc81e5fb8711c0b62e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 512a5596b303d6cea04e0107a258625a1efc03fa)

3 years agoBump versions to 5.0.12-SNAPSHOT 18/90218/2
Robert Varga [Tue, 2 Jun 2020 13:20:09 +0000 (15:20 +0200)]
Bump versions to 5.0.12-SNAPSHOT

This starts the next development iteration.

Change-Id: I44c316c3b83434878fcd18dac3db627cb58af0d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoBump to odlparent-6.0.7 and yangtools-4.0.9 17/90217/2
Robert Varga [Tue, 2 Jun 2020 13:19:30 +0000 (15:19 +0200)]
Bump to odlparent-6.0.7 and yangtools-4.0.9

Pick up upstream fixes.

Change-Id: I5de6520d14de405deac9d4e3dded1392e5073624
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoAdd odlparent-docs to links 16/90216/1
Robert Varga [Tue, 2 Jun 2020 13:16:57 +0000 (15:16 +0200)]
Add odlparent-docs to links

We may want to reference odlparent constructs, make sure we have
the links to support it.

Change-Id: I6a91716af02f2c5c68d424d4e9dae5c8a00829fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 years agoUse odl-mdsal-broker in odl-mdsal-binding-dom-adapter 19/90119/1
Robert Varga [Fri, 29 May 2020 15:41:21 +0000 (17:41 +0200)]
Use odl-mdsal-broker in odl-mdsal-binding-dom-adapter

Binding API implementations ride on top of DOM implementations,
which are provided by odl-mdsal-dom-broker. Make sure we express
that in packaging. Solves duplicate packaging of mdsal-dom-broker.

JIRA: MDSAL-560
Change-Id: I6c0da82473d0c65b3586a3f8fcf9f5fa7b815352
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4605d53ab4ce5bca477acb10b4f53fda18b0d54a)

3 years agoBump byte-buddy to 1.10.10 17/90117/1
Robert Varga [Fri, 29 May 2020 20:49:02 +0000 (22:49 +0200)]
Bump byte-buddy to 1.10.10

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.10

Change-Id: I536fc350302459e59245a87ab0d105d8df6ff3df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit d8b07ad5fb6adf8429dbacd21b74e39f9ee424c6)

3 years agoBump byte-buddy to 1.10.9 16/90116/1
Robert Varga [Tue, 7 Apr 2020 09:52:49 +0000 (11:52 +0200)]
Bump byte-buddy to 1.10.9

https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.8
https://github.com/raphw/byte-buddy/releases/tag/byte-buddy-1.10.9

Change-Id: I6dd7ef731fefd5de334b268f23c9a24bf5ae0a41
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 47ed66475387e149a10bbd93d351d8c2e91e8afc)

3 years agoBump byte-buddy to 1.10.7 15/90115/1
Robert Varga [Tue, 21 Jan 2020 11:58:48 +0000 (12:58 +0100)]
Bump byte-buddy to 1.10.7

There are a number of improvements, including Java compatibility,
update our repackaged version to current latest.

Change-Id: I8b54a1b20e510e2738d6f61f62d7b088db534e78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit c4903ecfaca2898bcda71921c839c066411a7c6c)

3 years agoDocument tests 10/90110/1
Robert Varga [Fri, 29 May 2020 18:52:20 +0000 (20:52 +0200)]
Document tests

Since we have brought it a dependency on test-jar, we need to
pull it to docs, too.

JIRA: MDSAL-556
Change-Id: I4914de8c8dc3cc437ec1f162352374abc99186cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9b5402ab9c6fbab19ef86fa80fc2ac881b264bd2)

3 years agoCleanup DataBrokerTestModule error reporting 90/90090/1
Robert Varga [Fri, 29 May 2020 12:40:52 +0000 (14:40 +0200)]
Cleanup DataBrokerTestModule error reporting

Do not declare RuntimeException as thrown and do not wrap reported
RuntimeExceptions. Also make sure we use IllegalStateException as
the wrapper.

JIRA: MDSAL-556
Change-Id: Ifc47004c6d5cc2c974045c3f4d94154b506c8ebd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4e78a1e85ca3bd04a204bb05ab3fa1695cbbf94b)

3 years agoDataBrokerTestModule getBindingToNormalizedNodeCodec() & Co. 78/90078/2
Michael Vorburger [Thu, 18 Jan 2018 02:15:23 +0000 (03:15 +0100)]
DataBrokerTestModule getBindingToNormalizedNodeCodec() & Co.

need these exposed for a new standalone component style test  I'm on

JIRA: MDSAL-556
Change-Id: I5efd3a6e507d46d035067a561aaca7c2f80f51e6
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 8a6e5f0946f5ed60f7554c51e7621e2ac3e41edd)

3 years agoBug 8163: getDataTreeChangeListenerExecutor() & DataBrokerTestModule 77/90077/1
Michael Vorburger [Thu, 13 Jul 2017 21:17:24 +0000 (02:47 +0530)]
Bug 8163: getDataTreeChangeListenerExecutor() & DataBrokerTestModule

Adjust AbstractDataBrokerTestCustomizer with a
getDataTreeChangeListenerExecutor() instead of a
setDataTreeChangeListenerExecutor(), just for more consistency with the
existing getCommitCoordinatorExecutor() method.  Also less confusing (to
me) than seeing the private Executor set by default which may get
changed by the setter later.

Adjust ConcurrentDataBrokerTestCustomizer with the
useMTDataTreeChangeListenerExecutor as a constructor argument, instead
of an useMTDataTreeChangeListenerExecutor() method, just for consistency
for how you already have it in AbstractConcurrentDataBrokerTest.

Extend ConstantSchemaAbstractDataBrokerTest and DataBrokerTestModule to
allow passing through this new opt-in tweak flag, so that tests in
downstream projects such as genius and netvirt can staring exploring
enabling this.

JIRA: MDSAL-556
Change-Id: I4ad85ac48163d2f4bac865f46a3b047d5b7d333a
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 2224375d3c22043958c31195044b4169cb1caff7)

3 years agoAbstractConcurrentDataBrokerTest @deprecate-s the AbstractDataBrokerTest 76/90076/1
Michael Vorburger [Mon, 6 Feb 2017 23:23:31 +0000 (00:23 +0100)]
AbstractConcurrentDataBrokerTest @deprecate-s the AbstractDataBrokerTest

This is take #2 on a similar earlier attempt which made the same change
directly in AbstractDataBrokerTest, which broke some downstrean tests,
which were BADLY WRITTEN (!) because the assumed single threaded direct
execution (which DataBroker does not guarantee).

https://bugs.opendaylight.org/show_bug.cgi?id=7538 has full background

JIRA: MDSAL-556
Change-Id: I05ac3525bdcf1ab9c99dfa15b98e090848d0fddc
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 3282f1989aba438817739bbf611fd133c381a5e7)

3 years agoAbstractDataBrokerTestTest which actually does something 75/90075/1
Michael Vorburger [Wed, 5 Oct 2016 16:22:25 +0000 (18:22 +0200)]
AbstractDataBrokerTestTest which actually does something

Incl. verification that each @Test cleans up after itself.  We had a
suspicion that this didn't work; it turns out that it actually does and
we had another problem somewhere else.  Contributing this test still
seems useful for future non-regression.

JIRA: MDSAL-556
Change-Id: I295ebde45a0c030ab74852788b45203cdf6639e0
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 4a461d624f03984047b593c823112feac729aceb)

3 years agoDataBrokerTestModule: use AbstractDataBrokerTest without inheritance 74/90074/1
Michael Vorburger [Wed, 10 Aug 2016 15:22:30 +0000 (17:22 +0200)]
DataBrokerTestModule: use AbstractDataBrokerTest without inheritance

While starting to write JUnit tests (for functional components) with the
AbstractDataBrokerTest, I found myself not liking its design which
forces one to use a class SomeTest extends AbstractDataBrokerTest...

Modern JUnit tests should be written by composition, not enforced
inheritance.  Thus this new DataBrokerTestModule allows one to obtain a
DataBroker suitable for Tests from anywhere.

The *(Test)Module naming convention is obviously inspired by a DI point
of view (think Spring Framework's @Configuration classes, or Google
Guice or Dagger (yay!) *Module classes - which is exactly what this
really is - a particular way to obtain an instance of an
implementationof some service (here a DataBroker) in a certain
environment (here for tests).

The internal implementation of DataBrokerTestModule could be changed
later; I guess ideally what's in AbstractDataBrokerTest could go into
DataBrokerTestModule and AbstractDataBrokerTest could use it, but for
now I'm too lazy to change that, as this does the trick nicely.  Later
implementation changes would be transparent to users of
DataBrokerTestModule.

JIRA: MDSAL-556
Change-Id: I9641f527bbc0cb92732f2e513cdd64cc6a837200
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e94d340da0d1b19e506fe2ad7e4e19c79959e241)

3 years agoFix SnapshotBackedWriteTransaction error message 88/89988/1
Robert Varga [Tue, 26 May 2020 11:15:42 +0000 (13:15 +0200)]
Fix SnapshotBackedWriteTransaction error message

The message is misleading, as we are not performing a write, but
a merge operation.

Change-Id: I8b61ac7b0bf5f3ae746a2b6c1883a02e6fe61e47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit fb0a271c02454f11cd3c64130513dfb7caf3f386)

3 years agoAdd test-sources for mdsal-binding-dom-adapter 65/89665/1
Robert Varga [Mon, 11 May 2020 15:58:41 +0000 (17:58 +0200)]
Add test-sources for mdsal-binding-dom-adapter

We are (unwisely) constructing a test-jar here, hence we should
also be publishing the corresponding sources.

Change-Id: I08ffb23b1e5eb8036e16237b8bc6fb0c6480f848
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 9cf191a88781e5208392b08740e480fd048e58c2)

3 years agoImprove notification delivery defensiveness 89/89489/1
Robert Varga [Mon, 27 Apr 2020 11:45:28 +0000 (13:45 +0200)]
Improve notification delivery defensiveness

If a listener throws an exception, make sure to log it and proceed
as if nothing happened.

JIRA: MDSAL-544
Change-Id: I0ca54bb5c517115b840ad03ea24d442c7762ff05
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit bc58fd6b46acb6f94d6b9395a67f7112d134f0c1)

3 years agoFix unsubscribe checks in DOMNotificationRouterEvent 18/89418/1
Robert Varga [Mon, 27 Apr 2020 11:42:12 +0000 (13:42 +0200)]
Fix unsubscribe checks in DOMNotificationRouterEvent

The checks here are based on old assumption that the listener
would be set to null, which does not hold true for quite some
time. Update the check to close a simple race.

JIRA: MDSAL-545
Change-Id: I950ffcbcf732d4c24dcad675b81c2889465d9045
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 5.0.11-SNAPSHOT 89/89189/1
Robert Varga [Tue, 21 Apr 2020 09:02:54 +0000 (11:02 +0200)]
Bump versions to 5.0.11-SNAPSHOT

This starts the next development iteration.

Change-Id: Ia1dc6af2c3c76697d4ac70785ebff4b9c55ffe3d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>