mdsal.git
10 years agoBug 1106: Introduced TransactionCommitFailedException.
Tony Tkacik [Thu, 5 Jun 2014 15:43:36 +0000 (17:43 +0200)]
Bug 1106: Introduced TransactionCommitFailedException.

Change-Id: Icc4392a74aee24e3d2ae69387caa76bbeccb15ca
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "BUG-614: split out RpcServiceMetadata"
Tony Tkacik [Fri, 6 Jun 2014 13:02:40 +0000 (13:02 +0000)]
Merge "BUG-614: split out RpcServiceMetadata"

10 years agoMerge "BUG-614: migrate RuntimeGeneratedInvokerPrototype"
Tony Tkacik [Fri, 6 Jun 2014 12:38:24 +0000 (12:38 +0000)]
Merge "BUG-614: migrate RuntimeGeneratedInvokerPrototype"

10 years agoMerge "BUG-614: sal-common-impl does not use xtend"
Tony Tkacik [Fri, 6 Jun 2014 12:37:46 +0000 (12:37 +0000)]
Merge "BUG-614: sal-common-impl does not use xtend"

10 years agoMerge "Bug 1073: Added Transaction Chain support to InMemoryDataTreeModification."
Ed Warnicke [Fri, 6 Jun 2014 12:21:03 +0000 (12:21 +0000)]
Merge "Bug 1073: Added Transaction Chain support to InMemoryDataTreeModification."

10 years agoBUG-614: split out RpcServiceMetadata
Robert Varga [Thu, 5 Jun 2014 11:21:54 +0000 (13:21 +0200)]
BUG-614: split out RpcServiceMetadata

RpcServiceMetadata is just another holder, no reason to define it in
xtend.

Change-Id: Ic069a9698e47a347e634289c7a96fac20c2a3d3f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: migrate RuntimeGeneratedInvokerPrototype
Robert Varga [Thu, 5 Jun 2014 11:09:41 +0000 (13:09 +0200)]
BUG-614: migrate RuntimeGeneratedInvokerPrototype

Splits off RuntimeGeneratedInvokerPrototype DTO into java. There is no
reason it should be in xtend.

Change-Id: I625d44d398cfe72be21ac33d29986c736412970e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: sal-common-impl does not use xtend
Robert Varga [Wed, 4 Jun 2014 21:20:37 +0000 (23:20 +0200)]
BUG-614: sal-common-impl does not use xtend

This is a cleanup of sal-common-impl component -- it no longer uses
xtend, so there is no reason to depend on the maven plugin nor the
support library.

Change-Id: Ifa5d9934997f8f4d6a9d4f1b9db5f251b421713c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: remove dependecy on xtend
Robert Varga [Wed, 4 Jun 2014 17:05:20 +0000 (19:05 +0200)]
BUG-614: remove dependecy on xtend

There was an unused import of xtends' Exceptions helpers -- just remove
it and reformat the class to comply.

Change-Id: Ifb8f4993414d5abbb5c9b5030de1674ed78c5409
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-1120: improve notification queue"
Tony Tkacik [Thu, 5 Jun 2014 13:46:06 +0000 (13:46 +0000)]
Merge "BUG-1120: improve notification queue"

10 years agoMerge "Bug 1073: Implemented Transaction chain on InMemoryDOMDataStore level."
Ed Warnicke [Thu, 5 Jun 2014 13:19:27 +0000 (13:19 +0000)]
Merge "Bug 1073: Implemented Transaction chain on InMemoryDOMDataStore level."

10 years agoBUG-1120: improve notification queue
Robert Varga [Mon, 2 Jun 2014 21:57:06 +0000 (23:57 +0200)]
BUG-1120: improve notification queue

This is a slight improvement in that it uses a ForwardingBlockingQueue
instead of subclassing -- allowing for easy replacement (for an
ArrayBlockingQueue for example).

Another improvement is the use of RejectedExecutionException instead of
IllegalStateException -- allowing clients to cleanly recover from thread
interruption.

Change-Id: I80040846bb34a12da1eb1e0df62a538b0551239e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-1120: optimize notification delivery fast path"
Tony Tkacik [Tue, 3 Jun 2014 07:58:50 +0000 (07:58 +0000)]
Merge "BUG-1120: optimize notification delivery fast path"

10 years agoMerge "BUG-1120: fold GenerationalListenerMap back"
Tony Tkacik [Tue, 3 Jun 2014 07:58:31 +0000 (07:58 +0000)]
Merge "BUG-1120: fold GenerationalListenerMap back"

