mdsal.git
7 years agoReplace mockito-all by mockito-core (see Bug 7662) 69/50869/1
Michael Vorburger [Mon, 23 Jan 2017 18:58:43 +0000 (19:58 +0100)]
Replace mockito-all by mockito-core (see Bug 7662)

Change-Id: I897ca24b64ef078cabfde442620fd41fe7a804da
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBUG-7611: Add a simple DOMEntityOwnershipService 49/50749/6
Robert Varga [Fri, 20 Jan 2017 22:57:50 +0000 (23:57 +0100)]
BUG-7611: Add a simple DOMEntityOwnershipService

This adds a very simplistic DOMEntityOwnershipService,
which assumes it is the only thing in town. Local node always
owns the entities registered.

Listeners are dispatched synchronously as registrations occur.

Change-Id: Ia0a4dbcc159d80b4efd2463722867eaf6a791780
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoDo not open-code routed RPC identification 13/50713/1
Robert Varga [Fri, 20 Jan 2017 12:22:23 +0000 (13:22 +0100)]
Do not open-code routed RPC identification

The code to identify routed RPCs is available via RpcRoutingStrategy,
so remove code duplication.

Change-Id: If072a9aa6d3c54d1de7fb842398e6e3b10725013
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 1459-3 #6 - Re-organize mdsal-binding2-util 71/50671/3
Martin Ciglan [Thu, 19 Jan 2017 14:06:25 +0000 (15:06 +0100)]
Bug 1459-3 #6 - Re-organize mdsal-binding2-util

- refactor package name in mdsal-binding2-util module
- with changes at places of use

Change-Id: I797993fe6678c2ae99765d2b5f15c1513b649698
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1459-3 #5 - Re-organize mdsal-binding2-java-api-generator 65/50665/4
Martin Ciglan [Thu, 19 Jan 2017 12:43:01 +0000 (13:43 +0100)]
Bug 1459-3 #5 - Re-organize mdsal-binding2-java-api-generator

- refactor package name in mdsal-binding2-java-api-generator module
- with changes at places of use

Change-Id: Ibe3a2b1fe7cad4272087d9a6301f37419bbf38fe
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1459-3 #4 - Re-organize mdsal-binding2-generator-util 62/50662/3
Martin Ciglan [Thu, 19 Jan 2017 12:08:21 +0000 (13:08 +0100)]
Bug 1459-3 #4 - Re-organize mdsal-binding2-generator-util

- refactor package name in mdsal-binding2-generator-util module
- with changes at places of use

Change-Id: I398be506b178d5e4fd38bebf25d65d601ed63514
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1459-3 #3 - Re-organize mdsal-binding2-generator-impl 59/50659/3
Martin Ciglan [Thu, 19 Jan 2017 11:38:28 +0000 (12:38 +0100)]
Bug 1459-3 #3 - Re-organize mdsal-binding2-generator-impl

- refactor package name in mdsal-binding2-generator-impl module
- with changes at places of use

Change-Id: I5fe7d393c1ab93b0f64b9a831985613f9698239f
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1459-3 #2 - Re-organize mdsal-binding2-generator-api 55/50655/2
Martin Ciglan [Thu, 19 Jan 2017 09:59:54 +0000 (10:59 +0100)]
Bug 1459-3 #2 - Re-organize mdsal-binding2-generator-api

- refactor package name in mdsal-binding2-generator-api module
- with changes at places of use

Change-Id: I5df404eb91fad8291811cf6324b3aea361b338a1
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1459-3 #1 - Re-organize mdsal-binding2-spec 53/50653/2
Martin Ciglan [Thu, 19 Jan 2017 09:25:05 +0000 (10:25 +0100)]
Bug 1459-3 #1 - Re-organize mdsal-binding2-spec

- refactor package name in mdsal-binding2-spec module
- with changes at places of use

Change-Id: Iffb8c1d9a8d8f5dd7ae758efe3ed661d5e32982d
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1459-2 - Re-organize mdsal-binding2-spec 51/50551/3
Martin Ciglan [Tue, 17 Jan 2017 14:44:25 +0000 (15:44 +0100)]
Bug 1459-2 - Re-organize mdsal-binding2-spec

- new 'base' & 'structural' packages added
- various replacements done based on bug description
- some Javadocs added

