mdsal.git
5 years agoadd additional (debug) logging to AbstractStreamWriterGenerator 90/71890/1
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>
6 years agoUse QName.withModule() 71/70671/4
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>
6 years agoBump versions by x.y.(z+1) 42/71342/1
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>
6 years agoFix derived types missing pattern restrictions 47/70747/1
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)

6 years agoartifacts mdsal-binding-test-utils <scope>test 99/70699/1
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)

6 years agoBump to odlparent 3.1.0 and yangtools 2.0.3 96/69996/5
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>
6 years agoFix invalid yang models 43/70343/2
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)

6 years agoUpgrade ietf-inet-types dependency to 2013-07-15 54/70154/1
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)

6 years agomake sure to eliminate any reference to builders 74/69974/2
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)

6 years agoRefactor GeneratedTypeBuilderImpl 73/69973/2
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)

6 years agoRefactor GeneratedTOBuilderImpl 72/69972/2
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)

6 years agoDo not generate pattern constraints in runtime types 71/69971/2
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)

6 years agoSplit up TypeProviderImpl 70/69970/2
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)

6 years agoSplit out BindingRuntimeGenerator 43/69943/1
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)

6 years agoFix deprecation warnings in RangeGenerators 42/69942/1
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)

6 years agoInvert enforcement patterns when needed 28/69928/1
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)

6 years agoFix a patterns reference 27/69927/1
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)

6 years agoSilence code generator a bit 26/69926/1
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)

6 years agoSquash regular expression constants 25/69925/1
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)

6 years agoRemove ietf-inet-types dependency from ietf-interfaces 05/69905/2
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)

6 years agoFix YangModuleInfoTemplate 73/69073/3
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)

6 years agoAdd alternative enum assigned name mapping 34/69334/4
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)

6 years agoChange transformation from DOMRpcResult to RpcResult 03/69603/6
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>
6 years agoEliminate twirl execution from mdsal-binding2-generator-impl 60/68760/2
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>
6 years agoBump versions by x.y.(z+1) 46/69846/1
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>
6 years agoUpdate .gitreview to stable/oxygen 05/68705/1
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>
6 years agoMDSAL-301: Binding v2 - Rework javadoc generation 57/68657/4
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>
6 years agoEliminate XtendHelper and SchemaLock 53/68553/3
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>
6 years agoBinding codec v2 - fix anyxml #3 51/62351/19
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>
6 years agoBinding codec v2 - fix anyxml #2 50/62350/18
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>
6 years agoBinding codec v2 - fix anyxml #1 49/62349/15
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>
6 years agoBinding codec v2 - fix notification implements Instantiable 48/62248/17
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>
6 years agoBinding codec v2 - fix augmentation #7 46/64146/15
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>
6 years agoBinding codec v2 - fix augmentation #6 45/64145/16
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>
6 years agoSwitch to java.util.function.Supplier 83/67683/3
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>
6 years agoRe-organize YANG snippet generation and comment confusion 54/68254/4
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>
6 years agoEliminate xtend from mdsal-binding-generator-impl 91/68191/6
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>
6 years agoCleanup properties 00/67900/10
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>
6 years agoFix odl-mdsal-dom-broker 77/68177/1
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>
6 years agoBinding codec v2 - fix augmentation #5 44/64144/12
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>
6 years agoBinding codec v2 - fix augmentation #4 59/62259/17
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>
6 years agoBinding codec v2 - fix augmentation #3 90/62190/19
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>
6 years agoMDSAL-218: Binding v2 - *Builder classes for 'type union' YANG gen. code should have... 05/68005/2
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>
6 years agoMDSAL-218: Binding v1 - *Builder classes for 'type union' YANG gen. code should have... 04/68004/2
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>
6 years agoDelay snapshot backed transaction ready error 25/68125/1
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>
6 years agoFix infinite loop on cancel transaction 98/68098/1
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>
6 years agoSpeed up whitespace replacement 29/68029/3
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>
6 years agoFix a few warnings 08/67908/2
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>
6 years agoMDSAL-269: fix missing identityref union members 57/67757/5
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>
6 years agoBinding codec v2 - fix augmentation #2 99/61299/34
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>
6 years agoBinding codec v2 - fix augmentation #1 98/61298/31
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>
6 years agoBinding v2 generator - fix JavaCodePrettyPrint 96/64096/15
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>
6 years agoBinding codec v2 - fix get implemented interface as input of getCacheSerializer 82/62482/16
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>
6 years agoBinding codec v2 - fix collect all properties from generated type 47/62247/17
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>
6 years agoMDSAL-206: improve DOMEvent instant resolution 29/67729/2
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>
6 years agoLookup leaf key methods in parents 26/67826/3
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>
6 years agoMDSAL-298: properly handle unkeyed lists 69/67669/14
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>
6 years agoFix BindingCodecTreeNode.getSchema() a bit 78/67678/5
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>
6 years agoCache group replacement pattern 56/67756/1
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>
6 years agoMigrate to commons-text StringEscapeUtils 34/67734/1
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>
6 years agoFix YangTemplate key statement generation 77/67677/1
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>
6 years agoAdd DataTreeIdentifier.toString() 68/67668/1
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>
6 years agoLower DataObjectCodecContext method visibility 67/67667/1
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>
6 years agoMDSAL-302: make sure uses+augment works in RPCs 15/67615/4
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>
6 years agoEliminate odl-mdsal-dom-schema-service-osgi 38/67538/2
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>
6 years agoBinding v2 codec - fix KeyedListNodeCodecContext 93/64093/10
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>
6 years agoBinding codec v2 - fix startMapEntryNode 33/62133/18
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>
6 years agoBinding codec v2 - fix startMapNode/startOrderedMapNode parameter 31/62131/18
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>
6 years agoBinding generator v2 - fix IdentifiableItem and Item 16/62116/19
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>
6 years agoUse ranges to cross-reference yangtools features 01/67301/2
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>
6 years agoBump yangtools to 2.0.1 49/67249/1
Robert Varga [Wed, 17 Jan 2018 19:00:33 +0000 (20:00 +0100)]
Bump yangtools to 2.0.1

