Robert Varga [Fri, 16 Nov 2018 06:51:27 +0000 (07:51 +0100)]
Switch on method names
Method names are guarateed to be interned by the JVM, hence their
hashCode is O(1) -- making them a prime target for a switch statement,
which side-steps the need to run String.equals() slow path most of
the time.
JIRA: MDSAL-398
Change-Id: Ie57c2f9fd8c3757ec08e1be945b08d66ebbcff4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
b4db803c07b50d2f3f7977e0509dbb60724c4b1d)
Robert Varga [Fri, 16 Nov 2018 06:47:39 +0000 (07:47 +0100)]
Switch on parameterCount
The else case here assumes parameterCount being 1, make that explicit,
resulting in cleaner code.
JIRA: MDSAL-398
Change-Id: Ie3fa47de6b1630e98a426da69bb6c6d2b6b4b026
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
312facb6827886b2a129b754e416809a2115b878)
Robert Varga [Fri, 16 Nov 2018 06:38:51 +0000 (07:38 +0100)]
Use Method.getParameterCount()
Java 8 introduced this method, which bypasses array cloning done
by getParameterTypes(), making it more efficient. Take advantage
of it.
JIRA: MDSAL-398
Change-Id: Id5d4972ba20d63a8ff79e4adbdf6d2adbfce0b87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d90adcf214a8f17ae5de22cf8964cbb2a9963972)
Robert Varga [Fri, 16 Nov 2018 06:34:37 +0000 (07:34 +0100)]
Define getImplementedInterface name in BindingMapping
This moves the definition from LazyDataObject to a common place,
so we have one place which defines it. Also remove unused Throwable
declaration.
Change-Id: Icfbc861419fca3b207e9aebfc2b00ddf8a1fc38f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ee3d79b4cd72051048d734407a23981051f21197)
Stephen Kitt [Fri, 19 Oct 2018 13:29:31 +0000 (15:29 +0200)]
Bump to odlparent 3.1.4 and yangtools 2.0.6.5
Change-Id: I121d31fcfb4e0c5eaa9817519e34348e89501613
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Tue, 13 Nov 2018 14:13:41 +0000 (15:13 +0100)]
Cache mismatched augmentations
Address a FIXME around caching of mismatched augmentations, as it
seems openflowplugin is doing this on purpose.
The cache is expected to be needed infrequently in terms of associated
objects as well as modified infrequently, hence we use a space-efficient
ImmutableMap.
JIRA: MDSAL-388
Change-Id: Id86d8c713ee1014d9d4867558032ba3ccd51fc45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
c44477a41ca49f9fddf92b56a129f915741de5c7)
Stephen Kitt [Tue, 6 Nov 2018 16:08:35 +0000 (17:08 +0100)]
Fix AbstractTypeMember toString()
It shouldn't reference MethodSignatureImpl.
Change-Id: I20c44fe66b76daa5fb8ccd51485e57c1da0e932c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit
2786e60fbb57e29857adebfe2c4e2a03da80b01b)
Robert Varga [Sat, 13 Oct 2018 08:54:39 +0000 (10:54 +0200)]
Optimize AbstractBuilderTemplate key property sort
Rather than using a lambda for each comparison, create a constant
Comparator and reuse it.
Change-Id: I0b5af97b485f65924adb2de369a69e03027af887
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
8fde45a68a9a39ac9358e720f1e8f0791c8703a3)
Robert Varga [Sat, 13 Oct 2018 08:38:32 +0000 (10:38 +0200)]
Use ArrayList.sort() instead of Collections.sort()
We do not need Collections, as we have Java 8 and hence can
directly use List.sort(). This has the side-effect of
short-circuiting to ArrayList's implementation.
Change-Id: If978265242275014c586fcf92d96d5ba09bb7bca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
0da0d185e5c0720029b5cab2d1c614e96493431e)
Robert Varga [Thu, 4 Oct 2018 15:17:42 +0000 (17:17 +0200)]
Make sure we compare key members via their property name
As it turns out, simple comparison ignoring cases does not correctly
work if the schema is using CamelCase. We need to do the hard work of
deriving Binding property name and sort on that to be consistent with
what the codegen does.
JIRA: MDSAL-355
Change-Id: I34cdb032fbdeb093e2973b91c5011e302e6280bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
f1353f855b99a1f1fd2e5c32b0f58ecf83398600)
Robert Varga [Tue, 18 Sep 2018 12:35:42 +0000 (14:35 +0200)]
Bump yangtools to 2.0.6.3
This bumps yangtools to 2.0.6.3, picking up latest fixes.
Change-Id: Ia14e13084156b29a29eae3e7275d230dc93f3e21
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 25 Jul 2018 12:16:29 +0000 (14:16 +0200)]
Rework ClusterSingletonServiceGroupImpl locking
The problem we are are seeing is a classic AB/BA deadlock, hence
we need to change how serviceGroup is handled. This patch reworks
ClusterSingletonServiceGroupImpl to separate state tracking from
service startup/shutdown mechanics.
State locking is separated out into three domains:
- entity state, guarded by ClusterSingletonServiceGroupImpl object
- service membership, tracked in a ConcurrentMap
- service instantiation, guarded by a simple CAS-based lock
Furthermore anytime state changes, we mark this fact in a volatile
variable. Whenever we observe dirty state, we attempt to reconcile
it -- if we can also acquire the service instantiation lock.
Each registered service is tracked separately, so we do not have
to have wholesale aggregator futures for stopping services and can
also start newcomer services without causing weird state tracking
disruptions.
Splitting state tracking and service instantiation leads to faster
group shutdown, because when a group is being closed we know we can
unregister the service entity irrespective of the state of user
services. Unit tests, especially asynchronous, are updated to account
for this accelerated shutdown procedure.
This has the benefit of improving inter-node failover latency,
because the process of user service shutdown and service entity
unregistration runs concurrently. That leads to lower likelihood
of the new service entity owner having to block on becoming
the cleanup entity owner, as services which shut down quickly
will have released the cleanup entity by the time the new owner
is selected.
JIRA: MDSAL-362
Change-Id: I7cd82f81da9135591e4242a196cc0f06a78973a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 31 Aug 2018 09:16:53 +0000 (11:16 +0200)]
Bump yangtools to 2.0.6.2
This brings in latest fixes.
Change-Id: I04fe9e387cff73fe5d3d887f740990d28409c78f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 24 Jul 2018 16:29:37 +0000 (18:29 +0200)]
Update internal structure to pass registrations
Within lusterSingletonServiceGroupImpl we need identity-based
lookup, which ObjectRegistration provides.
This is useful for keeping additional per-service state without
relying on user's equals() method.
JIRA: MDSAL-362
Change-Id: I01fd1f34a689a2c8f50ff7efc590f713a0212354
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 10 Aug 2018 08:51:45 +0000 (10:51 +0200)]
Fixup javassist class use
We need to cast the returned class, as the Javassist API no longer
does so.
Change-Id: Ib19477ece9e76b735285df3b553ca9504579f8c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 8 Aug 2018 09:10:46 +0000 (11:10 +0200)]
Activate BUG-6135 test
The underlying bug was fixed long time ago, but the corresponding
test was not activated. Fix that.
Change-Id: I97a31722a4cf5145f6f3c6a1ef3eba5f1f213d25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
351db7989bdb5fba3695383d408e7af391e29d9d)
jenkins-releng [Thu, 9 Aug 2018 16:39:43 +0000 (16:39 +0000)]
Bump versions by x.y.(z+1)
Change-Id: I8c749737713eaa0349bd923c39ae17caf48adaf9
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Stephen Kitt [Tue, 31 Jul 2018 08:54:43 +0000 (10:54 +0200)]
Bump yangtools to 2.0.6.1
Change-Id: I9d6d5bf1242d84ee9aab94e3a50a69537cef2b5d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Wed, 27 Jun 2018 09:50:05 +0000 (11:50 +0200)]
Fix case-related augment test
The test model used in this test is not valid, as it introduces
same container/leaf as both an augmentation of the list and as an
augmentation of that list's choice, leading to the leaf/container
being defined twice in the list's data tree hierarchy.
Change-Id: I582b53ea942f71141e98e14aa0f23878af339b86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
7a0e6a60c9d71a08f0b981e812850675f802a752)
Stephen Kitt [Thu, 26 Jul 2018 14:05:39 +0000 (16:05 +0200)]
Bump to odlparent 3.1.3
Change-Id: I81642019c080a688fafc93940f012cc706b483b8
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Stephen Kitt [Fri, 6 Jul 2018 07:28:19 +0000 (09:28 +0200)]
Enforce Xtend Maven plugin dependencies
This aligns the Eclipse dependencies used by version 2.13 of the Xtend
Maven plugin, to avoid signature issues. See
https://github.com/eclipse/xtext/issues/1231 for details.
Change-Id: I61e2d70e1a0c98f831ec647669a48e210e4e1f8f
JIRA: ODLPARENT-156
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Tue, 3 Jul 2018 07:37:41 +0000 (09:37 +0200)]
BUG-7697: add defences against nulls
Null listener is invalid, also make sure we do not ever set
prevRpcs to null.
Change-Id: If8cd16e93a2a07c77a26569c8ecacdc35696cea1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 28 Jun 2018 17:23:21 +0000 (19:23 +0200)]
Override xtend-maven-plugin dependencies
org.eclipse.equinox.common-3.10.0 seems to be required for some
reason.
Change-Id: I556c934db07148f05f701d1c541fd1f1bfc34219
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
4e97682b0aaadc08db639ef688e9c275210c28ff)
Robert Varga [Wed, 13 Jun 2018 14:34:39 +0000 (16:34 +0200)]
Validate augmentation binding class
LazyDataObject's DataObject.augmentation(Class) implementation
needs to re-validate if the augmentation we are about to decode
matches user-requested augmentation.
This is needed to ensure that we do not return shape-equivalent
augmentation, such as when the same augmentation is applied to
multiple instantiations of the same grouping. In such a case
type-safety indicates that the grouping can have either of the
augmentations, yet in reality its validity depends on
instantiation.
JIRA: MDSAL-328
Change-Id: I57dd70ddead65fc7f61c72b58da4ef6d26e739f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
4225a73eff1f9ee46498722e4d247a0d0aca1ed4)
Stephen Kitt [Mon, 18 Jun 2018 08:26:52 +0000 (10:26 +0200)]
Bump to odlparent 3.1.1
Change-Id: I28f4212e0b5c7c9e6fd73aa9af0ff4ba78a17229
JIRA: RELENG-129
Signed-off-by: Stephen Kitt <skitt@redhat.com>
jenkins-releng [Wed, 13 Jun 2018 00:07:30 +0000 (00:07 +0000)]
Bump versions by x.y.(z+1)
Change-Id: Idcd85a0ac923264db2a7b3e841be2358531b5841
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Robert Varga [Mon, 28 May 2018 20:48:28 +0000 (22:48 +0200)]
Fix BindingReflections with no revisions
When a module does not have a revision statement, we end up using
.norev instead of the usual .revXXYYZZ package component. This means
that valid Binding classes are not recognized by
getModelRootPackageName(), throwing IllegalArgumentException.
Fix this by updating matcher pattern to account for .norev being
a possibility.
Change-Id: Ifeede5cd2371a73eca7b189af3f3ac95db4acb9d
JIRA: MDSAL-346
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6abeecffa7a64a7c14e02ffa6198cf2276f311d3)
Robert Varga [Mon, 28 May 2018 17:51:15 +0000 (19:51 +0200)]
Fix codegen of root choices
If a choice which is a direct child of a module is targeted via
an augment, codegen fails.
The reason for this is that it attempts to use an empty SchemaPath
to find a DataSchemaNode: something that cannot be done. The problem
is the assumption that a Module is a SchemaNode -- which it is not.
To fix this, recognize when the parent path is empty and short-circuit
to the defining module if that is the case.
JIRA: MDSAL-345
Change-Id: I52679c822b220271d943bfbc421049d2dc394d70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
f6e117a1e6a41447823258ac525ffcec4781ef0b)
Robert Varga [Mon, 28 May 2018 17:29:06 +0000 (19:29 +0200)]
Fix YangModuleInfoTemplate
Optional is not comparable, hence we need to pass an explicit
Comparator to the TreeMap.
JIRA: MDSAL-344
Change-Id: I79e8000c85ed74d3f14e77da156038f3c781aa59
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
aa92942e2b516b0c14c7bbd5048c398c3ccc9ce0)
Robert Varga [Thu, 24 May 2018 09:52:19 +0000 (11:52 +0200)]
Bump yangtools to 2.0.5
Change-Id: Ia6f422cee5b5f9b363dac9d0645076d576d34963
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Michael Vorburger [Tue, 8 May 2018 14:59:24 +0000 (16:59 +0200)]
add additional (debug) logging to AbstractStreamWriterGenerator
* LOG.debug() in generateSerializer() to see if in a load test
scenario that ever gets called twice for the same type (it should not)
due to a concurrency bug I'm not seeing.
* reduce the only other LOG.debug() in that class to trace()
because that one will happen more often (constantly?) and make it hard
to see the other one.
* log onBindingRuntimeContextUpdated() on the off chance
that changing the BindingRuntimeContext somehow could cause this
suspected concurrency issue.
* log constructor to better understand the lifecycle of
AbstractStreamWriterGenerator in production.
* add Guava Cache removalListener with logging to see if this is caused
by eviction by GC due to .weakKeys() - ACK to tpantelis for this hunch.
JIRA: MDSAL-213
Change-Id: I2416131fe140ee483cc93740480ee0e37f0ce130
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Robert Varga [Mon, 12 Mar 2018 10:53:51 +0000 (11:53 +0100)]
Use QName.withModule()
There are multiple places where we are creating a well-known QName
with a new namespace. Use QName.withModule() so we do not end up
checking localName over and over.
Change-Id: I932bf3762bfb6ae201e6b309f8a7d95887b99b00
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Wed, 25 Apr 2018 18:24:26 +0000 (18:24 +0000)]
Bump versions by x.y.(z+1)
Change-Id: Ied3777a0b9bf9d1ac983c3829ce6c329c9267ada
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Robert Varga [Tue, 10 Apr 2018 17:14:19 +0000 (19:14 +0200)]
Fix derived types missing pattern restrictions
We have missed a place where constants to support restrictions need
to be generated, which meant that Ipv4AddressNoZone and similar
constructs were not doing correct enforcement.
JIRA: MDSAL-335
Change-Id: Id659362038e001207eab9ca5f1618c376aa0ea5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
a2713a39a1b1aac6a2337a09559f930240523311)
Michael Vorburger [Fri, 6 Apr 2018 18:39:36 +0000 (20:39 +0200)]
artifacts mdsal-binding-test-utils <scope>test
Change-Id: Iffc49385dd269f045291c2a22e02fbd904d5bb6e
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit
004920a6341442abbdd25e53162ed16cf492a864)
Stephen Kitt [Fri, 23 Mar 2018 13:11:11 +0000 (14:11 +0100)]
Bump to odlparent 3.1.0 and yangtools 2.0.3
Change-Id: I36e5aa7ae0e11819ae50db3c67f4279a2c483bc7
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Wed, 14 Mar 2018 14:12:24 +0000 (15:12 +0100)]
Fix invalid yang models
This patch eliminates bad test models, which use constructs which
are not valid YANG identifiers.
Change-Id: If0fbf08226d64b76def98421eb4d68e781e97b98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6d5b9f5c2e1cdbb0009c42199466485326f14110)
Marek Gradzki [Fri, 23 Mar 2018 08:28:24 +0000 (09:28 +0100)]
Upgrade ietf-inet-types dependency to 2013-07-15
The ietf-restconf already uses ietf-yang-types@2013-07-15,
so bump ietf-inet-types for consistency.
Change-Id: Id9a871a6f7d273efa94dedb1c98451ba27e7ab7d
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
(cherry picked from commit
1de4a8e8dac2ed42f57942207427cc32612c2134)
Robert Varga [Sat, 3 Mar 2018 22:47:33 +0000 (23:47 +0100)]
make sure to eliminate any reference to builders
We are picking up indexing information from ModuleContext, but we
also need to make sure to built these types.
Change-Id: I32c18b31885bcd1391412819e66314e5fa48ae3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
4bc170fb392d2100d676199abcf059b1116de2b5)
Robert Varga [Sat, 3 Mar 2018 17:07:37 +0000 (18:07 +0100)]
Refactor GeneratedTypeBuilderImpl
GeneratedTypeBuilderImpl is used by both runtime and codegen, capturing
data not needed at runtime leading to a bloated RuntimeContext.
Split out RuntimeGeneratedTOBuilder, renaming the original to
CodegenGeneratedTypeBuilder.
JIRA: MDSAL-315
Change-Id: Iaea5f9ae7b260bc5c9ef37cdb1a74aec52457a22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d70cc768e3ff3500b9b49136e41a1e6345f749b5)
Robert Varga [Sat, 3 Mar 2018 16:36:07 +0000 (17:36 +0100)]
Refactor GeneratedTOBuilderImpl
This builder is used at both runtime and codegen-time and it captures
information irrelevant to runtime, leading to bloat.
Refactor this class into three classes:
- AbstractGeneratedTypeBuilder for common information
- CodegenGeneratedTOBuilder common + codegen information
- RuntimeGeneratedTOBuilder throwing UnsupportedOperationException
for codegen information
JIRA: MDSAL-315
Change-Id: Ie1d3d075590334cb5b8ce41c059ac2e10cf02d56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
636ac0055012e2ee436d5526a95640c6df35e46a)
Robert Varga [Sat, 3 Mar 2018 14:08:17 +0000 (15:08 +0100)]
Do not generate pattern constraints in runtime types
We do not need this information at run-time, so short-circuit
collection so that we always end up seeing an empty expression
map.
JIRA: MDSAL-312
Change-Id: Ia62d20b247fed69e32321ec42f2cfd68d63d9afc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
c3378c4cdf4cb4bec65ae737b9cf74204bdaa02d)
Robert Varga [Fri, 2 Mar 2018 19:55:58 +0000 (20:55 +0100)]
Split up TypeProviderImpl
This class needs to be split up into compile-time and runtime
implementations to eliminate polluting runtime with information
required only for code generators.
Rename the baseline to AbstractTypeProvider and provide two distinct
subclasses, CodegenTypeProvider and RuntimeTypeProvider.
JIRA: MDSAL-312
Change-Id: Ia3a8b0677dee2252820cd9ee6c709e2e896b135f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
59787cce8cce649341d38cfa7faf36de0c2613bd)
Robert Varga [Fri, 2 Mar 2018 17:09:44 +0000 (18:09 +0100)]
Split out BindingRuntimeGenerator
BindingRuntimeContext does not require all of the information
captured in a normal BindingGenerator run, such as constants, comments
and similar.
The fact that we do not have separation between compile-time and
run-time granularity of this data comes from history of the codebase,
when BindingRuntimeContext did not exist in its current form and we
infered much of the information from the classes lazily.
Introduce BindingRuntimeGenerator interface and refactor
BindingGeneratorImpl to reflect this split. This leads to faster
BindingRuntimeContext creation, as the call to generateTypes()
is no longer needed.
JIRA: MDSAL-312
Change-Id: Ibb1c22d4e4c9ff90e37d6e10e258f632a9c87ef5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
4a558ef0c1b722ee079a2855aabe285c5528ae36)
Robert Varga [Thu, 1 Mar 2018 09:41:31 +0000 (10:41 +0100)]
Fix deprecation warnings in RangeGenerators
Propagate @Deprecated annotation outward, removing most of the warnings.
Change-Id: I4c4da282bfe4fca1b43c00d2826e3161ac288a2e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
b1aacfe534ad030562fc02d6c10af5c6db00c279)
Robert Varga [Wed, 28 Feb 2018 15:03:09 +0000 (16:03 +0100)]
Invert enforcement patterns when needed
RFC7950 and yang-model-api defines pattern modifier invert-match,
which needs to be taken into account when validating incoming strings.
Mutate the pattern we expose to the codegen such that it captures
the inversion operation. This code is closely related to generated
code and string formats used therein, hence the beef of the
implementation lives in BindingMapping.
JIRA: MDSAL-314
Change-Id: Ie29745d3343f565ac6b1b5716b1ec38dd0f09bc9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
e809976bed3033047c72bf8fa094ef950f41f55f)
Robert Varga [Wed, 28 Feb 2018 12:32:55 +0000 (13:32 +0100)]
Fix a patterns reference
We should be referencing the constant name rather than hard-coding
it in the template.
Change-Id: Ib552b37cdfb4e3f8cef794d764ba8558f6db3df6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
02d279beb583373815e29d48be4aed3353c82b9f)
Robert Varga [Tue, 27 Feb 2018 23:56:28 +0000 (00:56 +0100)]
Silence code generator a bit
We do not need an explicit INFO whenever a service is generated.
Lower the level at which this information is logged to debug.
Change-Id: Ifab29e0cec7519135e1d96adc486134d3204c329
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
db40844299071e3d7bbe1a33417badfe065f50d5)
Robert Varga [Wed, 21 Feb 2018 14:49:18 +0000 (15:49 +0100)]
Squash regular expression constants
A heap dump analysis has shown we are retaining default-sized
sparse ArrayLists in ConstantImpl. Make sure we squash them to
a properly-sized ImmutableList.
Change-Id: I0b83440af46bcaad334d55506c2f08e36d9a7727
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
152301d3b1575a0132d1a0493cc20eb3c6ac0bf0)
Marek Gradzki [Wed, 21 Mar 2018 12:25:38 +0000 (13:25 +0100)]
Remove ietf-inet-types dependency from ietf-interfaces
The ietf-interfaces@2014-05-08.yang depends only
on ietf-yang-types@2013-07-15.yang
Change-Id: I146c0b130ee0a4cb6e7132a8a4ffe4a8f0bc7ccc
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
(cherry picked from commit
5e53050e07f749db8d781b2533bc1da7c6380486)
Robert Varga [Mon, 5 Mar 2018 08:16:03 +0000 (09:16 +0100)]
Fix YangModuleInfoTemplate
YangModuleInfoTemplate has a wrong check for null, where it should
be checking for Optional.present. Fix that.
Change-Id: I95ccfd7a938b173cd0cc8aa6be997a2afe471056
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
3a2d30a4fd44905431546826ca9226015545ee08)
Robert Varga [Fri, 9 Mar 2018 15:55:44 +0000 (16:55 +0100)]
Add alternative enum assigned name mapping
This patch corrects enumeration mapping rules so that any unicode
string can be mapped to a valid Java identifier as per JLS8.
This is done by attempting to apply className() mapping to all names
and using that if it results in valid non-conflicting identifiers.
If a conflict is detected, we use a bijective mapping, which encodes
any conflicting characters using an $-based escaping scheme.
JIRA: MDSAL-309
Change-Id: Ic51405e533eff9af6afc2abaa8d0cc193d718e64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
53433dfe15da970a6af8362ad21911a82943de7d)
Peter Nosal [Mon, 19 Mar 2018 07:59:37 +0000 (08:59 +0100)]
Change transformation from DOMRpcResult to RpcResult
When RpcResult was created, it was always as successful RpcResult,
this is changed so in presence of RpcErrors, RcpResult is built as
failed RpcResult with RpcErrors and binding result.
Change-Id: I7ee54dfffb271505fd52feee4c6b2235c0ae4964
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 26 Feb 2018 00:04:00 +0000 (01:04 +0100)]
Eliminate twirl execution from mdsal-binding2-generator-impl
We do not have any templates left, speed up compilation by eliminating
unneeded plugin invocations. Also fixe project import in default Eclipse.
Change-Id: I3416f2cd5ed50e4a914817a205a5ca56a85091da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Thu, 22 Mar 2018 16:57:43 +0000 (16:57 +0000)]
Bump versions by x.y.(z+1)
Change-Id: Icf336ee5dd0faaa2585418aa1c151d4af9e80618
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Anil Belur [Mon, 26 Feb 2018 06:59:44 +0000 (16:59 +1000)]
Update .gitreview to stable/oxygen
Change-Id: I1c3c76d21d33f02c385d43c0850cc8f4575cd03c
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Jie Han [Sat, 24 Feb 2018 07:33:31 +0000 (15:33 +0800)]
MDSAL-301: Binding v2 - Rework javadoc generation
- ported from:
https://git.opendaylight.org/gerrit/68191
https://git.opendaylight.org/gerrit/68254
- Move javadoc generation from mdsal-binding2-generator-impl
to mdsal-binding2-java-api-generator
Change-Id: Ia9a23af5528f7511908d13a0570e8900daeb60a1
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Robert Varga [Fri, 23 Feb 2018 15:43:04 +0000 (16:43 +0100)]
Eliminate XtendHelper and SchemaLock
These classes are not used anywhere, eliminate them.
Change-Id: If3e726219b8a5e62a2138a3d98bc1ebd7d86a405
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jie Han [Mon, 28 Aug 2017 06:59:50 +0000 (14:59 +0800)]
Binding codec v2 - fix anyxml #3
- Add AnyxmlNodeCodecContext
Change-Id: I76d3cec49cbd98747f666719908be304057bf364
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jie Han [Mon, 28 Aug 2017 06:46:01 +0000 (14:46 +0800)]
Binding codec v2 - fix anyxml #2
- Add AnyxmlCodec to serialize/deserialize between
Document and DOMSource.
Change-Id: Idf3c6be4fa1e88874aa331b170301fa65ce10e1c
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Mon, 28 Aug 2017 06:34:40 +0000 (14:34 +0800)]
Binding codec v2 - fix anyxml #1
- Support Anyxml node codec
Change-Id: Ic2ff67cf1be56f4e560b929cc695c329268d1d4e
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Thu, 24 Aug 2017 07:25:26 +0000 (15:25 +0800)]
Binding codec v2 - fix notification implements Instantiable
- Call implementedInterface to get class to
get serializer.
Change-Id: I53c7422b0d15167452e9e30a3d3a43557831389a
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Wed, 11 Oct 2017 06:49:05 +0000 (14:49 +0800)]
Binding codec v2 - fix augmentation #7
- add yangs and tests
- add comment
Change-Id: I7bf32c49a68cd7724da4a0cf355a755178f119c1
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Wed, 11 Oct 2017 06:41:10 +0000 (14:41 +0800)]
Binding codec v2 - fix augmentation #6
- Add AbstractStreamWriterGenerator to support multiple
augmentation schemas with the same target path for
one generated type.
Change-Id: Iac5ec67adb6f77da2e181c59c4e6cecb0239fb9d
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Robert Varga [Mon, 29 Jan 2018 17:49:44 +0000 (18:49 +0100)]
Switch to java.util.function.Supplier
This is an internal interface, we can safely switch it to
Java 8 interface rather than the Guava one.
Change-Id: Ie199bb690e80958c859036708ce1945e3ed313f6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 14 Feb 2018 13:06:02 +0000 (14:06 +0100)]
Re-organize YANG snippet generation and comment confusion
This is a follow-up cleanup on the previous patch, which has created
an unnecessary interface and tunneling contract. We instead record
the details of why a class was generated, capturing comments correctly
in GeneratedType.comment. mdsal-binding-java-api-generator is then
taught to use this information correctly and generate the YANG snippet
as it sees fit.
Change-Id: I25580c6310d05007fea63e04d70cd12d5c6f9ace
JIRA: MDSAL-301
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 13 Feb 2018 13:02:44 +0000 (14:02 +0100)]
Eliminate xtend from mdsal-binding-generator-impl
This patch moves YangTextTemplate into mdsal-binding-java-api-generator
and bridges it into BindingGeneratorImpl, without it having to be lug
all the extent stuff around. This slims down the runtime classes by
143kB.
JIRA: MDSAL-301
Change-Id: Ibdafa574c5a825aa7a02b9ecef5352fff78ae035
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 4 Feb 2018 18:46:17 +0000 (19:46 +0100)]
Cleanup properties
Properties should not be used for versions, clean them up in parent
poms. Everything the users need is communicated via
dependency/pluginManagement.
Also ditches down-revisioned maven-depends-plugin, as that is already
provided by odlparent and removes unneeded site plugin configuration.
Change-Id: I54b507342c995c5e3589171c42e708829acc908b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 13 Feb 2018 12:19:10 +0000 (13:19 +0100)]
Fix odl-mdsal-dom-broker
It should depend on odl-yangtools-data so it does not package
yang-data-impl.
Change-Id: Ia8d852c24b6fa6e929d84265f8bd1309116f35df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jie Han [Wed, 11 Oct 2017 06:35:24 +0000 (14:35 +0800)]
Binding codec v2 - fix augmentation #5
- Since all augmentation with the same target would be
taken into one generated type, the map of type and schema
would not correct at all, just to delete it.
Change-Id: I705383ca58a9ba1e64c77dffdd4470b60d4aca73
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Thu, 24 Aug 2017 10:11:47 +0000 (18:11 +0800)]
Binding codec v2 - fix augmentation #4
- Since uses nodes were processed as-if they were direct
children of parent node, so just to find target node
(added by uses) not its original node which would result
in wrong augmentation type.
Change-Id: I8d74e368e44075eb6e273119c07578ff16a4f1dc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Wed, 23 Aug 2017 09:19:50 +0000 (17:19 +0800)]
Binding codec v2 - fix augmentation #3
- Since multiple augments with same target were grouped as like
just one augment, all child nodes of them were resolved as methods
to the generated type, so in runtime, it should also find all these
child nodes to add to the new EffectiveAugmentSchema object as
real childs.
Change-Id: I433930be45007e545b2e2fb074af32e118aa7cd4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Wed, 7 Feb 2018 08:55:16 +0000 (16:55 +0800)]
MDSAL-218: Binding v2 - *Builder classes for 'type union' YANG gen. code should have private constructor
- Do not affect old generated class, one should mannually rebuild to update.
Change-Id: I7682fc19e29e659589b71695403c83094b138e48
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Wed, 7 Feb 2018 08:50:57 +0000 (16:50 +0800)]
MDSAL-218: Binding v1 - *Builder classes for 'type union' YANG gen. code should have private constructor
- Do not affect old generated class, one should mannually rebuild to update.
Change-Id: Ib45f7aca1aa261b2c4bce433b139cd94b91a5066
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jaime Caamaño Ruiz [Fri, 9 Feb 2018 19:41:25 +0000 (20:41 +0100)]
Delay snapshot backed transaction ready error
Delay snapshot backed transaction ready error to 3PC canCommit.
Change-Id: Ie4004db194483dfa1528258b464df8a2f8fa573e
JIRA: CONTROLLER-1812
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
Jaime Caamaño Ruiz [Fri, 9 Feb 2018 09:47:26 +0000 (10:47 +0100)]
Fix infinite loop on cancel transaction
This patch fixes a problem where you would run into an infinite loop
after cancelling DOMForwardedWriteTransaction following an exception
thrown by the backed transaction ready or submit methods.
Change-Id: I14bcca6727ab2f173d481b84742c4edbf7bf9dd8
JIRA: CONTROLLER-1812
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
Robert Varga [Wed, 7 Feb 2018 15:50:05 +0000 (16:50 +0100)]
Speed up whitespace replacement
Rather than compiling a pattern, pre-compile it once and keep it
around.
Change-Id: Ibb1879d2546f731daa25e536ef45f48bde671f4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 5 Feb 2018 01:15:48 +0000 (02:15 +0100)]
Fix a few warnings
- unneeded imports
- potentially static methods
- unneeded @SupressWarnings
Change-Id: I0c80e0a7e917ec9b71147e582df4b6f4c7a698a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jan 2018 18:14:12 +0000 (19:14 +0100)]
MDSAL-269: fix missing identityref union members
Due to a API consistency issue in binding specification typedefs
which point to leafref and identityref types do not get a generated
encapsulation class.
BUG-8449/MDSAL-253 has dealt with the leafref case, but has omitted
identityref case. This patch corrects the situation, providing a bit
of background and a testcase.
Change-Id: Ib4247e0690c2aaa89aef51b3986bf848ce6b8192
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jie Han [Tue, 8 Aug 2017 01:26:17 +0000 (09:26 +0800)]
Binding codec v2 - fix augmentation #2
- filter out local augments by using a child node qname of
augment schema.
Change-Id: I475e399460e3b19cbc1691a8c0be10cd1a2e0298
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Tue, 8 Aug 2017 01:00:54 +0000 (09:00 +0800)]
Binding codec v2 - fix augmentation #1
- Since if target node in same module as augment, data nodes are represented as-if
their statements were inlined in target. so we should process these data nodes from
binding structs to normalized nodes.
Change-Id: Ib024517f050758cadfbd016b96cf2821bc7c689c
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Tue, 10 Oct 2017 05:28:35 +0000 (13:28 +0800)]
Binding v2 generator - fix JavaCodePrettyPrint
- Specially, such as union builder, these isn't any import,
it doesn't work well.
Change-Id: I84b2408bd2f840bdc19e3c1c39ee731369f23361
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Thu, 31 Aug 2017 07:36:22 +0000 (15:36 +0800)]
Binding codec v2 - fix get implemented interface as input of getCacheSerializer
- The class of input is the intern class xxxImpl in Builder,
it should be the interface, so we should call implementedInterface.
Change-Id: I880cb750cf418541c1f27849dec9c83b4eff8bf8
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Thu, 24 Aug 2017 07:16:21 +0000 (15:16 +0800)]
Binding codec v2 - fix collect all properties from generated type
- Since uses nodes were processed as-if they were direct children
of parent node, so it's no need and not uncorrect to get properties
from implements which would overwrite the return type for the same
getter method.
Change-Id: I68b565d71ddf17cc13b98e29450aa144f0733adc
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Robert Varga [Tue, 30 Jan 2018 15:58:54 +0000 (16:58 +0100)]
MDSAL-206: improve DOMEvent instant resolution
Rather than using a Date, use an java.time.Instant, which is more
appropriate.
Change-Id: I45513f12f83065d9fc7016e357c53332d0070d6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 1 Feb 2018 16:37:20 +0000 (17:37 +0100)]
Lookup leaf key methods in parents
Union is a valid key type and it can actually come from a grouping,
in which case it gets generated as an inner type. If that happens
the typedef is not populated into the usual places, leading to
a failure to find method return type -- leading to a missing key
member.
This is a problem similar to YANGTOOLS-424, so let's use the same
ModuleContext approach taken then.
JIRA: MDSAL-161
Change-Id: Id342701d603bdd2b9b78ba3295c8eae60f253429
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2018 13:18:05 +0000 (14:18 +0100)]
MDSAL-298: properly handle unkeyed lists
Unkeyed lists are not representable in binding, which means they
cannot be reported as modified children, either. This has implications
for any data change which contains unrepresentable fields as child
modifications.
Previously we would report SUBTREE_MODIFIED for the container node,
but would fail to report any children, which is obviously wrong, as the
user is left guessing as to what exactly happened.
This patch modifies LazyDataObjectModification to report a WRITE event
if modifications to unrepresentable children are found in SUBTREE_MODIFIED
case. Since this is a potentially expensive operation, we cache a child
addressability summary in BindingCodecTreeNode, so that we go to this
slow path only when needed.
We also expose BindingStructuralType enumeration, so controller's
sal-binding-broker can reuse the implementation rather than having its
own copy.
Change-Id: I6642166cd262d0dddb1b2ed6d73a20785d0efff6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2018 16:20:14 +0000 (17:20 +0100)]
Fix BindingCodecTreeNode.getSchema() a bit
Using Object as the return type of getSchema() is confusing, as it
does not provide a proper anchor point for users. While subclasses
provide proper access point, further restricting the domain to
DocumentedNode.WithStatus provides for a better experience.
Change-Id: Iebd198b695f5271ebadd5315c1ec22b8488c227c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jan 2018 21:26:29 +0000 (22:26 +0100)]
Cache group replacement pattern
Rather than compiling it over and over again, compile it once.
Change-Id: Id8699f42c081b06197b769f22539e918457b5298
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 Jan 2018 19:00:36 +0000 (20:00 +0100)]
Migrate to commons-text StringEscapeUtils
The utilities from commons-lang3 are deprecated, move on to their
replacement.
Change-Id: I7ed6f163d8414ef6db27876101ceaa43218ead37
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2018 14:39:16 +0000 (15:39 +0100)]
Fix YangTemplate key statement generation
key statement should be terminated by a semicolon and it should be
emitted only if the key definition is really present.
Change-Id: I499b697be586d5cf92149a14a8ca763ba2272816
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2018 13:17:30 +0000 (14:17 +0100)]
Add DataTreeIdentifier.toString()
Adding a toString() method aids debugging and is generally nice.
Change-Id: I70944c85d6507e47aec282a018e7e101c684de62
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 29 Jan 2018 09:07:24 +0000 (10:07 +0100)]
Lower DataObjectCodecContext method visibility
This class is not leaked outside of the package, lower visibility
of its methods.
Change-Id: I486bf3d407eabb99f5ee5cafd08d4e7cb76d2c50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 26 Jan 2018 12:24:54 +0000 (13:24 +0100)]
MDSAL-302: make sure uses+augment works in RPCs
Add missing callouts to generate uses augments for RPC input/output
nodes. This complements processing for data nodes and notifications.
Change-Id: I4f0d9fddce1e019c57b9a45874a45b22ffe6a15f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 24 Jan 2018 13:58:44 +0000 (14:58 +0100)]
Eliminate odl-mdsal-dom-schema-service-osgi
This is osgi-specific bundle and since karaf is all about OSGi,
we should not pretend odl-mdsal-dom-broker feature can work without
it. Eliminate the feature, bundling the artifact inside
odl-mdsal-dom-broker instead.
Change-Id: I8436d331ff391c72593bfb03aa0aeb422dee4c49
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jie Han [Tue, 10 Oct 2017 00:44:59 +0000 (08:44 +0800)]
Binding v2 codec - fix KeyedListNodeCodecContext
- change geyKey to getIdentifier for using
concepts.Identifiable
Change-Id: I8e903186c6d7962091ce4d45da3f73c0e9e1cc27
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Tue, 22 Aug 2017 07:20:57 +0000 (15:20 +0800)]
Binding codec v2 - fix startMapEntryNode
- Cast return type of treeIdentifier() to be
IdentifiableItem manually since it was erased.
Change-Id: I4daef75919d38ca64c5a37defacc58653195496f
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Tue, 22 Aug 2017 07:11:44 +0000 (15:11 +0800)]
Binding codec v2 - fix startMapNode/startOrderedMapNode parameter
- It should be class type for these two methods
Change-Id: I0be5296c835b3948392382e8fe4200e8427ca2f4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Jie Han [Tue, 22 Aug 2017 01:48:14 +0000 (09:48 +0800)]
Binding generator v2 - fix IdentifiableItem and Item
- Support generated interface of List implements
kind of TreeChildNode<ParentClass,IdentifiableItem<Class,KeyClass>>
- Other interface implements
kind of TreeChildNode<ParentClass,Item<Class>>
- checkstyle
Change-Id: Ia0c5805e20c1ecb75a507aeaa02ed165b14b4986
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Robert Varga [Thu, 18 Jan 2018 19:38:45 +0000 (20:38 +0100)]
Use ranges to cross-reference yangtools features
This allows run-time to work with compatible versions of yangtools,
even when a new version is introduced after compilation. Also fixes
an odl-lmax-3 range omission and removes unneeded feature dependencies
when they are brought in transitively.
Change-Id: I10753809286b4df71abd62526d5b5ca1effdf2ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>