mdsal.git
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)

4 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)

4 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>
4 years agoBump to odlparent-6.0.6 and yangtools-4.0.8 17/89117/3
Robert Varga [Sat, 18 Apr 2020 08:54:21 +0000 (10:54 +0200)]
Bump to odlparent-6.0.6 and yangtools-4.0.8

Pick up latest upstream updates and update docs links to reflect
test harness updates.

Change-Id: I63a59ef56874e5bb9586acccbe9ca7f3952d9ac3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove grouping sort allocation 07/89107/3
Robert Varga [Fri, 17 Apr 2020 19:37:28 +0000 (21:37 +0200)]
Improve grouping sort allocation

Pre-allocating the result list saves us the common case when
the input is actually empty.

Change-Id: I237a75db38e8e0c160b204875bc5824433e9c3dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove grouping error reporting 08/89108/2
Robert Varga [Fri, 17 Apr 2020 19:54:00 +0000 (21:54 +0200)]
Improve grouping error reporting

Reporting FQCN here is useful, as it is giving us crucial information
as to what class is being generated -- including the namespace.

Change-Id: I1ad5f6a0a568a71656e338ae0d5d9e3f863103a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCache YangModuleInfo type name 16/89016/2
Robert Varga [Wed, 18 Dec 2019 09:05:15 +0000 (10:05 +0100)]
Cache YangModuleInfo type name

Analysis of a heap dump shows we are creating a number of instances
pointing to the same type for the purposes of having the QNAME constant.

As we have the context in which we are creating YangModuleInfo,
instantiate a primitive cache to de-duplicate these definitions.

JIRA: MDSAL-515
Change-Id: I9bb52d04627e91eac3adff672b06f6340cac157f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix logic ensuring parent presence 81/88981/1
Robert Varga [Wed, 8 Apr 2020 13:01:59 +0000 (15:01 +0200)]
Fix logic ensuring parent presence

When we are asked to create intermediate nodes for a path, whose
parent is the conceptual root (i.e. its parent is empty), we should
not attempt to merge it, as it just does not make sense.

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

4 years agoMigrate test to use mergeParentStructure{Merge,Put} 80/88980/1
Robert Varga [Wed, 8 Apr 2020 12:22:51 +0000 (14:22 +0200)]
Migrate test to use mergeParentStructure{Merge,Put}

We have deprecated these methods, make sure we migrate the test
so that it does not add false warnings.

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

4 years agoRemove superfluous @NonNull annotations 38/88938/1
Robert Varga [Wed, 8 Apr 2020 12:31:02 +0000 (14:31 +0200)]
Remove superfluous @NonNull annotations

These annotations are inherited from interface contract, there is
no point in specifying them again.

Change-Id: I7e2cb6d353b358f5c2eefc03181803377e047750
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix YANG snippet escaping 39/88339/1
Robert Varga [Mon, 2 Mar 2020 12:58:50 +0000 (13:58 +0100)]
Fix YANG snippet escaping

This is the non-javadoc path for module generation, where we are
failing to escape potential unicode references. Add the proper
callout and also optimize it to be a faster no-op when not
applicable, properly documenting what is going on.

JIRA: MDSAL-529
Change-Id: Ib21ed4f15555d49aaa7eb3dac61043c4b2e90451
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoPropagate grouping inference flag 31/88331/2
Samuel Kontris [Fri, 28 Feb 2020 13:33:02 +0000 (14:33 +0100)]
Propagate grouping inference flag

The test case ends up looking through the magic code flagged
for refactoring -- which is losing knowledge that the parent
node is actually a grouping. Fix this up by propagating the
flag correctly.

JIRA: MDSAL-519
Change-Id: I8fe04e688adfcc068ff29e90a039530bcd56b3c3
Signed-off-by: Samuel Kontris <samuel.kontris@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove unneeded cast 64/88164/1
Robert Varga [Sat, 29 Feb 2020 10:28:54 +0000 (11:28 +0100)]
Remove unneeded cast

Pointed out by Eclipse, very true.

