yangtools.git
9 years agoRemove unused imports 24/9624/2
Robert Varga [Sun, 3 Aug 2014 12:04:17 +0000 (14:04 +0200)]
Remove unused imports

Lowers the number of warnings a bit.

Change-Id: I9cbb9f0bd2f711fa4f7410a5023c73497a59f35e
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-1275: Expose XmlStreamUtils.writeValue()"
Tony Tkacik [Sun, 3 Aug 2014 18:17:16 +0000 (18:17 +0000)]
Merge "BUG-1275: Expose XmlStreamUtils.writeValue()"

9 years agoMerge "BUG-997: Evolve the SchemaRegistry concepts"
Tony Tkacik [Sun, 3 Aug 2014 18:13:58 +0000 (18:13 +0000)]
Merge "BUG-997: Evolve the SchemaRegistry concepts"

9 years agoMerge "BUG-1469: introduce ReflectiveExceptionMapper"
Tony Tkacik [Sun, 3 Aug 2014 18:13:27 +0000 (18:13 +0000)]
Merge "BUG-1469: introduce ReflectiveExceptionMapper"

9 years agoMerge "BUG-1473: rename yang.model.util.InstanceIdentifier"
Tony Tkacik [Sun, 3 Aug 2014 18:11:59 +0000 (18:11 +0000)]
Merge "BUG-1473: rename yang.model.util.InstanceIdentifier"

9 years agoMerge "BUG-1460: make sure DCL works"
Tony Tkacik [Sun, 3 Aug 2014 18:09:16 +0000 (18:09 +0000)]
Merge "BUG-1460: make sure DCL works"

9 years agoBUG-1473: rename yang.model.util.InstanceIdentifier 22/9622/1
Robert Varga [Sun, 3 Aug 2014 11:28:05 +0000 (13:28 +0200)]
BUG-1473: rename yang.model.util.InstanceIdentifier

The class is renamed to InstanceIdentifierType and users are updated to
point to the new name.

Change-Id: I7ece7ea97a4bbbc623156e0e9db692d1e2a56f81
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-997: Evolve the SchemaRegistry concepts 81/9581/9
Robert Varga [Fri, 1 Aug 2014 14:19:29 +0000 (16:19 +0200)]
BUG-997: Evolve the SchemaRegistry concepts

This is the next step in SchemaRegistry evolution. Introduces
SchemaSourceListener and abstract classes for cache and transformer
patterns. Also completes implementation of the the abstract schema
registry and converts URLSchemaContextResolver. Finally it marks the
APIs as Beta, since they are being proven until we certify NETCONF
completely.

Change-Id: If82522c9a9a1913c818146da1247c8c5ca79b9c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1469: introduce ReflectiveExceptionMapper 09/9609/5
Robert Varga [Sat, 2 Aug 2014 10:34:00 +0000 (12:34 +0200)]
BUG-1469: introduce ReflectiveExceptionMapper

Convenience class for use when simple instantiation is acceptable and
the mapper instance can be shared.

Change-Id: I1946155a46b94fda5067ccbffcbf3b72f2ce8e3d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Updated creation of Binding Spec Context to provide additional information."
Robert Varga [Sun, 3 Aug 2014 10:36:24 +0000 (10:36 +0000)]
Merge "Updated creation of Binding Spec Context to provide additional information."

9 years agoMerge "Runtime Codec cleanup"
Robert Varga [Sun, 3 Aug 2014 10:33:48 +0000 (10:33 +0000)]
Merge "Runtime Codec cleanup"

9 years agoUpdated creation of Binding Spec Context to provide additional information. 85/9585/2
Tony Tkacik [Fri, 1 Aug 2014 17:18:28 +0000 (19:18 +0200)]
Updated creation of Binding Spec Context to provide additional information.

Change-Id: I0c71d8b3cb3a569b340fc0ef0c71283382fe2ac6
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoRuntime Codec cleanup 84/9584/2
Tony Tkacik [Fri, 1 Aug 2014 17:15:36 +0000 (19:15 +0200)]
Runtime Codec cleanup

- Extracted Augmentation getter to Bidning Reflections
- Fixed retrieval of IdenfierCodec

Change-Id: Ib6b6f45349bd8b5b055dccd036549ec727c0186d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Bug 1437, Bug 1438 NormalizedNode Stream Writer API and Implementation"
Robert Varga [Fri, 1 Aug 2014 22:11:20 +0000 (22:11 +0000)]
Merge "Bug 1437, Bug 1438 NormalizedNode Stream Writer API and Implementation"

9 years agoMerge "BUG-997: make sure we carry YANG text around"
Tony Tkacik [Fri, 1 Aug 2014 17:33:10 +0000 (17:33 +0000)]
Merge "BUG-997: make sure we carry YANG text around"

