mdsal.git
6 years agoBug 8237 - BI to BA conversion not resolving nested nodes 35/57135/4
Jakub Toth [Tue, 16 May 2017 10:55:17 +0000 (12:55 +0200)]
Bug 8237 - BI to BA conversion not resolving nested nodes

  * not real bug - only example of used referencing in test

Change-Id: Ib5c0d2f27f368f6bca3f917a7ef922bcb5d75fa5
Signed-off-by: Jakub Toth <jakub.toth@pantheon.tech>
7 years agoBUG-8327: Introduce DOMYangTextSourceProvider and implement it 98/56298/1
Robert Varga [Fri, 28 Apr 2017 12:05:21 +0000 (14:05 +0200)]
BUG-8327: Introduce DOMYangTextSourceProvider and implement it

Migration requires that DOMSchemaService provides the capability to
access underlying sources in YANG text. Rather than modifying the
base DOMSchemaService, make it an DOMExtensibleService and define
the appropriate extension, DOMYangTextSourceProvider.

Update OsgiBundleScanningSchemaService to implement the new
extension.

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

7 years agoBUG-7927: stop scanning bundles on framework stop 42/56242/1
Robert Varga [Thu, 27 Apr 2017 17:33:36 +0000 (19:33 +0200)]
BUG-7927: stop scanning bundles on framework stop

Monitor framework bundle for STOPPING event and when it triggers
flag us as stopping: all bundles are about to shut down, so there
is no point in trying to update the schema context anymore.

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

7 years agoLazily create schema context in GlobalBundleScanning* 05/56205/2
Robert Varga [Thu, 27 Apr 2017 16:38:37 +0000 (18:38 +0200)]
Lazily create schema context in GlobalBundleScanning*

On OsgiBundleScanningSchemaService startup, it calls
tryToUpdateSchemaContext when bundleTracker.open() completes.
This parses and creates a schema context and notifies listeners
of the updated schema context. However we don't have to call
tryToUpdateSchemaContext in start() unless there actually are
listeners registered as the purpose of tryToUpdateSchemaContext
is to update listeners. So made this change. It's not likely there
would be any listeners at that point anway.

I also changed the synchronization so as not to synchronize on 'this'
or the class instance as both are unsafe (users could sync on the
instance causing unwanted contention, either innocently or maliciously).

Change-Id: I435358b0851671b7fbfdc9784577c91ff20556df
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 62ca5284757904ee8a2ac0f79f07b0f4c41dc830)

7 years agoTurn off visibility of OsgiBundleScanningSchemaService#start() 10/56210/1
Robert Varga [Thu, 27 Apr 2017 16:41:10 +0000 (18:41 +0200)]
Turn off visibility of OsgiBundleScanningSchemaService#start()

Since the start() method is only used in the createInstance(), it
should be private and not exposed.

Change-Id: I0264d0a66bbfb2536bc4d6c57f27f15584ddfabb
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
7 years agoSpeed up OsgiBundleScanningSchemaService close 95/56195/1
Robert Varga [Thu, 27 Apr 2017 16:20:53 +0000 (18:20 +0200)]
Speed up OsgiBundleScanningSchemaService close

On close, the OsgiBundleScanningSchemaService closes the
BundleTracker which untracks all the bundles and notifies the listener
of removed bundles. This results in a call to tryToUpdateSchemaContext
which causes the remaining yang files to be re-parsed to build a new
SchemaContext. To prevent this extra processing on shutdown, I added
a "stopping" flag to elide tryToUpdateSchemaContext the same we do
with the "starting" flag.

Change-Id: I9f7c05277df9bf1ffaec1c699453020312aab203
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit b0a11d8bb72e2b74f64ca1dbd6d981cf3a70c8ea)

7 years agoBUG-8004: handle implicit RPC input 36/54136/2
Robert Varga [Mon, 27 Mar 2017 17:42:17 +0000 (19:42 +0200)]
BUG-8004: handle implicit RPC input

RPC input is always defined implicitly, which is something we cannot
deal with in Binding Specification compatibly, as original generators
did not emit classes for such methods and implicitly map them to Void.

In order to deal with these, we need to recognize when an RPC input
is not declared and re-wire it to a null codec. This loses information,
but it is the best we can do (simply because there is no binding
representation).

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

7 years agoBumping versions by x.y.(z+1) for next dev cycle 80/54480/1
Anil Belur [Fri, 7 Apr 2017 07:54:21 +0000 (17:54 +1000)]
Bumping versions by x.y.(z+1) for next dev cycle

Change-Id: I9f9ec883207d29812092af1e3cc3782d87627b32
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
7 years agoBug 7759 - TEST - Getter of BA object fails to construct class instance 64/53264/3
Jakub Toth [Tue, 14 Mar 2017 10:10:29 +0000 (11:10 +0100)]
Bug 7759 - TEST - Getter of BA object fails to construct class instance

 * negative test - if value of data is other like type of data define by yang

Change-Id: Ia6a9abd43e78384f84c867cf6a755cd07d6503c6
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoBindingGenerator v1 "copy-paste" bug in RPCs 18/53218/1
Martin Ciglan [Mon, 13 Mar 2017 12:17:22 +0000 (13:17 +0100)]
BindingGenerator v1 "copy-paste" bug in RPCs

This patch fixes kind of "copy-paste" bug revealed during
dealing with Actions in Binding Spec v2. This needs
to be cherry-picked to Boron too.

Change-Id: I22d56fd7ca899e4634ad0c2aaaec63d5b7c11403
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit 97dcb94d6f9bb515c4ca22e6ab1ac05633fe6402)

7 years agoBug 7759 - TEST - Getter of BA object fails to construct class instance 67/53067/2
Jakub Toth [Thu, 9 Mar 2017 10:31:08 +0000 (11:31 +0100)]
Bug 7759 - TEST - Getter of BA object fails to construct class instance

Change-Id: Idfb3ceabe6808bcd9c421d189566f680f8f0077f
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoBug 6856: Rpc definition should implicitly define input/output 08/53008/1
Martin Ciglan [Mon, 6 Mar 2017 08:59:21 +0000 (09:59 +0100)]
Bug 6856: Rpc definition should implicitly define input/output

- corresponding patch for MDSAL
- code clean-up in affected class

Change-Id: I715585331496d181031f5a82ce801a1b7271c56d
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit e6ba71a1853e1e49affe1f9712c3c63c74028878)