Change-Id: If9ad77f87889e423e7918badc1b4bff2480079ca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoModernize ListenerRegistry users 63/88163/1
Robert Varga [Sat, 29 Feb 2020 10:16:40 +0000 (11:16 +0100)]
Modernize ListenerRegistry users

ListenerRegistry has been modernized for Java 8 way back
in https://git.opendaylight.org/gerrit/c/yangtools/+/73957 and our
users have not been updated.

Use new API surface introduced in that patch, which actually makes
our code cleaner.

Change-Id: Id7e554ed229638cdc871d5b4152cc6795a662514
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove TracingBroker.name 62/88162/1
Robert Varga [Sat, 29 Feb 2020 11:58:15 +0000 (12:58 +0100)]
Remove TracingBroker.name

This can only ever be 'default', remove it as a property.

Change-Id: I66ca5bb6fdf1072cc3f9550866ff375f59a6c544
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not use by-listener unregistration 61/88161/1
Robert Varga [Sat, 29 Feb 2020 10:36:10 +0000 (11:36 +0100)]
Do not use by-listener unregistration

This test is the only one needing access to unregister(L). Remove
it via proper registration interaction.

Change-Id: I5eff48b7123820bb090fdb834054fa78fd767e8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoExpand test suite to cover uses-augment of actions 37/88137/1
Robert Varga [Fri, 28 Feb 2020 17:39:51 +0000 (18:39 +0100)]
Expand test suite to cover uses-augment of actions

Augment can also target a relative path from uses context, this
expands the testing model to cover that case, too.

The test case flushes out the problem of not handling
action/notification nodes when targeted in this manner, leading
to an obvious hiccup.

JIRA: MDSAL-517
Change-Id: If389440622c31f544917b04e3825fe6e08e08244
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate Mdsal517Test a bit 36/88136/1
Robert Varga [Fri, 28 Feb 2020 17:36:28 +0000 (18:36 +0100)]
Update Mdsal517Test a bit

This just cleans up naming to prevent confusion.

JIRA: MDSAL-617
Change-Id: I75d2e95d2396f63d05cd533f16057f556850763c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix augmentation pointing to a grouping action's input 26/88126/2
miroslav.kovac [Thu, 27 Feb 2020 16:51:37 +0000 (17:51 +0100)]
Fix augmentation pointing to a grouping action's input

When augmentation targets an action input which itself is defined
in a grouping, we need to actually lookup the original definition.

Add a type aliasing information, which should be consulted when
making a simple reference to a type -- and use it in
augmentationToGenTypes().

JIRA: MDSAL-517
Change-Id: I1ef383e8777a7c09a979cbdd84f71be3a0f9b021
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSwitch from NPE to ISE 25/88125/1
Robert Varga [Fri, 28 Feb 2020 05:55:29 +0000 (06:55 +0100)]
Switch from NPE to ISE

When we fail to locate a type it constitutes an IllegalState, not
a plain NPE.

Change-Id: I46eaa470342a5e72ad6a92aefed97e458a2ca398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBindingReflections.getModuleInfo() returns @NonNull 19/88119/1
Robert Varga [Thu, 27 Feb 2020 15:38:47 +0000 (16:38 +0100)]
BindingReflections.getModuleInfo() returns @NonNull

A null return here would be an API violation, make sure we catch
these in BindingReflections and do not bother users with potential
nulls.

Change-Id: I1670a46d1de4aeac0730538822157ec6ae216011
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix action/grouping lookup mechanics 92/88092/2
Robert Varga [Thu, 27 Feb 2020 09:38:33 +0000 (10:38 +0100)]
Fix action/grouping lookup mechanics

When we are following references towards the original definitions
we need to mind the fact that 'uses' statement may point to a grouping
in a different module and hence we need to adjust namespace accordingly.

The same thing applies when we want to find generated types for such
actions' input/output -- here we need to acquire the correct
ModuleContext.

JIRA: MDSAL-516
Change-Id: I1931279beb8e663e6d8558d50c5d7d274e248cf3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse osgi-core constants 62/87962/1
Robert Varga [Wed, 26 Feb 2020 10:38:07 +0000 (11:38 +0100)]
Use osgi-core constants

