mdsal.git
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 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 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"

10 years agoMerge "Deprecate org.opendaylight.controller.sal.common.util.Futures"
Tony Tkacik [Thu, 27 Feb 2014 14:57:41 +0000 (14:57 +0000)]
Merge "Deprecate org.opendaylight.controller.sal.common.util.Futures"

10 years agoFixed order of applying changes when forwarding transactions
Robert Varga [Thu, 27 Feb 2014 11:44:18 +0000 (12:44 +0100)]
Fixed order of applying changes when forwarding transactions

Commit 5659f588f80522a5be5c80d0e5ff34068b5f4786 changed the semantics of
remove/update operations such that the order of application became
significant: remove, then put.

Unfortunately we failed to notice that there are two places which apply
the operations in wrong order, thus breaking clients who perform a
remove/put in a single transaction -- e.g. replacing data without
merging it.

Fix DataStore and Binding->DOM connector.

Change-Id: I4fb12730e8256d3614846adb1fa5a1096284e0eb
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoCentralize yang-maven-plugin version
Robert Varga [Thu, 27 Feb 2014 12:05:29 +0000 (13:05 +0100)]
Centralize yang-maven-plugin version

There is no reason for individual projects to define the version over
and over again -- let's keep it in one place.

Change-Id: I4ea6ccbc51e31cf3cef3b7c1304ea7dcc02667f7
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoDeprecate org.opendaylight.controller.sal.common.util.Futures
Robert Varga [Thu, 27 Feb 2014 11:11:34 +0000 (12:11 +0100)]
Deprecate org.opendaylight.controller.sal.common.util.Futures

We use guava throughout -- and those are better.

Change-Id: I0013f8fc0c10742791159abdf151662eaae5629f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoAdding routed RPC support in Remote RPC Router
Abhishek Kumar [Fri, 24 Jan 2014 08:31:49 +0000 (00:31 -0800)]
Adding routed RPC support in Remote RPC Router

 - Updated RoutingTable to add a new routed RPC cache
 - Updated sal-core-api to add Remote RPC Router as default delegate in SchemaAwareRpcBroker
 - Refactored RemoteRpcProvider code.
 - Added unit tests for routing table
 - Removed RouteIdentifier <-> JSON conversion. Its not used anymore
 - Rebased with master

Change-Id: Id13a0a6a9ae6ded7ea9068b7a613a9e196c89a7b
Signed-off-by: Abhishek Kumar <abhishk2@cisco.com>
10 years agoMerge "Prune long-deprecated APIs"
Tony Tkacik [Tue, 25 Feb 2014 18:13:31 +0000 (18:13 +0000)]
Merge "Prune long-deprecated APIs"

10 years agoPrune long-deprecated APIs
Robert Varga [Wed, 19 Feb 2014 10:44:06 +0000 (11:44 +0100)]
Prune long-deprecated APIs

These APIs are from prototype days and have never properly worked. Prune
them to reduce the baggage we carry around.

Change-Id: I9ac89552edf76f0740c660c100ec0426627b413a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFix logging arguments in two-phase commit
Robert Varga [Tue, 25 Feb 2014 13:35:32 +0000 (14:35 +0100)]
Fix logging arguments in two-phase commit

Change-Id: I0be572998f4ce5d30dca5178f946fab15ed925ca
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFix comments and remove use of deprecated class
Robert Varga [Wed, 19 Feb 2014 02:55:48 +0000 (03:55 +0100)]
Fix comments and remove use of deprecated class

This primarily removes SchemaServiceListener, as that is deprecated and
implied by SchemaContextListener, which is replacing it.

Change-Id: I977e818ff466ab27f6cd213d1e0e255e2f1b59a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "fix bug 431"
Tony Tkacik [Tue, 25 Feb 2014 12:02:03 +0000 (12:02 +0000)]
Merge "fix bug 431"

10 years agoRpcRegistration.close() should not throw
Robert Varga [Tue, 25 Feb 2014 10:12:14 +0000 (11:12 +0100)]
RpcRegistration.close() should not throw

Closing an RPC registration is an atomic act, e.g. it should never be
allowed to throw exceptions.

Change-Id: Ie49c67691540db4d4a8a21814e01d3287c5f31cd
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agofix bug 431
Vaclav Demcak [Mon, 24 Feb 2014 21:52:44 +0000 (22:52 +0100)]
fix bug 431

Change-Id: Ifd972d7e8acfbc8ed2b9d64391f156b09617d304
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
10 years agoMerge "Modify config-api exceptions, bump config and netconf to 0.2.5-SNAPSHOT."
Tony Tkacik [Mon, 24 Feb 2014 17:22:10 +0000 (17:22 +0000)]
Merge "Modify config-api exceptions, bump config and netconf to 0.2.5-SNAPSHOT."