9 years agoBug 1437, Bug 1438 NormalizedNode Stream Writer API and Implementation 96/9496/5
Tony Tkacik [Wed, 30 Jul 2014 15:09:08 +0000 (17:09 +0200)]
Bug 1437, Bug 1438 NormalizedNode Stream Writer API and Implementation

Initial draft of NormalizedNode Stream Writer API, along
with initial implementation which produces immutable NormalizedNodes.

Change-Id: I45513d88eefca7aa070e6679ccfdedf358266d59
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-997: make sure we carry YANG text around 80/9580/1
Robert Varga [Fri, 1 Aug 2014 17:12:38 +0000 (19:12 +0200)]
BUG-997: make sure we carry YANG text around

Unfortunately we need the schema source for module builder, in order to
support netconf monitoring. This is not right, as that component should
be talking to the schema repository to get the text version of a
particular module.

Change-Id: I3360c5b060f63b415f6248ae6e05d41136247ed0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 1119 - Optimize generated range checks"
Robert Varga [Fri, 1 Aug 2014 15:38:01 +0000 (15:38 +0000)]
Merge "Bug 1119 - Optimize generated range checks"

9 years agoBug 1119 - Optimize generated range checks 83/9483/7
Ladislav Borak [Wed, 30 Jul 2014 21:56:02 +0000 (23:56 +0200)]
Bug 1119 - Optimize generated range checks

- moved initialization of range and length constraints list
  into static initialization block

Change-Id: I2f5631fceb0e776fe3172e9a05ee97b7fe81252b
Signed-off-by: Ladislav Borak <lborak@cisco.com>
9 years agoMerge "BUG-1305: fixed unknown nodes and issue with single quote in antlr grammar."
Tony Tkacik [Fri, 1 Aug 2014 14:24:39 +0000 (14:24 +0000)]
Merge "BUG-1305: fixed unknown nodes and issue with single quote in antlr grammar."

9 years agoMerge "Bug 1436: Introduced BindingStreamEventWriter interface"
Robert Varga [Fri, 1 Aug 2014 13:50:22 +0000 (13:50 +0000)]
Merge "Bug 1436: Introduced BindingStreamEventWriter interface"

9 years agoMerge "Bug 1430: New common/util concurrent classes"
Robert Varga [Fri, 1 Aug 2014 13:49:06 +0000 (13:49 +0000)]
Merge "Bug 1430: New common/util concurrent classes"

9 years agoBug 1436: Introduced BindingStreamEventWriter interface 77/9377/6
Tony Tkacik [Mon, 28 Jul 2014 11:36:48 +0000 (13:36 +0200)]
Bug 1436: Introduced BindingStreamEventWriter interface

Introduced BindingStreamEventWriter interface,
which allows to implement Binding codecs
with plugable backend for actual serialization.

This interface needs to present in yang.binding
package, since this in only package which
is imported by all generated YANG Java Bindings
and thus visible for them.

Change-Id: I2d235cd63ecda1d63c8077854a38a5dc9d184d2d
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-1305: fixed unknown nodes and issue with single quote in antlr grammar. 70/9570/1
Martin Vitez [Fri, 1 Aug 2014 09:23:18 +0000 (11:23 +0200)]
BUG-1305: fixed unknown nodes and issue with single quote in antlr grammar.

Change-Id: I6721cfc3b2042f3564996f08d155201cc2ff2d43
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "BUG-997: introduce base SchemaRepository"
Tony Tkacik [Fri, 1 Aug 2014 09:16:39 +0000 (09:16 +0000)]
Merge "BUG-997: introduce base SchemaRepository"

9 years agoMerge "BUG-997: Rework URLSchemaContextResolver"
Tony Tkacik [Fri, 1 Aug 2014 09:16:12 +0000 (09:16 +0000)]
Merge "BUG-997: Rework URLSchemaContextResolver"

9 years agoMerge "BUG-997: Introduce ASTSchemaSource"
Tony Tkacik [Fri, 1 Aug 2014 09:15:46 +0000 (09:15 +0000)]
Merge "BUG-997: Introduce ASTSchemaSource"

9 years agoBUG-1460: make sure DCL works 67/9567/3
Robert Varga [Fri, 1 Aug 2014 08:26:58 +0000 (10:26 +0200)]
BUG-1460: make sure DCL works

As the bug correctly notes, the check of non-volatile field can result
in bad effects.

Change-Id: Ifd0d72c28fe53692b037c2ecf861d36d312b4182
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-1402: removed hardcoded plugin version for testing."
Tony Tkacik [Fri, 1 Aug 2014 08:26:00 +0000 (08:26 +0000)]
Merge "BUG-1402: removed hardcoded plugin version for testing."

