mdsal.git
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 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>
10 years agoBUG-509: reorganize data tree abstractions.
Robert Varga [Thu, 15 May 2014 13:14:03 +0000 (15:14 +0200)]
BUG-509: reorganize data tree abstractions.

This patch has no functional changes, it only rearranges code such that
the flow of data and object lifecycle becomes more obvious. This will
make metadata lifecycle easier to manage.

Change-Id: I10fd912433b72e25729d163c27699a5a5c47e305
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-1027: rework lookup for clarity
Robert Varga [Sun, 18 May 2014 10:10:21 +0000 (12:10 +0200)]
BUG-1027: rework lookup for clarity

This patch gets rid of the nasty 'catch Exception', making the lookup
fail as soon as a DeserializationException is thrown. We account for
most of the checked exceptions, so this should not be a problem.

Change-Id: I3d0440933ebc30ba32a06690ebe326e18addf613
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug 967: Do not translate leaf Instance Identifiers."
Ed Warnicke [Fri, 16 May 2014 15:15:24 +0000 (15:15 +0000)]
Merge "Bug 967: Do not translate leaf Instance Identifiers."

10 years agoBug 967: Do not translate leaf Instance Identifiers.
Tony Tkacik [Fri, 16 May 2014 11:02:33 +0000 (13:02 +0200)]
Bug 967: Do not translate leaf Instance Identifiers.

Improved extraction of Instance Identifiers from
DOM Data Change Event.

Logs in console are poluted with DeserializationException,
which fails to deserialize DOM Instance Identifier
to Binding Instance Identifier.

Added explicit check against schema context to
see if Instance Identifier is representable
in Binding Format, if not we will not report
is as part of subtree Data Change event.

Change-Id: Iaee2390fd089e0a2d66ec658aab4e7dab2a93a46
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 953 - Enable mounted RPC calls via RestConf
Devin Avery [Thu, 8 May 2014 13:00:29 +0000 (09:00 -0400)]
Bug 953 - Enable mounted RPC calls via RestConf

Modify RestconfImpl to allow RPC calls via mount points.
===
MountPointImpl - wired pass through call for invokeRpc that was missing.
RestconfImpl - abstract the execution of RPC out to an "RpcExecutor" class.
Remaining classes - added tests to cover new code, including the toaster.yang file (modified from original) to test various RPC calls.

- Patch Set 8 - fixed unit tests which were failing (one failure due to missing future enhancement, another due to missing test rpc in yang file).
- Patch Set 10 - fixed run failure by addressing package import.
- Patch Set 13 - Cleaned up exception throws / used Preconditions checking.
- Patch Set 14 - Rebased
- Patch Set 15 - Added back change that was accidently removed during merge / rebase.

Change-Id: Ib214b4c82ffc487ee2f7b912e65d5c189b82154a
Signed-off-by: Devin Avery <devin.avery@brocade.com>
10 years agoMerge "Bug 509: Improve conflict detection of leaf merges"
Tony Tkacik [Thu, 15 May 2014 15:50:38 +0000 (15:50 +0000)]
Merge "Bug 509: Improve conflict detection of leaf merges"

10 years agoMerge changes Ibe0145be,I0764bfa9
Tony Tkacik [Thu, 15 May 2014 15:50:08 +0000 (15:50 +0000)]
Merge changes Ibe0145be,I0764bfa9

* changes:
  BUG-509: remove DataAndMetadataSnapshot.Builder.getDataTree()
  BUG-509: remove StoreMetadataNode.children()

10 years agoMerge "BUG-509: remove StoreUtils.initialChangeEvent()"
Tony Tkacik [Thu, 15 May 2014 15:49:44 +0000 (15:49 +0000)]
Merge "BUG-509: remove StoreUtils.initialChangeEvent()"

10 years agoMerge "BUG-509: StoreUtils should operate on NormalizedNode"
Tony Tkacik [Thu, 15 May 2014 15:49:11 +0000 (15:49 +0000)]
Merge "BUG-509: StoreUtils should operate on NormalizedNode"

10 years agoBug 509: Improve conflict detection of leaf merges
Robert Varga [Thu, 15 May 2014 14:55:02 +0000 (16:55 +0200)]
Bug 509: Improve conflict detection of leaf merges