Change-Id: I9d2266845d77a9902a1c937e21884a409585a630
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1459-1 - Re-organize mdsal-binding2-spec 42/50542/4
Martin Ciglan [Tue, 17 Jan 2017 12:11:00 +0000 (13:11 +0100)]
Bug 1459-1 - Re-organize mdsal-binding2-spec

- new artifact mdsal-binding2-util (starts with Binding2Mapping)
- new 'runtime' package for run-time support: serializer, etc..
- various replacements done based on previous changes and review comments

Change-Id: I4525d2c3f706ce1e77051711c57a3ca55ecc8350
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoSet Binding RPCs cost to 1 69/50569/2
Robert Varga [Tue, 17 Jan 2017 17:57:55 +0000 (18:57 +0100)]
Set Binding RPCs cost to 1

Default DOMRpcImplementation returns cost 0. Since invoking
a binding RPC involves some codec work, we want the binding
implementation to take a back seat of there is a native
RPC implementation (for example implemented in pure DOM terms).

Change-Id: I10e3bc6133980c6fc9750f02e94450655b67020f
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-3128: Update DOM RPC concepts 62/50562/1
Robert Varga [Tue, 17 Jan 2017 15:44:34 +0000 (16:44 +0100)]
BUG-3128: Update DOM RPC concepts

This is the API part of https://git.opendaylight.org/gerrit/50487,
ported back to MD-SAL.

It allows a DOMRpcAvailabilityListener to request filtering of
notifications based on the RPC implementation class.

The other part of it is the ability for DOMRpcImplementation
to advertise its invocation cost -- allowing the RPC router
to make better routing decisions

Change-Id: Icdd36aeea0780bfae5883abd786244a9291b106f
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 1411-5 #10: MDSAL Binding2 Java API Generator 00/46900/9
Martin Ciglan [Thu, 12 Jan 2017 09:13:56 +0000 (10:13 +0100)]
Bug 1411-5 #10: MDSAL Binding2 Java API Generator

- yangModelBindingProvider interface + templates
- bit of a code clean-up

Change-Id: If58ef3945b98dc2671482ec8b4489f394a82329f
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1411-5 #9: MDSAL Binding2 Java API Generator 99/46899/18
Martin Ciglan [Thu, 8 Dec 2016 09:43:24 +0000 (10:43 +0100)]
Bug 1411-5 #9: MDSAL Binding2 Java API Generator

- interface generator, renderer, template TOgenerator
for generating union, union builder and class
- bit of cleanup
- review comments implemented

Change-Id: Iedbf069e629c6fb92b93046348c6a15fa3e77fd9
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years ago1411-5 #8 MDSAL Binding2 API Generator 83/50283/2
Martin Ciglan [Wed, 11 Jan 2017 12:04:16 +0000 (13:04 +0100)]
1411-5 #8 MDSAL Binding2 API Generator

- code refactored according to review comments in
https://git.opendaylight.org/gerrit/#/c/46898/15

- Binding specification v2 fix for
https://bugs.opendaylight.org/show_bug.cgi?id=7425

Change-Id: Ieddc32ede050fea9b1320454f477f4bc3ec451ec
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1411-5 #8: MDSAL Binding2 Java API Generator 98/46898/20
Martin Ciglan [Thu, 8 Dec 2016 09:02:11 +0000 (10:02 +0100)]
Bug 1411-5 #8: MDSAL Binding2 Java API Generator

- union and union builder renderers and templates
- bit of a cleanup

Change-Id: I413bf4f284d5f3151436f5a96e31e4c7ada0c021
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1411-5 #7: MDSAL Binding2 Java API Generator 97/46897/22
Martin Ciglan [Wed, 23 Nov 2016 10:46:36 +0000 (11:46 +0100)]
Bug 1411-5 #7: MDSAL Binding2 Java API Generator

- class renderer, templates this is parent for more renderers
- minor do comment fix
- reworked method call
- bit of a cleanup, review comments implemented

Change-Id: I66cbf521b3be36e7278b6026fd02353a337c12b4
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1411-5 #6: MDSAL Binding2 Java API Generator 94/46894/22
Martin Ciglan [Wed, 23 Nov 2016 09:57:54 +0000 (10:57 +0100)]
Bug 1411-5 #6: MDSAL Binding2 Java API Generator