7 years agoBug 6856: Rpc definition should implicitly define input/ouput 98/52398/1
Martin Ciglan [Tue, 28 Feb 2017 09:51:32 +0000 (10:51 +0100)]
Bug 6856: Rpc definition should implicitly define input/ouput

- corresponding fix for MD-SAL
- rely on yang model API only

Change-Id: I7380b7d8366c4c18925da09a95a14f5309a8e9ef
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit cca0a276d2e55ccc92bd1c3e4e51bffb29d482c6)

7 years agoBUG-6028: check value types for encapsulation 03/52203/1
Robert Varga [Wed, 8 Jun 2016 17:09:17 +0000 (19:09 +0200)]
BUG-6028: check value types for encapsulation

This is a fast check to see if the argument matches expected
value class. If it does not it does not make sense to invoke
the serializer, as it will fail.

Change-Id: I4ca556fea057f2188fa1c34d303467565af38d5c
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit a6d0735732b202f40bd37f7ae291c8a4af9e3ccf)

7 years agoFix generate of comma before augmentations in toString generator 73/51773/1
Jakub Toth [Fri, 10 Feb 2017 10:04:32 +0000 (11:04 +0100)]
Fix generate of comma before augmentations in toString generator

Change-Id: Ibb4c19028b758c27126cc244a8657efbd46bc1b2
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit 4920e768c2d376661eace4206df4f6fc95115162)

7 years agoBUG-7222: Improve ClusterSingletonService error handling. 52/51752/1
Tomas Cere [Thu, 9 Feb 2017 13:13:23 +0000 (14:13 +0100)]
BUG-7222: Improve ClusterSingletonService error handling.

The applications that are managed by singleton service
may throw an unchecked exception while handling the calls from
the service. We also need to handle these so that they don't prevent
other services from being started/stopped.

Change-Id: I711b8c1e8b2fcb8e9a9699ba96fa3b0c2daff594
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit 55b8b0a9dfe50a20dec1c8e55e1610a4614a51be)

7 years agoBug 3147 - Binding spec v1: auto generated code by YANGTOOLS could 12/51612/1
Robert Varga [Thu, 2 Feb 2017 16:24:09 +0000 (17:24 +0100)]
Bug 3147 - Binding spec v1: auto generated code by YANGTOOLS could
be more efficient

  *fix generating of commas in toString() for more effecient
  *tests

Change-Id: I13b59c3c5be90446a9511a9cd46969850cb77595
Signed-off-by: Jakub Toth <jatoth@cisco.com>
(cherry picked from commit e6f9ca95834a6d081ce663c24f17cc3467a18100)

7 years agoRevert "Bug 3147 - Binding spec v1: auto generated code by YANGTOOLS could" 54/51354/1
Robert Varga [Thu, 2 Feb 2017 16:23:37 +0000 (17:23 +0100)]
Revert "Bug 3147 - Binding spec v1: auto generated code by YANGTOOLS could"

This reverts commit b88102998caf1d7ed9b9e720cc9fe4bbdc7e11bb.

Change-Id: If322b38d32e759522800af099b42d649e1237cb7
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 69299b34a1b1ab2442c23cd145d7a0b3f7f0acd3)

7 years agoFix getValue() of bits in union 33/51333/1
Xiao Liang [Wed, 11 Jan 2017 05:59:14 +0000 (05:59 +0000)]
Fix getValue() of bits in union

Call Arrays.toString instead of calling toString directly for bits in union,
since getValue() of bits returns boolean[].

Change-Id: I4b06c95f07ff6d5ff81dc17613ed972b453db184
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
(cherry picked from commit b689dd6d7ce7ea26fa1f580c5d354749df90a31b)

7 years agoBug 3147 - Binding spec v1: auto generated code by YANGTOOLS could 90/51290/1
Jakub Toth [Fri, 23 Dec 2016 21:23:59 +0000 (22:23 +0100)]
Bug 3147 - Binding spec v1: auto generated code by YANGTOOLS could
           be more efficient

  *fix generating of commas in toString() for more effecient
  *tests

Change-Id: I5a1ac0ad8068655168824d89a9acb1f203a64639
Signed-off-by: Jakub Toth <jatoth@cisco.com>
7 years agoDon't use deprecated SourceIdentifier.create() method anymore 70/51170/1
Martin Ciglan [Fri, 27 Jan 2017 15:18:38 +0000 (16:18 +0100)]
Don't use deprecated SourceIdentifier.create() method anymore

- replace call with right method
- bit of a code cleanup

Change-Id: Ie9dacf66cbb6494b25e1747952463326152c423a
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit 061b7374a7b9d70104a675d033c6762cb3c5b5a3)

7 years agoBug 7425: Recognize instance-identifier in union template 88/50088/1
Vratko Polak [Thu, 5 Jan 2017 16:06:35 +0000 (17:06 +0100)]
Bug 7425: Recognize instance-identifier in union template

Previously, it was wrongly identified as a generated type,
but InstanceIdentifier is a base type, so no getValue() there.

Change-Id: I18d67357753eda6e241a608fc5a2c933aa1f9eda
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
(cherry picked from commit aaa5f227c44cb48a579004f2aa500c4fa8f41b0b)

7 years agoFix backport damage 90/49690/1
Robert Varga [Wed, 21 Dec 2016 11:08:50 +0000 (12:08 +0100)]
Fix backport damage

Change-Id: I85145dbeb22fca216e94cdea287dddcef20ae53f
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoNew test utility AssertDataObjects 53/48753/4
Michael Vorburger [Wed, 12 Oct 2016 15:10:48 +0000 (17:10 +0200)]
New test utility AssertDataObjects

This adapts https://github.com/vorburger/xtendbeans to OpenDaylight.

That library can be used as-is for "normal" Java objects, such as Flow
beans, as seen e.g. in https://git.opendaylight.org/gerrit/#/c/42109/.

This change make it possible to use that library to compare actual
DataObject obtained from the DataBroker with expected objects in tests,
as illustrated e.g. in https://git.opendaylight.org/gerrit/#/c/44000/
(Those objects have a number of peculiarities which need adaption,
provided by the classes in this change.)

One can use AssertDataObjects.assertEqualBeans(Object expected, Object
actual)
WITHOUT ever writing any Xtend code, and WITHOUT any code generation,
and use this utility JUST to get a very readable text diff between two
object trees; this will look like shown in this presentation screenshot:
https://docs.google.com/presentation/d/1bnwj8CrFGo5KekONYSeIHySdkoXZiewJxkHcZjXnzkQ/edit#slide=id.g17d8ae4d92_0_150