Just to keep things consistent, use OSGi's Constants class to get
the bundle id for framework (i.e. SYSTEM_BUNDLE_ID).

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

4 years agoRefactor GeneratedClassLoadingStrategy 01/87901/1
Robert Varga [Tue, 18 Feb 2020 08:58:07 +0000 (09:58 +0100)]
Refactor GeneratedClassLoadingStrategy

This class holds two implementations, each of which is a singleton.
Make sure we lazy-load implementation classes so that the CHA can
be more effective.

JIRA: MDSAL-392
Change-Id: Ia31f63d877ec1025e1a06bf8676d918857e6fd1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate BindingRuntimeContext.getEnumMapping() 00/87900/1
Robert Varga [Mon, 17 Feb 2020 22:36:15 +0000 (23:36 +0100)]
Deprecate BindingRuntimeContext.getEnumMapping()

Generated enumerations capture their YANG-declared name and expose
it as their method.

JIRA: MDSAL-392
Change-Id: Iac16b6b3599565f059332ed079c432c0603ac500
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate AugmentationReader for removal 99/87899/1
Robert Varga [Tue, 18 Feb 2020 21:23:52 +0000 (22:23 +0100)]
Deprecate AugmentationReader for removal

AugmentationHolder provides the equivalent functionality in-line
in the DataObject itself. Deprecate AugmentationHolder for removal.

JIRA: MDSAL-392
Change-Id: I51044365a38e26f57792bb2036a2775f3b92d711
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDeprecate DispatchSerializers for removal 34/87834/2
Robert Varga [Mon, 17 Feb 2020 17:13:40 +0000 (18:13 +0100)]
Deprecate DispatchSerializers for removal

These classes are not used anywhere, deprecate them for removal.

Change-Id: I4538b1c794cd21fd0f21921c0838db620af5eff2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix checkstyle a bit 36/87836/1
Robert Varga [Mon, 17 Feb 2020 16:55:45 +0000 (17:55 +0100)]
Fix checkstyle a bit

We have a misaligned method here, fix that up.

Change-Id: Iff4ad3e9a5c2da1e64f73f8b3dfaf78d77b1db85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump to odlparent-6.0.5/yangtools-4.0.7 43/87543/1
Robert Varga [Mon, 10 Feb 2020 14:18:45 +0000 (15:18 +0100)]
Bump to odlparent-6.0.5/yangtools-4.0.7

This picks up latest updates from both yangtools and odlparent.

Change-Id: I5ad354f87e65c4ea2141d3bc13c414e89869f833
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove use of org.junit.rules.ExpectedException 00/87100/1
Robert Varga [Thu, 23 Jan 2020 11:02:46 +0000 (12:02 +0100)]
Remove use of org.junit.rules.ExpectedException

We can use assertThrows() instead.

Change-Id: I8d752851d11496c74388f625067e41582447a8c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 5.0.10-SNAPSHOT 26/87026/1
Robert Varga [Fri, 17 Jan 2020 11:04:20 +0000 (12:04 +0100)]
Bump versions to 5.0.10-SNAPSHOT

This starts the next development iteration.

Change-Id: I51753f3615b32d290b6716cb1b996a9df01efb46
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix path namespace resolution 21/87021/1
miroslav.kovac [Mon, 16 Dec 2019 15:57:22 +0000 (16:57 +0100)]
Fix path namespace resolution

If a path is defined in terms of a submodule-local import,
SchemaContextUtil.findDataSchemaNode() breaks down because
it's reparse attempt fails to find the import in the actual
module.

SchemaContextUtil is providing findDataTreeSchemaNode() which
works properly on parsed PathExpression, use that instead.

JIRA: MDSAL-499
Change-Id: Ifa8a8958d7118d851d27fcc2c70c6d8382e3e3c0
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump version to 5.0.9-SNAPSHOT 88/86988/2
Robert Varga [Thu, 16 Jan 2020 15:52:25 +0000 (16:52 +0100)]
Bump version to 5.0.9-SNAPSHOT