9 years agoMerge changes Ic9936326,I9b600761
Tony Tkacik [Fri, 1 Aug 2014 07:54:20 +0000 (07:54 +0000)]
Merge changes Ic9936326,I9b600761

* changes:
  BUG-865: move ClassLoaderUtils into util package
  BUG-865: prepare to move ListenerRegistry

9 years agoMerge "BUG-865: Move Immutables"
Tony Tkacik [Fri, 1 Aug 2014 07:54:03 +0000 (07:54 +0000)]
Merge "BUG-865: Move Immutables"

9 years agoBUG-576: fixed bug in parsing of union types. 65/9565/1
Martin Vitez [Fri, 1 Aug 2014 07:06:41 +0000 (09:06 +0200)]
BUG-576: fixed bug in parsing of union types.

Parser creates an empty collection of restrictions and tries to set them to union builder, but union cannot be restricted.
This patch avoid adding restrictions to union builder.
Added test.

Change-Id: Ie0822f21380f8e5f9cd42960e7248927710053cd
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-997: introduce base SchemaRepository 68/9368/9
Robert Varga [Mon, 21 Jul 2014 13:43:59 +0000 (15:43 +0200)]
BUG-997: introduce base SchemaRepository

Change-Id: I51d6c14a217b008afd0fa73c18c6dfc6cc8909b7
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-997: Rework URLSchemaContextResolver 24/9524/6
Robert Varga [Mon, 28 Jul 2014 10:47:21 +0000 (12:47 +0200)]
BUG-997: Rework URLSchemaContextResolver

This patch introduces an alternative implementation of
URLSchemaContextResolver, which takes advantage of the newly-created
APIs. The core improvement lies in the fact that it pre-validates
registered sources, thus eliding multiple parse actions.

Change-Id: I3311a3f0251868f91c385d0291365934ccfb9ede
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Introduced CompositeNode <-> NormalizedNode serializer"
Tony Tkacik [Thu, 31 Jul 2014 15:31:09 +0000 (15:31 +0000)]
Merge "Introduced CompositeNode <-> NormalizedNode serializer"

9 years agoIntroduced CompositeNode <-> NormalizedNode serializer 39/9539/1
Tony Tkacik [Thu, 31 Jul 2014 14:50:44 +0000 (14:50 +0000)]
Introduced CompositeNode <-> NormalizedNode serializer

- add AnyXmlNodeBase parser and serializer
- in ContainerNodeCnSnSerializer and MapEntryNodeCnSnSerializer was used
MutableCompositeNodeTOImpl which uses init() method which is deprecated
therefore it was rewritten and also whole package was renamed.
- support for AnyXml yang type to yang-data-composite-node

Change-Id: I1f40beef29e8c1c052113043f7029fbc0650192c
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "Revert "Composite node <-> normalized node serializer and deserializer""
Tony Tkacik [Thu, 31 Jul 2014 13:58:24 +0000 (13:58 +0000)]
Merge "Revert "Composite node <-> normalized node serializer and deserializer""

9 years agoRevert "Composite node <-> normalized node serializer and deserializer" 35/9535/1
Tony Tkacik [Thu, 31 Jul 2014 13:48:15 +0000 (13:48 +0000)]
Revert "Composite node <-> normalized node serializer and deserializer"

This commit renamed artefact, which was missed on code
review done by me, so reverting it for now, to be properly
documented.

Change-Id: Iffaa2f6e1c0e245adbc10ae59cdbc3eb2f365346
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoBUG-1402: removed hardcoded plugin version for testing. 31/9531/1
Martin Vitez [Thu, 31 Jul 2014 12:58:28 +0000 (14:58 +0200)]
BUG-1402: removed hardcoded plugin version for testing.

In test-parent/pom.xml was hardcoded yang-maven-plugin version in property it-project.version.
This patch remove this property and use parent pom version.

Change-Id: Ib6478c839abcc54a0862439b201b4889f2af5cc7
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-997: Introduce ASTSchemaSource 69/9369/8
Robert Varga [Fri, 25 Jul 2014 02:45:53 +0000 (04:45 +0200)]
BUG-997: Introduce ASTSchemaSource

ASTSchemaSource represents an intermediate processing step, where we
have parsed the YANG text and extracted dependency information.

Change-Id: Ice0b841404a28912787b83f88f9b2d28c68497d5
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Composite node <-> normalized node serializer and deserializer"
Tony Tkacik [Thu, 31 Jul 2014 09:24:41 +0000 (09:24 +0000)]
Merge "Composite node <-> normalized node serializer and deserializer"

9 years agoBUG-1457: fixed parsing of max-elements statement. 21/9521/2
Martin Vitez [Thu, 31 Jul 2014 07:09:08 +0000 (09:09 +0200)]
BUG-1457: fixed parsing of max-elements statement.

If max-elements was set to "unbounded", parser throws an exception.
Added test.