Original conflict detection for merge action on leaves
only looked at node version and subtree version, which
caused the transaction to fail even if the leaf was
unmodified and contained the same value.

Conflict detection now checks if the leaves are not same,
and only in that case it checks for concurrent writes.

Change-Id: I5e43233e86adf96e3dad2a93cdcf512b3d17977a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: remove DataAndMetadataSnapshot.Builder.getDataTree()
Robert Varga [Thu, 15 May 2014 12:37:19 +0000 (14:37 +0200)]
BUG-509: remove DataAndMetadataSnapshot.Builder.getDataTree()

This getter and its associated field is completely unused. Remove it to
improve clarity.

Change-Id: Ibe0145bee610c7a2b147852f43d0492ca5061adc
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Cosmetics: fix typo facilitate"
Ed Warnicke [Thu, 15 May 2014 11:12:31 +0000 (11:12 +0000)]
Merge "Cosmetics: fix typo facilitate"

10 years agoBUG-509: remove StoreMetadataNode.children()
Robert Varga [Thu, 15 May 2014 09:10:36 +0000 (11:10 +0200)]
BUG-509: remove StoreMetadataNode.children()

This patch removes the now-unneeded access, which means the children
iteration order is no longer part of StoreMetadataNode, allowing us to
use more memory-efficient HashMap instead of LinkedHashMap. Let's do
precisely that.

Change-Id: I0764bfa9861f9df4d3014151db96edf1024e3f9b
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: remove StoreUtils.initialChangeEvent()
Robert Varga [Thu, 15 May 2014 08:56:48 +0000 (10:56 +0200)]
BUG-509: remove StoreUtils.initialChangeEvent()

This method is unused. Remove it, such that StoreUtils are now
completely independent of org.opendaylight.controller.md.sal, making
them a candidate for move to yang-data-*.

Change-Id: Idf945aee6fd4a80f8ca58fc50bcc997880a60ec0
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-509: StoreUtils should operate on NormalizedNode
Robert Varga [Thu, 15 May 2014 08:47:00 +0000 (10:47 +0200)]
BUG-509: StoreUtils should operate on NormalizedNode

This prunes the use of MetadataNode from StoreUtils. It turns out it is
completely unnecessary. This removes the last user of
Metadata.getChildren(), which will be removed in a subsequent patch.

Change-Id: I778e77b826576b8fa53e040a825d615dab7d253f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBug 967: Fixed incorrect delete was addressing augmentation of augmentation
Tony Tkacik [Wed, 7 May 2014 11:10:40 +0000 (13:10 +0200)]
Bug 967: Fixed incorrect delete was addressing  augmentation of augmentation

DataNormalizationOperation was constructed incorrectly, if augmentation
was already augmented, which leaded to incorrect construction of instance
identifier for delete.

Patchset 2: Fixed normalization in cases of mixin inside mixin
e.g. augmentation containing choice with cases.

Change-Id: I580e5dfe41ce504775ac454b66368037f4d707bb
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBUG-981: Fixed incorrect condition in ResolveDataChangeEventsTask
Robert Varga [Tue, 13 May 2014 11:52:10 +0000 (13:52 +0200)]
BUG-981: Fixed incorrect condition in ResolveDataChangeEventsTask

When we insert a new subtree, we need to make sure to call serialization
on the entire, such that any new elements which appear have their
classed attached to paths.