This starts the next development iteration.

Change-Id: I33871dca5983daada30a3ddc63c4fb2dec2adb7e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump to odlparent-6.0.4 and yangtools-4.0.6 80/86980/1
Robert Varga [Thu, 16 Jan 2020 14:35:00 +0000 (15:35 +0100)]
Bump to odlparent-6.0.4 and yangtools-4.0.6

Pick up latest updates and fix for SFT.

Change-Id: Ia95f9aa740d77407043d7a59823c0c71cad0e681
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump version to 5.0.8-SNAPSHOT 23/86923/1
Robert Varga [Wed, 15 Jan 2020 11:30:31 +0000 (12:30 +0100)]
Bump version to 5.0.8-SNAPSHOT

This starts the next development iteration.

Change-Id: I92ce66cd6adf2b3af8f0d8efcafbef1dec9895f1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate away from DataNodeIterator 19/86919/1
Robert Varga [Tue, 14 Jan 2020 16:09:05 +0000 (17:09 +0100)]
Migrate away from DataNodeIterator

We do not need to collect the entire analysis, just typedefs
(and containers in a test). Migrate to new SchemaUtils methods which
provide exactly that functionality more efficiently.

Change-Id: Idfbe19c785351f3280eae33c476d533055cb16e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump to yangtools-4.0.5 18/86918/1
Robert Varga [Tue, 14 Jan 2020 16:02:29 +0000 (17:02 +0100)]
Bump to yangtools-4.0.5

This picks up the latest improvements.

Change-Id: If88980b7f1e38e1ee3c736a7bd04ddecd4d0f74e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse parallelStream() to generate files 04/86904/1
Robert Varga [Tue, 7 Jan 2020 20:35:22 +0000 (21:35 +0100)]
Use parallelStream() to generate files

This is a follow-up cleanup, reducing complexity of parallel dispatch
by taking advantage of parallel streams.

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

4 years agoGenerate binding files in parallel 03/86903/1
Robert Varga [Tue, 7 Jan 2020 20:35:22 +0000 (21:35 +0100)]
Generate binding files in parallel

Binding-generated files are standalone in that the process of
generating its source does not have any other side effects.

Improve the performance by generating these files in parallel
using the common ForkJoin pool -- thus taking advantage of all
available cores.

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

4 years agoAdd utility methods to strip zone from Ipv{4,6}Address 90/86790/1
Robert Varga [Tue, 7 Jan 2020 11:25:33 +0000 (12:25 +0100)]
Add utility methods to strip zone from Ipv{4,6}Address

Most callers really want to operate of Ipv4AddressNoZone, as a zone
does not make sense. Some amount of translation may be needed when
dealing with models which we have no control over, hence ensuring
no zone is present needs to be done quickly.

This adds ipv4AddressNoZoneFor(Ipv4Address), which does an efficient
check (for the case where the source is already a NoZone) and strips
the zone.

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

4 years agoParse IPv4-mapped IPv6 address as an IPv6 address 83/86783/1
Ajay Lele [Mon, 6 Jan 2020 18:49:50 +0000 (10:49 -0800)]
Parse IPv4-mapped IPv6 address as an IPv6 address

Inet6Address.getByAddress(byte[]) does not explicitly exist, and is
really InetAddress.getByAddress(byte[]). That method ends up returning
an Inet4Address for IPv4-mapped IPv6 addresses.

This in turn causes addressStringV6() to do the wrong thing and format
the address as an Ipv4. This is not caught by validation, as we are
skipping it by default -- and ends up causing problems way later when
such an address meets an enforcement point -- such as DOM->Binding
translation.

Fix this by using Inet6Address.getByAddress(String. byte[], NetworkInterface),
which is guaranteed to result in an Inet6Address.

Also add proper defences to addressStringV6(InetAddress), so that any
attempt to mis-use it is caught.

JIRA: BGPCEP-891
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
Change-Id: Ife4cc9e57bd49b45f2beb73462a865ad84483d8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1d8897caf5cec5f044f870f949a15fa57de54d71)