It is ALSO possible, but not required, to use the text syntax shown (see
linked screenshot) to declare the expected object by copy/paste of that
syntax into an *.xtend source file (from which an Xtend Maven plugin
code
generates Java code), because that text "happens" (intentionally) to be
valid Xtend.

This last step is purely optional though, and while some downstream
projects may adopt this to define expected objects in a readable syntax,
others may not, and simply define their expected objects with normal
Java code and Builders (or reading them from XML, or whatever) - yet can
still use this this new utility - just for a great diff / comparison
kind of view, only.

This code has dependencies on yangtools, mdsal, plus a test
model for its self test - and the external xtendbeans library (which
should be considered like any of the 100s of other ext. deps. we have).

Change-Id: I34aac96bd13b936d6fb76a484a512081c18e0b11
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit 18170324fab2eb494c7d8721521a429802dd48f9)

7 years agoBug 6236: Introduce "mdsal.skip.verbose" property, for build speed 34/49234/2
Michael Vorburger [Mon, 17 Oct 2016 15:47:38 +0000 (17:47 +0200)]
Bug 6236: Introduce "mdsal.skip.verbose" property, for build speed

This doesn't "fix" Bug 6236, but works around it - and gives us a low
hanging fruit build performance improvement.

If this change gets accepted, I would make the odlparent -Pq profile set
this to true by default.

In parallel, I'm trying to get a root cause fix in a future Xtend
version. (At which point this could be removed again.)

Change-Id: I108f401fa2fbca6f17a8b23cb098910c5a6021fb
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit 535737b1a8c91de648c5215d6430df693dba52bc)

7 years agoBumping versions by 0.0.1 for next dev cycle 73/49573/1
Anil Belur [Tue, 20 Dec 2016 02:36:06 +0000 (12:36 +1000)]
Bumping versions by 0.0.1 for next dev cycle

Change-Id: Ib29ee1195b6f5ecb41a43ba9fc70dabee2b2f819
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
7 years agoBug 6163: fixed number of argument when resolving rpc input 84/49184/1
Martin Ciglan [Fri, 9 Dec 2016 15:15:47 +0000 (16:15 +0100)]
Bug 6163: fixed number of argument when resolving rpc input

- changed functionality of resolving rpc input. Input class is
  resolved by it's assignability from DataContainer class
- quite a bit of cleanup, comments added

https://bugs.opendaylight.org/show_bug.cgi?id=6163

Change-Id: I4a7d05283951db280c3e92301590407da4f40ffa
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 6135: Java binding v1: IAE from provideTypeForLeafref 02/48702/1
Martin Ciglan [Fri, 18 Nov 2016 14:25:13 +0000 (15:25 +0100)]
Bug 6135: Java binding v1: IAE from provideTypeForLeafref

- add referenced types in order to resolve leafrefs (main idea of this bug)
- do it in rather conservative way to not to spoil BGPCEP build
- fix back non-sense change in GenEnumResolvingTest.java to original state

Change-Id: I0d7083c7b71e07cb60a22f3106657060a2936c9c
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit 504fb56ec17458fc9cdd62127484bd780e53f04c)

7 years agoBug 6710 - Close ClusterSingletonServiceRegistration fix 61/46761/4
Vaclav Demcak [Mon, 26 Sep 2016 11:30:41 +0000 (13:30 +0200)]
Bug 6710 - Close ClusterSingletonServiceRegistration fix

Note: Closing process for CSSRegistration has to follow same
way as a lostLeadership and the main diferences between this
two ways is a not null MainEntityCandidate registration.

* fix using closeClusterSingletonGroup method
  - this method has to be use ONLY without active EOS listener
* fix closeResources method
  - MainEntityCandidate has to be close before lock.release
* fix removing actual CSSGroup instance from EOS listener map
  - close proces has to always finish with removing parth and
    we have to check guardEntityCandidate instece only. Because
    we don't get any aditional notif. from Eos without
    GuardEntityCandidate registration.
* add and modify test
* add async Test Case for SingletonServiceGroup

Change-Id: I15f89cbd43310b0a8e4b7ac78595eeaaa82a65ee
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
7 years agoBUG-7013: do not rely on default character encoding 63/47663/2
Robert Varga [Thu, 27 Oct 2016 10:33:43 +0000 (12:33 +0200)]
BUG-7013: do not rely on default character encoding

Generated java files should always be UTF8-encoded,
as that is what our maven settings enforce.

Therefore we cannot rely on JVM-default encoding, but
have to force file output to be UTF8.

Change-Id: Ie24f753fda3ab4d71ec951cf7b725b97678bae7a
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit d2b401cc036c53685dcd076a406a13f348ca5102)

7 years agoBug 7064: yang-to-source error on description 58/48058/1
Martin Ciglan [Mon, 7 Nov 2016 13:27:54 +0000 (14:27 +0100)]
Bug 7064: yang-to-source error on description

Existing logic of formatToParagraph() method doesn't expect a case
when very first text sequence is longer than 80 characters
and crashes in wrong condition branch. This has been fixed and tested
for various inputs.

Change-Id: Iefeb2b4063335561f3277c3ee40b3d9a46c418dc
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBumping versions by 0.0.1 for next dev cycle 15/47915/1
Anil Belur [Fri, 4 Nov 2016 00:27:41 +0000 (10:27 +1000)]
Bumping versions by 0.0.1 for next dev cycle

Change-Id: I561963e704c6997fc0346e88546062d22a4e8506
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
7 years agoBUG-7009: fix invalid model 03/47403/1
Robert Varga [Sun, 23 Oct 2016 20:24:23 +0000 (22:24 +0200)]
BUG-7009: fix invalid model

The test model is not valid, as it specifies an extension
argument while the extension definition does not allow arguments.

Change-Id: I2bae1ee5eb3dcf4b98875001b2b4a46f2723601b
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoRemove augmentableToAugmentations maps 23/47223/1
Robert Varga [Wed, 31 Aug 2016 15:25:52 +0000 (17:25 +0200)]
Remove augmentableToAugmentations maps

These maps are not needed, hence we can forgo creating and maintaining
them.

Change-Id: Ib366bc3d61d8aca7a6f5f881b8a7c8db30ce8c85
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 082ccfc61766e06fb45c545780b53849f0c19771)

