mdsal.git
10 years agoBug 740: Forwardingrules-Manager support for DataChangeListeners
Vaclav Demcak [Tue, 15 Apr 2014 16:26:20 +0000 (18:26 +0200)]
Bug 740: Forwardingrules-Manager support for DataChangeListeners

+ Bug 619 - Eliminate the use of xtend in md-sal/forwardingrules-manager

migration from xtend to java files FRM
add DataChangeListener to FRM (Flow, Meter, Group)
remove FRM handlers (Flow, Meter, Group)
fix delete changes registration (in ImmutableDataChangeEvent -> old DataStore)

Change-Id: I56003833519d9689a489ed5f77b3f7fc4ac2e204
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
10 years agoMerge "Bug 509: Added support for merge operation to InMemoryData Store"
Ed Warnicke [Thu, 24 Apr 2014 11:56:27 +0000 (11:56 +0000)]
Merge "Bug 509: Added support for merge operation to InMemoryData Store"

10 years agoBug 509: Added support for merge operation to InMemoryData Store
Tony Tkacik [Wed, 23 Apr 2014 14:17:31 +0000 (16:17 +0200)]
Bug 509: Added support for merge operation to InMemoryData Store

Merge operation support is critical for backwards compatibility
and for Binding-Aware mapping and Restconf, which are not aware
of Mixin nodes representing lists, leaflists and choices.

Semantics of merge operation are similar to subtree modified,
but when node is not existing it creates one based on
state provided by user of the Data Broker APIs.

Merge operation also fixes concurrent creations of mixin nodes
as demonstrated in ConcurrentImplicitCreateTest,
where two separate applications may indirectly create same
root node.

Change-Id: I9ab290b512601bd99750a68ee53564e67ef0c879
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge changes I67420353,I6851f9b9
Tony Tkacik [Wed, 23 Apr 2014 11:48:59 +0000 (11:48 +0000)]
Merge changes I67420353,I6851f9b9

* changes:
  Bug:701-Have Typed ErrorNotification for different node errors
  Bug:645 - MDSAL Notification pool threads not getting spawned besides the core threads

10 years agoBUG-509, BUG-808: Added datastore support for lists without keys.
Robert Varga [Tue, 22 Apr 2014 12:54:04 +0000 (14:54 +0200)]
BUG-509, BUG-808: Added datastore support for lists without keys.

The datastore needs to support users who do not specify a list key, but
how expect the item ordering to be retained.

Added test which test all three possible behaviours of list
statement: ordered map, unordered map and list without keys.

Change-Id: I9e136267f57a88e4d2a6a4476025c33497373518
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 509: Improve logging in InMemoryDataStore."
Ed Warnicke [Mon, 21 Apr 2014 21:35:07 +0000 (21:35 +0000)]
Merge "Bug 509: Improve logging in InMemoryDataStore."

10 years agoRemoved duplication of the yang-jmx-generator-plugin
Giovanni Meo [Fri, 18 Apr 2014 15:25:11 +0000 (17:25 +0200)]
Removed duplication of the yang-jmx-generator-plugin

- Removed unnecessary duplications or a dependency of
yang-maven-plugin which would cause issues in the release process

Change-Id: I858d96d298d2ce6a3a6be87a0261a7f23c2d70e8
Signed-off-by: Giovanni Meo <gmeo@cisco.com>
10 years agoMerge "BUG-509: use dedicated executor for notifications"
Tony Tkacik [Thu, 17 Apr 2014 17:16:19 +0000 (17:16 +0000)]
Merge "BUG-509: use dedicated executor for notifications"

10 years agoBUG-509: use dedicated executor for notifications
Robert Varga [Thu, 17 Apr 2014 16:48:22 +0000 (18:48 +0200)]
BUG-509: use dedicated executor for notifications

This dedicates a thread to datastore notifications, such that they are
delivered outside of the invoking threads. Also adds proper headers.

Change-Id: I44aeb9c4fefb8784d22ded9ae591d38993905ffa
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoAdding auto-sorting plugin to all Controller via parent/pom.xml
jameshall03885 [Wed, 16 Apr 2014 18:18:57 +0000 (14:18 -0400)]
Adding auto-sorting plugin to all Controller via parent/pom.xml

leveraging google's sortpom plugin, all controller poms are sorted
at build time as per the opendaylight/commons/parent/pom.xml configuration.

Sorted lists of properties, dependencies, and plugins will increase pom readability
and help prevent duplicate entry errors.

This first submission is huge as I changed one pom.xml and all are then sorted.
Only if the sortpom plugin is reconfigured will all pom's again be changed.

Note that if any pom.xml is pushed without having been through a build ... folks are
going to see pom.xml files showup as modified unintentionally.

Change-Id: I8553f38b9f0e5f6d27177ad6b9b9c35a4b43d55a
Signed-off-by: jameshall03885 <ghall@brocade.com>
10 years agoUnify jacoco versions to 0.6.2.201302030002
Maros Marsalek [Mon, 31 Mar 2014 16:30:55 +0000 (18:30 +0200)]
Unify jacoco versions to 0.6.2.201302030002

This cleans up previously unused pluginManagement sections and bumps
jacoco version 0.6.2.201302030002 (previously used by config subsys).

Change-Id: I027b219e7fd0225fe2ef12cbdcc1f7d47509e993
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
10 years agoBug:645 - MDSAL Notification pool threads not getting spawned besides the core threads
Kamal Rameshan [Wed, 2 Apr 2014 00:20:22 +0000 (17:20 -0700)]
Bug:645 - MDSAL Notification pool threads not getting spawned besides the core threads