- builder generator, renderer and templates
- fixed minor issues
- bit of cleanup, review comments implemented

Change-Id: I7cedfb4fde4e441b7d68b2717fbb4f8ea6d3d77e
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBUG-7446: fix tests' usage of MoreExecutors 74/50174/1
Robert Varga [Tue, 10 Jan 2017 12:13:38 +0000 (13:13 +0100)]
BUG-7446: fix tests' usage of MoreExecutors

MoreExecutors.sameThreadExecutor() is deprecated, use its
appropriate replacement instead.

Change-Id: I487285b156d3fbe7b558fecd5cbc13cb66f02a2c
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBump xtendbeans version for AssertBeans to support YANG union types 37/50137/6
Michael Vorburger [Mon, 9 Jan 2017 16:02:45 +0000 (17:02 +0100)]
Bump xtendbeans version for AssertBeans to support YANG union types

Change-Id: If6998d3e5dc766e67ca7bfa5f1954197759bc05f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBug 7425: Recognize instance-identifier in union template 70/50070/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>
7 years agoBUG-7435: eliminate use of yang-parser-impl internals 50/49750/4
Robert Varga [Thu, 22 Dec 2016 18:08:41 +0000 (19:08 +0100)]
BUG-7435: eliminate use of yang-parser-impl internals

Switch to using YangParserTestUtil instead.

Change-Id: I98e0870051e42372adf7d7284b10b368e68516f6
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6859: Cleanup package names for mdsal-binding-generator-util module 47/49647/2
Martin Ciglan [Tue, 20 Dec 2016 13:25:15 +0000 (14:25 +0100)]
Bug 6859: Cleanup package names for mdsal-binding-generator-util module

- correct package names in respect to change:
  https://git.opendaylight.org/gerrit/#/c/46780
  to get back sonar code coverage number
- bit of a code clean-up

Change-Id: I766745343eb6d174438834e9087c14168d68cea8
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoImprove binding type instantiation 40/49440/4
Robert Varga [Thu, 15 Dec 2016 15:53:48 +0000 (16:53 +0100)]
Improve binding type instantiation

This patch causes binding generator to emit valueOf()
constructors instead of explicit 'new' for well-known
types, allowing better reuse of instances.

Change-Id: I66f7cbc0b8362d82759d2276c81aed1fd5296101
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-4219: clean up features.xml 31/49431/4
Stephen Kitt [Thu, 15 Dec 2016 13:40:45 +0000 (14:40 +0100)]
BUG-4219: clean up features.xml

In models' features.xml, odl-mdsal-binding-base includes yang-ext so
it's not strictly necessary in odl-mdsal-models. (This is potentially
controversial of course since it should perhaps be construed as a
declared part of the odl-mdsal-models API.)

In mdsal's features.xml:
* use odl-lmax-3 instead of odl-lmax;
* drop mdsal-dom-{api,spi} from odl-mdsal-dom-broker (they're part of
  odl-mdsal-dom-api);
* odl-mdsal-binding-api needs odl-yangtools-yang-parser, and
  mdsal-binding-util;
* odl-mdsal-singleton-dom needs odl-mdsal-common.

Change-Id: I4f18d697065f4e9df2b0e621fd32d4b18b8068fd
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoBUG-4219: remove slf4j-api dependencies 30/49430/2
Stephen Kitt [Thu, 15 Dec 2016 13:38:10 +0000 (14:38 +0100)]
BUG-4219: remove slf4j-api dependencies

These are provided by odlparent and cause issues when generating
features (in preparation for the Karaf 4 migration).

Change-Id: I24c392017ae4353264b721d4ea01f5769172fc4c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoBUG-2138: Add shard DTO classes to spi 39/49239/6
Tomas Cere [Mon, 12 Dec 2016 12:11:46 +0000 (13:11 +0100)]
BUG-2138: Add shard DTO classes to spi

This patch moves common classes useful for DOMDataTreeShard
implementations public in the spi package, allowing them to be reused
rather than re-implemented.

Change-Id: I4885fd862291642c702a1bf561a920bf8459016c
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoMake variadic enter() a default method 23/49423/2
Robert Varga [Thu, 15 Dec 2016 11:21:12 +0000 (12:21 +0100)]
Make variadic enter() a default method