10 years agoMerge "BUG-1120: introduce generations to ListenerMap"
Tony Tkacik [Tue, 3 Jun 2014 07:58:22 +0000 (07:58 +0000)]
Merge "BUG-1120: introduce generations to ListenerMap"

10 years agoBug 1073: Added Transaction Chain support to InMemoryDataTreeModification.
Tony Tkacik [Mon, 26 May 2014 21:29:53 +0000 (23:29 +0200)]
Bug 1073: Added Transaction Chain support to InMemoryDataTreeModification.

Added support for chaining transactions to underlying implementation.

Added test case testTransactionChain, which is documented
and illustrates basic behaviour of transaction chain -
local virtual memory, which allows to allocate new transactions
which provides view as-if previous transaction already happened.

Change-Id: I23f5622f9a6498356b3c54d53e0111f3fba33bf5
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 1073: Implemented Transaction chain on InMemoryDOMDataStore level.
Tony Tkacik [Mon, 26 May 2014 20:38:26 +0000 (22:38 +0200)]
Bug 1073: Implemented Transaction chain on InMemoryDOMDataStore level.

- Extracted Transactions implementations from InMemoryDOMDataStore
to separate classes
- implemented initial DOMStoreTransactionChain inside InMemoryDOMDataStore

Change-Id: I3033f26d2a4c141a32aaac6bc3a20e8c7ba1c28c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-1120: optimize notification delivery fast path
Robert Varga [Mon, 2 Jun 2014 14:11:20 +0000 (16:11 +0200)]
BUG-1120: optimize notification delivery fast path

Now that the interface contract is completely separated, our fast path
is as good as it gets, except it still allocates a few objects in the
lookup path. These are expected to be generally small, but we do now
they are constant while a particular generation is in place.

This means we can stategically place a LoadingCache, which will
eliminate the need to allocate the objects for notifications which are
often used -- thus the fast path really becomes a lookup by class into a
prepared iterable of listeners. For initial implementation we will place
an upper bound of 1000 entries and see where it leads us.

Change-Id: I2cf39f0d4681aa60afb9d517fb7beef99838bbab
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1120: fold GenerationalListenerMap back
Robert Varga [Mon, 2 Jun 2014 13:46:28 +0000 (15:46 +0200)]
BUG-1120: fold GenerationalListenerMap back

This moves needless indirection code form GenerationalListenerMap back
to NotificaitonBrokerImpl. Now the contract is directly between
NotificationBrokerImpl and ListenerMapGeneration

Change-Id: I0b401fa4b10e06afbc7206323d1c1f4afb19d422
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1120: introduce generations to ListenerMap
Robert Varga [Mon, 2 Jun 2014 11:58:22 +0000 (13:58 +0200)]
BUG-1120: introduce generations to ListenerMap

This removes the synchronized block in the fast path, biasing the
implementation heavily towards fast readers.

The readers need only to take a volatile reference (AtomicReference),
at which point they have an isolated read-only view of the map.

Writers on the other hand, though, are fully synchronized and are
required to perform a full copy operation, then do the modifications and
finally reinstate the read-only view through setting the atomic
reference.

Change-Id: I5d118177c1508199b66b9e26499c9fc628d3f65e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1120: Rename to GenerationalListenerMap
Robert Varga [Mon, 2 Jun 2014 12:01:12 +0000 (14:01 +0200)]
BUG-1120: Rename to GenerationalListenerMap

This name better captures the overall intent, so before we make changes
just do a rename, so it's easily reviewable.

Change-Id: I578edc26bcdc5dacbe3575dbb3ed3fe83694a9dd
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1120: promote synchronization to all entrypoints
Robert Varga [Mon, 2 Jun 2014 11:35:29 +0000 (13:35 +0200)]
BUG-1120: promote synchronization to all entrypoints

This is a temporary regression in performance: get rid of the
synchronized map at the cost of explicit synchronized methods.
Subsequent patches will remove the synchronization from the fast paths.

Change-Id: Ibe90e4e7ff99655a69b77c942ad50baec9df1ba2
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1120: introduce NotificationListenerMap
Robert Varga [Mon, 2 Jun 2014 11:26:47 +0000 (13:26 +0200)]
BUG-1120: introduce NotificationListenerMap

Introduces encapsulation of the set of listeners, such that
modifications and lookup are isolated fromt the rest of the
implementation -- thus clearly defining the entry points.

Also fixes a possible iteration failure if concurrent modification
happens while a interest listener is being added.

Change-Id: I96e0260d372425d261b352b229ae293e638c287c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-868: disallow instantiation without executor
Robert Varga [Mon, 2 Jun 2014 11:33:10 +0000 (13:33 +0200)]
BUG-868: disallow instantiation without executor