Pick up latest fixes in yangtools, notably API contract violations
in SchemaContext.{get,find}Modules().

Change-Id: I34b803a60037ba2db1f1ecabc699d506b32de460
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix type ordering assumptions 42/67242/1
Robert Varga [Wed, 17 Jan 2018 15:58:59 +0000 (16:58 +0100)]
Fix type ordering assumptions

There are two types in this test with the same name. Do not assume
they will be reported in a particular order, but rather pick the
correct one for testing.

Change-Id: I0593b6505d7aec985504e92f8487b562c96c2a7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix wrong ietf-type-util version 75/67075/1
Robert Varga [Thu, 11 Jan 2018 20:48:02 +0000 (21:48 +0100)]
Fix wrong ietf-type-util version

We inadvertently dropped the -SNAPSHOT suffix, which is not correct
and hence we are failing to deploy correctly.

Change-Id: I87280b7c863946e9fadcec1e33f933dfecc05116
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoUse version ranges for odlparent features 03/66703/4
Stephen Kitt [Thu, 21 Dec 2017 09:18:43 +0000 (10:18 +0100)]
Use version ranges for odlparent features

odlparent allows the use of ranged imports, take advantage of that.

Change-Id: I64e2968ab50e556b190dddf5824891ec50acaa14
Signed-off-by: Stephen Kitt <skitt@redhat.com>
6 years agoAdjust to yangtools-2.0.0 changes 68/64168/43
Robert Varga [Wed, 11 Oct 2017 15:03:32 +0000 (17:03 +0200)]
Adjust to yangtools-2.0.0 changes

Most notable adjustments:
- type empty requires Empty
- Date -> Revision, with the possibility of being absent
  - This changes behaviour for revisionless modules, these are now
    generated as '.norev' rather than '.rev700101'