Implementations do not need to implement this themselves,
as it can be implemented efficiently by wrapping the argument
in Arrays.asList().

Change-Id: I07d282dbd23555642d52bc3d6a81158526c3a03e
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 1411-5 #5: MDSAL Binding2 Java API Generator 92/46892/18
Martin Ciglan [Tue, 22 Nov 2016 10:14:53 +0000 (11:14 +0100)]
Bug 1411-5 #5: MDSAL Binding2 Java API Generator

- generator to java file
- enum generator, renderer and template
- bit of cleanup

Change-Id: I79f96631e765c2d7a9b4d96c7e19c1a288bb7139
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 1411-5 #4: MDSAL Binding2 Java API Generator 90/46890/14
Martin Ciglan [Tue, 22 Nov 2016 08:02:05 +0000 (09:02 +0100)]
Bug 1411-5 #4: MDSAL Binding2 Java API Generator

- top parent class for all renderers
- bit of cleanup, review comments implemented

Change-Id: If84b1e4505f7e16e462ae51dfe4ac4f3c6dbcc26
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 7159: Add yang-test-util artifact 32/49232/4
Martin Ciglan [Mon, 12 Dec 2016 10:20:55 +0000 (11:20 +0100)]
Bug 7159: Add yang-test-util artifact

- follow-up patch for MD-SAL
- bit of a code cleanup

Please see Yangtools introduction here:
https://git.opendaylight.org/gerrit/#/c/49129/

Change-Id: I91b2cb2e07245ce1f558ecf62a9a81a1d1ed2ebc
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBug 7271: Modify AbstractDOMStoreTreeChangePublisher to batch candidates 46/48846/5
Tom Pantelis [Wed, 30 Nov 2016 21:42:34 +0000 (16:42 -0500)]
Bug 7271: Modify AbstractDOMStoreTreeChangePublisher to batch candidates

The AbstractDOMStoreTreeChangePublisher was modified to keep track of
DataTreeCandidates per listener via a Map in order to notify listeners
of all DataTreeCandidate changes in one event. This allows the
initial event on registration to send all list entry nodes. The
previous notifyListeners abstract method was removed in lieu of a
new notifyListener that takes a listener registration and the list
of DataTreeCandidates