This clarifies the deprecated API. As it turns out, instantiation
without an executor should be removed, not the other way around.

Change-Id: I3a2738a4da18ef92d3e8c38d0c12f6df653bd74c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1120: fix race window in unregistration
Robert Varga [Sun, 1 Jun 2014 14:33:52 +0000 (16:33 +0200)]
BUG-1120: fix race window in unregistration

This has the nice benefit of unifying the registration/unregistration
paths, too. This requires a supporting ehnancement in yangtools, which
has been submitted at https://git.opendaylight.org/gerrit/#/c/7568/

Change-Id: Ifd489d6eaf5b7feb4a6efaa09bd468d5818c24cc
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-832 Refactor netconf connector"
Tony Tkacik [Mon, 2 Jun 2014 08:50:39 +0000 (08:50 +0000)]
Merge "BUG-832 Refactor netconf connector"

10 years agoBUG-832 Refactor netconf connector
Maros Marsalek [Tue, 29 Apr 2014 12:23:52 +0000 (14:23 +0200)]
BUG-832 Refactor netconf connector

- Extract general API for remote connectors
- Split NetconfDevice into more classes
- Make data operations over netconf device in inventory binding aware (fixes 969)
- Add dependency on binding-broker
- Make connector crash if schema is not present for device
- Improve logging

Change-Id: Idf4fa4994b3ac067bd69e9cd629b6d8c225d7b77
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
10 years agoBUG-614: degrade NotifyTask to Runnable
Robert Varga [Sun, 1 Jun 2014 09:00:48 +0000 (11:00 +0200)]
BUG-614: degrade NotifyTask to Runnable

The call() method always returned null anyway, so we might as well make it
Runnable.

Change-Id: I6be36490aba33ba1bf4b205ba4d9b0aa8160dbdf
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: do not use xtend's library
Robert Varga [Sun, 1 Jun 2014 08:01:47 +0000 (10:01 +0200)]
BUG-614: do not use xtend's library

Convert from using xtendlib to using guava directly.

Change-Id: Ic72af54e0b1480658fb4067821969419bbab2e8e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: No need to build a future list
Robert Varga [Sun, 1 Jun 2014 07:52:44 +0000 (09:52 +0200)]
BUG-614: No need to build a future list

It is obvious that the constructed list of futures is never going to be
used, so let's not construct it at all.

Change-Id: I506e33da52c53b5e63088a5c8ae0bb206eb6a720
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: Remove xtendisms
Robert Varga [Sun, 1 Jun 2014 06:09:06 +0000 (08:09 +0200)]
BUG-614: Remove xtendisms

Generated xtend code is quite verbose and sometimes the logic gets quite
obfuscated. This patch brings the code more in-line to what a programmer
might write.

Change-Id: I9a04012a2ba106082e9b1eef25bd9cb6958736cd
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: explicitly use old constructor
Robert Varga [Sun, 1 Jun 2014 11:43:54 +0000 (13:43 +0200)]
BUG-614: explicitly use old constructor

This makes use of the legacy constructor until a concrete migration path
is selected.

Change-Id: I375504303c7e134f03bf649b360327e9076d2d08
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: Hide the executor and improve logging
Robert Varga [Sun, 1 Jun 2014 06:01:21 +0000 (08:01 +0200)]
BUG-614: Hide the executor and improve logging

As part of the xtend->Java rewrite, we get rid of unnecessary
getExecutor() and improve logging a bit.

Change-Id: I9c7052472289f701a289f4ba76312fb28af18a3f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-614: convert NotificationBrokerImpl
Robert Varga [Sat, 31 May 2014 07:34:09 +0000 (09:34 +0200)]
BUG-614: convert NotificationBrokerImpl

This does a straight xtend->java conversion by moving xtend-generated
java files into the repository instead of xtend. This is the first step
in optimizing NotificationBrokerImpl.

Change-Id: Ie8dc1dfb6c5b9e80a8d79a5de31410100b35c7fc
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 1003: Restconf - remove whitespace on input"
Tony Tkacik [Fri, 30 May 2014 12:33:04 +0000 (12:33 +0000)]
Merge "Bug 1003: Restconf - remove whitespace on input"

10 years agoMerge "Bug 1073: Introduced Transaction Chain to DOMStore APIs."
Ed Warnicke [Fri, 30 May 2014 12:25:16 +0000 (12:25 +0000)]
Merge "Bug 1073: Introduced Transaction Chain to DOMStore APIs."