4 years agoEliminate shift variable 66/86766/1
Robert Varga [Mon, 6 Jan 2020 22:36:21 +0000 (23:36 +0100)]
Eliminate shift variable

We do not need to track shift amount, as we can can just shift
the entire previous result, leading to more invariants in the loop.

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

4 years agoAdd DottedQuad/int interface 63/86763/1
Robert Varga [Mon, 6 Jan 2020 22:17:05 +0000 (23:17 +0100)]
Add DottedQuad/int interface

DottedQuad is essentially an Ipv4Address, hence we should have
the same level of support. Add interface to create DottedQuad from
bits and serialize it to bits.

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

4 years agoAdd IPv4 address bridges to primitive int 53/86753/1
Robert Varga [Mon, 6 Jan 2020 17:41:24 +0000 (18:41 +0100)]
Add IPv4 address bridges to primitive int

Interfacing Ipv4Address(NoZone) with plain int is useful when
we we want to interface with byte streams, such as DataInput
or Netty's ByteBuf. This adds the methods to do so.

JIRA: MDSAL-509
Change-Id: Icce95e4a94ae41be4fc2aee352f83655ea55e89f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 98143cfc18f95eb4057587c1bdb4aa3b5e3b2e20)

4 years agoAdd HexString/DottedQuad/Uuid support to IetfYangUtil 17/86717/1
Robert Varga [Sun, 5 Jan 2020 12:33:34 +0000 (13:33 +0100)]
Add HexString/DottedQuad/Uuid support to IetfYangUtil

HexString is similar to a MacAddress and PhysAddress, hence it is
very simple to support it.

DottedQuad is essentially an Ipv4Address, hence it is almost as
simple to support it, too.

Uuid can be created from java.util.UUID, so that is the input
we are expecting.

JIRA: MDSAL-508
Change-Id: I82abd68b23bf857deeb9a64eefb69164fe6c8b24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7cbd12d8894b1703b19e70b07436a937a7b8d0bf)

4 years agoAdd uint24.yang 98/86698/1
Robert Varga [Sat, 4 Jan 2020 10:40:52 +0000 (11:40 +0100)]
Add uint24.yang

uint24 is used in a variety of binary protocols (rsvp,lisp,bgp),
this adds a common definition of this type and the corresponding
netty utilities.

JIRA: MDSAL-507
Change-Id: I5170c2bb9ed65d25bada3a85aca6c22f9ba4696b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 28d302faed8b6f57263991257163414ac073a37f)

4 years agoCleanup AbstractTypeProvider.isLeafRefSelfReference() 49/86649/1
Robert Varga [Mon, 30 Dec 2019 12:45:01 +0000 (13:45 +0100)]
Cleanup AbstractTypeProvider.isLeafRefSelfReference()

This method's logic eagerly strips the xpath, even when we may
end up not needing it. Refactor implementation to initialize
later (and bail quicker).

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

4 years agoSpeed up AbstractBuilderTemplate.removeProperty() 08/86608/3
Robert Varga [Thu, 19 Dec 2019 14:51:20 +0000 (15:51 +0100)]
Speed up AbstractBuilderTemplate.removeProperty()

Rather than performing a linear unbounded search followed by a
conditional remove, use an interator and remove the first matching
property, bailing out.

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

4 years agoDTOs for anydata/anyxml are not generated within a list 04/86604/2
wusandi [Wed, 25 Dec 2019 12:04:16 +0000 (20:04 +0800)]
DTOs for anydata/anyxml are not generated within a list

Code generation for container and list statements follows different
code paths and we have missed a hook in the latter to generate
opaque objects.

JIRA: MDSAL-506
Change-Id: I25a54362ceb09937ffe796081660afe7fa1d6bb2
Signed-off-by: wusandi <wusandi@163.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit e905b3d4792076251ddc276fa248e441bba157b2)

4 years agoSpeed up check for list 06/86606/1
Robert Varga [Thu, 19 Dec 2019 14:42:41 +0000 (15:42 +0100)]
Speed up check for list