Change-Id: I6851f9b90b500b2b10a135bcda784a11c8f44786
Signed-off-by: Kamal Rameshan <kramesha@cisco.com>
10 years agoMerge "BUG-731: remove unneeded null check"
Tony Tkacik [Wed, 16 Apr 2014 17:07:44 +0000 (17:07 +0000)]
Merge "BUG-731: remove unneeded null check"

10 years agoMerge "Bug 509: Fixed incorrect merging of Data Store Writes / Events"
Ed Warnicke [Wed, 16 Apr 2014 16:44:35 +0000 (16:44 +0000)]
Merge "Bug 509: Fixed incorrect merging of Data Store Writes / Events"

10 years agoBUG-731: remove unneeded null check
Robert Varga [Wed, 16 Apr 2014 09:20:38 +0000 (11:20 +0200)]
BUG-731: remove unneeded null check

Fixes a sonar warning:
https://sonar.opendaylight.org/issue/show/0b9faac8-cbfc-4aed-8749-80fdd53410d5

Change-Id: Ib44157dde70d9c654f6dcb242e1d44619a685ea6
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 509: Improve logging in InMemoryDataStore.
Tony Tkacik [Wed, 16 Apr 2014 07:14:34 +0000 (09:14 +0200)]
Bug 509: Improve logging in InMemoryDataStore.

Change-Id: Ia83fd9f68fde9cf082f5571f42b265a323638fb2
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 509: Fixed incorrect merging of Data Store Writes / Events
Tony Tkacik [Tue, 15 Apr 2014 15:48:56 +0000 (17:48 +0200)]
Bug 509: Fixed incorrect merging of Data Store Writes / Events

ForwardedBackwardsCompatibleDataBroker:

In old Data API only way to replace element was to use
remove/put combination, which changed with new Async DOM Broker
APIs where put is actually add/replace so previous delete is not
neccessary.

BackwardsCompatibleTransaction keeps track of such remove/put
operations and propagates put-only to new Async Data Transaction.

DOMImmutableDataChangeEvent:

Builder for DOMImmutableDataChange event used ImmutableMap builder
which throws IllegalArgumentException when same key/value combo
is overriden, which made impossible to merge some events. Switched
Builder implementation to use combination of HashMap and
ImmutableMap.copyOf() in order to prevent this
IllegalArgumentException to fail commit process.

Change-Id: I935bd4f5499c26190c52adcaee1df6335640bfaf
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "BUG-509: add missing copyright headers"
Ed Warnicke [Tue, 15 Apr 2014 16:19:23 +0000 (16:19 +0000)]
Merge "BUG-509: add missing copyright headers"

10 years agoMerge "Bug 509: Fixed small discrepancies in Binding Data Change Events."
Ed Warnicke [Tue, 15 Apr 2014 16:15:53 +0000 (16:15 +0000)]
Merge "Bug 509: Fixed small discrepancies in Binding Data Change Events."

10 years agoMerge "Bug 509: Added In-memory datastore support for wildcarded change listeners"
Ed Warnicke [Tue, 15 Apr 2014 16:13:12 +0000 (16:13 +0000)]
Merge "Bug 509: Added In-memory datastore support for wildcarded change listeners"

10 years agoBUG-509: add missing copyright headers
Robert Varga [Tue, 15 Apr 2014 09:13:52 +0000 (11:13 +0200)]
BUG-509: add missing copyright headers

Change-Id: Idb205cb5e14364661de24b0c9a8008a5995ba08b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 509: Fixed small discrepancies in Binding Data Change Events.
Robert Varga [Mon, 14 Apr 2014 15:46:07 +0000 (17:46 +0200)]
Bug 509: Fixed small discrepancies in Binding Data Change Events.

DataNormalizer which was responsible to render representation
of Instance Identifier in original format was introducing
additional node, when translation happened from normalized
to legacy, which is only triggered by Data Change Events.

Implementation of responsible algorithm was changed to
use schema in order to derive legacy InstanceIdentifier.

Data Change Events

 - Translated Data Change events were deserialized from
   DOM format on each access to fields, which may introduced
   CPU time overhead.

   Immutability of backing Data Change Events allows to
   add lazy caching of translated TOs, since event and data
   contained in Event Object are immutable.

 - getUpdated*Data in original Binding APIs returned
   both created and modified, so backwards-compatible fix
   was introduced.

Change-Id: Idab3dffb8651d50cca79a22ddcd43af29561b80e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 591: Minimize the use of Xtend in sal-binding-broker-impl
Raghurama Bhat [Tue, 8 Apr 2014 20:48:25 +0000 (13:48 -0700)]
Bug 591: Minimize the use of Xtend in sal-binding-broker-impl

Change-Id: I3b21ccdf42685c7b10bf66fadf99ae82692149cf
Signed-off-by: Raghurama Bhat <ragbhat@cisco.com>
10 years agoMerge "Change RpcImplementation contract to asynchronous"
Tony Tkacik [Tue, 15 Apr 2014 07:43:39 +0000 (07:43 +0000)]
Merge "Change RpcImplementation contract to asynchronous"

10 years agoBug 509: Added In-memory datastore support for wildcarded change listeners
Tony Tkacik [Thu, 10 Apr 2014 13:39:31 +0000 (15:39 +0200)]
Bug 509: Added In-memory datastore support for wildcarded change listeners

Added support for wildcarded data change listeners,
which may register to updates of list entries (and their
subentries) without specifying key for list items.