Change-Id: I37df99b504e989353f5a0b33f0a2d99e6c796668
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoComposite node <-> normalized node serializer and deserializer 72/9472/1
Jozef Gloncak [Fri, 11 Jul 2014 08:40:11 +0000 (10:40 +0200)]
Composite node <-> normalized node serializer and deserializer

- add AnyXmlNodeBase parser and serializer
- in ContainerNodeCnSnSerializer and MapEntryNodeCnSnSerializer was used
MutableCompositeNodeTOImpl which uses init() method which is deprecated
therefore it was rewritten and also whole package was renamed.
- support for AnyXml yang type to yang-data-composite-node

Change-Id: Icef3549e402eee0da074900a3db6e2959a5a67a5
Signed-off-by: Jozef Gloncak <jgloncak@cisco.com>
9 years agoMerge "Bug 1354: Added rpcReplyToDomNodes method."
Tony Tkacik [Wed, 30 Jul 2014 09:14:36 +0000 (09:14 +0000)]
Merge "Bug 1354: Added rpcReplyToDomNodes method."

9 years agoBUG-865: move ClassLoaderUtils into util package 63/9463/2
Robert Varga [Wed, 30 Jul 2014 06:42:45 +0000 (08:42 +0200)]
BUG-865: move ClassLoaderUtils into util package

Removes the two previously-deprecated instances, deprecate the third one
and instantiate the utility at the proper place.

Change-Id: Ic9936326fb0f4d4b2129562ae84b131b79746c23
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-865: Move Immutables 64/9464/2
Robert Varga [Wed, 30 Jul 2014 06:46:15 +0000 (08:46 +0200)]
BUG-865: Move Immutables

Immutables is a utility class, so it should go into util. Its
capabilities can be expanded there to account for guava classes.

Change-Id: I6f93befd03249cb83a842a53600260b776822ba2
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-865: prepare to move ListenerRegistry 65/9465/2
Robert Varga [Wed, 30 Jul 2014 06:48:30 +0000 (08:48 +0200)]
BUG-865: prepare to move ListenerRegistry

This will evacuate the concepts.util package, guiding users towards
plain util package.

Change-Id: I9b600761f6cd7950b366e2bf40fd85f4bc8d5e9b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize binding types memory usage 49/9149/4
Robert Varga [Fri, 18 Jul 2014 09:48:42 +0000 (11:48 +0200)]
Optimize binding types memory usage

Profiling SP edition shows that we have ~30000 empty ArrayList instances
retained by binding.generator.generated.type.builder objects, wasting
around 800kB of memory.

This patch introduces LazyCollections, which allow us to build up these
lists in a manner which uses minimal collections to support the elements
currently present.

Change-Id: I4676356f7684c9cdd152c98a65a240d0c5b94259
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1275: Expose XmlStreamUtils.writeValue() 16/9116/4
Robert Varga [Thu, 17 Jul 2014 12:26:40 +0000 (14:26 +0200)]
BUG-1275: Expose XmlStreamUtils.writeValue()

This exposes a utility method needed for RESTCONF datastore notification
delivery.

Change-Id: Ica14b6a11ecb95da306c37790e6a2fbf5533bfc1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-1281: fix SchemaContext module ordering"
Tony Tkacik [Tue, 29 Jul 2014 15:15:24 +0000 (15:15 +0000)]
Merge "BUG-1281: fix SchemaContext module ordering"

9 years agoMerge "BUG-1305: improved antlr grammar handling of unknown nodes."
Tony Tkacik [Tue, 29 Jul 2014 13:35:08 +0000 (13:35 +0000)]
Merge "BUG-1305: improved antlr grammar handling of unknown nodes."

9 years agoBUG-1281: fix SchemaContext module ordering 13/9413/4
Robert Varga [Mon, 28 Jul 2014 21:47:18 +0000 (23:47 +0200)]
BUG-1281: fix SchemaContext module ordering

This patch fixes the wildcard lookup and optimizes it by precomputing
the revision.

Change-Id: Icad0a9435aacc4b5401130608833d2cb45e3624f
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1092: rename data.api.InstanceIdentifier to YangInstanceIdentifier 27/9427/3
Robert Varga [Tue, 29 Jul 2014 10:13:03 +0000 (12:13 +0200)]
BUG-1092: rename data.api.InstanceIdentifier to YangInstanceIdentifier

On popular request to clear up confusion between
yang.binding.InstanceIdentifier and yang.data.api.InstanceIdentifier, we
rename the latter (which is the low-level one). This will make it clear
for users of GUIs, who were confused by the tools giving them the choice
between the two.

Change-Id: I1e30a0df93d8bfb891d047c58abcb117d4006c76
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1305: improved antlr grammar handling of unknown nodes. 92/9392/4
Martin Vitez [Mon, 28 Jul 2014 16:38:16 +0000 (18:38 +0200)]
BUG-1305: improved antlr grammar handling of unknown nodes.