7 years agoClean up apparently dead (and not thread safe) code 00/47200/1
Michael Vorburger [Mon, 17 Oct 2016 15:52:45 +0000 (17:52 +0200)]
Clean up apparently dead (and not thread safe) code

YangTemplate's private static Module is necessarily always null, so this
is dead code, and it should be perfectly safe, and clearer, to remove
this.

Full disclosure: I actually have absolutely no idea what writeIdentityNs
was originally good for, but don't think I'm breaking anything with this
clean up, because the way the code is now there is no way that this can
ever be anything else than null.

Change-Id: Ib08112c836efdc1c72443a5f93549a96f954dae8
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
(cherry picked from commit 24522e1ea2cbc45350697265fa90cf419fcb5689)

7 years agoBUG-5561: retain SchemaContext order for bits 14/47014/1
Robert Varga [Mon, 5 Sep 2016 14:41:37 +0000 (16:41 +0200)]
BUG-5561: retain SchemaContext order for bits

This patch reworks BitsCodec so it retains the bit order
defined in SchemaContext, which by extension means the values
coming from Binding objects should end up being sorted
by position.

Change-Id: Ice154dd7e38e6b213c281ddb492408f619e3a5f8
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 85945172d532b22797b0f1786dbf448c63b66f63)

7 years agoConvert to using BatchedListenerInvoker 74/46374/2
Robert Varga [Thu, 22 Sep 2016 18:21:31 +0000 (20:21 +0200)]
Convert to using BatchedListenerInvoker

This will deliver all notifications in one go, leading to faster
flushing.

Change-Id: I7a5023fadbfc67a19348963c15ae332986cd18d8
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit f822ec2d88c315709ee845af39920a149b75b580)

7 years agoMove transaction-invariants into producer 73/46373/2
Robert Varga [Tue, 20 Sep 2016 18:48:05 +0000 (20:48 +0200)]
Move transaction-invariants into producer

Instead of re-calculating the context, cache most of the information
required in the InMemoryDOMDataTreeShardProducer, so it can be quickly
reused when creating transactions. This information is calculated when
a producer is created or when the sharding layout changes.

Change-Id: Id2bcab420cf6d1635aba6cd97bf68f1860533780
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 5a9368fc20a5a6d403a63fe405b79c55a0a647cc)

7 years agoAdd cursor lookup fast-path 72/46372/2
Robert Varga [Tue, 20 Sep 2016 15:39:19 +0000 (17:39 +0200)]
Add cursor lookup fast-path

Users will typically select one of the subtrees to create
cursor on, hence add a fast path which will perform a simple
lookup.

Change-Id: Ied0710a765edf8cdd4ebd7f2712f310f82f35b1a
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 2ff021b039e02cfc74661383a2a204992b4ef200)

7 years agoFix a raw type warning 71/46371/2
Robert Varga [Tue, 20 Sep 2016 14:56:19 +0000 (16:56 +0200)]
Fix a raw type warning

Iterable should be qualified, fix that.

Change-Id: Icff504ab73c1cd180c6f50d239f1fe9630845de1
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit cbdea71ec0022926d9535ba9b4e80e1af95aedc2)

7 years agoFix raw types 70/46370/2
Robert Varga [Tue, 20 Sep 2016 12:58:36 +0000 (14:58 +0200)]
Fix raw types

Fix eclipse warnings from raw types.

Change-Id: Iae0d43883cbcf8b084f2c7469796b9a7d80ba32f
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit f6af6b03353f111cce3c8875aaf76e203199de57)

7 years agoMake sure we optimize DOMDataTreeIdentifier 69/46369/2
Robert Varga [Tue, 20 Sep 2016 00:59:00 +0000 (02:59 +0200)]
Make sure we optimize DOMDataTreeIdentifier

DOMDataTreeIdentifier inside a shard is heavily reused. Do not trust
the user to give us an optimized YangInstanceIdentifier but try
optimizing it.

Change-Id: I8a73b21562393a5f9100359d5ffaf3e2af057b6e
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 7488878f65eef4396e5985f2228fbbad2f05d536)

7 years agoDo not allow transaction creation with an empty shard map. 68/46368/2
Tomas Cere [Tue, 20 Sep 2016 15:44:38 +0000 (17:44 +0200)]
Do not allow transaction creation with an empty shard map.

Change-Id: I445c43a5af430bb0b4838c2e77d155d5318e0bbb
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit 1bd1474746e48cfa86d48b5e2b65046bc21125dc)

7 years agoRemove public keyword 67/46367/2
Robert Varga [Tue, 20 Sep 2016 01:54:46 +0000 (03:54 +0200)]
Remove public keyword

ShardDataModification is not a public class, no sense
in declaring its methods public.

Change-Id: I4d198ad16aa6cf02b28262ecc5b7a169cb99955c
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 596b89ec503f56c87d066c00d6550e675eb7cf0c)

7 years agoEncapsulate ShardedDOMDataTreeProducer layout 66/46366/2
Robert Varga [Sun, 18 Sep 2016 22:21:23 +0000 (00:21 +0200)]
Encapsulate ShardedDOMDataTreeProducer layout

This patch encapsulates all state related to sharding
layout into an inner class, so that this information
can be accessed concurrently.

Change-Id: If66a7ac5b574d612b31e7c52156b80580ef9f79a
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 09111573277ec258069ecba5e02ad8750ca50633)

7 years agoFix warnings in AbstractDOMShardTreeChangePublisher 65/46365/2
Robert Varga [Fri, 16 Sep 2016 09:20:54 +0000 (11:20 +0200)]
Fix warnings in AbstractDOMShardTreeChangePublisher

Raw types and potentially static method.

Change-Id: I271a7fe28df47dce6b8fd335a215d14c3f46b7b8
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit e662b9c1d106916c3f5f537f4230738d69a6fcb4)

7 years agoDo not instantiate iterator for debugging 54/46354/2
Robert Varga [Fri, 23 Sep 2016 13:38:37 +0000 (15:38 +0200)]
Do not instantiate iterator for debugging

Logging the entire collection is more appropriate and also
faster when logging is disabled.

Change-Id: Ib3e44851bcedad1eaabad983c1ac45de6890eec2
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoPerform delegate cursor enter/exit first 62/46362/1
Robert Varga [Tue, 20 Sep 2016 14:01:08 +0000 (16:01 +0200)]
Perform delegate cursor enter/exit first