10 years agoBUG-509: cleanup datastore interafaces
Robert Varga [Thu, 29 May 2014 13:04:30 +0000 (15:04 +0200)]
BUG-509: cleanup datastore interafaces

This removes unused methods and adds interface contract documentation.

Change-Id: I7bc57d034da1d0503d76afa6f4c09ce6a6bfe669
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: remove unnecessary Version objects
Robert Varga [Wed, 28 May 2014 22:02:17 +0000 (00:02 +0200)]
BUG-509: remove unnecessary Version objects

Testing has revealed the datastore instantiates effectively a version
per tree node. This turns out to be not needed, as we really just need a
single version per commit -- which can be shared between nodes, as the
(node,version) tuple remains unique.

So let's just instantiate a single version when we start the
transaction, which we need to do anyway, and use it for all
nodes/subtrees added or modified. This places an upper bound on Version
objects retained to the number of transactions committed (not counting
no-ops).

Change-Id: I40d095ec230eee8b5af2409c1e8ee61a1860a9d3
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: use concurrent hash-trie Map
Robert Varga [Fri, 23 May 2014 11:11:39 +0000 (13:11 +0200)]
BUG-509: use concurrent hash-trie Map

This patch switches to using concurrent hash-trie map for metadata
tracking. It has the nice feature of having O(1) concurrent snapshots,
which should give us better performance when dealing with large children
bases.

This is a trade-off, please refer to yangtools.util.MapAdaptor for
system properties which tune its behavior.

Change-Id: I2ddb81a1296cc17528a605eeaeda1f303560fb55
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-648: include yangtools.util package"
Tony Tkacik [Thu, 29 May 2014 10:37:59 +0000 (10:37 +0000)]
Merge "BUG-648: include yangtools.util package"

10 years agoBUG-648: include yangtools.util package
Robert Varga [Wed, 28 May 2014 17:02:01 +0000 (19:02 +0200)]
BUG-648: include yangtools.util package

This include yangtools.util, which will hold various utility classes.
First of which is MapAdaptor, needed to solve the 'copying hashmaps'
problem.

Change-Id: Ifdb7709e1b83d07d1e96832954987072f82274ae
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-614: convert RuntimeCodeSpecification"
Tony Tkacik [Wed, 28 May 2014 08:29:56 +0000 (08:29 +0000)]
Merge "BUG-614: convert RuntimeCodeSpecification"

10 years agoBUG-614: convert RuntimeCodeSpecification
Robert Varga [Wed, 28 May 2014 07:14:33 +0000 (09:14 +0200)]
BUG-614: convert RuntimeCodeSpecification

This migrates RuntimeCodeSpecification from xtend to Java, increasing
its efficiency.

Change-Id: I00b3ab7f3a47e0d3fc71e55b4bec99364bfa8e5f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-620: replace xtend version of classes with Java versions
Robert Varga [Tue, 20 May 2014 23:08:23 +0000 (16:08 -0700)]
BUG-620: replace xtend version of classes with Java versions

replace xtend versions of classes with java versions where the java was
generated by hand based on the source of the xtend file as well as leveraging
the code generated from the xtend source

Change-Id: I36a3a61608710543f66c36f7d5179cf976257953
Signed-off-by: David K. Bainbridge <dbainbri.ciena@gmail.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 1073: Introduced Transaction Chain to DOMStore APIs.
Tony Tkacik [Mon, 26 May 2014 10:03:23 +0000 (12:03 +0200)]
Bug 1073: Introduced Transaction Chain to DOMStore APIs.

Introduced concept of TransactionChain to DOMStore APIs.
Decomposed DOMStore to DOMStoreTransactionFactory
to allow factory methods reuse between DOMStoreTransactionChain
and DOMStore itself.

Change-Id: I186242e40e8ada098deb431b09db67707371af58
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge changes I7c36c88e,I7c5d97c7
Tony Tkacik [Mon, 26 May 2014 19:30:58 +0000 (19:30 +0000)]
Merge changes I7c36c88e,I7c5d97c7

* changes:
  BUG-1070: make BundleContext required
  BUG-1070: allow for URL registration failing

10 years agoBUG-1070: make BundleContext required
Robert Varga [Mon, 26 May 2014 08:05:40 +0000 (10:05 +0200)]
BUG-1070: make BundleContext required

It does not make sense to instantiated
GlobalBundleScanningSchemaServiceImpl without a bundlecontext, so let's
make it required in the constructor, making interactions more clear.

Change-Id: I7c36c88e2e26163e0ef41480ea8f5d1d79353e5f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1070: allow for URL registration failing
Robert Varga [Mon, 26 May 2014 07:56:15 +0000 (09:56 +0200)]
BUG-1070: allow for URL registration failing