Removed useless unknown_statement2 and unknown_statement3 definitions

Improved antlr parser to propertly handle extension description by moving unknown_statement definition as last
statement in extension_stmt definition to properly handle description.

Change-Id: I9d8da69ac9336feee07855e85fad5ee2e4033f12
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoMerge "BUG-461 Test transformation of rpc input using XmlDocumentUtils"
Tony Tkacik [Tue, 29 Jul 2014 09:25:01 +0000 (09:25 +0000)]
Merge "BUG-461 Test transformation of rpc input using XmlDocumentUtils"

9 years agoMerge "BUG-1413: fixed bug in antlr grammar."
Tony Tkacik [Tue, 29 Jul 2014 09:14:02 +0000 (09:14 +0000)]
Merge "BUG-1413: fixed bug in antlr grammar."

9 years agoBug 1354: Added rpcReplyToDomNodes method. 32/9232/3
Lukas Sedlak [Fri, 18 Jul 2014 09:11:29 +0000 (11:11 +0200)]
Bug 1354: Added rpcReplyToDomNodes method.

Added rpcReplyToDomNodes method into XmlDocumentUtils to convert XML Payload from Rpc Reply message into
Composite Node structures.
Added test and test files (schema, test payloads) for rpcReplyToDomNodes method.

Change-Id: I45e01d58689ad448cdf6e8541cb680db62667d7c
Signed-off-by: Lukas Sedlak <lsedlak@cisco.com>
9 years agoBug 1430: New common/util concurrent classes 05/9305/15
tpantelis [Sun, 27 Jul 2014 00:11:33 +0000 (20:11 -0400)]
Bug 1430: New common/util concurrent classes

AsyncNotifyingListeningExecutorService:
    A ListeningExecutorService that executes ListenableFuture callback
    Runnables on another executor to off-load them.

AsyncNotifyingListenableFutureTask
    Listenable FutureTask used by AsyncNotifyingListeningExecutorService.

QueuedNotificationManager
    Manages queuing and dispatching notifications for multiple listeners
    concurrently. Notifications are queued on a per-listener basis and
    dispatched serially to each listener via an Executor.

FastThreadPoolExecutor
    Executor with a bounded queue that provides fast task execution time
    by favoring creating threads over queuing.

CachedThreadPoolExecutor
    Executor with a bounded queue that favors reusing existing idle
    threads over creating new threads at the expense of slower task
    execution time.

SpecialExecutors
    Factory methods for creating Fast/CachedThreadPoolExecutor
    instances.

Change-Id: Ie0d2f4d4e0561976c6956d551e386da78631aafa
Signed-off-by: tpantelis <tpanteli@brocade.com>
9 years agoBUG-1431: make InstnaceIdentifier serializable 06/9406/2
Robert Varga [Mon, 28 Jul 2014 20:43:38 +0000 (22:43 +0200)]
BUG-1431: make InstnaceIdentifier serializable

Straightforward fix for serializability.

Change-Id: I6681e6c85a4ebb8bf23d4dc239204b3a757ea942
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1381: remove getLock() and deprecated constructor 20/9320/4
Robert Varga [Fri, 25 Jul 2014 13:37:26 +0000 (15:37 +0200)]
BUG-1381: remove getLock() and deprecated constructor

All users have been updated to synchronize properly, now remove
getLock(). At the same time, shed the deprecated contructor, too.
Requires I3e962f284132b376f77e9e2665b3fbb47f246514 to go into controller
first.

Change-Id: Ic8b62468a4e829f035e45b3c715966315b3103a0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Degrade DataNodeContainer.getChildNodes() from Set to Collection"
Tony Tkacik [Mon, 28 Jul 2014 15:03:00 +0000 (15:03 +0000)]
Merge "Degrade DataNodeContainer.getChildNodes() from Set to Collection"

9 years agoMerge "Improve performance of SchemaContext.findModuleByName()"
Tony Tkacik [Mon, 28 Jul 2014 15:01:43 +0000 (15:01 +0000)]
Merge "Improve performance of SchemaContext.findModuleByName()"

9 years agoMerge "Fix Ip{Address,Prefix}Builder performance"
Tony Tkacik [Mon, 28 Jul 2014 15:01:27 +0000 (15:01 +0000)]
Merge "Fix Ip{Address,Prefix}Builder performance"

9 years agoDegrade DataNodeContainer.getChildNodes() from Set to Collection 52/9352/6
Robert Varga [Sat, 26 Jul 2014 02:17:52 +0000 (04:17 +0200)]
Degrade DataNodeContainer.getChildNodes() from Set to Collection