Delegate may fail to perform the operation, which would leave
our stack inconsistent, leading to confusion if the user ignores
exceptions. Perform enter/exit on delegate first and only if it
succeeds proceed to update our stack.

Change-Id: If6ebfd9b530e9052a5dc8cab120a5d0c8317f937
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 10787df610669aa4bb22f7f8feae1dc1455dffb8)

7 years agoMove lookup check 61/46361/1
Robert Varga [Tue, 20 Sep 2016 14:00:03 +0000 (16:00 +0200)]
Move lookup check

We can use a precondition to make the code flow
more obvious.

Change-Id: Iaddfcfd4d49a91b6875a6f4803fed744ada63a85
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit bf69b6948754f6b1a7de124cc54bbe88b3532772)

7 years agoEliminate ShardedDOMDataTreeWriteTransaction.doSubmit()'s return 60/46360/1
Robert Varga [Tue, 20 Sep 2016 12:59:19 +0000 (14:59 +0200)]
Eliminate ShardedDOMDataTreeWriteTransaction.doSubmit()'s return

Returned future is not used anywhere, hence we can easily remove it.

Change-Id: I4ead4da32d1c2658d5c88f01534b5452230068e7
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit ada2c265698298bdab0201bb9a2c30af64376a9d)

7 years agoDo not use entrySet() where values() or keySet() suffices 59/46359/1
Robert Varga [Tue, 20 Sep 2016 01:48:33 +0000 (03:48 +0200)]
Do not use entrySet() where values() or keySet() suffices

Instead of forcing instatiation of entrySet() and using only
part of the provided data, use values() and keySet() based
on what we really need.

Change-Id: I0a9333b872f9c56e1fa4eddb985309741cf77fe8
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit c935f35b6eb698878eb73ba439a57fb7f40d6539)

7 years agoDo not use ExecutorService unnecessarily 58/46358/1
Robert Varga [Tue, 20 Sep 2016 01:09:40 +0000 (03:09 +0200)]
Do not use ExecutorService unnecessarily

Executor is the interface we need, not ExecutorService. ExecutorServices
are more complex, and we do not care about shutting them down anyway.

So require only an Executor, letting callers to deal with its lifecycle,
which allows us to use more efficient MoreExecutors.directExecutor()
instead.

Change-Id: Ide57266cc1fac395e545b466bf3b5ad86dee7b2f
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 195ee42d6fe586b331ec949a0f3579a27bb51eed)

7 years agoUse ImmutableMap instead of Collections.emptyMap() 57/46357/1
Robert Varga [Tue, 20 Sep 2016 01:51:07 +0000 (03:51 +0200)]
Use ImmutableMap instead of Collections.emptyMap()

ImmutableMap behaves nicely when it meets copying and can
be checked for.

Change-Id: I2e0b52b8ea83c69e4ace3364904975b806a67aae
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 474a3348cb0a272c6c6dde7089c68497ad619198)

7 years agoSpeed up InmemoryDOMDataTreeShardWriteTransaction's operations 56/46356/1
Robert Varga [Tue, 20 Sep 2016 00:41:13 +0000 (02:41 +0200)]
Speed up InmemoryDOMDataTreeShardWriteTransaction's operations

SimpleOperation's apply() method can be updated to invoke hasNext()
only once for each iteration.

Change-Id: Id94f01428dd1c8b55b883371c9830d6d7209727a
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit ab0f754780a5960525f13a06797eea0e347a4a57)

7 years agoSwitch to using StampedLock 55/46355/1
Robert Varga [Fri, 9 Sep 2016 20:30:20 +0000 (22:30 +0200)]
Switch to using StampedLock

Instead of using ReentrantReadWriteLock, use StampedLock,
which has better performance.

Change-Id: Ifb8c3c90fb05a37264e006acc7d94b4bde5d2893
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 24f1985c8a8f8aa4afaafc2cec7a1908890c993a)

7 years agoRemove mdsal-binding-util from features because it's only a pom file 00/46100/1
Colin Dixon [Tue, 20 Sep 2016 20:19:52 +0000 (16:19 -0400)]
Remove mdsal-binding-util from features because it's only a pom file

Change-Id: I2271c644416d75223858a79796343770e7ee073e
Signed-off-by: Colin Dixon <colin@colindixon.com>
(cherry picked from commit 2483a3622d0e9b395cc4c114ed56a2176b966756)

7 years agoImprove ShardedDOMDataTreeProducer locking 34/45834/1
Robert Varga [Fri, 16 Sep 2016 22:33:35 +0000 (00:33 +0200)]
Improve ShardedDOMDataTreeProducer locking

Making 'closed' a CAS-capable field allows us to check
state and transition to closed state without holding
the object's lock.

This allows associated critical sections to be reduced
to the extent as to make the reuse fast-path completely
lock-free.

Change-Id: I29bacebf5d37a38ea6b4cc641f43dc369cd9edcf
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 6f0f4aeb4562db98368051b3ab7382ea6af8baf8)

7 years agoImprove ShardedDOMDataTreeProducer locking 33/45833/1
Robert Varga [Fri, 16 Sep 2016 20:20:43 +0000 (22:20 +0200)]
Improve ShardedDOMDataTreeProducer locking

The path from backend was taking coarse lock even when not needed.
Explicitly annotate submitTransaction() as needing the lock being
held and push down its acquisition so we take it only after we
are certain we actually need it.

Change-Id: Icd1226796568829ea3735e6eec42677a79b9b3b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 2ce13c8680d68ba1e50eab9609069b6aecfa62a5)

7 years agoImprove ShardedDOMDataTreeWriteTransaction performance 32/45832/1
Robert Varga [Fri, 16 Sep 2016 20:39:45 +0000 (22:39 +0200)]
Improve ShardedDOMDataTreeWriteTransaction performance

Make internal maps/collection immutable, as it really is
and forgo internal copying of their values in iterators.

Change-Id: Icb0e59d52464498fe87440467fec9095cc8d414e
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit edecff765d21129c17050d77400f15b670c74bdf)

7 years agoOptimize InMemoryDOMDataTreeShardProducer 31/45831/1
Robert Varga [Fri, 16 Sep 2016 19:17:07 +0000 (21:17 +0200)]
Optimize InMemoryDOMDataTreeShardProducer

All state transitions in this class are based on lock-free
algorithms -- compare-and-swap and retries on conflict.

Eliminate unneeded synchronized keywords, plus inline simple
single-use methods.