- Length constraint update to match
- QName requires namespace to be non-null
- SchemaContext.getModule() et al., which also improves performance
- binding tests are updated to eliminate useless reflection
- bump twirl-api to 1.3.13
- bump scala-maven-plugin to 3.3.1
- bump twirl-maven-plugin to 1.1.0

Change-Id: Ie35090cc0f60a2411399e5b2d3fe59246bbfbdba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBump yangtools dependency to 2.0.0 67/64167/21
Robert Varga [Wed, 11 Oct 2017 14:54:31 +0000 (16:54 +0200)]
Bump yangtools dependency to 2.0.0

This patch adopts odlparent-3.0.2 and yangtools-2.0.0. As such it is
not expected to pass compilation due to the amount of breaking changes
in yangtools. It is separated out to allow review of changes at the
build system level.

Adjustments include:
- feature reference updates, so we pull in correct yangtools features
- bump scala-maven-plugin to 3.3.1
- bump twirl-maven-plugin to 1.1.0
- bump twirl-api to 1.3.13

Follow-up patch adapts the codebase to the inbound changes, making
the compilation pass.

Change-Id: I21a3d55969c31b89b56c6ba637593f033b035e14
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoShare pre-generated non-verbose string 48/66948/1
Robert Varga [Mon, 8 Jan 2018 17:19:45 +0000 (18:19 +0100)]
Share pre-generated non-verbose string

As it turns out, xtend does not do any sort of constant folding,
hence we need to share the strings instance ourselves to get
the most speed out of quick profile.

Change-Id: I83239aa27567d2927fbed2039f28f7e17461db4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding generator v2 - fix list/key implements identifiable/identifier 17/62117/12
Jie Han [Tue, 22 Aug 2017 02:07:49 +0000 (10:07 +0800)]
Binding generator v2 - fix list/key implements identifiable/identifier

- Support keyed list type implements
  Identifiable and its key implements Identifier.

Change-Id: I0d12d2154f727a0088dc5329a4bd748edfa3e9f6
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBinding generator v2 - Add concepts.Identifiable to BindingTypes 55/64055/4
Jie Han [Mon, 9 Oct 2017 08:26:30 +0000 (16:26 +0800)]
Binding generator v2 - Add concepts.Identifiable to BindingTypes

- Use Identifiable defined in concepts without duplication.
Change-Id: Ia4fbcb481f41368d81f03aef829561d5fc4a1ce5
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoFix odlparent-3.0.0 checkstyle issues 44/65544/6
Robert Varga [Wed, 15 Nov 2017 12:30:58 +0000 (13:30 +0100)]
Fix odlparent-3.0.0 checkstyle issues

This fixes issues identitifed by checkstyle in odlparent-3.0.0,
split out of the bump proper to keep the migration patch smaller.

Change-Id: Ib42dbebb0bdbcec770cb9e4daaf24fb14dccde6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMDSAL-294: Binding v1 generator - Add @CheckReturnValue on RPC methods 63/65063/5
Jie Han [Fri, 3 Nov 2017 01:05:09 +0000 (09:05 +0800)]
MDSAL-294: Binding v1 generator - Add @CheckReturnValue on RPC methods

-  Use @CheckReturnValue annotation in static code analysis
to ensure that all users of the RPC do check the Future RpcResult
 for errors - even if there is no Output.

Change-Id: I7b4e5f0d7ca81db154a39325490a46bfcf8820a4
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoMDSAL-107: Fix pre-existing data notification for wildcarded DTCL 34/64734/3
Tom Pantelis [Wed, 25 Oct 2017 18:58:57 +0000 (14:58 -0400)]
MDSAL-107: Fix pre-existing data notification for wildcarded DTCL

This issue was fixed in CDS a while but should also be fixed for the
in-memory DOM data store.

Change-Id: Ib3e25c6164d6868f5b80680467732aed0beac093
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
6 years agoFix checkstyle in mdsal-binding2-dom-codec 06/64506/1
Jie Han [Thu, 19 Oct 2017 05:45:02 +0000 (13:45 +0800)]
Fix checkstyle in mdsal-binding2-dom-codec

 - Fix checkstyle issues and activate enforcement.