As part of the error reporting effor, the API contract will change, such
that the URLs can get parsed during registration, potentially throwing a
checked exception. This adds the preparatory groundwork and optimized
the codepath, as it's called repeatedly during controller startup.

Change-Id: I7c5d97c7be6cc488f8b61a99d8e27804ce24e523
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 1003: Restconf - remove whitespace on input
tpantelis [Mon, 26 May 2014 05:47:18 +0000 (01:47 -0400)]
Bug 1003: Restconf - remove whitespace on input

JsonReader, XmlReader:
   - Trimmed whitespace on leaf data input

AbsractRpcExecutor, BrokerRpcExecutor, MountPointRpcExecutor:
   - Modified to handle IllegalArgumentEx and UnsupportedOperationEx
     thrown from invokeRpc to throw appropriate ResconfDocumentedEx.

ResconfDocumentedExeptionMapper, RestconfError, RestconfErrorTest:
   - I discovered that the Response.Status.NOT_IMPLEMENTED jaxrs enum
     is defined in the enum class that is used at compile time but
     isn't defined in the run time enum class provided by jersey.
     So I changed RestconfError.ErrorTag to store the integer status
     code (501) instead of the enum. Ideally compile and run time
     should use the same lib.

- SchemaAwareRpcBroker:
   - Modified to throw UnsupportedOperationEx if no RPC impl is found
     so the restconf front-end can yield the appropriate
     501 (Not Implemented) status code.

Change-Id: Ibfa1dc7ff1526b6d352b9f4e6be2aae0d19ab655
Signed-off-by: tpantelis <tpanteli@brocade.com>
10 years agoMerge changes Ieef23a07,I8057763e
Tony Tkacik [Fri, 23 May 2014 15:02:57 +0000 (15:02 +0000)]
Merge changes Ieef23a07,I8057763e

* changes:
  BUG-868: migrate users of CompositeNode.getChildren()
  BUG-731: Warning suppression is not necessary

10 years agoMerge "BUG-509: introduce Version concept"
Tony Tkacik [Fri, 23 May 2014 14:09:24 +0000 (14:09 +0000)]
Merge "BUG-509: introduce Version concept"

10 years agoMerge "BUG-509: fix ModifiedNode locking"
Tony Tkacik [Fri, 23 May 2014 14:08:59 +0000 (14:08 +0000)]
Merge "BUG-509: fix ModifiedNode locking"

10 years agoMerge "BUG-509: migrate to TreeNodes"
Tony Tkacik [Fri, 23 May 2014 14:07:44 +0000 (14:07 +0000)]
Merge "BUG-509: migrate to TreeNodes"

10 years agoMerge "BUG-509: create data tree SPI package"
Tony Tkacik [Fri, 23 May 2014 13:56:42 +0000 (13:56 +0000)]
Merge "BUG-509: create data tree SPI package"

10 years agoMerge "BUG-509: add some documentation"
Tony Tkacik [Fri, 23 May 2014 13:56:17 +0000 (13:56 +0000)]
Merge "BUG-509: add some documentation"

10 years agoMerge "Bug 716: Errors on controller shutdown"
Tony Tkacik [Fri, 23 May 2014 12:42:54 +0000 (12:42 +0000)]
Merge "Bug 716: Errors on controller shutdown"

10 years agoBUG-868: migrate users of CompositeNode.getChildren()
Robert Varga [Fri, 23 May 2014 10:35:19 +0000 (12:35 +0200)]
BUG-868: migrate users of CompositeNode.getChildren()

This converts the callers from getChildren() to getValue(), eliminating
around a hundred of warnings in eclipse.

Change-Id: Ieef23a07ac02b719866ec447a7e3365ab11e150a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: Warning suppression is not necessary
Robert Varga [Fri, 23 May 2014 10:09:44 +0000 (12:09 +0200)]
BUG-731: Warning suppression is not necessary

This removes unnecessary SuppressWarnings.

Change-Id: I8057763e9c9b71a52b2f615b0ffafb0dee3cbe78
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: introduce Version concept
Robert Varga [Thu, 22 May 2014 21:35:02 +0000 (23:35 +0200)]
BUG-509: introduce Version concept

This patch introduces the concept of a Version, which is disconnected
from any ordinal number. This is useful for saving memory, as the
versioning of TreeNodes needs to only detect version mismatches and not
which version is historically newer.

Change-Id: I625d9d945ff3fd416dd82bb3f1ff4268f2001e5a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: fix ModifiedNode locking
Robert Varga [Thu, 22 May 2014 21:50:05 +0000 (23:50 +0200)]
BUG-509: fix ModifiedNode locking