Change-Id: I87e22333bb6c3c4db324c5918481fe79d5da2592
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit 7d465def070bd22e0ad3836119449b3063074e13)

7 years agoFix InMemory shard transaction chaining. 30/45830/1
Tomas Cere [Fri, 9 Sep 2016 15:53:20 +0000 (17:53 +0200)]
Fix InMemory shard transaction chaining.

In case we had multiple transactions going after each other quickly
the next transaction might not observe the state of the previous transaction yet.
Fix this by reusing the DataTreeModification of the previous transaction.
Also introduce state transitions into InMemoryDOMDataTreeProducer so it
behaves more like a transaction chain.

Change-Id: I96c746c1b91ac9f6b87152dca612094c73c23387
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit 7d8e59521efbfadd55de34f645db8a8692de6564)

7 years agoAdd batching of non-isolated transaction in ShardedDOMDataTreeProducer 29/45829/1
Tomas Cere [Fri, 9 Sep 2016 09:43:02 +0000 (11:43 +0200)]
Add batching of non-isolated transaction in ShardedDOMDataTreeProducer

Change-Id: If5ee94a6b2f58c6fd5a243f8784c8b56200b7343
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit 1a1d9e054b9676dfe386241bc62d02c877fcff50)

7 years agocheckStyleViolationSeverity=error implemented for mdsal-dom-broker 28/45828/1
janab [Tue, 23 Aug 2016 21:03:32 +0000 (14:03 -0700)]
checkStyleViolationSeverity=error implemented for mdsal-dom-broker
Resolved the merge conflicts.
Implemented code review comments.
Implemented another set of code review comments.

Change-Id: I3eecb17342e4fd7f4736ca67bc57f01f91115c0f
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
(cherry picked from commit f2910f31928b7f29c7e3593065ba35460052c38f)

7 years agoUse a bounded blocking queue in InmemoryDOMDataTreeShards. 27/45827/1
Tomas Cere [Wed, 31 Aug 2016 12:48:50 +0000 (14:48 +0200)]
Use a bounded blocking queue in InmemoryDOMDataTreeShards.

Change-Id: I72b02d9f77985ec80db87792424403b6960616a2
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit f2ed6a6adc28783703c40facfcf4b5171581fbef)

7 years agocheckStyleViolationSeverity=error implemented for mdsal-dom-inmemory-datastore 26/45826/1
janab [Fri, 26 Aug 2016 20:18:06 +0000 (13:18 -0700)]
checkStyleViolationSeverity=error implemented for mdsal-dom-inmemory-datastore
Changed the local variable indVal to index.
An unwanted folder was added accidentally, removed.
Code review comments are implemented.

Change-Id: Ie1736dbec9e00a49961a46c32f4433f60c211dc0
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
(cherry picked from commit 099ae98f4694007d7edf76c695a901766521f45f)

7 years agoBumping versions by 0.0.1 for next dev cycle 76/45676/1
Anil Belur [Thu, 15 Sep 2016 23:07:32 +0000 (09:07 +1000)]
Bumping versions by 0.0.1 for next dev cycle

Change-Id: I38fe7c903e5ad5aadcabdebdf0c4fbdde89e7583
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
7 years agoBug 6540 - HotFix for IsolatedLeader message handler 57/45257/2
Vaclav Demcak [Thu, 25 Aug 2016 14:20:48 +0000 (16:20 +0200)]
Bug 6540 - HotFix for IsolatedLeader message handler

Change-Id: Icc495dbbbc5583ed68f162ace0e7f2ab12c498c3
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
7 years agoBug 1411-4: MDSAL Binding2 Generator Impl 89/45089/1
Martin Ciglan [Thu, 16 Jun 2016 12:27:11 +0000 (14:27 +0200)]
Bug 1411-4: MDSAL Binding2 Generator Impl

- BindingGeneratorImpl decomposition proposal
- introduction for Twirl templates for Yang Snippets generation
- rather more templates, less logic, more content
- JUnit test - to be finished
- added several twirl templates for YANG
- review comments fixed
- apply https://git.opendaylight.org/gerrit/#/c/44939/ for spec v2

Change-Id: I79cb7e9c0d41c23408949dd5d4d40d572cc86652
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
Signed-off-by: Filip Gregor <fgregor@cisco.com>
(cherry picked from commit a5e2366bfdf89f9b859b0a7ecfe4bdf4b4cc423e)

7 years agoBug 1411-3: MDSAL Binding2 Generator Util 90/44890/1
Martin Ciglan [Fri, 10 Jun 2016 07:39:15 +0000 (09:39 +0200)]
Bug 1411-3: MDSAL Binding2 Generator Util

- general util classes & methods
- generated type & builder classes
- Types & BindingTypes
- Annotations, Enumeration
- Method signature support
- Deviation/AnnotationType issue fixed
- Objects.hash() used in hashCode() methods
- review comments fixed

FIXME/TODO:
Binding2GeneratorUtil - implement rest of static methods, colon-dash issue
Binding2Mapping - implement rest of static methods, underscore issue

Change-Id: I9f602a893f6cbd2e9e30c6ca6dc3810e0c678d89
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit b798df97a01fdd0ac78d1d57a24ebadc7b38bed3)

7 years agoExecute the ShardedDOMDataTreeTransaction.submit() async. 42/44542/4
Tomas Cere [Tue, 23 Aug 2016 08:38:55 +0000 (10:38 +0200)]
Execute the ShardedDOMDataTreeTransaction.submit() async.

Change-Id: I7e8a59f03a6ed2f3e37d0aa31a2fc12b983644a8
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoMake ShardCoordinationTasks public 45/44645/2
Tomas Cere [Wed, 10 Aug 2016 08:57:29 +0000 (10:57 +0200)]
Make ShardCoordinationTasks public

These will be reused in controller so make them public.

Change-Id: I89fb776768d8e975fd744fd1daefc2d0bb3eaa3f
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit 6a8c4d89d24cb6a819949b3782965f2cde1d20fe)

7 years agoBug 6413: Fix ipv4 and ipv6 patterns used by IpAddressNoZoneBuilder 90/44590/1
Filip Gregor [Tue, 16 Aug 2016 08:23:57 +0000 (10:23 +0200)]
Bug 6413: Fix ipv4 and ipv6 patterns used by IpAddressNoZoneBuilder

due to vague regex definition there was no way to distinguish
if shorter ip address was ipv6 or ipv4 resulting in exception
added tests