10 years agoModify config-api exceptions, bump config and netconf to 0.2.5-SNAPSHOT.
Maros Marsalek [Tue, 11 Feb 2014 15:36:32 +0000 (16:36 +0100)]
Modify config-api exceptions, bump config and netconf to 0.2.5-SNAPSHOT.

Change ConflictingVersionException and ValidationException to be checked instead of
runtime exceptions.
Fix ConfigPusher's ConflictVersionException handling that was introduced when IOException was
used to wrap RuntimeException.
Small fixes in netconf, more refactoring of exception handling will be needed there.

Maros Marsalek: Rebase commit + fix compliation issue in ShutdownTest

Change-Id: Iab89de6ef6ced0de0a267470f860912ae3c56892
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
10 years agoAdd ModuleInfoBackedContext loading strategy to RuntimeGeneratedMapping service.
Maros Marsalek [Tue, 18 Feb 2014 15:51:09 +0000 (16:51 +0100)]
Add ModuleInfoBackedContext loading strategy to RuntimeGeneratedMapping service.

RuntimeGeneratedMappingServiceImpl is now started by the config-manager.
ModuleInfoBackedContext is filled by BundleTracker in config-manager.

This fix allows use of yang identities in netconf and restconf.

Change-Id: Id59d9d2ce08bfc9216d90cb5673e2d02aafd9151
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
10 years agoAdd logging for HashMapDataStore
Robert Varga [Tue, 18 Feb 2014 15:36:36 +0000 (16:36 +0100)]
Add logging for HashMapDataStore

Change-Id: Icea99ff59317cc387a1143762840795149d4058e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Activate enforcement of Path type"
Tony Tkacik [Tue, 18 Feb 2014 12:30:44 +0000 (12:30 +0000)]
Merge "Activate enforcement of Path type"

10 years agoActivate enforcement of Path type
Robert Varga [Tue, 18 Feb 2014 11:33:01 +0000 (12:33 +0100)]
Activate enforcement of Path type

This activates pre-prepared requirement of P to be of type Path<P>,
which had prerequisites in generated DTOs. Yangtools have been updated,
so it should be safe to activate this now.

Change-Id: I68ad3a77311e44db2e6bee1d7e2b3684090e5cbd
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoFix a few more warnings
Robert Varga [Tue, 18 Feb 2014 08:53:30 +0000 (09:53 +0100)]
Fix a few more warnings

- Remove unused string constants
- Add type arguments
- Removed unused field

Change-Id: I8fbbd238a805d9445eecc4d7c65176ce4ff36b6d
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoOptimize empty transactions
Robert Varga [Tue, 18 Feb 2014 08:34:14 +0000 (09:34 +0100)]
Optimize empty transactions

This is a micro-optimization: if we know there are no affected paths,
we used to spin an entire transaction -- which ended up revalidating an
empty delta. Let's skip the entire circus and proceed to commit
directly.

Change-Id: Ia6250663c01348dd08610c2a44dc01743761a05c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoAnother round of warnings fixes
Robert Varga [Tue, 18 Feb 2014 07:34:56 +0000 (08:34 +0100)]
Another round of warnings fixes

Removes one unused method
Fixes raw type usage where possible
Organize imports to get rid of unused/duplicate imports
Remove the use of deprecated InstanceIdentifier methods

Change-Id: I75bac5eae1e8cffcf88ab01451d3e4a8afa8c43e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoPlace an upper bound on notification concurrency
Robert Varga [Tue, 18 Feb 2014 06:43:15 +0000 (07:43 +0100)]
Place an upper bound on notification concurrency

In Cbench tests we have seen as many as 2000 threads being created. This
is certainly an overkill and thus let's place an upper bound on the
number of threads we create.

Change-Id: I6a7f429080504cbfa75679cc5879264a0622f140
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge changes I393151af,I0a302cde
Tony Tkacik [Mon, 17 Feb 2014 16:30:03 +0000 (16:30 +0000)]
Merge changes I393151af,I0a302cde

* changes:
  Fix unused field warnings
  Fix warnings about overriden versions

10 years agoFix warnings about overriden versions
Robert Varga [Sun, 16 Feb 2014 11:03:08 +0000 (12:03 +0100)]
Fix warnings about overriden versions

With proper parent structure, version overrides should not be present.

Change-Id: I0a302cde1c619af76f9290f7e5ca5080ff4fe251
Signed-off-by: Robert Varga <rovarga@cisco.com>