This speeds up the check for list by first checking if key is not
null and searching for interface afterwards.

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

4 years agoBump yangtools to 4.0.4 03/86603/1
Robert Varga [Mon, 23 Dec 2019 17:00:18 +0000 (18:00 +0100)]
Bump yangtools to 4.0.4

This picks up the latest version, adjusting for API changes made
therein.

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

4 years agoUse BindingTypes.identifiable() 04/86504/1
Robert Varga [Thu, 19 Dec 2019 12:51:04 +0000 (13:51 +0100)]
Use BindingTypes.identifiable()

Instead of looking up Identifiable type each time we use it, use
the convenience method exposed through BindingTypes, improving
efficiency a bit.

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

4 years agoAdd BindingTypes.augmentation() 77/86477/1
Robert Varga [Wed, 18 Dec 2019 10:23:33 +0000 (11:23 +0100)]
Add BindingTypes.augmentation()

This migrates Types.augmentationTypeFor() into BindingTypes, so we
have proper separation.

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

4 years agoAdd BindingTypes.QNAME 72/86472/1
Robert Varga [Wed, 18 Dec 2019 08:52:20 +0000 (09:52 +0100)]
Add BindingTypes.QNAME

We are looking this type for each constant, which is not entirely
efficient. Add a constant to BindingTypes and use it directly, providing
a slight performance benefit.

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

4 years agoDeprecate Types.augmentableTypeFor() 71/86471/1
Robert Varga [Wed, 18 Dec 2019 08:48:31 +0000 (09:48 +0100)]
Deprecate Types.augmentableTypeFor()

This method has a mirror in BindingTypes, which is a more appropriate
place for the definition. Deprecate the method for removal and
redirect it to BindingTypes.augmentation().

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

4 years agoFix RPC method name conflict with JLS 65/86465/1
miroslav.kovac [Mon, 16 Dec 2019 16:28:41 +0000 (17:28 +0100)]
Fix RPC method name conflict with JLS

When we are constructing the method name for use with the RPC
provider interface we need to pay attention to conflicts with
JLS reserved words.

If such a conflict occurs, append a single '$' to the name, so
that we have a valid method name.

JIRA: MDSAL-500
Change-Id: Ifb533e2daa71bc9d1780a5d8eb48da6ce3b2d209
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6e6ebc43866204667658f8bbf7cfb6233caffdc7)

4 years agoRevert "Make sure javax.inject is scope=provided" 18/86418/1
Robert Varga [Fri, 13 Dec 2019 14:24:45 +0000 (15:24 +0100)]
Revert "Make sure javax.inject is scope=provided"

This reverts commit ed39857808f10bb2641a19fdc66dc4fadcc62401.
scope=provided does not really help.

Change-Id: I9ba3cde2038b6b1d522b0b43408e08d13685fe91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMove Bug5224/Bug5845 tests 09/86409/1
Robert Varga [Thu, 12 Dec 2019 22:12:39 +0000 (23:12 +0100)]
Move Bug5224/Bug5845 tests

These tests are in reality testing BindingNormalizedNodeCodecRegistry,
move them to mdsal-binding-dom-codec, eliminating their dependency
on AbstractDataBrokerTest.

JIRA: MDSAL-393
Change-Id: I05fd3129efffeac5564096c34f7170a578caa380
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove overrides of maven.compiler.release 45/86345/3
Robert Varga [Wed, 11 Dec 2019 02:55:30 +0000 (03:55 +0100)]
Remove overrides of maven.compiler.release

We have adopted a fixed-up odlparent, which has the fixes needed
to suppress ARIES-1923. Remove the now-unneeded overrides.

Change-Id: Ibeed12dac7bb96c8b7d5b652233ce51e755bf1e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump versions to 5.0.7-SNAPSHOT 06/86406/2
Robert Varga [Thu, 12 Dec 2019 17:45:09 +0000 (18:45 +0100)]
Bump versions to 5.0.7-SNAPSHOT

This starts the next development iteration.

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