Change-Id: I9857df844aba6bee4ddc729fb8246a2d8a085ad5
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoFix checkstyle in mdsal-binding-dom-codec 18/64418/2
Robert Varga [Tue, 17 Oct 2017 18:17:48 +0000 (20:17 +0200)]
Fix checkstyle in mdsal-binding-dom-codec

Fix checkstyle issues and activate enforcement.

Change-Id: I5ef078ba907284d5885521971cb0391a28fa2e57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix checkstyle in maven-sal-api-gen-plugin 12/64412/4
Robert Varga [Tue, 17 Oct 2017 16:03:40 +0000 (18:03 +0200)]
Fix checkstyle in maven-sal-api-gen-plugin

Fix violations and enable enforcement.

Change-Id: Ibc88fbe40b09a0aeff977bd1aaeed408954c201a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix checkstyle violations in yang-binding 11/64411/2
Robert Varga [Tue, 17 Oct 2017 14:58:56 +0000 (16:58 +0200)]
Fix checkstyle violations in yang-binding

Fixes violations and activates enforcement.

Change-Id: Iaa11d659549fa62a35201dea77992b32aebbd998
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoAdd read-write transaction to the AsyncDataBroker APIs 56/50156/9
Tom Pantelis [Tue, 10 Jan 2017 04:27:42 +0000 (23:27 -0500)]
Add read-write transaction to the AsyncDataBroker APIs

Read-write transactions were ommitted from the AsyncDataBroker
and related APIs. It is unclear as to why but the DOMStore API
defines read-write transaction as do the equivalent controller
APIs so clients will expect it when converting to the mdsal APIs.
Plus we want to convert the CDS to the mdsal APIs and deprecate the
controller APIs but we cannot provide an adapter between the two
without read-write transactions.

Change-Id: I46cd1783931044a34039f4a2100c50b645446bf2
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix some checkstyle and other issues 98/63998/7
David Suarez [Thu, 5 Oct 2017 17:52:43 +0000 (19:52 +0200)]
Fix some checkstyle and other issues

- Make some classes final
- Remove redundant "extends Object"
- Remove types that can be inferred by the compiler
- Make some variables final
- Avoid potential NPEs

Change-Id: I6ab30e3015e00f8e7e1df3e33b6aae0cf57dbede
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
6 years agoAdd ClusteredDOMDataTreeChangeListener interface 67/50267/5
Tom Pantelis [Wed, 11 Jan 2017 06:31:50 +0000 (01:31 -0500)]
Add ClusteredDOMDataTreeChangeListener interface

Change-Id: Ifa302db331ae7518c5327f7616171390b0e64eed
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
6 years agoUse mdsal's MappingCheckedFuture 95/64195/1
Robert Varga [Thu, 12 Oct 2017 11:34:58 +0000 (13:34 +0200)]
Use mdsal's MappingCheckedFuture

yangtools is getting rid of this class, use our internal copy
of it.

Change-Id: I8522672bdc6c8a93d55336415a02b2c32ea0fd44
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix odlparent references 66/64166/1
Robert Varga [Wed, 11 Oct 2017 17:14:08 +0000 (19:14 +0200)]
Fix odlparent references

These have been left behind in the version bump, fix them up.

Change-Id: Ie3df04a7650fe572a3b223c143fe309c07dc5448
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-9043: import MappingCheckedFuture from yangtools 14/64114/3
Robert Varga [Tue, 10 Oct 2017 13:36:55 +0000 (15:36 +0200)]
BUG-9043: import MappingCheckedFuture from yangtools

This patch moves MappingCheckedFuture from yangtools to mdsal,
where it is required to retain API compatibility, as we cannot
get rid of CheckedFuture just yet.

Change-Id: I33096b80de2d355181aafdfc69b38394f6fcfe80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoFix wrong yangtools import 79/64079/1
Robert Varga [Mon, 9 Oct 2017 17:03:46 +0000 (19:03 +0200)]
Fix wrong yangtools import