Change-Id: Id81e26f018e718675fd58469204c7ad1b647a7b1
Signed-off-by: Filip Gregor <fgregor@cisco.com>
(cherry picked from commit 25b6f8582bce7502cbfe70bbe04860d5d75ff8f8)

7 years agoBUG-1411: MDSAL Binding2 Spec - comments/feedback fixed 66/44266/2
Martin Ciglan [Mon, 15 Aug 2016 13:19:42 +0000 (15:19 +0200)]
BUG-1411: MDSAL Binding2 Spec - comments/feedback fixed

- based on review by Martin Sunal

Change-Id: I7da6e1c35ffed18fe62c7d4092b1eb8557913762
Signed-off-by: Martin Sunal <msunal@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit a303d7a4a894d7ae9c14e0e8924388de57f08c95)

7 years agoBug 1411: MDSAL Binding2 Generator API fix 65/44265/2
Martin Ciglan [Thu, 18 Aug 2016 11:39:16 +0000 (13:39 +0200)]
Bug 1411: MDSAL Binding2 Generator API fix

Since we narrowed down schemaPath in DocumentedNode
to List, this needs to be reflected also in
GeneratedTypeBuilderBase class.

Change-Id: Id9edb2fef730bab24415878c85ccc74c4b8a1e9d
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit 017c75d8779d33096b9c9a9826d3be17dad462e3)

7 years agoBug 6252 64/44264/1
Martin Ciglan [Fri, 5 Aug 2016 09:18:01 +0000 (11:18 +0200)]
Bug 6252

Add target/generated-sources/spi & yang/ as resource folders
Follow-up patch for Binding v2

Change-Id: I52822ca5ed5d468f8d62238133a212c9773ddffb
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit 0f7a8627428f10e94d3d1ff730baea85f0f46413)

7 years agoBug 1411: MDSAL Binding2 Generator API Enumeration fix 63/44163/2
Martin Ciglan [Wed, 17 Aug 2016 13:37:10 +0000 (15:37 +0200)]
Bug 1411: MDSAL Binding2 Generator API Enumeration fix

- support for missing optional sub-statements of Enum statement added
- minor related Javadoc fixes

Change-Id: I45130065c183c4e0b6094fdb0a9d18fc9709caa7
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit 0730aaec52eb3aa6bb59fd0ac78636bd5094955f)

7 years agoFix NPE when creating a producer after shard was unregistered 62/44162/1
Tomas Cere [Wed, 17 Aug 2016 11:24:54 +0000 (13:24 +0200)]
Fix NPE when creating a producer after shard was unregistered

Change-Id: I9f6728f4c885cc18d8adf8dc9d1c14e8c99977ef
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit f065e5c7ac0ff2bf0227b06c1ebcdf29d30414e0)

7 years agoBUG-1411 MDSAL Binding2 Generator API Enumeration fix 97/43997/1
Martin Ciglan [Fri, 12 Aug 2016 14:03:25 +0000 (16:03 +0200)]
BUG-1411 MDSAL Binding2 Generator API Enumeration fix

- missing getMappedName() method in Enumeration API

Change-Id: Ibcd79173745b14464614b494880d20b434070584
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit 92f913b4049a93520db9510b8652848791f8ec08)

7 years agoBUG-1411: MDSAL Binding2 Generator API small fix 81/43781/2
Martin Ciglan [Fri, 12 Aug 2016 09:46:20 +0000 (11:46 +0200)]
BUG-1411: MDSAL Binding2 Generator API small fix

- Enumeration import fix
- reflecting Yangtools API change - EnumPair.getValue() returns int now

Change-Id: I7148801e5b184e64294344f158483ca96cc58f56
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit cf079c86e7924776fb170adab48f2f67f993b6c5)

7 years agoFix AbstractDOMShardTreeChangePublisher's initial data change event 92/43692/2
Jakub Morvay [Mon, 8 Aug 2016 11:25:54 +0000 (13:25 +0200)]
Fix AbstractDOMShardTreeChangePublisher's initial data change event

Strip shard path from listener path, when reading initial data from non
root shard. Also add requirement on DOMStoreTreeChangePublisher
interface to send initial data change event to even when data does not
exist yet.

Change-Id: I90f3aa33764a4812703c37e91378a73270fe19a3
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoBUG-6316: Fix Bit and EnumPair's position/value types 27/43627/1
Martin Ciglan [Mon, 8 Aug 2016 13:47:50 +0000 (15:47 +0200)]
BUG-6316: Fix Bit and EnumPair's position/value types

Follow-up patch for Yangtools API change:
https://git.opendaylight.org/gerrit/#/c/42855/

This solves issue with distibution-check jenkins job, where
EnumPair.getValue() returns Integer instead of correct int type.

Change-Id: I459364d17747e0adf10ec021a0bd9cc3e316726d
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
(cherry picked from commit 36a598c3b773cf67d0897354c2644fcadcd11f8f)

7 years agoUpdate .gitreview for stable/boron 70/43370/1
Thanh Ha [Mon, 8 Aug 2016 21:40:30 +0000 (17:40 -0400)]
Update .gitreview for stable/boron

Change-Id: Ice19ba299590e2b414e082ec011dc64e90b67265
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
7 years agoBUG-865: remove String-based getDataChildByName() 37/43037/3
Martin Ciglan [Wed, 3 Aug 2016 09:41:59 +0000 (11:41 +0200)]
BUG-865: remove String-based getDataChildByName()

This is follow-up patch to reflect Yangtools changes
and needs to be merged after
https://git.opendaylight.org/gerrit/#/c/42898

Note:
based on information from YT devs, relying on string-based
choice node local-name when lookup by QName failed
was useful when dealing with augmented cases.
This is supposed to be fixed now in YT and MDSAL should
rely on lookup by QName only. See patch:
https://git.opendaylight.org/gerrit/#/c/40158/

Change-Id: I1300f3ee01ad678757d564ae76e23ce2c57c76fb
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 6165: Do not omit java.lang prefix in various places 08/41408/5
Vratko Polak [Mon, 1 Aug 2016 15:15:46 +0000 (17:15 +0200)]
Bug 6165: Do not omit java.lang prefix in various places

Yang expression "typedef String" leads to java class String,
creating potential naming conflict with java.lang.String.
Few places places in EnumTemplate are fixed by using «String.importedName».