Support for Wildcarded Data Change Listneners is done by
refactoring DataChangeEventResolver into Map/Reduce processing.

Map phase:
When visiting each modified node (with key) we also
looks for listener listening on same level without key.
This actually may trigger creation (mapping) of multiple events
for same listeners (eg. two flows we're added at the same time).

Reduce phase:
We walked thru all listeners to be notified and if they have
multiple events assigned, we merge them into one even to be
delivered.

Change-Id: Ic05ddae10bd0b316009cc5bafdeca76350f00390
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-509: improve normalization error reporting
Robert Varga [Mon, 14 Apr 2014 16:13:00 +0000 (18:13 +0200)]
BUG-509: improve normalization error reporting

This patch introduces an explicit checked exception for reporting
normalization errors, declares it at strategic places and makes use of
it for generating better error reports than:

Caused by: java.lang.IllegalArgumentException: Supplied QName (urn:opendaylight:params:xml:ns:yang:pcep:crabbe:initiated:00?revision=2014-01-13)initiation is not valid according to schema container stateful

Change-Id: I2020c9e6ef85035259558a32f141a132b6321e0e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Fail forwarning write if read fails.
Robert Varga [Mon, 14 Apr 2014 13:12:45 +0000 (15:12 +0200)]
BUG-509: Fail forwarning write if read fails.

This primarily gets rid of e.printStackTrace(), but as part of that it
defines an important thing: if a read fails while we're building up the
path, we should not try to continue with the operation.

Change-Id: I48cb6cd304a98684a6984d26b6fc8dd5d14963c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 651 - Added back IDE profile and changed target for yang sources
jameshall03885 [Wed, 9 Apr 2014 14:30:03 +0000 (10:30 -0400)]
Bug 651 - Added back IDE profile and changed target for yang sources

- The IDE maven profile was added back based on feedback from Giovanni Meo

- To avoid devs from having to run the IDE profile so eclipse can see the yang
generated source files, the yang source files are now generated under src/main/yang-gen-sals
or src/main/yang-gen-config instead of target/target-ide.

- The maven-clean-plugin was moved to the commons base pom and removed from
all child poms where it was specified. Thus, it will be automatically run for all
projects. The plugin's execution will clean all xtend and yang generated source dirs.

- The build-helper-maven-plugin was also moved to the commons base pom and removed from
all child poms. It will automatically run for all projects and no longer needs to be
specified in child poms. The plugin's execution will created eclipse source folders
for all xtend and yang generated source.

Tom P and Devin A really did all this work, Greg just gets credit unfairly.

Conflicts:
        opendaylight/config/config-module-archetype/src/main/resources/archetype-resources/pom.xml

Change-Id: I8d9e403629cab2e48d03d5c7a417a02f1d878ca7
Signed-off-by: tpantelis <tpanteli@brocade.com>
Signed-off-by: jameshall03885 <ghall@brocade.com>
Signed-off-by: dbavery <devin.avery@brocade.com>
Signed-off-by: jameshall03885 <ghall@brocade.com>
10 years agoChange RpcImplementation contract to asynchronous
Robert Varga [Thu, 27 Feb 2014 08:02:42 +0000 (09:02 +0100)]
Change RpcImplementation contract to asynchronous

This changes the method used to invoke RPCs such that they need not be
synchronous anymore, but rather return a ListenableFuture. If an
implementation is synchronous, it should use Futures.immediateFuture()
as a wrapper.

Change-Id: I0623d2afda038ba49afa83ed6020910b74b4911e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-592: Fix InstanceIdentifier instantiation"
Tony Tkacik [Fri, 11 Apr 2014 14:45:56 +0000 (14:45 +0000)]
Merge "BUG-592: Fix InstanceIdentifier instantiation"

10 years agoMerge "BUG-509: improve memory efficiency of ListenerTree"
Tony Tkacik [Fri, 11 Apr 2014 08:52:59 +0000 (08:52 +0000)]
Merge "BUG-509: improve memory efficiency of ListenerTree"

10 years agoMerge "BUG-509: Encapsulate ListenerTree"
Tony Tkacik [Fri, 11 Apr 2014 08:52:42 +0000 (08:52 +0000)]
Merge "BUG-509: Encapsulate ListenerTree"

10 years agoBUG-592: Fix InstanceIdentifier instantiation
Robert Varga [Wed, 26 Mar 2014 23:54:48 +0000 (00:54 +0100)]
BUG-592: Fix InstanceIdentifier instantiation

This is a follow-up patch for
https://git.opendaylight.org/gerrit/#/c/5778 and gets rid of using
direct constructor use.

Change-Id: I09310b71c595a99bb09038f129b47b5b28aaaa33
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-509: improve memory efficiency of ListenerTree
Robert Varga [Thu, 10 Apr 2014 16:59:45 +0000 (18:59 +0200)]
BUG-509: improve memory efficiency of ListenerTree

As it turns out, we do not need a Set<>, but rather a collection. We do
not expect major modifications of listeners, but memory efficiency and
iteration speed are required. Thus turn the HashSet into an ArrayList.

Also rename DataChangeListenerRegistration to
DataChangeListenerRegistrationImpl, so that the interface itself can be
imported and used as a shortname. This has the nice effect of rendering
a nasty SuppressWarnings completely unneeded.

Change-Id: I100337651c3b42c715978708bc98cf24ce5bf703
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Encapsulate ListenerTree
Robert Varga [Thu, 10 Apr 2014 10:28:24 +0000 (12:28 +0200)]
BUG-509: Encapsulate ListenerTree

This patch encapsulates the ListenerTree. This provides the
infrastructure needed to make listener registration/unregistration scale
and work in face of asynchronous commits.

Whenever a listener is about to be registered, the tree is write-locked,
the apropriate structure is created and the registration is enqueued.
When a registration is closed, the removeListener() callback re-takes
the appropriate lock and removes the listener.

When the last listener is removed from a node, and that node is unused,
it is cascaded up to its parent for removal, which recursively does the
same. This means that the tree is of unused nodes as soon as they are
freed. The backreference to parent is kept weak, which makes sure we are
able to finalize as much as we can in case of funky references lying
around.

Write locks are never leaked outside of the ListenerTree class, e.g.
they are always released before we return to the caller.

When a transaction is being committed, the ListenerTree is asked for a
Walker, which is an AutoCloseable resource. A Walker is the only way how
foreign code can get hold of a listener tree root node. Each walker is
backed by a reference to a read-lock, e.g. listener
registration/unregistration cannot occur while such a lock is held. This
makes sure the commit process sees a point-in-time view of the listener
tree. When a Walker is closed, the tree lock is read-unlocked. The
close() method is idempotent.

Change-Id: I6ea9b2e00f8ab21a5d8bd3b8c82c193c2069d683
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-694: Disable DataReader registration for BA Broker"
Tony Tkacik [Thu, 10 Apr 2014 12:10:24 +0000 (12:10 +0000)]
Merge "BUG-694: Disable DataReader registration for BA Broker"

10 years agoBUG-694: Disable DataReader registration for BA Broker
Robert Varga [Wed, 9 Apr 2014 16:23:19 +0000 (18:23 +0200)]
BUG-694: Disable DataReader registration for BA Broker

The DataReader's semantic contract with its users, data merge,
when working with Binding-Aware DTOs.

The existing DataReaders implementations need to be rewritten as
datastores, which deal with the same problem in Binding Independent
format, such as the BI Data Broker.

Change-Id: I91b4516bb04a570acb6bf2b381860e9ae3fbbd43
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: improve safety of MutableDataTree
Robert Varga [Wed, 9 Apr 2014 04:37:06 +0000 (06:37 +0200)]
BUG-509: improve safety of MutableDataTree

This limits field visibility and improves seal operation with respect to
other operations. Also make sure to check for multiple seals.

Change-Id: I2c91e59e3308010f8c95a3fb3898bace97b2db97
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: limit visibility of updateModificationType()
Robert Varga [Wed, 9 Apr 2014 04:20:17 +0000 (06:20 +0200)]
BUG-509: limit visibility of updateModificationType()

Limits updateModificationType() to private. Also add GuardedBy
annotations to explain that seal and this method require
synchronization.

Change-Id: Iff49e15c890bac38cb5ff19c347551dcee5bb4b8
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: explain the use of SuppressWarnings
Robert Varga [Wed, 9 Apr 2014 04:02:11 +0000 (06:02 +0200)]
BUG-509: explain the use of SuppressWarnings

This adds an explanation why we opted to suppress warnings instead of
doing the type-safe thing.

Also speeds up string building very slightly by compacting two append()
calls and using append(char) instead append(String).

Change-Id: Ifed1005bb118de101476063790b5c8aee73888bb
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: clean up comment
Robert Varga [Wed, 9 Apr 2014 03:48:36 +0000 (05:48 +0200)]
BUG-509: clean up comment

This cleans up a comment why subtracting 1 from nesting is safe. It also
adds a Preconditions.checkState() to explicitly guard on the
expectation.

Change-Id: Ia0b755d723d399b99fec98398afabba1222b97b3
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Fix a constructor typo/thinko
Robert Varga [Wed, 9 Apr 2014 03:39:58 +0000 (05:39 +0200)]
BUG-509: Fix a constructor typo/thinko

The 'nested' array should be initialized as empty, but sized for
the size of path.getPath(), as we fill it continuously as we traverse
the tree.

The original initialization also copied path.getPath(), resulting in the
path reported in full and then correctly.

Change-Id: I9a918ced62a845b985459699e23f1f2f1d55cf35
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Rename StoreMetadataNode.createRecursivelly
Robert Varga [Wed, 9 Apr 2014 03:29:00 +0000 (05:29 +0200)]
BUG-509: Rename StoreMetadataNode.createRecursivelly

This is a rename of StoreMetadataNode.createRecursivelly() to
StoreMetadataNode.createRecursively(), fixing an obvious typo.

Change-Id: I3891459ebae561b89c27438f2e0f187bd7b7c503
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Fix thread safety of listener registration
Robert Varga [Tue, 8 Apr 2014 16:07:32 +0000 (18:07 +0200)]
BUG-509: Fix thread safety of listener registration

This commit fixes the race condition where a listener is registered
after preCommit() and before commit(). This is done by moving the
collection into the commit() where it is protected by the
commit/listener synchronized block.

The unregistration safety is handled by wrapping the returned
registration and invoking the equivalent synchronized block.

Change-Id: Ie9abc81b2a773418b34c3051f7665b0dcf047f76
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Improve InMemoryDOMDataStore structure
Robert Varga [Thu, 27 Mar 2014 02:52:42 +0000 (03:52 +0100)]
BUG-509: Improve InMemoryDOMDataStore structure

Introduce AbstractDOMStoreTransaction, which holds common code. Also use
ToStringHelper to get consistent toString().

Change-Id: I246c891fa4a9a4c12b21eeb2743a00097dd95fbe
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 509: Fixed order of invoking Schema listeners."
Ed Warnicke [Tue, 8 Apr 2014 16:12:31 +0000 (16:12 +0000)]
Merge "Bug 509: Fixed order of invoking Schema listeners."

10 years agoMerge "BUG-509: Fix thread safety of DOMDataBrokerImpl.ready()"
Tony Tkacik [Tue, 8 Apr 2014 16:11:43 +0000 (16:11 +0000)]
Merge "BUG-509: Fix thread safety of DOMDataBrokerImpl.ready()"

10 years agoMerge "BUG-579: Remove ImmutableMap in favor of LinkedHashMap"
Tony Tkacik [Tue, 8 Apr 2014 16:11:26 +0000 (16:11 +0000)]
Merge "BUG-579: Remove ImmutableMap in favor of LinkedHashMap"

10 years agoMerge "Fixed potential class pool override in integration tests."
Ed Warnicke [Tue, 8 Apr 2014 16:11:16 +0000 (16:11 +0000)]
Merge "Fixed potential class pool override in integration tests."

10 years agoBUG-509: Fix thread safety of DOMDataBrokerImpl.ready()
Robert Varga [Thu, 27 Mar 2014 02:51:34 +0000 (03:51 +0100)]
BUG-509: Fix thread safety of DOMDataBrokerImpl.ready()

Transition to ready has to occur precisely once, so the process of
taking cohorts has to be synchronized.

Change-Id: I8ba8fe7437dd59547d04fec73f5cd9ed43232161
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-579: Remove ImmutableMap in favor of LinkedHashMap
Robert Varga [Thu, 27 Mar 2014 03:55:56 +0000 (04:55 +0100)]
BUG-579: Remove ImmutableMap in favor of LinkedHashMap

This prevents a single round og ImmutableMapBuilder.build() as a
trade-off for not leaking a mutable reference to the map.

Change-Id: Idb97a5f4ece1d2f27af728310d9b0807ae305926
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFixed potential class pool override in integration tests.
Tony Tkacik [Mon, 7 Apr 2014 15:34:04 +0000 (17:34 +0200)]
Fixed potential class pool override in integration tests.

Classloader in JUnit test is shared resource and in order
to integrate well with Javassist we are required to share
also classpool in order to compile generated code
using previously existing generated code in same Classloader.

If we introduce new ClassPool for same classloader,
compilation may fail, because new ClassPool is unable
to fetch bytecode for already generated classes.

Change-Id: Idd933670fe0a1c06d40aeed182f46997a843ab91
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 509: Fixed order of invoking Schema listeners.
Tony Tkacik [Mon, 7 Apr 2014 10:31:55 +0000 (12:31 +0200)]
Bug 509: Fixed order of invoking Schema listeners.

Explicitly registered SchemaServiceListeners
are invoked before listeners picked-up by whiteboard
pattern, which by default are not aware
of the service.

Change-Id: Id41b89a1ba2ccb5323d5ab5ad8a95d2048776679
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "BUG-509: make sure datastore commits are visible"
Tony Tkacik [Mon, 7 Apr 2014 09:04:13 +0000 (09:04 +0000)]
Merge "BUG-509: make sure datastore commits are visible"

10 years agoBUG-509: internal cleanup
Robert Varga [Fri, 4 Apr 2014 17:14:57 +0000 (19:14 +0200)]
BUG-509: internal cleanup

Spell-check internal class and make it static
Make sure we don't have null name in contructor
Make sure we don't have null executor in constructor
getIdentifier() should be final

Change-Id: Ib8ebe82106d953581738bccbe1d4b878f9520b5b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: make sure datastore commits are visible
Robert Varga [Fri, 4 Apr 2014 17:50:57 +0000 (19:50 +0200)]
BUG-509: make sure datastore commits are visible

This wraps the datastore root in an AtomicReference, which makes sure
started transactions see the latest published commit. This will make
the datastore handling more robust under tight conditions.

Also uncovers the fact that we are invoking user code under lock, which
we fix by reusing the executor used by the commit machinery.

Finally it uncovers thread-unsafe listener list manipuation. This will
need to be addressed in a follow-up patch.

Change-Id: Ic7efd266ef680701c1f0944ee675122d8527568b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 510: Implementation of Forwarded Binding Data Broker"
Ed Warnicke [Fri, 4 Apr 2014 17:05:09 +0000 (17:05 +0000)]
Merge "Bug 510: Implementation of Forwarded Binding Data Broker"

10 years agoBug 510: Implementation of Forwarded Binding Data Broker
Robert Varga [Fri, 28 Mar 2014 21:23:07 +0000 (22:23 +0100)]
Bug 510: Implementation of Forwarded Binding Data Broker

Initial implementation of Forwarded Binding Data Broker
and Forwarded Backwards Compatible Data Broker,
which provides access to new data broker via original
API.

Added sample configuration which enables new
DOM Data Broker, In-memory Data Broker and
ForwardedCompatibleDataBroker.

Change-Id: I3569da20a9873edf352a54622be7a01fd329aa9b
Signed-off-by: Moiz Raja <moraja@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 499: Fixed normalization of InstanceIdentifier for backwards compatibility
Robert Varga [Wed, 26 Mar 2014 18:29:13 +0000 (19:29 +0100)]
Bug 499: Fixed normalization of InstanceIdentifier for backwards compatibility

Change-Id: I633eb004729c6013df49c3f82420adf6d2417ea9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 499: Improved data change listener tree management
Robert Varga [Fri, 21 Mar 2014 12:30:45 +0000 (13:30 +0100)]
Bug 499: Improved data change listener tree management

Change-Id: I62843c3c4df32dd5a5849511d41352fa6822550b
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 499: Added support for old DOM Broker APIs."
Ed Warnicke [Tue, 1 Apr 2014 15:22:45 +0000 (15:22 +0000)]
Merge "Bug 499: Added support for old DOM Broker APIs."

10 years agoMerge "Bug 499: Added support for change listeners."
Ed Warnicke [Tue, 1 Apr 2014 15:22:27 +0000 (15:22 +0000)]
Merge "Bug 499: Added support for change listeners."

10 years agoMerge "Bug 499: Initial draft of in-memory datastore and data broker"
Ed Warnicke [Tue, 1 Apr 2014 15:21:25 +0000 (15:21 +0000)]
Merge "Bug 499: Initial draft of in-memory datastore and data broker"

10 years agoMerge "Bug 499: Initial implementation of data tree modifications"
Ed Warnicke [Mon, 31 Mar 2014 20:13:53 +0000 (20:13 +0000)]
Merge "Bug 499: Initial implementation of data tree modifications"

10 years agoMerge "Bug 499: Initial implementation of supporting tree structures"
Ed Warnicke [Mon, 31 Mar 2014 20:09:54 +0000 (20:09 +0000)]
Merge "Bug 499: Initial implementation of supporting tree structures"

10 years agoMerge "Do not use InstanceIdentifier.builder()"
Tony Tkacik [Mon, 31 Mar 2014 07:23:02 +0000 (07:23 +0000)]
Merge "Do not use InstanceIdentifier.builder()"

10 years agoBug 499: Added support for old DOM Broker APIs.
Tony Tkacik [Wed, 26 Mar 2014 18:29:13 +0000 (19:29 +0100)]
Bug 499: Added support for old DOM Broker APIs.

Added implementation of BackwardsCompatibleBroker
which exposes sal.core.api.DataBrokerService
using new DOMDataBroker and Data Store.

Enabled configuration which allows for configuring
specificing which implementation of Data DOM Broker
should be used in the MD-SAL.

Change-Id: I6ad7172e62eac1ae0af9be08684b2ae4adba6005
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 499: Added support for change listeners.
Tony Tkacik [Fri, 21 Mar 2014 12:30:45 +0000 (13:30 +0100)]
Bug 499: Added support for change listeners.

Change-Id: I9e9c46f13f77ac8b1bda459c35724a5e0b24d91f
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 499: Initial draft of in-memory datastore and data broker
Tony Tkacik [Tue, 18 Mar 2014 16:18:37 +0000 (17:18 +0100)]
Bug 499: Initial draft of in-memory datastore and data broker

Initial implementation of InMemoryDOMDataStore with support
for commits to the store and conflict checking

  - DOMDataBrokerImpl - initial implementation of DOM Data Broker which
       uses InMemoryDOMDataStore instances as store for Operational
       and Configuration data

  - InMemoryDOMDataStore - implementation of in-memory DOM Data Store
      which uses MutableDataTree

  - Updated SchemaAwareApplyOperation to provide
    more granular operations as
       - verifyStructure - verify if correct tree node types are used
       - isApplicable - verifies if modification is applicable to other
           snapshot

  Added test suite which tests InMemoryDOMStore, performance
  of DOMDataBroker and DOM Data Broker.

Change-Id: Ia7f8659aa128e1dc1e9a8580ac46452dfe66289a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 499: Initial implementation of data tree modifications
Tony Tkacik [Tue, 18 Mar 2014 16:10:14 +0000 (17:10 +0100)]
Bug 499: Initial implementation of data tree modifications

Initial implementation of data tree modifications using
StoreMetadataNode and NodeModification.

  - DataAndMetadataSnapshot - helper class, which
      contains immutable snapshot of data and metadata

  - ModificationApplyOperation - interface definition
      of composite hierarchical operation, which
      is responsible for applying changes to provided
      subtree

  - SchemaAwareApplyOperation - implementations of
      ModificationApplyOperation based on parsed
      SchemaContext

  - MutableDataTree - class which integrates
     Data tree, Metadata tree, Node Modification tree
     and ModificationApplyOperations into mutable logical
     tree, which will serves as a basis for read-write
     transactions.

  - Unit test for MutableDataTree in following scenarios
      - Create empty MutableDataTree, write subtree, read nested nodes
      - Create empty MutableDataTree, write subtree, modify subtree
      - Create MutableDataTree with existing date, write changes and deletes

Change-Id: I5c0c84764f93d150eac6d227c4bc367b67652f9d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 499: Initial implementation of supporting tree structures
Robert Varga [Tue, 18 Mar 2014 16:00:55 +0000 (17:00 +0100)]
Bug 499: Initial implementation of supporting tree structures

  - StoreTreeNode - interface defining common interface to tree
    structures used by data store.

  - TreeNodeUtils - utility methods which uses StoreTreeNode
      as tree definitions and provides functionality such
      as retrieval of deep nodes.

  - StoreMetadataNode - immutable tree node (and tree), representing
        versioning metadata and data.

  - NodeModification - mutable tree node (and tree),
       representing modification (diff) which should be applied to
       data tree. Tree is lazily populated by invoking client
       operations to be maded.

This patchset requires https://git.opendaylight.org/gerrit/#/c/5646/
to be merged.

Change-Id: I2d2437ea64ba54565ba60826fe0e7c14f071598e
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge changes Id6b8ba01,Ic4081b36
Tony Tkacik [Fri, 28 Mar 2014 16:47:30 +0000 (16:47 +0000)]
Merge changes Id6b8ba01,Ic4081b36

* changes:
  Bug:553 - RPC providers are not cleaned up on bundle stop, causing bundle restart to fail
  Bug:441-closing listener on stop of md-topologymaneger bundle

10 years agoMerge "Bug 500: DOMStore SPI"
Ed Warnicke [Fri, 28 Mar 2014 01:01:22 +0000 (01:01 +0000)]
Merge "Bug 500: DOMStore SPI"

10 years agoMerge "Bug 500: Type capture for DOM and Binding APIs"
Ed Warnicke [Fri, 28 Mar 2014 00:59:11 +0000 (00:59 +0000)]
Merge "Bug 500: Type capture for DOM and Binding APIs"

10 years agoMerge "Bug 500: Updated data APIs with new concepts."
Ed Warnicke [Fri, 28 Mar 2014 00:57:35 +0000 (00:57 +0000)]
Merge "Bug 500: Updated data APIs with new concepts."

10 years agoBug 500: DOMStore SPI
Robert Varga [Tue, 11 Mar 2014 18:20:00 +0000 (19:20 +0100)]
Bug 500: DOMStore SPI

This is the API which needs to be implemented by a single logical tree
store, such that it can be plugged into the in-memory datastore
prototype.

The prototype keeps one logical data store for each of operational and
configuration subtrees. A front-end (client-visible) transaction results
in two back-end (data store) transactions. State transitions between the
three are coordinated using three-phase-commit protocol (3PC), with the
frontend transaction acting as the coordinator and the backend
transactions acting as cohorts.

Change-Id: Idfce04553e7c36ae6a1bb8c8b2699ca78c458bb4
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 500: Type capture for DOM and Binding APIs
Robert Varga [Wed, 12 Mar 2014 14:54:52 +0000 (15:54 +0100)]
Bug 500: Type capture for DOM and Binding APIs

This commit introduces the type captures of new interfaces introduced in
the preceding commit.

Change-Id: I8da8ecd0a0404e89ae20d0d85894fc9da59e9903
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 500: Updated data APIs with new concepts.
Robert Varga [Tue, 11 Mar 2014 12:28:59 +0000 (13:28 +0100)]
Bug 500: Updated data APIs with new concepts.

  - Logical Datastore Type idenfier
  - Asynchronous Data Broker contracts - some data broker contracts
    were synchronous which could misslead consumers of APIs

  - New Transaction subtypes with support for Asynchronous reads
    - read-only transaction
    - write-only transaction
    - read-write transaction
  - Scoped Data Change Publisher - client code is able
    to specify scope of changes and logical datastore
    type on which it is listening.

Change-Id: I2367e7df633dd07b08550014bed7a35c3e88a7ba
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoDo not use InstanceIdentifier.builder()
Robert Varga [Tue, 25 Mar 2014 21:07:14 +0000 (22:07 +0100)]
Do not use InstanceIdentifier.builder()

Stop using the type-usafe identifier builder. This eradicates the
obvious places. The leftover now are just the BI connector.

Change-Id: Iff1d1fc58e638d02e08951dbddead067d3e746e1
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug:553 - RPC providers are not cleaned up on bundle stop, causing bundle restart...
Kamal Rameshan [Wed, 26 Mar 2014 21:12:19 +0000 (14:12 -0700)]
Bug:553 - RPC providers are not cleaned up on bundle stop, causing bundle restart to fail

Change-Id: Id6b8ba01194d71d2eb7ea97ca70088dec8b29d6e
Signed-off-by: Kamal Rameshan <kramesha@cisco.com>
10 years agoUpdate to use yang concepts
Robert Varga [Tue, 25 Mar 2014 12:00:56 +0000 (13:00 +0100)]
Update to use yang concepts

Change-Id: I529ec122c54d51efe10128985e8b1b0cd715461b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFix sal-binding-api dependencies
Robert Varga [Tue, 25 Mar 2014 01:32:15 +0000 (02:32 +0100)]
Fix sal-binding-api dependencies

Remove unused dependencies on sal-common and add used dependencies on
yang concepts and guava.

Change-Id: Ifb2b16f00b9af2bb8716412b4e6d4fa0fd5bdc54
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Add MountInstance client documentation and promote to ListenableFuture"
Tony Tkacik [Tue, 25 Mar 2014 05:24:51 +0000 (05:24 +0000)]
Merge "Add MountInstance client documentation and promote to ListenableFuture"

10 years agoMerge "Fix sal-common-api dependencies"
Tony Tkacik [Tue, 25 Mar 2014 05:20:41 +0000 (05:20 +0000)]
Merge "Fix sal-common-api dependencies"

10 years agoFix sal-common-api dependencies
Robert Varga [Tue, 25 Mar 2014 01:27:36 +0000 (02:27 +0100)]
Fix sal-common-api dependencies

sal-common-api should not depend on org.osgi.core nor sal-common. Remove
these dependencies and fix users which relied on org.osgi.core being
brought into compilation transitively.

Change-Id: Idf27f78e0c52c8a93e38c1fb7f8bba6615c3b745
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Resolve Bug:448 - Remove yang-store api and impl."
Tony Tkacik [Tue, 18 Mar 2014 10:45:26 +0000 (10:45 +0000)]
Merge "Resolve Bug:448 - Remove yang-store api and impl."

10 years agoAdd MountInstance client documentation and promote to ListenableFuture
Robert Varga [Thu, 13 Mar 2014 08:23:27 +0000 (09:23 +0100)]
Add MountInstance client documentation and promote to ListenableFuture

This adds documentation to MountInstance interface. Also promote
Future<> to ListenableFuture<>, as there is only a single implementation
anyway.

Change-Id: I9346f1f38c633b32fa7039f143d6c7634cb97359
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoResolve Bug:448 - Remove yang-store api and impl.
Tomas Olvecky [Mon, 10 Mar 2014 08:56:13 +0000 (09:56 +0100)]
Resolve Bug:448 - Remove yang-store api and impl.

Depends on yangtools commit https://git.opendaylight.org/gerrit/#/c/5579/ .
Instead of having multiple bundle trackers for config and netconf, keep only
one. Each bundle containing yang files should use sal code generator, which
generates YangModuleInfo objects. Using this instead of speculatively having
to parse all current yang files for each adding bundle event allows not having
to deal with broken yang dependencies when bundle events come in wrong order.
Put SchemaContextProvider to OSGi SR in config-manager, so that any bundle
working with yang can use it. This replaces too specific YangStoreService which
was coupled with yang-jmx-generator. Users can listen for changes directly
on OSGi SR - they receive service changed event when yang module is added or
removed.

Change-Id: Iabcb35929a1eeef0df328f3f948d70e1bfcbba0d
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
10 years agoMerge "Fix typos in documentation"
Tony Tkacik [Wed, 12 Mar 2014 09:53:20 +0000 (09:53 +0000)]
Merge "Fix typos in documentation"

10 years agoFix typos in documentation
Moiz Raja [Wed, 12 Mar 2014 08:13:38 +0000 (09:13 +0100)]
Fix typos in documentation

Change-Id: I0023e7256f02170c04cc00579ee791f5a3578b1d
Signed-off-by: Moiz Raja <moraja@cisco.com>
10 years agoMerge "Prune long-deprecated APIs"
Tony Tkacik [Tue, 11 Mar 2014 11:17:54 +0000 (11:17 +0000)]
Merge "Prune long-deprecated APIs"

10 years agoPrune long-deprecated APIs
Robert Varga [Fri, 28 Feb 2014 12:42:05 +0000 (13:42 +0100)]
Prune long-deprecated APIs

Prune APIs which have been deprecated well before the Hydrogen release.
No outside users should be relying on them at this point.

Change-Id: I5b966c98733912ece175ce8fa5a4a821c3b2c6d9
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoCleanup AbstractDataTransaction state changes
Robert Varga [Sun, 9 Mar 2014 10:40:11 +0000 (11:40 +0100)]
Cleanup AbstractDataTransaction state changes

Centralize state to be internal and add time tracking, such that it can
be used in logs and statistics.

Change-Id: Ie4197cd2a10bb6b89931f5ecd9b3cc6dcfbe3011
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoRemove SupressWarnings("all")
Robert Varga [Sun, 9 Mar 2014 10:15:37 +0000 (11:15 +0100)]
Remove SupressWarnings("all")

It turns out to be unnecessary except for a raw type usage -- which is
fixed.

Change-Id: Icdbfbb9b23a4446caeff4cf73a423874b05e0361
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoAdd interface documentation
Robert Varga [Fri, 28 Feb 2014 12:41:49 +0000 (13:41 +0100)]
Add interface documentation

Change-Id: I3573d1153a62bfe36a01504198a3d1182d1013c1
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Enabling Remote RPC Router module in ODL distribution."
Tony Tkacik [Wed, 5 Mar 2014 09:16:37 +0000 (09:16 +0000)]
Merge "Enabling Remote RPC Router module in ODL distribution."

10 years agoEnabling Remote RPC Router module in ODL distribution.
Abhishek Kumar [Thu, 13 Feb 2014 23:26:44 +0000 (15:26 -0800)]
Enabling Remote RPC Router module in ODL distribution.

- Added initial Route Change event
- Updated pom
- Fix rebase conflicts
- Added 02-clustering to initial configuration

Change-Id: I64dc6550171755af52a403f576c086ef2257b4a2
Signed-off-by: Abhishek Kumar <abhishk2@cisco.com>
10 years agoMerge "Remove static state and default beans from RuntimeMappingModuleFactory,SchemaS...
Tony Tkacik [Mon, 3 Mar 2014 13:06:34 +0000 (13:06 +0000)]
Merge "Remove static state and default beans from RuntimeMappingModuleFactory,SchemaServiceImplSingletonModuleFactory."

10 years agoRemove static state and default beans from RuntimeMappingModuleFactory,SchemaServiceI...
Tomas Olvecky [Fri, 28 Feb 2014 10:27:13 +0000 (11:27 +0100)]
Remove static state and default beans from RuntimeMappingModuleFactory,SchemaServiceImplSingletonModuleFactory.

Remove static reference from factories as this breaks tests: it is useful to tear down config subsystem
between tests, but there is no way to clean up static fields.
Since default beans are discouraged, rework those factories to enforce instance naming so that only a single
instance can be created.
01-md-sal.xml already creates both modules.

Change-Id: I5efbe12b349ae82bfff12ae9a767505a66df2f90
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
10 years agoMerge "Centralize yang-maven-plugin version"
Tony Tkacik [Thu, 27 Feb 2014 14:59:24 +0000 (14:59 +0000)]
Merge "Centralize yang-maven-plugin version"