This removes the 'sealed' flag from ModifiedNode, as it is not a
publicly-visible object. Also drop the synchronized blocks and
reintroduce them in InMemoryDataTreeModification, which is the user
entrypoint.

Change-Id: I6c8be61701134bd8f645b8d4f0a8ef3ae218f0ac
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: migrate to TreeNodes
Robert Varga [Thu, 22 May 2014 20:58:55 +0000 (22:58 +0200)]
BUG-509: migrate to TreeNodes

This patch performs the switchover to SPI-provided TreeNodes. It also
extracts the information needed for checking applicability of a
modification into a separate interface. Also adds some documentation in
the non-trivial write+merge path.

Change-Id: I83f5ca30bff21774759f9b675b19b6e9622076a2
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: create data tree SPI package
Robert Varga [Thu, 22 May 2014 20:49:47 +0000 (22:49 +0200)]
BUG-509: create data tree SPI package

This patch introduces an SPI package, which contains the metadata tree
node abstraction and reference implementation. This will substitute the
StoreMetadataNode class.

Major improvement is the isolation of lifecycle from the rest of the
implementation and major reduction in memory usage, as leaf nodes no
longer need to lug a HashMap around.

Change-Id: I89215672006b1ed6064feaf186c94c05550d299e
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: add some documentation
Robert Varga [Thu, 22 May 2014 05:38:07 +0000 (07:38 +0200)]
BUG-509: add some documentation

Documents AlwaysFailOperation and DataNodeContainerModificationStrategy

Change-Id: Ibb67dc5f4a829547538ba02c3eac4f995a6fe6ef
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: break up SchemaAwareApplyOperation
Robert Varga [Wed, 21 May 2014 11:55:41 +0000 (13:55 +0200)]
BUG-509: break up SchemaAwareApplyOperation

This patch breaks up the SchemaAwareApplyOperation class by moving its
abstract subclasses out, allowing their subclasses to be retained within
them. This will allow to better understand the relationships between the
classes.

Change-Id: I0acf48fa7c38d600fe38a8ec9951858f46be18e0
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: move snapshotCache get out of try block
Robert Varga [Wed, 21 May 2014 13:21:14 +0000 (15:21 +0200)]
BUG-509: move snapshotCache get out of try block

This just moves the get which cannot throw out of the 'catch Exception'
block.

Change-Id: I936e987fa6b9e8b3eecb35656c586e3afb070046
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-509: merge InMemoryDataTreeModification.resolveSnapshot()"
Tony Tkacik [Wed, 21 May 2014 17:24:58 +0000 (17:24 +0000)]
Merge "BUG-509: merge InMemoryDataTreeModification.resolveSnapshot()"

10 years agoMerge "BUG-509: there is only one createRecursively()"
Tony Tkacik [Wed, 21 May 2014 17:23:52 +0000 (17:23 +0000)]
Merge "BUG-509: there is only one createRecursively()"

10 years agoMerge "BUG-509: Remove unused methods"
Tony Tkacik [Wed, 21 May 2014 17:23:08 +0000 (17:23 +0000)]
Merge "BUG-509: Remove unused methods"

10 years agoMerge "BUG-509: node version is always required"
Tony Tkacik [Wed, 21 May 2014 17:22:30 +0000 (17:22 +0000)]
Merge "BUG-509: node version is always required"

10 years agoBUG-509: merge InMemoryDataTreeModification.resolveSnapshot()
Robert Varga [Wed, 21 May 2014 09:40:36 +0000 (11:40 +0200)]
BUG-509: merge InMemoryDataTreeModification.resolveSnapshot()

This patch adds some minimal documentation and merges the two
resolveSnapshot() methods into one, making the call stack a bit easier
to understand.

Change-Id: Ib23fccdc9d2987aa255483becc63155904ebc332
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: there is only one createRecursively()
Robert Varga [Tue, 20 May 2014 14:25:33 +0000 (16:25 +0200)]
BUG-509: there is only one createRecursively()

The naming and exposure of two and three arugment variants made things
confusing -- let it be clear there is only one version.

Change-Id: If05620e99c2200ee10c1881de8eecd015f18eb9b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Remove unused methods
Robert Varga [Tue, 20 May 2014 14:12:41 +0000 (16:12 +0200)]
BUG-509: Remove unused methods

These two have no users, so let's remove them to make navigating the
code easier.

Change-Id: I515570db5a8a4095ff525f1ca5614f9f627616df
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: node version is always required
Robert Varga [Tue, 20 May 2014 13:42:32 +0000 (15:42 +0200)]
BUG-509: node version is always required