Change-Id: I02f14f202a46bbf9afe8de1941701849a41a431c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBug 6163: fixed number of argument when resolving rpc input 69/47069/19
Martin Ciglan [Thu, 10 Nov 2016 10:36:26 +0000 (11:36 +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: Peter Nosal <peter.nosal@pantheon.tech>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoCheckstyle compliant src/main|test/resources 11/48711/1
Michael Vorburger [Fri, 25 Nov 2016 18:20:55 +0000 (19:20 +0100)]
Checkstyle compliant src/main|test/resources

Change-Id: I68823f3538bbd0fe932e6469abecbdaed8ef9702
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBug 6135: Java binding v1: IAE from provideTypeForLeafref 80/48480/6
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>
7 years agoJavassistUtils cleanup 59/48559/1
Martin Ciglan [Tue, 22 Nov 2016 09:18:02 +0000 (10:18 +0100)]
JavassistUtils cleanup

Change-Id: I481caf9954aec0ae2051d1722c0375cd1dcbe5d8
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoRemoved sonar warnings. 34/48034/9
Dana Kutenicsova [Thu, 13 Oct 2016 16:34:52 +0000 (18:34 +0200)]
Removed sonar warnings.

Change-Id: I2dbe2018cc1d2672f98fd3aea9e01c7d851eacc8
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoRemoved sonar warnings. 33/48033/9
Dana Kutenicsova [Thu, 13 Oct 2016 09:37:08 +0000 (11:37 +0200)]
Removed sonar warnings.

Change-Id: I30d1be315d148a3a19809f4b33bfe40cec676e84
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoRemoved sonar warnings. 32/48032/9
Dana Kutenicsova [Thu, 13 Oct 2016 09:36:52 +0000 (11:36 +0200)]
Removed sonar warnings.

Change-Id: I44f590d2bb3c814898cb00b9441c16f774100974
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoRemoved sonar warnings. 31/48031/7
Dana Kutenicsova [Wed, 12 Oct 2016 18:59:16 +0000 (20:59 +0200)]
Removed sonar warnings.

Change-Id: Iad015c6deab0f6fb432c36265ada159afac57b13
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoFixup compilation after YT move 12/48512/1
Robert Varga [Sun, 20 Nov 2016 20:22:14 +0000 (21:22 +0100)]
Fixup compilation after YT move

The move in YANG Tools has caused inherited type problems.
YANG Binding should not be doing this, really.

Change-Id: I518ab258f26d2db38349087736d37a76352642be
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 1411-5 #3: MDSAL Binding2 Java API Generator 89/46889/11
Martin Ciglan [Fri, 4 Nov 2016 15:04:37 +0000 (16:04 +0100)]
Bug 1411-5 #3: MDSAL Binding2 Java API Generator

- Range generators
- dedicated folder

Change-Id: I53d448049bdd0a0fcdc7e113b7c209699321fab9
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoBUG-5222: use dependency=true between features 78/47778/2
Robert Varga [Mon, 31 Oct 2016 13:06:01 +0000 (14:06 +0100)]
BUG-5222: use dependency=true between features

This patch marks feature dependencies as such, so karaf
knows not to reinstall them if they are already installed.

Change-Id: I979d85ec9dcf890a246ace63720f5ec194104cc3
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 1411-5 #2: MDSAL Binding2 Java API Generator 88/46888/10
Martin Ciglan [Fri, 4 Nov 2016 10:53:29 +0000 (11:53 +0100)]
Bug 1411-5 #2: MDSAL Binding2 Java API Generator

-new utility class for various string processings
-added comparator
-Javadocs added for all public methods

Change-Id: I26747a53544dd6deafcef21a4e8330790ed4165f
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
7 years agoRemoved sonar warnings from binding-dom-adapter. 18/46818/4
Dana Kutenicsova [Wed, 12 Oct 2016 09:00:00 +0000 (11:00 +0200)]
Removed sonar warnings from binding-dom-adapter.

Change-Id: I25fce8206a8219e9bb5479b2df07d9bb70388d89
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoBUG-3128: Extract abstract shard implementations. 21/46821/10
Tomas Cere [Mon, 3 Oct 2016 12:19:54 +0000 (14:19 +0200)]
BUG-3128: Extract abstract shard implementations.

Extract abstract shard implementations that can be reused
in other shard implementations.
While we're here fix a bug with shard modification creation
when there were multiple levels between parent and child shards.

Change-Id: I1a24cb32363d8d56ef8e5817c474e35c41af49e5
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6236: Introduce "mdsal.skip.verbose" property, for build speed 36/47036/7
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>
7 years agoBug 7064: yang-to-source error on description 55/48055/2
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 agoAssertDataObjects with LOG of diff 09/48009/3
Michael Vorburger [Fri, 4 Nov 2016 18:03:23 +0000 (19:03 +0100)]
AssertDataObjects with LOG of diff

When running failing tests in CI on build (or simply local mvn CLI),
then the ComparisonFailure for large expected/actual objects, such as
flows, is very difficult to make sense of.

In the IDE one doesn't have this problem, because the JUnit view of IDEs
will interpret an ComparisonFailure and show a very clear side-by-side
comparison of expected VS actual.

This change introduces a LOG, in case of AssertDataObjects failure,
which prints a diff for the ComparisonFailure, which will make analysing
AssertDataObjects based test failures much easier on CI build.

Change-Id: I666fbceeb794f7b810a11c2efa8e33a51afc1b2d
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBug 6859: Cleanup package names for mdsal-binding-generator-util module 80/46780/6
Rashmi Pujar [Tue, 11 Oct 2016 16:42:48 +0000 (12:42 -0400)]
Bug 6859: Cleanup package names for mdsal-binding-generator-util module

The APIs are copied to new package.
Added deprecated annotation to the old api.

Change-Id: I4a9d6dd6ea78e16bdb1b86c9f9235b3db00db836
Signed-off-by: Rashmi Pujar <rpujar@inocybe.com>
7 years agotarget-ide/ support by resourceBaseDir using ${project.build.directory} 12/47812/1
Michael Vorburger [Tue, 1 Nov 2016 20:43:32 +0000 (21:43 +0100)]
target-ide/ support by resourceBaseDir using ${project.build.directory}

without explicitly setting this,
org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
defaults to hard-coded target/generated-sources/spi for
META-INF/services/org.opendaylight.yangtools.yang.binding.YangModelBindingProvider
instead of target-ide.

Minor: Also add target-ide/ to .gitignore of this git repository.

Change-Id: I4155eb666dd6ef028dc2397e32c88cd50db4f0c6
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBug 6859: Cleanup package names for mdsal-binding-generator-api module 03/46503/10
Rashmi Pujar [Fri, 7 Oct 2016 17:15:52 +0000 (13:15 -0400)]
Bug 6859: Cleanup package names for mdsal-binding-generator-api module

Most packages still contain yangtools in the package name in mdsal which seems to be
a by-product of cleaning up of the Java Binding code from YANG Tools to md-sal.

The APIs are copied to new package.
Added deprecated annotation to the old api.
Deleted pkg org.opendaylight.yangtools.sal.binding.model.api.type.provider

Change-Id: Ic120a7ec1f85d8f604aa575047d8bd639630517b
Signed-off-by: Rashmi Pujar <rpujar@inocybe.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoRevert "Bug 6135: Java binding v1: IAE from provideTypeForLeafref" 38/47738/1
Robert Varga [Fri, 28 Oct 2016 13:30:54 +0000 (15:30 +0200)]
Revert "Bug 6135: Java binding v1: IAE from provideTypeForLeafref"

This reverts commit a8795e3746f753c21bd09615bc2b582590b9db54.

Change-Id: I7135954d1f9af9579feebfa85681eb6a3439b3c7
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6135: Java binding v1: IAE from provideTypeForLeafref 85/47485/6
Filip Gregor [Tue, 25 Oct 2016 10:12:36 +0000 (12:12 +0200)]
Bug 6135: Java binding v1: IAE from provideTypeForLeafref

added tests, fixed condition in isInnerType method

Change-Id: I5ed41b5be3daf68d6d0895c07f955fed2c076e7f
Signed-off-by: Filip Gregor <fgregor@cisco.com>
7 years agoBUG-7013: do not rely on default character encoding 61/47661/3
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>
7 years agoReplace target/ by ${project.build.directory}/ to make target-ide/ possible 84/47184/3
Michael Vorburger [Thu, 20 Oct 2016 00:17:33 +0000 (02:17 +0200)]
Replace target/ by ${project.build.directory}/ to make target-ide/ possible

Change-Id: I32c4c0e8207f58b864e21054d12174ad45dc0e7f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBUG-7009: fix invalid model 99/47399/2
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 agoBug 5947: additional tests for mdsal project #12 71/46771/8
Filip Gregor [Tue, 11 Oct 2016 13:49:27 +0000 (15:49 +0200)]
Bug 5947: additional tests for mdsal project #12

Change-Id: Ied67c8b6c479e60ceb4fde54bbc9feeadc7d1be1
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoBug 5947: additional tests for dom-adapter #11 59/46759/6
Filip Gregor [Tue, 11 Oct 2016 11:24:48 +0000 (13:24 +0200)]
Bug 5947: additional tests for dom-adapter #11

Change-Id: I290bd0e503b09aed2e24985a28df946292a4a4d0
Signed-off-by: Filip Gregor <fgregor@cisco.com>
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoNew test utility AssertDataObjects 42/46842/9
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>
7 years agoRemove augmentableToAugmentations maps 39/44939/7
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>
7 years agoClean up apparently dead (and not thread safe) code 31/47031/2
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>
7 years agoBug 5947: additional tests for mdsal project #10 62/46662/6
Peter Nosal [Fri, 7 Oct 2016 10:04:55 +0000 (12:04 +0200)]
Bug 5947: additional tests for mdsal project #10

- added additional tests
- refactored some util classes
- properly fixed some issues and checkstyle validations

Change-Id: Ibd483985bfc5bed23d61c7c81695398abdd427ae
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoBug 1411-5 #1: MDSAL Binding2 Generator Util 86/46886/4
Filip Gregor [Thu, 13 Oct 2016 13:24:40 +0000 (15:24 +0200)]
Bug 1411-5 #1: MDSAL Binding2 Generator Util

new constant definitions
change of variable initialization order
fixed equals method

Change-Id: I41f7cacc2e7e21f0ac69b7e8a0b682addc83b5b9
Signed-off-by: Filip Gregor <fgregor@cisco.com>
7 years agoBug 5947: additional tests for binding-dom-codec #9 45/46345/5
Peter Nosal [Mon, 3 Oct 2016 09:22:44 +0000 (11:22 +0200)]
Bug 5947: additional tests for binding-dom-codec #9

Change-Id: Ib9a3bdf105d673be7c2d52be5c9f9cfcd63409fb
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoBug 5947: additional tests for dom-adapter #7 85/46285/5
Peter Nosal [Thu, 29 Sep 2016 08:16:09 +0000 (10:16 +0200)]
Bug 5947: additional tests for dom-adapter #7

Change-Id: Ic970ea7bccda9d4f82901fa93c92508065de35a9
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Signed-off-by: Filip Gregor <fgregor@cisco.com>
7 years agoBug 5947: additional tests for dom-adapter #6 40/46240/6
Peter Nosal [Wed, 28 Sep 2016 06:43:57 +0000 (08:43 +0200)]
Bug 5947: additional tests for dom-adapter #6

Change-Id: If497e570342391c9d8aecf81bcd3cee24438f786
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
Signed-off-by: Filip Gregor <fgregor@cisco.com>
7 years agoBug 6710 - Close ClusterSingletonServiceRegistration fix 75/46175/14
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 agoFixed some problems with GeneratorUtil 39/46539/4
Peter Nosal [Wed, 5 Oct 2016 10:12:36 +0000 (12:12 +0200)]
Fixed some problems with GeneratorUtil

Change-Id: If496bb149f755d17610c93c0e828123dc9bbde9d
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoFix groupId to reflect org.opendaylight.mdsal 59/46559/3
Alexis de Talhouët [Wed, 5 Oct 2016 16:05:26 +0000 (12:05 -0400)]
Fix groupId to reflect org.opendaylight.mdsal

The merge job is currently broken because of that. It is failing to
deploy binding-aggregator because it doesn't have the correct groupId.
See https://jenkins.opendaylight.org/releng/job/mdsal-merge-carbon/23/console
for more details.

This issue was introduced with the clean up of the pom file that occured
here https://git.opendaylight.org/gerrit/#/c/45912/

Change-Id: Ia3cae6215547702467d42d604641ec46667bc488
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoRemove unused yang file - opendaylight-inmemory-datastore-provider.yang 31/44631/6
Alexis de Talhouët [Wed, 24 Aug 2016 20:52:43 +0000 (16:52 -0400)]
Remove unused yang file - opendaylight-inmemory-datastore-provider.yang

This is probably something than came in when project were splitted up.

Change-Id: Ib05b1cad54bef6885a83966ec1d2b28dc88ab266
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoFix checkstyle in mdsal-binding-dom-adapter 99/45399/14
janab [Fri, 9 Sep 2016 03:05:14 +0000 (20:05 -0700)]
Fix checkstyle in mdsal-binding-dom-adapter

checkstyleViolationSeverity=error added
Fixed all CS errors. Code review comments are implemented.
Fixed the merge conflicts.

Change-Id: I8c2af744474a5ae6d28fb62b11ed0da65251825a
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
7 years agoBug 5947: additional tests for dom-adapter #8 90/46290/2
Peter Nosal [Thu, 29 Sep 2016 10:43:15 +0000 (12:43 +0200)]
Bug 5947: additional tests for dom-adapter #8

Change-Id: I92113a82940b8e61a57638aba2ca71cf822de023
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoCleanup pom.xml layout 12/45912/12
Robert Varga [Tue, 20 Sep 2016 17:04:40 +0000 (19:04 +0200)]
Cleanup pom.xml layout

This performs the long-overdue cleanup of build structure,
aligning it with ODL best pracitices and removing quite
a bit of crud in the process.

Change-Id: I04ac6a917928c1da286b8c4ec4e1c7cb66e9990b
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoDo not instantiate iterator for debugging 31/46131/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 agoConvert to using BatchedInvoker 42/46142/2
Robert Varga [Fri, 23 Sep 2016 16:35:03 +0000 (18:35 +0200)]
Convert to using BatchedInvoker

Single-step invoker has been deprecated and this prevents
useless re-encapsulation.

Change-Id: I3f7dbe2b4ca4af37df9ab017eeddd9ff16803b61
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix javadoc warnings 41/46141/2
Robert Varga [Fri, 23 Sep 2016 16:33:59 +0000 (18:33 +0200)]
Fix javadoc warnings

The description for arguments was present twice, remove
the duplication.

Change-Id: I5cd19ff66184e0ec9a6d507e65db3e3d231362ff
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agocheckStyleViolationSeverity=error implemented for mdsal-binding-api module 21/45321/4
janab [Wed, 7 Sep 2016 17:39:51 +0000 (10:39 -0700)]
checkStyleViolationSeverity=error implemented for mdsal-binding-api module
Code review comments are implemented.

Change-Id: I925d71befa5806db4e7522c8009f5b125564adfe
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
7 years agocheckStyleViolationSeverity=error implemented for mdsal-singleton-common-api and... 76/45276/5
janab [Tue, 6 Sep 2016 22:05:55 +0000 (15:05 -0700)]
checkStyleViolationSeverity=error implemented for mdsal-singleton-common-api and mdsal-singleton-dom-impl modules
Done implementing code review comments.

Change-Id: I09443eeb61b09844d1e6960e7ff480dcaaface9f
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
7 years agoConvert to using BatchedListenerInvoker 97/46097/3
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>
7 years agoBug 5947: additional tests for dom-adapter #5 10/45810/6
Peter Nosal [Mon, 19 Sep 2016 12:44:56 +0000 (14:44 +0200)]
Bug 5947: additional tests for dom-adapter #5

Change-Id: I236f1c92852665a0dab1c6d6f14b50ff31c4c600
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoBug 5947: additional tests for dom-broker and inmemory-datastore #4 87/45787/8
Peter Nosal [Mon, 19 Sep 2016 07:47:14 +0000 (09:47 +0200)]
Bug 5947: additional tests for dom-broker and inmemory-datastore #4

Change-Id: I43af7e4dae33e8d7a5fd9c8c4c58afe747f3f7c3
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoBug 5947: additional tests for maven--sal-api-gen-plugin #3 32/45532/2
Peter Nosal [Tue, 13 Sep 2016 11:40:22 +0000 (13:40 +0200)]
Bug 5947: additional tests for maven--sal-api-gen-plugin #3

Change-Id: I84d0d77f7e335f36ddf831ce63ae3095eb329513
Signed-off-by: Peter Nosal <peter.nosal@pantheon.tech>
7 years agoRemove mdsal-binding-util from features because it's only a pom file 29/45929/5
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>
7 years agoMove transaction-invariants into producer 22/45922/7
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>
7 years agoAdd cursor lookup fast-path 07/45907/4
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>
7 years agoFix a raw type warning 06/45906/4
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>
7 years agoPerform delegate cursor enter/exit first 95/45895/4
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>
7 years agoMove lookup check 94/45894/4
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>
7 years agoEliminate ShardedDOMDataTreeWriteTransaction.doSubmit()'s return 86/45886/4
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>
7 years agoFix raw types 85/45885/4
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>
7 years agoMake sure we optimize DOMDataTreeIdentifier 56/45856/7
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>
7 years agoDo not use entrySet() where values() or keySet() suffices 58/45858/5
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>
7 years agoDo not use ExecutorService unnecessarily 57/45857/6
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>
7 years agoUse ImmutableMap instead of Collections.emptyMap() 59/45859/5
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>
7 years agoDo not allow transaction creation with an empty shard map. 08/45908/3
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>
7 years agoSwitch to using StampedLock 46/45446/6
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>
7 years agocheckStyleViolationSeverity=error implemented for mdsal-eos-common-api, mdsal-eos... 57/44957/11
janab [Wed, 31 Aug 2016 20:38:05 +0000 (13:38 -0700)]
checkStyleViolationSeverity=error implemented for mdsal-eos-common-api, mdsal-eos-common-spi, mdsal-eos-dom-api
Code review comments are implemented.
Removed @SupressWarnings{"checkstyle:RedundantModifier"} for removing private modifier for enum constructor
Resolved merge conflicts for EntityOwnershipChangeState and EntityOwnershipChangeStateTest files.
Implement some more code review changes.

Change-Id: I215d564d2a9f647961a9b1915d466a7cfb5b0c00
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
7 years agoRemove public keyword 60/45860/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>