Datastore-geared workload shows that around 1% of CPU is being used by
AbstractDocumentedDataNodeContainer.getChildNodes(). Of that, around 72%
is spent in ImmutableSet.copyOf(). We could perform that copy in the
constructor, but we can actually do better.

As it turns out, there is already a childNodes map, which is immutable
and indexed via QName present. That indexing guarantees that the values
compare as distinct, so we can reuse childNodes.values(), except for the
contract.

None of the callers care if the return is a Collection, so downgrade the
return, such that we can elide copying the stuff completely. Also fixup
all the callers. Requires https://git.opendaylight.org/gerrit/#/c/9340/
to fix controller-based users.

Change-Id: I310b351d80955a37f6672064dd238bb9cb1e16b1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoImprove performance of SchemaContext.findModuleByName() 51/9351/6
Robert Varga [Sat, 26 Jul 2014 05:24:38 +0000 (07:24 +0200)]
Improve performance of SchemaContext.findModuleByName()

Maintaining an index multimap allows us to heavily optimize lookups,
especially when coming from restconf, which accepts the latest revision
of a particular module.

Change-Id: I615a3c08508111d9389821d24f51cd35c06b5eb1
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-461 Test transformation of rpc input using XmlDocumentUtils 80/9380/1
Maros Marsalek [Mon, 28 Jul 2014 12:46:08 +0000 (14:46 +0200)]
BUG-461 Test transformation of rpc input using XmlDocumentUtils

Change-Id: I5d1a8c5e2360fc3cfd47c72facac9007c8a2cc4b
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoReuse comparator between sort invocations 50/9350/7
Robert Varga [Sat, 26 Jul 2014 05:23:32 +0000 (07:23 +0200)]
Reuse comparator between sort invocations

Change-Id: Ic7b36c76424a910df6f958ce468d58aef6bcd1fd
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Convert SchemaSourceRegistration to extend ObjectRegistration"
Robert Varga [Mon, 28 Jul 2014 09:50:14 +0000 (09:50 +0000)]
Merge "Convert SchemaSourceRegistration to extend ObjectRegistration"

9 years agoMerge "BUG-1412: fixed bug in antlr grammar."
Tony Tkacik [Mon, 28 Jul 2014 09:39:04 +0000 (09:39 +0000)]
Merge "BUG-1412: fixed bug in antlr grammar."

9 years agoConvert SchemaSourceRegistration to extend ObjectRegistration 74/9374/1
Tony Tkacik [Mon, 28 Jul 2014 09:35:35 +0000 (11:35 +0200)]
Convert SchemaSourceRegistration to extend ObjectRegistration

Change-Id: I86a48fb4846fa88fcd459ebe06fa5bcbbe0918a4
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
9 years agoMerge "BUG-432: remove type argument from Registration"
Tony Tkacik [Mon, 28 Jul 2014 08:54:21 +0000 (08:54 +0000)]
Merge "BUG-432: remove type argument from Registration"

9 years agoMerge "Cache public view of children of AbstractImmutableDataContainerNode"
Tony Tkacik [Mon, 28 Jul 2014 08:39:42 +0000 (08:39 +0000)]
Merge "Cache public view of children of AbstractImmutableDataContainerNode"

9 years agoMerge "Optimize AbstractDocumentedDataNodeContainer.getDataChildByName()"
Tony Tkacik [Mon, 28 Jul 2014 08:39:30 +0000 (08:39 +0000)]
Merge "Optimize AbstractDocumentedDataNodeContainer.getDataChildByName()"

9 years agoMerge "BUG-997: Introduce SchemaSource respository and related APIs"
Tony Tkacik [Mon, 28 Jul 2014 08:37:55 +0000 (08:37 +0000)]
Merge "BUG-997: Introduce SchemaSource respository and related APIs"

9 years agoMerge "BUG-865: remove InstanceIdentifier.Builder.getIdentifier()"
Tony Tkacik [Mon, 28 Jul 2014 08:15:17 +0000 (08:15 +0000)]
Merge "BUG-865: remove InstanceIdentifier.Builder.getIdentifier()"

9 years agoMerge "Rework data.api.InstanceIdentifier to work on Iterables"
Tony Tkacik [Mon, 28 Jul 2014 08:13:43 +0000 (08:13 +0000)]
Merge "Rework data.api.InstanceIdentifier to work on Iterables"

9 years agoMerge changes I1a5340f1,I9bb2bdd9
Martin Vitez [Mon, 28 Jul 2014 07:20:10 +0000 (07:20 +0000)]
Merge changes I1a5340f1,I9bb2bdd9

* changes:
  Implement DatastoreIdentifierBuilder
  Add String to known-immutable classes

9 years agoBUG-997: Introduce SchemaSource respository and related APIs 67/9367/2
Robert Varga [Sat, 19 Jul 2014 09:05:53 +0000 (11:05 +0200)]
BUG-997: Introduce SchemaSource respository and related APIs