Also, YangModuleInfoTemplate#getExplicitType
no longer removes java.lang unconditionally.

+ Ifs against void are re-ordered to occur sooner in getExplicitType.

Change-Id: If014aca30875589e361733317dfb47eaa07df031
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoAdd PMD configuration 40/43240/1
Robert Varga [Fri, 5 Aug 2016 15:07:13 +0000 (17:07 +0200)]
Add PMD configuration

PMD does not allow specifying wildcards, hence we have to enrich
its configuration here.

Change-Id: I45b7b8618950ec43f3c03cc9e4ee9d3b714d14ee
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoMake AbstractDOMShardTreeChangePublisher advertise initial data change 86/42886/4
Jakub Morvay [Mon, 1 Aug 2016 06:24:25 +0000 (08:24 +0200)]
Make AbstractDOMShardTreeChangePublisher advertise initial data change

Change-Id: Ia9d5a7fcb8bedcb3494b4acc55c372ca5e812424
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoBUG-6316: emit value unconditionally 58/42858/3
Robert Varga [Sun, 31 Jul 2016 15:21:55 +0000 (17:21 +0200)]
BUG-6316: emit value unconditionally

In the effective model of the world, value is always present.
This is a follow-up fix for the API change introduced in
yangtools.

Change-Id: I3fae5d57fce868e03fd36a7d521f87a83205bcce
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 5699 - Migrate existing code to use new sharding apis 87/42887/5
Jakub Morvay [Mon, 1 Aug 2016 07:36:39 +0000 (09:36 +0200)]
Bug 5699 - Migrate existing code to use new sharding apis

This adds adapters that translates DOMDataBroker API calls to cursor aware
API calls

Change-Id: Iab0a94af598f355768f6ef48ac8cb358960418b1
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoBug 6126: Use importedName for java.lang types in ClassTemplate 40/41040/4
Vratko Polak [Mon, 1 Aug 2016 14:31:34 +0000 (16:31 +0200)]
Bug 6126: Use importedName for java.lang types in ClassTemplate

There may be a type definition in Yang, which generates class name
which are the same as a class name in java.lang.

This patch fixes the conflict at defaultInstance(),
there may be other places which need fixing.

Change-Id: I3a73b5bb284db031dbfd45468cbbb8dd2a354737
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Signed-off-by: Filip Gregor <fgregor@cisco.com>
7 years agoFix a javadoc warning about empty paragraph 57/42857/2
Robert Varga [Sun, 31 Jul 2016 15:14:32 +0000 (17:14 +0200)]
Fix a javadoc warning about empty paragraph

Change-Id: I13eb715e2e24c51bd7df8354cc0b5338aa76763c
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-6238: Remove char[]-based union instantiation path 76/42076/7
Robert Varga [Tue, 19 Jul 2016 18:02:39 +0000 (20:02 +0200)]
BUG-6238: Remove char[]-based union instantiation path

Since we are iterating over the constituent types,
there is no need to fall back to string-based instantiation.

Change-Id: Ief17f444816d78d4266e82be3e359a5918213e6d
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 5947: additional tests for binding-dom-adapter 51/42651/4
Peter Nosal [Tue, 26 Jul 2016 11:32:04 +0000 (13:32 +0200)]
Bug 5947: additional tests for binding-dom-adapter

Change-Id: Iae78d6b0ba6c5e163fac964db0099235801e6cee
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoBug 5947: added some tests for osgi in dom-broker 56/42556/13
Peter Nosal [Tue, 26 Jul 2016 11:32:04 +0000 (13:32 +0200)]
Bug 5947: added some tests for osgi in dom-broker

Change-Id: I3d404e70bd34daa47a86f072420c5d06c7674425
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoBug 5947: refactored common-api tests 75/42475/7
Peter Nosal [Mon, 25 Jul 2016 12:50:16 +0000 (14:50 +0200)]
Bug 5947: refactored common-api tests

Change-Id: I3b138c524094fcd6c63c46493c8af42c5d0c0d5a
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoInMemoryDOMStoreThreePhaseCommitCohort: wrong trace parameter 72/42672/2
Isaku Yamahata [Thu, 28 Jul 2016 06:08:06 +0000 (23:08 -0700)]
InMemoryDOMStoreThreePhaseCommitCohort: wrong trace parameter

One parameter for trace is missing.
Looks like copy-n-paste bug

Change-Id: I4ca4cd8c790dfaefa7ad8b7f8e2f4f71ae85242d
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
7 years agoBug 5947: added tests for mdsal-binding-api 06/42606/2
Peter Nosal [Wed, 27 Jul 2016 07:39:42 +0000 (09:39 +0200)]
Bug 5947: added tests for mdsal-binding-api

Change-Id: Id6f0434eac4982ae91136fe5e2a04d40443df9a0
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoBug 5947: additional test for binding-dom-adapter 65/42765/2
Peter Nosal [Fri, 29 Jul 2016 07:49:16 +0000 (09:49 +0200)]
Bug 5947: additional test for binding-dom-adapter

Change-Id: I4cd34de1e706eb46f2f1ddef4a89a7cc560d20d3
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoUse EnumTypeBuilder 78/42778/1
Robert Varga [Fri, 29 Jul 2016 12:00:32 +0000 (14:00 +0200)]
Use EnumTypeBuilder

EnumPairImpl is going away, just as all public model.util
implementation classes. Use EnumPairBuilder instead.

Change-Id: Ife86e3ddf432bbd8552d95a282589b1a52645320
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6184: Workaround for namespaces with URL with trailing slash 69/41669/3
Vratko Polak [Mon, 11 Jul 2016 16:47:46 +0000 (18:47 +0200)]
Bug 6184: Workaround for namespaces with URL with trailing slash

Change-Id: I76712209a8d42825d9e8f6d8042877cec486c53f
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
7 years agoBug 2332: BindingMapping to camel split also on forward slash 80/41280/3
Vratko Polak [Mon, 4 Jul 2016 13:33:22 +0000 (15:33 +0200)]
Bug 2332: BindingMapping to camel split also on forward slash

This is only a partial workaround, full fix for Bug 2332 needs binding v2.

Forward slash is a first character (not allowed in general yang identifiers)
that was encountered in enums from real world Yang models.

Possibly, other separators could get the same treatment,
acting the same way as dash and dot already do.

Change-Id: Ic62198a843747092113c1c7dffaff13d09e7f943
Signed-off-by: Vratko Polak <vrpolak@cisco.com>