We should be importing 1.2.0, not its snapshot.

Change-Id: I9910ade87e596a57f24b531c657fb2aa7a9e74f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBUG-9145: rework singleton service group state tracking 26/63426/10
Robert Varga [Thu, 21 Sep 2017 23:00:04 +0000 (01:00 +0200)]
BUG-9145: rework singleton service group state tracking

The beef of the issue here is that there are multiple codepaths
which end up sharing state transitions -- hence we could erroneously
end up waiting for entity release, when if fact we have already
lost it.

Rather than going the explicit FSM route, which would require quite
a few more states, rework state tracking such that each event is
evaluated against current state. This has the nice feature of making
duplicate events idempotent, as the code is all about reconciling
current and intended state.

This also disentangles the loss of ownership codepaths, which means
we can optimize behavior when partitions are involved -- specifically
jeopardy service entity ownership does not result in service shutdown,
because service liveness is actually guaranteed by cleanup entity.
Hence we can keep the services and the cleanup entity intact, leading
to less churn during partitions.

Should the cleanup entity report jeopardy, we need to bring the services
down, but we do not need to unregister the cleanup entity -- if the
partition is healed, we can start services again without the delay
incurred by EOS. If we end up losing partition healing, cleanup entity
ownership will be taken from us, at which point we also unregister.

Change-Id: Id5c8a97722b9a21114135554d92c17898dd0150e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding v2 Generator - fix dependency yang-ext of mdsal-binding2-test-model 60/63860/7
Jie Han [Thu, 28 Sep 2017 06:07:42 +0000 (14:07 +0800)]
Binding v2 Generator - fix dependency yang-ext of mdsal-binding2-test-model

- It should depend on yang-ext in binding2 model for
using generated codes v2.

Change-Id: I3c5b597285b3ca67c376184b2b080745776c2d94
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoBug 8326 - Split out OsgiBundleScanningSchemaService 61/62261/33
Jakub Toth [Thu, 24 Aug 2017 10:46:16 +0000 (12:46 +0200)]
Bug 8326 - Split out OsgiBundleScanningSchemaService

 * move osgi part of mdsal-dom broker to new module
   mdsal-dom-schema-service-osgi (with unit tests)

Change-Id: I2eb2e4f96f50456f84982e5de6d439b0306bcc0f
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 years agoBinding codec v2 - cast case type to get serializer 91/61891/8
Jie Han [Thu, 17 Aug 2017 06:03:52 +0000 (14:03 +0800)]
Binding codec v2 - cast case type to get serializer

- it should be type of generated interface to get serializer for case,
  not the class type in builder.

Change-Id: Ibe2fdfaf2db7e95027809183c29011fb62b56058
Signed-off-by: Jie Han <han.jie@zte.com.cn>
6 years agoAdd yang-ext to model-binding2 59/63859/5
Vratko Polak [Thu, 5 Oct 2017 11:29:37 +0000 (13:29 +0200)]
Add yang-ext to model-binding2

- add yang-ext to resolve denpendency of odl-mdsal-binding2-base

Change-Id: Ie02a799b795a2b38009721339f2ff831694f5b51
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
6 years agoRemove explicit default super-constructor calls 11/63611/2
David Suarez [Wed, 27 Sep 2017 11:40:46 +0000 (13:40 +0200)]
Remove explicit default super-constructor calls

The default constructor is called by default (hence its name), no need
to call it explicitly.

Change-Id: Ibc4f160f14cd75d46b1bacea75c1bf29b3f49355
Signed-off-by: David Suarez <david.suarez.fuentes@gmail.com>
6 years agoBump mdsal to use yangtools 1.2.0 31/63831/1
Anil Belur [Fri, 29 Sep 2017 03:55:20 +0000 (13:55 +1000)]
Bump mdsal to use yangtools 1.2.0

Jira: releng-485

Change-Id: I61a5d889586ad228b3f05758cc76f15e5342bd36
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>