Change-Id: I9cddf1ca0d1df4360b6110663c0c5eb89bd8f51c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "Bug 1392: New yang-common/util classes"
Robert Varga [Mon, 28 Jul 2014 06:41:03 +0000 (06:41 +0000)]
Merge "Bug 1392: New yang-common/util classes"

9 years agoMerge "Bug 1386: Added DeadlockDetectingListeningExecutorService"
Robert Varga [Mon, 28 Jul 2014 06:40:52 +0000 (06:40 +0000)]
Merge "Bug 1386: Added DeadlockDetectingListeningExecutorService"

9 years agoBug 1392: New yang-common/util classes 40/9240/5
Thomas Pantelis [Mon, 14 Jul 2014 16:13:08 +0000 (12:13 -0400)]
Bug 1392: New yang-common/util classes

Needed for https://git.opendaylight.org/gerrit/#/c/9178/

OperationFailedException:

   Generalized exception class that contains an RpcError list.

MappingCheckedFuture:

   Futures#addCallback and Futures#transform call Future#get but
   CheckedFuture doesn't override the get methods to translate exceptions
   to the checked type. Thus you don't get the checked exception when using
   those Futures methods. This kind of defeats the purpose of CheckedFuture.

   The new MappingCheckedFuture class overrides the get methods to translate exceptions.

ExceptionMapper:

   Generalized class for use with CheckedFuture to translate exceptions to a
   specified exception type.

Change-Id: Idb4c7e8b5c2cf17795de2f3af4278989ac7bd116
Signed-off-by: tpantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-1413: fixed bug in antlr grammar. 65/9365/1
Martin Vitez [Fri, 25 Jul 2014 12:10:51 +0000 (14:10 +0200)]
BUG-1413: fixed bug in antlr grammar.

Parser was not able to parse unknown node in extension argument declaration.
Added test.

Change-Id: I834cc47bbae8834484ff024f97dcf77f3c5ddbf9
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBUG-1412: fixed bug in antlr grammar. 09/9309/2
Martin Vitez [Fri, 25 Jul 2014 10:28:26 +0000 (12:28 +0200)]
BUG-1412: fixed bug in antlr grammar.

Parser was not able to handle description statement inside unknown statement.
Added test.

Change-Id: I7e3e68ac20694c415bc7bbbc5406967727394967
Signed-off-by: Martin Vitez <mvitez@cisco.com>
9 years agoBug 1386: Added DeadlockDetectingListeningExecutorService 06/9206/5
Thomas Pantelis [Mon, 14 Jul 2014 04:12:45 +0000 (00:12 -0400)]
Bug 1386: Added DeadlockDetectingListeningExecutorService

Change-Id: I1da4c9ae118e0dd5248d42adccb3dcfff23fe0dd
Signed-off-by: tpantelis <tpanteli@brocade.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-432: remove type argument from Registration 62/9362/1
Robert Varga [Sun, 27 Jul 2014 19:56:46 +0000 (21:56 +0200)]
BUG-432: remove type argument from Registration

Change-Id: I5899328c96de8f6f473c1ab8767df10e614b41e0
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoCache public view of children of AbstractImmutableDataContainerNode 53/9353/5
Robert Varga [Sat, 26 Jul 2014 02:30:13 +0000 (04:30 +0200)]
Cache public view of children of AbstractImmutableDataContainerNode

Tracing of a datastore-heavy workload shows about 1% CPU being spent
in getValue(). This allocates 1.8M objects, just to throw them away.
Rather than that, let's wrap the map itself, which guarantes .values()
to be immutable, thus eliding the CPU cost.

Change-Id: Ieef0a2bb791ffd99f934457444d168f1a6c9fd77
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoOptimize AbstractDocumentedDataNodeContainer.getDataChildByName() 49/9349/4
Robert Varga [Sat, 26 Jul 2014 01:55:20 +0000 (03:55 +0200)]
Optimize AbstractDocumentedDataNodeContainer.getDataChildByName()

Datastore-intensive workload shows 2% CPU expended in this method, with
three quarters of that actually eaten up by the iterator (and the rest by
1M invocations of QName.equals()). Given that we know that childNodes
are keyed by the QName, this is utterly wasteful, so let's do a simple
lookup.

Change-Id: I44688cb92031b2d75a09d58bd76c63bb28ccbfae
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoBUG-865: remove InstanceIdentifier.Builder.getIdentifier() 48/9348/4
Robert Varga [Sat, 26 Jul 2014 00:58:31 +0000 (02:58 +0200)]
BUG-865: remove InstanceIdentifier.Builder.getIdentifier()

This method has been long-deprecated, so let's just remove it.