This just clarifies the requirement to know the node version you are
attempting to build before instantiating a builder. Also remove some
unused methods.

Change-Id: I09406bbedee963624b43a280529d4b8cbc9931c6
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-509: cleanup StoreMetadataNode"
Tony Tkacik [Wed, 21 May 2014 15:19:53 +0000 (15:19 +0000)]
Merge "BUG-509: cleanup StoreMetadataNode"

10 years agoMerge "BUG-509: Refactor listener walking"
Tony Tkacik [Wed, 21 May 2014 15:19:27 +0000 (15:19 +0000)]
Merge "BUG-509: Refactor listener walking"

10 years agoBUG-509: cleanup StoreMetadataNode
Robert Varga [Tue, 20 May 2014 13:10:29 +0000 (15:10 +0200)]
BUG-509: cleanup StoreMetadataNode

Removes StoreTreeNode<StoreMetadataNode> interface and tightens
visibility of a few methods.

Change-Id: I3bbf303025046f217bdcea81fcc14c420dbf9478
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Refactor listener walking
Robert Varga [Tue, 20 May 2014 08:52:59 +0000 (10:52 +0200)]
BUG-509: Refactor listener walking

This patch creates a proper abstraction for examining a
DataTreeCandidate for changes. This has the nice property of finishing
the hiding of all implementation details behind proper interfaces, such
that our implementation is free to do proper lifecycle as it pleases.

Also gets rid of the AutoCloseable from candidate. It can be
reintroduced in the need appears.

Change-Id: I13301548594d4ae34e929c7202661997ea5aca90
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 953 - Change the BindingIndependentConnector to handle RpcInvocationStrate...
Tony Tkacik [Tue, 20 May 2014 14:57:56 +0000 (14:57 +0000)]
Merge "Bug 953 - Change the BindingIndependentConnector to handle RpcInvocationStrategies consistently."

10 years agoMerge "BUG-509: Move ModificationApplyOperation"
Tony Tkacik [Tue, 20 May 2014 13:42:35 +0000 (13:42 +0000)]
Merge "BUG-509: Move ModificationApplyOperation"

10 years agoMerge "BUG-509: remove unused code"
Tony Tkacik [Tue, 20 May 2014 13:42:07 +0000 (13:42 +0000)]
Merge "BUG-509: remove unused code"

10 years agoMerge "BUG-509: Move DataTree concepts into separate package"
Tony Tkacik [Tue, 20 May 2014 13:41:49 +0000 (13:41 +0000)]
Merge "BUG-509: Move DataTree concepts into separate package"

10 years agoMerge "BUG-509: simple cleanup of DataTreeModification"
Tony Tkacik [Tue, 20 May 2014 13:39:41 +0000 (13:39 +0000)]
Merge "BUG-509: simple cleanup of DataTreeModification"

10 years agoMerge "BUG-509: Rename MutableDataTree to DataTreeModification"
Tony Tkacik [Tue, 20 May 2014 13:38:12 +0000 (13:38 +0000)]
Merge "BUG-509: Rename MutableDataTree to DataTreeModification"

10 years agoBug 953 - Change the BindingIndependentConnector to handle RpcInvocationStrategies...
Devin Avery [Mon, 12 May 2014 15:52:51 +0000 (11:52 -0400)]
Bug 953 - Change the BindingIndependentConnector to handle RpcInvocationStrategies consistently.

Patch Set 1/2/3
*Combined the RpcInvocationStrategies into a single intelligence class that handles the varying strategies since the majority of the intelligence was overlapped.
*Moved some logic out of the BindingIndependentConnector to simplify it.
*Added an RpcInvocationStrategyTest to validate logic in RpcInvocationStrategy.

Patch Set 4
* Removed tabs and trailing whitespace

Patch Set 6
* Addressed NPE that would happen when no input was provided to a method requiring input.

Change-Id: I8d6916819105c5530c9b501e1ae973cdcb769ea7
Signed-off-by: Devin Avery <devin.avery@brocade.com>
10 years agoMerge "BUG-731: fix warnings from missing generic arguments"
Tony Tkacik [Tue, 20 May 2014 13:19:25 +0000 (13:19 +0000)]
Merge "BUG-731: fix warnings from missing generic arguments"

10 years agoMerge "BUG-1018 Implement BackwardsCompatible BI broker data notifications"
Tony Tkacik [Tue, 20 May 2014 13:11:24 +0000 (13:11 +0000)]
Merge "BUG-1018 Implement BackwardsCompatible BI broker data notifications"

