Robert Varga [Sun, 3 Aug 2014 10:33:48 +0000 (10:33 +0000)]
Merge "Runtime Codec cleanup"
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>
Robert Varga [Fri, 1 Aug 2014 22:11:20 +0000 (22:11 +0000)]
Merge "Bug 1437, Bug 1438 NormalizedNode Stream Writer API and Implementation"
Tony Tkacik [Fri, 1 Aug 2014 17:33:10 +0000 (17:33 +0000)]
Merge "BUG-997: make sure we carry YANG text around"
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>
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>
Robert Varga [Fri, 1 Aug 2014 15:38:01 +0000 (15:38 +0000)]
Merge "Bug 1119 - Optimize generated range checks"
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>
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."
Robert Varga [Fri, 1 Aug 2014 13:50:22 +0000 (13:50 +0000)]
Merge "Bug 1436: Introduced BindingStreamEventWriter interface"
Robert Varga [Fri, 1 Aug 2014 13:49:06 +0000 (13:49 +0000)]
Merge "Bug 1430: New common/util concurrent classes"
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>
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>
Tony Tkacik [Fri, 1 Aug 2014 09:16:39 +0000 (09:16 +0000)]
Merge "BUG-997: introduce base SchemaRepository"
Tony Tkacik [Fri, 1 Aug 2014 09:16:12 +0000 (09:16 +0000)]
Merge "BUG-997: Rework URLSchemaContextResolver"
Tony Tkacik [Fri, 1 Aug 2014 09:15:46 +0000 (09:15 +0000)]
Merge "BUG-997: Introduce ASTSchemaSource"
Tony Tkacik [Fri, 1 Aug 2014 08:26:00 +0000 (08:26 +0000)]
Merge "BUG-1402: removed hardcoded plugin version for testing."
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
Tony Tkacik [Fri, 1 Aug 2014 07:54:03 +0000 (07:54 +0000)]
Merge "BUG-865: Move Immutables"
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>
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>
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>
Tony Tkacik [Thu, 31 Jul 2014 15:31:09 +0000 (15:31 +0000)]
Merge "Introduced CompositeNode <-> NormalizedNode serializer"
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>
Tony Tkacik [Thu, 31 Jul 2014 13:58:24 +0000 (13:58 +0000)]
Merge "Revert "Composite node <-> normalized node serializer and deserializer""
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>
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>
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>
Tony Tkacik [Thu, 31 Jul 2014 09:24:41 +0000 (09:24 +0000)]
Merge "Composite node <-> normalized node serializer and deserializer"
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>
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>
Tony Tkacik [Wed, 30 Jul 2014 09:14:36 +0000 (09:14 +0000)]
Merge "Bug 1354: Added rpcReplyToDomNodes method."
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>
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>
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>
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>
Tony Tkacik [Tue, 29 Jul 2014 15:15:24 +0000 (15:15 +0000)]
Merge "BUG-1281: fix SchemaContext module ordering"
Tony Tkacik [Tue, 29 Jul 2014 13:35:08 +0000 (13:35 +0000)]
Merge "BUG-1305: improved antlr grammar handling of unknown nodes."
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>
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>
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>
Tony Tkacik [Tue, 29 Jul 2014 09:25:01 +0000 (09:25 +0000)]
Merge "BUG-461 Test transformation of rpc input using XmlDocumentUtils"
Tony Tkacik [Tue, 29 Jul 2014 09:14:02 +0000 (09:14 +0000)]
Merge "BUG-1413: fixed bug in antlr grammar."
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>
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>
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>
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>
Tony Tkacik [Mon, 28 Jul 2014 15:03:00 +0000 (15:03 +0000)]
Merge "Degrade DataNodeContainer.getChildNodes() from Set to Collection"
Tony Tkacik [Mon, 28 Jul 2014 15:01:43 +0000 (15:01 +0000)]
Merge "Improve performance of SchemaContext.findModuleByName()"
Tony Tkacik [Mon, 28 Jul 2014 15:01:27 +0000 (15:01 +0000)]
Merge "Fix Ip{Address,Prefix}Builder performance"
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>
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>
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>
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>
Robert Varga [Mon, 28 Jul 2014 09:50:14 +0000 (09:50 +0000)]
Merge "Convert SchemaSourceRegistration to extend ObjectRegistration"
Tony Tkacik [Mon, 28 Jul 2014 09:39:04 +0000 (09:39 +0000)]
Merge "BUG-1412: fixed bug in antlr grammar."
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>
Tony Tkacik [Mon, 28 Jul 2014 08:54:21 +0000 (08:54 +0000)]
Merge "BUG-432: remove type argument from Registration"
Tony Tkacik [Mon, 28 Jul 2014 08:39:42 +0000 (08:39 +0000)]
Merge "Cache public view of children of AbstractImmutableDataContainerNode"
Tony Tkacik [Mon, 28 Jul 2014 08:39:30 +0000 (08:39 +0000)]
Merge "Optimize AbstractDocumentedDataNodeContainer.getDataChildByName()"
Tony Tkacik [Mon, 28 Jul 2014 08:37:55 +0000 (08:37 +0000)]
Merge "BUG-997: Introduce SchemaSource respository and related APIs"
Tony Tkacik [Mon, 28 Jul 2014 08:15:17 +0000 (08:15 +0000)]
Merge "BUG-865: remove InstanceIdentifier.Builder.getIdentifier()"
Tony Tkacik [Mon, 28 Jul 2014 08:13:43 +0000 (08:13 +0000)]
Merge "Rework data.api.InstanceIdentifier to work on Iterables"
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
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>
Robert Varga [Mon, 28 Jul 2014 06:41:03 +0000 (06:41 +0000)]
Merge "Bug 1392: New yang-common/util classes"
Robert Varga [Mon, 28 Jul 2014 06:40:52 +0000 (06:40 +0000)]
Merge "Bug 1386: Added DeadlockDetectingListeningExecutorService"
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Tony Tkacik [Fri, 25 Jul 2014 11:17:10 +0000 (11:17 +0000)]
Merge "BUG-1381: guide users to use external synchronized block"
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>
Tony Tkacik [Fri, 25 Jul 2014 08:16:26 +0000 (08:16 +0000)]
Merge "Fix XmlStreamUtils writing attributes."
Tony Tkacik [Fri, 25 Jul 2014 08:10:53 +0000 (08:10 +0000)]
Merge "BUG-1414: fix InstanceIdentifier.child(Class, Object)"
Tony Tkacik [Fri, 25 Jul 2014 07:58:43 +0000 (07:58 +0000)]
Merge "BUG-1407 fix."
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>
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>
Robert Varga [Wed, 16 Jul 2014 20:56:41 +0000 (22:56 +0200)]
BUG-1381: guide users to use external synchronized block
This will prevent potential misuses and allow us to scale the utility
class further.
Change-Id: I14bbbf76ccfc7e0ff7942880b25d1f6d5964283e
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 24 Jul 2014 11:42:18 +0000 (13:42 +0200)]
BUG-1414: fix InstanceIdentifier.child(Class, Object)
The result of the method is always a KeyedInstanceIdentifier, so let's
not force users to use casts.
Change-Id: Icabb8999445ff64936e7a32a69eacfc2c9647c64
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 24 Jul 2014 11:08:37 +0000 (13:08 +0200)]
Speed up augmentable class serialization
During debugging an unrelated issue, we have noticed the following
cropping up in thread dumps quite often:
java.lang.Thread.State: RUNNABLE
at sun.reflect.Reflection.getCallerClass(Native Method)
at java.lang.Class.getDeclaredField(Unknown Source)
at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$AugmentableDispatchCodec.getAugmentations(LazyGeneratedCodecRegistry.java:977)
at org.opendaylight.yangtools.sal.binding.generator.impl.LazyGeneratedCodecRegistry$AugmentableDispatchCodec.serialize(LazyGeneratedCodecRegistry.java:968)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.bandwidth.object.Bandwidth$Broker$Codec$DOM.toDomStatic(Bandwidth$Broker$Codec$DOM.java)
at org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev131024.pcep.client.attributes.path.computation.client.reported.lsp.Path$Broker$Codec$DOM.toDomStatic(Path$Broker$Codec$DOM.java)
Leading to conjecture that the native call is pretty costly. This
patch introduces a weakly-keyed cache of reflection handles, which
should improve performance.
Change-Id: Ie7001df912c47c77bee8127a2258e8a6a4dce469
Signed-off-by: Robert Varga <rovarga@cisco.com>
Robert Varga [Thu, 24 Jul 2014 10:29:16 +0000 (10:29 +0000)]
Merge "Documented Augmentable Codec"
Tony Tkacik [Thu, 24 Jul 2014 08:01:24 +0000 (10:01 +0200)]
Documented Augmentable Codec
Change-Id: Icecb78a557d41b49bce4af673aeae247c8b258d3
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Tony Tkacik [Wed, 16 Jul 2014 11:50:53 +0000 (13:50 +0200)]
Bug 1363: Introduced ModifiedNodeDoesNotExistsException.
Introduced new checked exception ModifiedNodeDoesNotExists.
This exception is thrown when node which has subtree
modification did not exist at time of transaction allocation
and also do not exist when allocation was processed
to be commited.
Change-Id: I54f040034b43bfaf4bdda089ad9d2378ddd6ab09
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Robert Varga [Wed, 9 Jul 2014 18:43:27 +0000 (20:43 +0200)]
Remove XmlDocumentUtils.fromElement()
This method is completely unused, so let's remove it.
Change-Id: I5aa8fd646e925c3a92b0acec5041127be954a06d
Signed-off-by: Robert Varga <rovarga@cisco.com>
Tony Tkacik [Tue, 22 Jul 2014 09:30:32 +0000 (09:30 +0000)]
Merge "BUG-979: reworked data schema nodes ordering"
Tony Tkacik [Mon, 21 Jul 2014 15:54:59 +0000 (15:54 +0000)]
Merge "Revert "BUG-1097: implemented check for null or empty list in builder classes.""
Tony Tkacik [Mon, 21 Jul 2014 14:59:20 +0000 (16:59 +0200)]
Fixed uninitialized DOMResult in XML codecs.
Change-Id: I8c0833985b42be304edc445c40a5528ed8a2dcbe
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Tony Tkacik [Mon, 21 Jul 2014 14:03:50 +0000 (14:03 +0000)]
Revert "BUG-1097: implemented check for null or empty list in builder classes."
This reverts commit
883ae26ee98953a5df7cc0956afa807a82d58a3a
which was breakage in Binding Specification and should not
be merged without community-wide discussion.
Change-Id: Ifda1124d974b1ce299551be80a84c45b85b4155a
Signed-off-by: Tony Tkacik <ttkacik@cisco.com>
Tony Tkacik [Mon, 21 Jul 2014 13:29:31 +0000 (13:29 +0000)]
Merge "BUG-1281: move the default codec"
Tony Tkacik [Mon, 21 Jul 2014 13:29:04 +0000 (13:29 +0000)]
Merge "Move XmlDocumentUtils.writeValueByType()"