Change-Id: Ib4ab7be5c463729607ae75c10d0ae6c500c5990b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoRework data.api.InstanceIdentifier to work on Iterables 30/9330/4
Robert Varga [Thu, 3 Jul 2014 16:22:25 +0000 (18:22 +0200)]
Rework data.api.InstanceIdentifier to work on Iterables

Profiling storage-dominated workloads shows that
InstanceIdentifier.node() is dominating by taking up 16% of the CPU
cycles, with 82% of that being spent in ImmutableList$Builder.addAll().
All of these calls occur in the data change resolution path, where they
account for 53% of CPU time.

This patch removes the ImmutableList at the heart of InstanceIdentifier
with an Iterable, along with all the machinery we know and love from the
binding InstanceIdentifier.

While we are at it, perform complete house-cleaning, compacting code and
tuning it for perfomance.

Change-Id: I52884d5660086ac53647a2a39127578017449b2d
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoImplement DatastoreIdentifierBuilder 54/9354/2
Robert Varga [Sat, 26 Jul 2014 15:50:13 +0000 (17:50 +0200)]
Implement DatastoreIdentifierBuilder

This is straightforward enough, so make it work with BA clients.

Change-Id: I1a5340f1ac72148e11cb54554acbb49540251f88
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoAdd String to known-immutable classes 44/9344/1
Robert Varga [Sat, 26 Jul 2014 00:04:44 +0000 (02:04 +0200)]
Add String to known-immutable classes

All instances of String are guaranteed to be immutable, not sure why
that was not captured anywhere.

Change-Id: I9bb2bdd91a0f54e6a8083c047cfd99c0cd029b4b
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoImprove QNameModule.equals() performance 29/9329/1
Robert Varga [Fri, 25 Jul 2014 19:09:23 +0000 (21:09 +0200)]
Improve QNameModule.equals() performance

URI.equals() is slower than Date.equals(), so let's compare revision
first, hopefully eliding the costlier equality check.

Change-Id: Ia42e13917432c696c756758c95c3f6a668396ff9
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoFix Ip{Address,Prefix}Builder performance 24/9324/1
Robert Varga [Fri, 25 Jul 2014 15:58:48 +0000 (17:58 +0200)]
Fix Ip{Address,Prefix}Builder performance

Using String.matches() incurs major overhead of almost 4ms. Precompile
the pattern and be smart about the use of it. At the same time do a
small optimization to HostBuilder in the form of not instantiating
multiple matchers.

Change-Id: Ifc7f5ff90e71c545acc00275d84780cebe02ec1c
Signed-off-by: Robert Varga <rovarga@cisco.com>
9 years agoMerge "BUG-1381: guide users to use external synchronized block"
Tony Tkacik [Fri, 25 Jul 2014 11:17:10 +0000 (11:17 +0000)]
Merge "BUG-1381: guide users to use external synchronized block"

9 years agoCodecs can handle the same yang "case" from multiple resources 08/9308/2
Martin Sunal [Fri, 25 Jul 2014 09:39:42 +0000 (11:39 +0200)]
Codecs can handle the same yang "case" from multiple resources

- resolves a problem when the same case statements are augmented through different paths

Change-Id: I85a0972e352556c525ab64e093e77ad33abeedba
Signed-off-by: Martin Sunal <msunal@cisco.com>
9 years agoMerge "Fix XmlStreamUtils writing attributes."
Tony Tkacik [Fri, 25 Jul 2014 08:16:26 +0000 (08:16 +0000)]
Merge "Fix XmlStreamUtils writing attributes."

9 years agoMerge "BUG-1414: fix InstanceIdentifier.child(Class, Object)"
Tony Tkacik [Fri, 25 Jul 2014 08:10:53 +0000 (08:10 +0000)]
Merge "BUG-1414: fix InstanceIdentifier.child(Class, Object)"

9 years agoMerge "BUG-1407 fix."
Tony Tkacik [Fri, 25 Jul 2014 07:58:43 +0000 (07:58 +0000)]
Merge "BUG-1407 fix."

9 years agoFix XmlStreamUtils writing attributes. 90/9290/3
Maros Marsalek [Thu, 24 Jul 2014 15:06:09 +0000 (17:06 +0200)]
Fix XmlStreamUtils writing attributes.

The prefix for attributes was no set.
This would result in an exception when no prefix was available by default.

Using RandomPrefix now.

Change-Id: I6110293b262a77f987534fe98abf51755a066be0
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
9 years agoBUG-1407 fix. 72/9272/4
Alex Fan [Thu, 24 Jul 2014 21:04:15 +0000 (14:04 -0700)]
BUG-1407 fix.

Change-Id: I4a7dbcbdbed61593d0096fa01a32af41a4cec4da
Signed-off-by: Alex Fan <railor33@gmail.com>