This reuses a previous code path, which pruned the walk tree as soon as
it encountered a node which did not have any listeners attached (thus
improving performance when we're gathering listeners).

In this specific case, though, this check is not correct: we need to
walk the path because it may be placing new data in the subtree.

At the same time add debug statements which made pinpointing this
problem possible.

Change-Id: I1687ba45817a84ea4a888496a90defc5896216c9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Bug-574 Added a 4th RPC Invocation strategy for the case where the RPC has...
Tony Tkacik [Mon, 12 May 2014 18:48:31 +0000 (18:48 +0000)]
Merge "Bug-574 Added a 4th RPC Invocation strategy for the case where the RPC has an output, but no input"

10 years agoBug-574 Added a 4th RPC Invocation strategy for the case where the RPC has an output...
Mayank Agarwal [Mon, 14 Apr 2014 21:58:31 +0000 (14:58 -0700)]
Bug-574 Added a 4th RPC Invocation strategy for the case where the RPC has an output, but no input

Change-Id: I7d1a596f3bb1362044cc240a15bdb9bb7d094c55
Signed-off-by: Mayank Agarwal <mayagarw@cisco.com>
10 years agoMerge "Bug 508: Improved error reporting for failed canCommit phase."
Ed Warnicke [Mon, 12 May 2014 14:41:49 +0000 (14:41 +0000)]
Merge "Bug 508: Improved error reporting for failed canCommit phase."

10 years agoMerge "Bug 981: Fixed accidental shaddowing of data in Data Change Event."
Giovanni Meo [Mon, 12 May 2014 13:53:28 +0000 (13:53 +0000)]
Merge "Bug 981: Fixed accidental shaddowing of data in Data Change Event."

10 years agoBug 508: Improved error reporting for failed canCommit phase.
Tony Tkacik [Mon, 12 May 2014 10:33:58 +0000 (12:33 +0200)]
Bug 508: Improved error reporting for failed canCommit phase.

Original implementation did not provide enough information
when transaction precondition failed.

Introduced new Exception DataPreconditionFailedException
which captures fail reason and path to subtree
for which precondition failed.

This helps debug accidental overwrites / conflicting
writes between transactions.

Change-Id: I0133fd3fdb8e6492bf457dab7b20efa67fd6e2af
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Bug 849: Fixed NPE in Translated Data Change Events."
Giovanni Meo [Mon, 12 May 2014 11:05:43 +0000 (11:05 +0000)]
Merge "Bug 849: Fixed NPE in Translated Data Change Events."

10 years agoBug 981: Fixed accidental shaddowing of data in Data Change Event.
Tony Tkacik [Sun, 11 May 2014 20:46:24 +0000 (22:46 +0200)]
Bug 981: Fixed accidental shaddowing of data in Data Change Event.

Not all Normalized DOM InstanceIdentifier has their counterpart
in Binding-Aware representation. Added explicit check to
detect mixin instance-identifiers which could lead to
incorrect deserialization into maps and shadowing parent data.

Change-Id: I66166f50c636ce0dfcd962efac7fc488da622336
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "BUG-648: Improve performance by reusing old data nodes"
Tony Tkacik [Mon, 12 May 2014 07:05:37 +0000 (07:05 +0000)]
Merge "BUG-648: Improve performance by reusing old data nodes"

10 years agoMerge "BUG-731: RoutedRegistration.close() should not throw"
Tony Tkacik [Mon, 12 May 2014 07:03:49 +0000 (07:03 +0000)]
Merge "BUG-731: RoutedRegistration.close() should not throw"

10 years agoMerge "Add serialVersionUID to Serializable"
Tony Tkacik [Mon, 12 May 2014 07:02:33 +0000 (07:02 +0000)]
Merge "Add serialVersionUID to Serializable"

10 years agoMerge "BUG-868: stop using InstanceIdentifier.builder()"
Tony Tkacik [Mon, 12 May 2014 07:02:17 +0000 (07:02 +0000)]
Merge "BUG-868: stop using InstanceIdentifier.builder()"

10 years agoBUG-648: Improve performance by reusing old data nodes
Robert Varga [Thu, 8 May 2014 16:29:30 +0000 (18:29 +0200)]
BUG-648: Improve performance by reusing old data nodes

This patchset gives yang-data-api the chance to optimize copy
operations we execute when creating a new generation.

Change-Id: Ib23a87e116a0a04f7fd4f2b709d7239e213ea744
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoAdd serialVersionUID to Serializable
Robert Varga [Sun, 11 May 2014 07:16:29 +0000 (09:16 +0200)]
Add serialVersionUID to Serializable

Serializable classes have to have serialVersionUID. Add it where it's
missing.

Change-Id: I23689005878280b6ee9f97fb12ae0b15151f20d7
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-868: stop using InstanceIdentifier.builder()
Robert Varga [Sun, 11 May 2014 06:41:18 +0000 (08:41 +0200)]
BUG-868: stop using InstanceIdentifier.builder()

The static helper method has been deprecated. Use either the non-static
one, or child()/augmentation() helpers.

Change-Id: Ic69057d2db669153dde60ba1797e8139623a755c
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-981: remove deprecated use of constructors
Robert Varga [Sun, 11 May 2014 05:35:34 +0000 (07:35 +0200)]
BUG-981: remove deprecated use of constructors

This removes the use of all constructors, such that we initialize in one
go.

Change-Id: Iff461a878fb7061b0ea1c8efea6a34b833645784
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "BUG-893: do not store classPool"
Tony Tkacik [Sun, 11 May 2014 16:46:53 +0000 (16:46 +0000)]
Merge "BUG-893: do not store classPool"

10 years agoMerge "BUG-642: get rid of sneakyThrow"
Tony Tkacik [Sun, 11 May 2014 16:46:25 +0000 (16:46 +0000)]
Merge "BUG-642: get rid of sneakyThrow"

10 years agoCosmetics: fix typo facilitate
Flavio Fernandes [Sun, 11 May 2014 03:27:02 +0000 (23:27 -0400)]
Cosmetics: fix typo facilitate

Change-Id: I351e285dd128f1d633f4940624096348b065f16a
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
10 years agoBUG-893: do not store classPool
Robert Varga [Sat, 10 May 2014 13:43:45 +0000 (15:43 +0200)]
BUG-893: do not store classPool

This prevents storing a reference to the classPool. It is not necessary
and it makes thinking about accesses much easier.

Change-Id: Iebbdac46c3ca445bbe36ba6efd19d3150d728f7f
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-642: get rid of sneakyThrow
Robert Varga [Sat, 10 May 2014 11:25:21 +0000 (13:25 +0200)]
BUG-642: get rid of sneakyThrow

This patch rids us of unneeded usage of Exceptions.sneakyThrow. It
generally hides problems and is only useful for generated (or sloppy)
code.

Change-Id: Ibb73f4546b1785c4bcb3e6c033249f58efd1d2d6
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-891: do not drop events silently
Robert Varga [Fri, 9 May 2014 15:22:19 +0000 (17:22 +0200)]
BUG-891: do not drop events silently

As it turns out, infrastructure silently drops things on the floor if
exceptions happen. When these exceptions occur, they hint at major
problems. Promote tham to warnings.

Change-Id: Ib4afdc7ff1a17e562211b3cfbb30735a592d0a2d
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoBUG-731: RoutedRegistration.close() should not throw
Robert Varga [Fri, 9 May 2014 10:16:50 +0000 (12:16 +0200)]
BUG-731: RoutedRegistration.close() should not throw

Routed RPC implementations should be allowed to unregister themselves
without incurring a checked exceptions. This allows downstream users to
elide having to deal with raw Exception.

Change-Id: Ia356c6272da3d22a375c954e192f79786ab42395
Signed-off-by: Robert Varga <rovarga@cisco.com>
10 years agoMerge "Add missing exception to log message in SchemaAwareRpcBroker"
Tony Tkacik [Wed, 7 May 2014 16:46:08 +0000 (16:46 +0000)]
Merge "Add missing exception to log message in SchemaAwareRpcBroker"

10 years agoMerge "Increase mdsal's notification queue size, make it configurable."
Tony Tkacik [Wed, 7 May 2014 15:42:46 +0000 (15:42 +0000)]
Merge "Increase mdsal's notification queue size, make it configurable."

10 years agoAdd missing exception to log message in SchemaAwareRpcBroker
Maros Marsalek [Wed, 7 May 2014 15:13:00 +0000 (17:13 +0200)]
Add missing exception to log message in SchemaAwareRpcBroker

Change-Id: I1e8196babd9f5486fbe1edadba5f610f00d1ac37
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
10 years agoIncrease mdsal's notification queue size, make it configurable.
Tomas Olvecky [Wed, 7 May 2014 12:56:56 +0000 (14:56 +0200)]
Increase mdsal's notification queue size, make it configurable.

Add System property mdsal.notificationqueue.size to allow tweaking
of queue size.
Increase default queue size from 10 to 1000.

Change-Id: I91e8ac3939092af2b26a7a4d952fe561557b7a46
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
10 years agoMerge "Fixed typo in SnapshotBackedWriteTransaction class"
Tony Tkacik [Wed, 7 May 2014 11:14:00 +0000 (11:14 +0000)]
Merge "Fixed typo in SnapshotBackedWriteTransaction class"

10 years agoBug 849: Fixed NPE in Translated Data Change Events.
Tony Tkacik [Tue, 6 May 2014 11:31:05 +0000 (13:31 +0200)]
Bug 849: Fixed NPE in Translated Data Change Events.

Change-Id: I7f79b9a713414192f14d934fbc3b9eabb3a2a051
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Bug 949: Fixed support for DataChangeListeners listening directly on Augmentation"
Ed Warnicke [Mon, 5 May 2014 19:53:40 +0000 (19:53 +0000)]
Merge "Bug 949: Fixed support for DataChangeListeners listening directly on Augmentation"

10 years agoBug 949: Fixed support for DataChangeListeners listening directly on Augmentation
Tony Tkacik [Mon, 5 May 2014 18:19:55 +0000 (20:19 +0200)]
Bug 949: Fixed support for DataChangeListeners listening directly on Augmentation

Used InstanceIdentifier codec does not support AugmentIdentifier, since it is
designed for CompositeNode format (serialization as defined by YANG Spec).
Instance Identifier for NormalizedNode format allows to directly reference
augmentation, for which support was missing.

Added a special case handling of Instance Identifiers which targets augmentation
directly, since Binding-Aware API and NormalizedNode API allows it.

Change-Id: I6371a54dae0e32cac4e1c9b9ab309e91ec3192d9
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoBug 933: Fixed datastore processing of nested augmentations.
Tony Tkacik [Thu, 1 May 2014 12:33:31 +0000 (14:33 +0200)]
Bug 933: Fixed datastore processing of nested augmentations.

Change-Id: I500e2a16666dfc7730da728c0cd47076c01343b0
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Bug 930 - Add bound to queue in SingletonHandler#NOTIFICATION_EXECUTOR ."
Tony Tkacik [Thu, 1 May 2014 11:22:17 +0000 (11:22 +0000)]
Merge "Bug 930 - Add bound to queue in SingletonHandler#NOTIFICATION_EXECUTOR ."

10 years agoMerge changes I4a9861ed,I61c130b9
Ed Warnicke [Thu, 1 May 2014 11:16:13 +0000 (11:16 +0000)]
Merge changes I4a9861ed,I61c130b9

* changes:
  Bug 509: Fixed DataTransactionListener support.
  Bug 509: Fixed Backwards compatibility bugs with datastore.

10 years agoBug 509: Fixed DataTransactionListener support.
Tony Tkacik [Thu, 1 May 2014 10:41:27 +0000 (12:41 +0200)]
Bug 509: Fixed DataTransactionListener support.

Change-Id: I4a9861ed543ce01e349737f7e779c2cfb5b1f107
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
10 years agoMerge "Bug 740: Forwardingrules-Manager support for DataChangeListeners"
Ed Warnicke [Wed, 30 Apr 2014 12:24:20 +0000 (12:24 +0000)]
Merge "Bug 740: Forwardingrules-Manager support for DataChangeListeners"

10 years agoBug 930 - Add bound to queue in SingletonHandler#NOTIFICATION_EXECUTOR .
Tomas Olvecky [Wed, 30 Apr 2014 10:36:49 +0000 (12:36 +0200)]
Bug 930 - Add bound to queue in SingletonHandler#NOTIFICATION_EXECUTOR .

Add queue capacity with hardcoded value 10. When maxPoolSize + queue capacity
is reached, caller thread will be blocked.
Mark thread as interrupted when catching InterruptedException, propagate it
to caller.
Remove code that pushed first two runnables to queue when core size was
reached - saturate whole threadpool capacity first.

Change-Id: I9c52b52eac127bea0cbb2abf7a65c0165daf8895
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
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 agoBug 509: Fixed Backwards compatibility bugs with datastore.
Tony Tkacik [Tue, 29 Apr 2014 16:57:08 +0000 (18:57 +0200)]
Bug 509: Fixed Backwards compatibility bugs with datastore.

Fixed bug in write and merge of leaf set children,
which prevented update of leaf sets.

Change-Id: I61c130b9d40876ae50468ebfbd2cf15208f1249c
Signed-off-by: Tony Tkacik <ttkacik@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 agoFixed typo in SnapshotBackedWriteTransaction class
Lukas Sedlak [Wed, 16 Apr 2014 08:32:34 +0000 (10:32 +0200)]
Fixed typo in SnapshotBackedWriteTransaction class

Fixed type in SnapshotBackedWriteTransaction class name.

Change-Id: I51e13023e33f95a0f36c56659664b59dff56048b
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
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>