10 years agoMerge "BUG-868: move to use unified ClassLoaderUtils"
Tony Tkacik [Tue, 20 May 2014 12:51:02 +0000 (12:51 +0000)]
Merge "BUG-868: move to use unified ClassLoaderUtils"

10 years agoBUG-509: Move ModificationApplyOperation
Robert Varga [Tue, 20 May 2014 07:45:36 +0000 (09:45 +0200)]
BUG-509: Move ModificationApplyOperation

This patch moves ModificationApplyOperation at al. to the data tree
package, improving its isolation.

Change-Id: I37081222e30c149a87baf6f4a5d3ce2e84f13acb
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: remove unused code
Robert Varga [Tue, 20 May 2014 07:21:43 +0000 (09:21 +0200)]
BUG-509: remove unused code

Removes unused code, writen -> written, adds a FIXME

Change-Id: Id0795edc23f2aef6f73e42d54be877003daf4244
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Move DataTree concepts into separate package
Robert Varga [Mon, 19 May 2014 09:56:10 +0000 (11:56 +0200)]
BUG-509: Move DataTree concepts into separate package

Create a new package for the data tree and related concepts to clean out
interactions. Also create and document the API and hide implementation
classes from the user itself.

Change-Id: I69f2a9b7bcac863b531f46f669bfd2fcfcd5b743
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: simple cleanup of DataTreeModification
Robert Varga [Mon, 19 May 2014 09:38:38 +0000 (11:38 +0200)]
BUG-509: simple cleanup of DataTreeModification

Rename rootModification to rootNode to clarify what it is
Use field updated to fix seals to save some memory

Change-Id: I0fe7f58a3c15613c15198830b77bc28a84a9006a
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: Rename MutableDataTree to DataTreeModification
Robert Varga [Mon, 19 May 2014 09:30:53 +0000 (11:30 +0200)]
BUG-509: Rename MutableDataTree to DataTreeModification

This name better reflects the semantics of the class. Also add some
javadoc documentation.

Change-Id: I7292c134bf87af8c0518e2905c7bd2b628c37a25
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: fix warnings from missing generic arguments
Robert Varga [Mon, 19 May 2014 20:20:29 +0000 (22:20 +0200)]
BUG-731: fix warnings from missing generic arguments

This just goes in and adds wildcard generic arguments where appropriate,
removing ~100 eclipse warnings.

Change-Id: I34269906d6b78618646876f6448d3066bf036105
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-868: move to use unified ClassLoaderUtils
Robert Varga [Sun, 18 May 2014 14:39:10 +0000 (16:39 +0200)]
BUG-868: move to use unified ClassLoaderUtils

This is a follow-up for yangtools patch
https://git.opendaylight.org/gerrit/#/c/7160/ . It updates the imports
to use the newly exposed version of ClassLoaderUtils.

Change-Id: I7178475ae698c3ba7120cf5ddfe56c4094f23d8b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 953 - Enable mounted RPC calls via RestConf"
Tony Tkacik [Mon, 19 May 2014 12:35:53 +0000 (12:35 +0000)]
Merge "Bug 953 - Enable mounted RPC calls via RestConf"

10 years agoMerge "BUG-1027: rework lookup for clarity"
Tony Tkacik [Mon, 19 May 2014 09:28:43 +0000 (09:28 +0000)]
Merge "BUG-1027: rework lookup for clarity"

10 years agoMerge "BUG-509: reorganize data tree abstractions."
Tony Tkacik [Mon, 19 May 2014 09:16:13 +0000 (09:16 +0000)]
Merge "BUG-509: reorganize data tree abstractions."

10 years agoBUG-1018 Implement BackwardsCompatible BI broker data notifications
Maros Marsalek [Mon, 19 May 2014 09:10:14 +0000 (11:10 +0200)]
BUG-1018 Implement BackwardsCompatible BI broker data notifications

Finish support for notifying BI data change listeners in backwards compatible broker.

Change-Id: I221a1e6937c8f9c493444afd0756e6c23fd4b18f
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
10 years agoMerge "BUG-868: do not use InstanceIdentifier.getPath()"
Tony Tkacik [Mon, 19 May 2014 08:42:21 +0000 (08:42 +0000)]
Merge "BUG-868: do not use InstanceIdentifier.getPath()"

10 years agoBUG-868: do not use InstanceIdentifier.getPath()
Robert Varga [Mon, 19 May 2014 06:45:47 +0000 (08:45 +0200)]
BUG-868: do not use InstanceIdentifier.getPath()

This simplifies the NodeMapping class significantly by using the
utility methods shipped in InstanceIdentifier itself.

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