Stephen Kitt [Fri, 21 Dec 2018 10:48:13 +0000 (11:48 +0100)]
Bump to odlparent 3.1.5
Upgrading xtend-maven-plugin to 2.16.0 and removing dependency
override.
Change-Id: Ia00a0698e40d14b75c5d4eb2eac3794d5928af5f
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 25 Nov 2018 15:01:34 +0000 (16:01 +0100)]
Separate out single-key Identifiable handling
We can further optimize IdentifiableItemCodec by separating
out the common case of a single-key from multiple-keys.
This allows us to specialize ImmutableMapTemplates we use for
the two cases, more efficiently binding to
NodeIdentifierWithPredicates constructor.
Furthermore we can specialize key constructor invocation such
that we directly invoke the constructor for single-key identifiers,
without the need to iterate and allocate arrays.
JIRA: MDSAL-387
Change-Id: I2fc26dc7285bfb3fe829b8b0efd9937daf6fbc8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
581410c9bc93c396631b8a09be0df7bc3faf03d3)
Robert Varga [Fri, 23 Nov 2018 00:30:08 +0000 (01:30 +0100)]
Optimize IdentifiableItemCodec
ImmutableMapTemplate allows us to instantiate space-efficient
ImmutableOffsetMaps very quickly, because we know exactly what
keySet() we are going to use, including our preferred ordering.
Use this class to instantiate keyValueContexts and also create
NodeIdentifierWithPredicates.
JIRA: YANGTOOLS-917
Change-Id: I087083fe4e1914bb5d8e58b9e378ebda9e070793
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
f6557f4f6831805301ea4690596310fcc03247c3)
Robert Varga [Mon, 26 Nov 2018 18:59:48 +0000 (19:59 +0100)]
Fix mdsal-binding-spi's relativePath
It should be empty, as we are inheriting from odlparent.
Change-Id: Ia7491e287ca7fe09cb3ece63a4c3943b7652a979
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 26 Nov 2018 08:48:56 +0000 (09:48 +0100)]
Bump yangtools to 2.0.13
This brings in the latest patch release.
Change-Id: I4a35bd7cafa38f7c60a3d9c330494f58a71c4b35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 25 Nov 2018 18:39:00 +0000 (19:39 +0100)]
Use internal classes for codecs
As we are exposing codecs through package-private interfaces, there
is no point in hiding the implementation class. This helps JIT to
devirtualize the calls.
Change-Id: I74262f76380c27c3cfbc6af2d97d69bd4f57bf9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
76afd0a109e9196d64ffde4c6980085779e984eb)
Robert Varga [Sun, 25 Nov 2018 15:15:23 +0000 (16:15 +0100)]
Bind invoker method handle to constructor
We only ever pass the constructor method handle to the invoker,
hence we can make this a constant by binding the invoker handle
to the constructor -- saving us a field.
Change-Id: I547f7eac202389aa0f7308266b2f3a451a2f83a3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
115d5e187372ec39779e97d0ab6c5cc8140a94e9)
Robert Varga [Wed, 14 Nov 2018 15:40:29 +0000 (16:40 +0100)]
Use ImmutableMaps for lazy augmentations initialization
Rather than tracking lookups in two separate ConcurrentMaps, we
perform locked atomic updates in copy-on-write immutable structure.
The two lookup maps are kept in ImmutableMaps, which offer tighter
packing and do not incur any further volatile reads beyond getting
a reference to them.
This results in lower memory overhead, as the maps are more tightly
packed and also biases performance towards the dominant use case,
which is pure lookups.
JIRA: MDSAL-391
Change-Id: I65ecb25a5d364040be44df144000d1bbbc2a922e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d349008b4936f7e128ec292a66e05f3e9bd57e73)
Robert Varga [Fri, 16 Nov 2018 09:20:45 +0000 (10:20 +0100)]
Index getter methods by String
Looking up by String offers slight advantage over Method lookup,
because we'll end up with a constant hashCode() over objects which
are guaranteed to be interned.
This rework implies we no longer get to have a map whose keySet
reflects property methods -- which is fine, as the keyset would
take up more memory than a plain array, so we retain the methods
in an array -- hence this ends up being a net win in both cases.
JIRA: MDSAL-398
Change-Id: I36526ce15735d4ef8e4ba847bcc24ea69b950e94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
4c0eb46c1924ca71bb4092b0c91fceb5b790e3f8)
Robert Varga [Sun, 18 Nov 2018 20:58:17 +0000 (21:58 +0100)]
Do not box result twice
result is an int while both cache and return type are Integer,
instantiate a local variable to hold the boxed value so we not
box twice.
Change-Id: I659b60b40d0d1dfa1eee25d214af4a096bf3e60e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 13 Nov 2018 14:13:41 +0000 (15:13 +0100)]
Cache mismatched augmentations
Address a FIXME around caching of mismatched augmentations, as it
seems openflowplugin is doing this on purpose.
The cache is expected to be needed infrequently in terms of associated
objects as well as modified infrequently, hence we use a space-efficient
ImmutableMap.
JIRA: MDSAL-388
Change-Id: Id86d8c713ee1014d9d4867558032ba3ccd51fc45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
c44477a41ca49f9fddf92b56a129f915741de5c7)
Robert Varga [Fri, 16 Nov 2018 07:15:42 +0000 (08:15 +0100)]
Index cached data by method name
Method.hashCode() is not a constant, whereas String.hashCode() is
pre-computed (for interned Strings). As Method.getName() is guaranteed
to be interned and getters have zero arguments, a method's name
is enough to uniquely identify the corresponding piece of data.
Therefore use Method.getName() to index cachedData.
Change-Id: Ie9fec477bd7346042e3700695588bc526fd56dac
JIRA: MDSAL-398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
5a4700262acd57d7ff878a0d690109e80de6f537)
Robert Varga [Fri, 16 Nov 2018 06:51:27 +0000 (07:51 +0100)]
Switch on method names
Method names are guarateed to be interned by the JVM, hence their
hashCode is O(1) -- making them a prime target for a switch statement,
which side-steps the need to run String.equals() slow path most of
the time.
JIRA: MDSAL-398
Change-Id: Ie57c2f9fd8c3757ec08e1be945b08d66ebbcff4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
b4db803c07b50d2f3f7977e0509dbb60724c4b1d)
Robert Varga [Fri, 16 Nov 2018 06:47:39 +0000 (07:47 +0100)]
Switch on parameterCount
The else case here assumes parameterCount being 1, make that explicit,
resulting in cleaner code.
JIRA: MDSAL-398
Change-Id: Ie3fa47de6b1630e98a426da69bb6c6d2b6b4b026
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
312facb6827886b2a129b754e416809a2115b878)
Robert Varga [Fri, 16 Nov 2018 06:38:51 +0000 (07:38 +0100)]
Use Method.getParameterCount()
Java 8 introduced this method, which bypasses array cloning done
by getParameterTypes(), making it more efficient. Take advantage
of it.
JIRA: MDSAL-398
Change-Id: Id5d4972ba20d63a8ff79e4adbdf6d2adbfce0b87
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d90adcf214a8f17ae5de22cf8964cbb2a9963972)
Robert Varga [Fri, 16 Nov 2018 06:34:37 +0000 (07:34 +0100)]
Define getImplementedInterface name in BindingMapping
This moves the definition from LazyDataObject to a common place,
so we have one place which defines it. Also remove unused Throwable
declaration.
Change-Id: Icfbc861419fca3b207e9aebfc2b00ddf8a1fc38f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ee3d79b4cd72051048d734407a23981051f21197)
Robert Varga [Thu, 8 Nov 2018 14:09:49 +0000 (15:09 +0100)]
Prevent NPE from being propagated from LazyDataObject
Rather than incurring a NPE when we fail to find proper
NodeContextSupplier, add an explicit verifyNotNull() check to
throw a more explanatory VerifyException.
Change-Id: Ieed6d050bccfe482f69152b33a9a84bbe20037c2
JIRA: MDSAL-18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
93e1775598fde7a18b2cf21b9009c50474411ea4)
Robert Varga [Thu, 8 Nov 2018 14:01:07 +0000 (15:01 +0100)]
Refactor DataObjectCodecContext.getBindingChildValue()
Using instanceof checks is an OOP anti-pattern, which we do not
want here anyways. Generalize NodeCodecContext.defaultObject()
to return null by default and refactor decoding to rely on it,
with LeafNodeCodecContext returning whatever it has as a default
value.
Change-Id: I2b58bc7f1a16496cf6bc93fd7a33aec38f864597
JIRA: MDSAL-18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
5376803e1c41d25f4c8e6e2ca38dc5e4d9fc18fb)
Robert Varga [Mon, 15 Oct 2018 10:22:09 +0000 (12:22 +0200)]
Speed up DataObjectCodecContext instantiation
Do not bounce multiple times to bindingClass(), but rather store
it in a local variable. Since we are here, also update other callers
of bindingClass().
Change-Id: Ia093d5dbdff16f6ec17f96c71895cb292eb12862
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
2b5988887490b942f1c9978f6792f5b93980afb6)
Stephen Kitt [Tue, 6 Nov 2018 16:08:35 +0000 (17:08 +0100)]
Fix AbstractTypeMember toString()
It shouldn't reference MethodSignatureImpl.
Change-Id: I20c44fe66b76daa5fb8ccd51485e57c1da0e932c
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit
2786e60fbb57e29857adebfe2c4e2a03da80b01b)
jenkins-releng [Tue, 20 Nov 2018 23:48:14 +0000 (23:48 +0000)]
Bump versions by x.y.(z+1)
Change-Id: I67eb31aaba226b77b83e04fda7fae5f9383766f9
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Robert Varga [Mon, 15 Oct 2018 12:44:48 +0000 (14:44 +0200)]
Try harder to acquire class mapping
We can perform a third try when we failed to load an augmentation
using TCCL by installing the candidate class classloader as the TCCL.
This can help in situations where we are invoked from a context where
the TCCL is not set up to actually see binding classes properly.
JIRA: MDSAL-379
Change-Id: I56d65494cbce32aee0592e3f0799a2bf283e6d17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
fde5334962bdf4e098af5c869e723e4c4c06c606)
Stephen Kitt [Thu, 11 Oct 2018 09:49:12 +0000 (11:49 +0200)]
Bump to odlparent 3.1.4 and yangtools 2.0.12
Change-Id: Ia84f914d4d14503fb0f9522ba85f41c74d2ab9ed
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Sat, 13 Oct 2018 09:35:56 +0000 (11:35 +0200)]
Relax LazyDataObject.augmentations() implementation
We use double-checked locking to guard against concurrent
initialization of cachedAugmentations. While this ensures we do
not do the same work twice, it is a bit costly for the typical
case when the augmentations field is accessed once.
During the first call, we perform:
- a volatile read
- a lock acquire
- a volatile read
- compute the value (exclusive)
- a volatile write
- a lock release
Rather than doing that, allow the value to be computed concurrently
and use compare-and-swap to initialize it. Hence for the first call
we perform:
- a volatile read
- compute the value (concurrent)
- a compare-and-set
In case of concurrent initialization, all threads will compute
the value, but all except the first one will issue another volatile
read and throw their work away.
JIRA: MDSAL-377
Change-Id: I1dbf9c4e60cf9800720eea31bd9de936b1dae5aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6379e438ee4c8496c7d71865b1a29409dcd06d7b)
Robert Varga [Sat, 13 Oct 2018 08:28:34 +0000 (10:28 +0200)]
Builder should acquire augmentations only once
While generated DataObjects have this method simple, LazyDataObject
constructs the map lazily and caches it -- hence additional access
is forcing an additional volatile read.
Therefore instead of invoking augmentations() twice, store its
result in a local variable and reuse that.
Change-Id: Ifbe2002bb7edbd253d65b5bdc1e53c4d687bed32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 13 Oct 2018 08:54:39 +0000 (10:54 +0200)]
Optimize AbstractBuilderTemplate key property sort
Rather than using a lambda for each comparison, create a constant
Comparator and reuse it.
Change-Id: I0b5af97b485f65924adb2de369a69e03027af887
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
8fde45a68a9a39ac9358e720f1e8f0791c8703a3)
Robert Varga [Sat, 13 Oct 2018 08:38:32 +0000 (10:38 +0200)]
Use ArrayList.sort() instead of Collections.sort()
We do not need Collections, as we have Java 8 and hence can
directly use List.sort(). This has the side-effect of
short-circuiting to ArrayList's implementation.
Change-Id: If978265242275014c586fcf92d96d5ba09bb7bca
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 12 Oct 2018 14:14:31 +0000 (16:14 +0200)]
Fixup javassist class use #2
Somehow Ib19477ece9e76b735285df3b553ca9504579f8c9 got munged
in Fluorine release train. This patch fixes it up.
Change-Id: I3f14edd27539fea03006a4c98d2f49c10099ed20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Thu, 11 Oct 2018 13:44:52 +0000 (15:44 +0200)]
Fix infinite recursion in ForwardingWriteTransaction
put() calls itself instead of delegating. This patch fixes that.
Change-Id: I4d42bbae0952e12f17ddfd46ad08cf06e746cf70
Signed-off-by: Stephen Kitt <skitt@redhat.com>
(cherry picked from commit
ab8addc791ca009a381e54c6d6344695052afe37)
Robert Varga [Wed, 10 Oct 2018 17:43:41 +0000 (19:43 +0200)]
Separate out builder/impl copy generators
Builders are taking an immutable implementation of target type,
hence for list entries they can rely on the key to be present and
do not have to check it. Implementations need to account
for the builder key being set to null, hence they need to
instantiate the key themselves.
This patch separates the two code paths, so both cases are properly
expressed in the object hierarchy. This allows us to simplify
the abstract template, removing weird boolean-based decisions.
We also promote implementation constructor to package-visible, which
allows javac to skip generation of synthetic accessor.
We further optimize the template output by capturing importedNames
when they are reused -- leading to xtend generating cleaner Java code.
JIRA: MDSAL-374
Change-Id: I3274e35780b8e6a56d470caf80459e9e115a5374
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
3a2c2590fe64953e59953c9a7dde5e97ecfe34ec)
Robert Varga [Thu, 4 Oct 2018 15:17:42 +0000 (17:17 +0200)]
Make sure we compare key members via their property name
As it turns out, simple comparison ignoring cases does not correctly
work if the schema is using CamelCase. We need to do the hard work of
deriving Binding property name and sort on that to be consistent with
what the codegen does.
JIRA: MDSAL-355
Change-Id: I34cdb032fbdeb093e2973b91c5011e302e6280bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Thanh Ha [Fri, 17 Aug 2018 17:39:36 +0000 (13:39 -0400)]
Migrate conceptual-data-tree to RST
Change-Id: Ic3c417a1f985055b0a80e3162940480c674d4712
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
(cherry picked from commit
e954c42ed4def1ff1326986d088f1a533311cb95)
Thanh Ha [Sat, 18 Aug 2018 02:47:54 +0000 (22:47 -0400)]
Set Fluorine branch version to Fluorine for RTD
Change-Id: I701e987b19a2e909f1d597fe251cf5ec1146d5d6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Fri, 17 Aug 2018 18:15:45 +0000 (14:15 -0400)]
Remove AsciiDoc documentation
Completed migrating these files to RST so remove the
AsciiDoc copy.
Change-Id: I92862e9bb3cd7e0d1263627da47a753319fb68dd
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
(cherry picked from commit
c9e3d948110213fb7777345e50ebf3d3c9c0dd6c)
Jakub Tóth [Fri, 14 Sep 2018 08:44:14 +0000 (10:44 +0200)]
Fix KeyedListAction serialization
SchemaRootCodecContext needs to understand both Action and
KeyedListAction, as their parameterizations differ.
JIRA: MDSAL-371
Change-Id: I405a73b1a8ca8801ae1786be704cefe674c5fb72
Signed-off-by: Jakub Tóth <jakub.toth@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 17 Sep 2018 08:58:25 +0000 (10:58 +0200)]
Bump yangtools to 2.0.11
This brings in latest fixes.
Change-Id: If33433d57695e584f4aa114213251ed0cbbd7bfa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 18 Sep 2018 08:30:13 +0000 (10:30 +0200)]
MDSAL-370: expose LogicalDatastoreType-aware constructor
This exposes the constructors needed to customize the underlying
data tree instances -- both through direct configuration and via
LogicalDatastoreType.
Change-Id: I056d74f4059cca792aa49e5463570b35e1d0005a
JIRA: MDSAL-370
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 10 Aug 2018 08:51:45 +0000 (10:51 +0200)]
Fixup javassist class use
We need to cast the returned class, as the Javassist API no longer
does so.
Change-Id: Ib19477ece9e76b735285df3b553ca9504579f8c9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 8 Aug 2018 09:10:46 +0000 (11:10 +0200)]
Activate BUG-6135 test
The underlying bug was fixed long time ago, but the corresponding
test was not activated. Fix that.
Change-Id: I97a31722a4cf5145f6f3c6a1ef3eba5f1f213d25
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
351db7989bdb5fba3695383d408e7af391e29d9d)
Jie Han [Fri, 17 Aug 2018 08:46:44 +0000 (16:46 +0800)]
Fix set schema context to action routing table
Change-Id: I33b400f05a0fafa01f64f64c599e457257f3ae02
Signed-off-by: Jie Han <han.jie@zte.com.cn>
(cherry picked from commit
05c28017d6c7613375abbed637a4063c88751f1e)
jenkins-releng [Thu, 30 Aug 2018 16:51:20 +0000 (16:51 +0000)]
Bump versions by x.y.(z+1)
Change-Id: I9d6e2da7ef180ea46476e708c93855cd026f18b1
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Robert Varga [Wed, 25 Jul 2018 12:16:29 +0000 (14:16 +0200)]
Rework ClusterSingletonServiceGroupImpl locking
The problem we are are seeing is a classic AB/BA deadlock, hence
we need to change how serviceGroup is handled. This patch reworks
ClusterSingletonServiceGroupImpl to separate state tracking from
service startup/shutdown mechanics.
State locking is separated out into three domains:
- entity state, guarded by ClusterSingletonServiceGroupImpl object
- service membership, tracked in a ConcurrentMap
- service instantiation, guarded by a simple CAS-based lock
Furthermore anytime state changes, we mark this fact in a volatile
variable. Whenever we observe dirty state, we attempt to reconcile
it -- if we can also acquire the service instantiation lock.
Each registered service is tracked separately, so we do not have
to have wholesale aggregator futures for stopping services and can
also start newcomer services without causing weird state tracking
disruptions.
Splitting state tracking and service instantiation leads to faster
group shutdown, because when a group is being closed we know we can
unregister the service entity irrespective of the state of user
services. Unit tests, especially asynchronous, are updated to account
for this accelerated shutdown procedure.
This has the benefit of improving inter-node failover latency,
because the process of user service shutdown and service entity
unregistration runs concurrently. That leads to lower likelihood
of the new service entity owner having to block on becoming
the cleanup entity owner, as services which shut down quickly
will have released the cleanup entity by the time the new owner
is selected.
JIRA: MDSAL-362
Change-Id: I7cd82f81da9135591e4242a196cc0f06a78973a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 30 Jul 2018 07:40:05 +0000 (09:40 +0200)]
Fix enumeration leafref lookup
Leafref lookup for straight uses of enumeration typedefs seems
to be failing. The code in question seems to rely on weird assumptions,
hence this patch places a FIXME and turns an alternative branch
into a fallback if the weird code fails to find a definition.
This also activates ietf-hardware models.
JIRA: MDSAL-352
Change-Id: I6d342c7418c1538ee928f85b33f8f58da8aca5c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6e6a3ea2c895e31da3a74da26fb0462095594cb1)
Anil Belur [Thu, 9 Aug 2018 12:12:25 +0000 (17:42 +0530)]
Update .gitreview to stable/fluorine
Change-Id: I6afe87ca4a96cff5e47cac0a2da007ff47fcfd94
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
Robert Varga [Sat, 28 Jul 2018 17:48:51 +0000 (19:48 +0200)]
Add ietf-hardware model
This adds ietf-hardware model, updating previously-defined features.
Unfortunately, this does not wuite work yet, as MDSAL-352 needs to
be fixed.
Change-Id: I6ce999e20cca870e043e42da42f264d9242dc872
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Thanh Ha [Wed, 1 Aug 2018 01:34:53 +0000 (21:34 -0400)]
Migrate Architecture doc to RTD
Change-Id: Ibed073a93ed1fc660a3b6ea36a608e76d9cc8b1e
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Thanh Ha [Wed, 1 Aug 2018 01:18:19 +0000 (21:18 -0400)]
Migrate overview page to RTD
Change-Id: I04278ca050c73785929e38451cafb01609fe1601
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Jie Han [Mon, 9 Apr 2018 01:06:25 +0000 (09:06 +0800)]
MDSAL-320 Mapping type collisions between yang built-in uint* and int*
- Use yang.commom.Uint* instead of java primitive types
and fix up the correlative UT.
- Add Uint*RangeGenerators, temporarily hard code
min and max values which would better be provided
by yang.common.Uint*.
Change-Id: Ieaa04c36f4f8a148cdf9740cdf544283fbecc4a8
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Robert Varga [Mon, 6 Aug 2018 15:49:05 +0000 (17:49 +0200)]
Bump yangtools to 2.0.10
This fixes an issue with actions, hence we need it in Fluorine.
Change-Id: I557bc824fdbe3d957a36caada17428e10fd2ab24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Aug 2018 16:46:57 +0000 (18:46 +0200)]
Avoid depending on immutables.value at runtime
Change-Id: Ia257d8d30cf51333a30b1244f1cd56886a7569de
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 18 Jul 2018 16:36:33 +0000 (18:36 +0200)]
Add DOMAction(Provider)Service facades
DOMRpcRouter needs to be able to route actions, i.e. implement
DOMActionService and DOMActionProviderService. Add facades
and implement them.
Change-Id: I9f66f3aee5ab5b63c2d0dcb3571831a7913a4650
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 6 Aug 2018 08:44:48 +0000 (10:44 +0200)]
Fix raw type warnings and null safety errors
This fixes up warnings.
Change-Id: Ib46adb83ea76cb0c2e62d9976e87d0d81b7275be
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 4 Aug 2018 00:56:15 +0000 (02:56 +0200)]
Remove MappingCheckedFuture
This class has been moved to controller.
Change-Id: Ib98d2d7c05d16ce66431ef7cb311a571f75e09e0
JIRA: MDSAL-229
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 4 Aug 2018 00:55:20 +0000 (02:55 +0200)]
Deprecate MappingCheckedFuture
CheckedFutures are not used anywhere in MD-SAL, this class is moved
to Controller.
JIRA: MDSAL-229
Change-Id: I5ce538edca4c902cc38b8aad0457927563f2f8b8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 4 Aug 2018 00:48:39 +0000 (02:48 +0200)]
Revert
4cc8455a7232d6833ba88911ad5c45a77ddda3dc
String utilities are not useful, as the functionality is provided
by generated code -- stringValue() does it for all unions.
Change-Id: I5f93d17d89601ceaa91e176a5f119d5c08e75d5f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 4 Aug 2018 00:07:58 +0000 (02:07 +0200)]
Get rid of CheckedFutures
We do not really need them, so let's replace them where we can.
Change-Id: I06dd05d60018a814fb0610096aa8fe5709669980
JIRA: MDSAL-229
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Jie Han [Tue, 24 Jul 2018 08:43:55 +0000 (16:43 +0800)]
Add DOMActionRoutingTable and DOMActionRoutingTableEntry
- Split out AbstractDOMRoutingTable and AbstractDOMRoutingTableEntry
- Provide Action routing table and entry
Change-Id: I6606b2b280344e52d58fb7b6fbec0e76231c2786
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Michael Vorburger [Thu, 21 Jun 2018 15:56:40 +0000 (17:56 +0200)]
inc. BindingRuntimeContext details in "Schema .. is not available"
but in a debug log, not the IllegalStateException, because it's huge.
JIRA: MDSAL-354
Change-Id: I65c236fc3b675e7cf231cc1d8cdc56fc36131281
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Jie Han [Mon, 30 Jul 2018 06:20:07 +0000 (14:20 +0800)]
Remove AbstractDOMRpcRoutingTableEntry.invokeRpc
Make routing entry not directly tied to invocation model and
add an inner static class RpcInvocation in DOMRpcRouter
to be used to invoke rpc with routing entries.
Change-Id: I55fa669bff8a18eb182a579b9dd636294d54e460
Signed-off-by: Jie Han <han.jie@zte.com.cn>
Robert Varga [Mon, 30 Jul 2018 08:44:33 +0000 (10:44 +0200)]
Expose Action(Provider)ServiceAdapter
Allow controller reuse of these adapters, as it is defining only
a shim on top of the baselines.
Change-Id: I49c9b5bda5e2d49c6fbbe839181b8a7e4d3f8d20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 28 Jul 2018 17:37:45 +0000 (19:37 +0200)]
Add iana-hardware and odl-mdsal-model-rfc8348
This starts the addition of {iana,ietf}-hardware models.
Change-Id: I586be5c181c2504ddb30c52888b38028850e79e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Jul 2018 22:08:51 +0000 (00:08 +0200)]
Clean up BaseTemplate
Move logic dispatch methods into JavaFileTemplate, where we can
write the same thing in Java. Also makes a few methods static.
Change-Id: I3ac8c16b5378d0420dcb37c31265f06a5f7770a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Jul 2018 19:32:04 +0000 (21:32 +0200)]
Rework inlined union generation
Unions internal to a leaf union end up being incompletely generated,
as they lack stringValue(), hashCode(), equals() and do not correctly
bind to its enclosing builder -- leading to a generated code not being
compilable.
There are multiple issues here, all of which are addressed in this patch:
- hashCode/equals properties are created in the wrong place
- property return type is set to the builder, not its product
- union builder type is not set as a union
- builders for nested types are not correctly emitted
- Class/InterfaceTemplate use different logic to emit the inner classes
JIRA: MDSAL-320
Change-Id: I626fb4ac42ae6528bc98b809bc33756e8daa08b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Jul 2018 22:57:06 +0000 (00:57 +0200)]
Wire Action(Provider)Service into mountpoints
We need to wire the two adapters so they can be exposed to binding
world from DOM mountpoints.
Change-Id: I63e68b0c7ebfeae2a3fbba64b171196ee9c8e8ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 16 Jul 2018 12:41:01 +0000 (14:41 +0200)]
Add ActionProviderService adapter
A mostly straightforward implementation of ActionProviderService on top
of a DOMOperationProviderService.
Change-Id: I50b7f2d7b03059088be9ba277999c11bc085b385
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Jul 2018 20:53:31 +0000 (22:53 +0200)]
Simplify DOMOperationService API
With DOMRpcService API being cleaned up to use FluentFuture, there
is no need for us to duplicate the API. Introduce a simplistic
DOMActionService API and port all users.
JIRA: MDSAL-283
Change-Id: Id59cd3a8c910dbd79aac87cc6777e8f9d108a749
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Mon, 23 Jul 2018 10:57:25 +0000 (12:57 +0200)]
Add forwarding transactions to binding v1
This ports the forwarding transactions from controller.
Change-Id: I1c1ce1a340424e8fb3f86d7b92fa53d1d623de00
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Jul 2018 21:21:06 +0000 (23:21 +0200)]
Pull in correct version of yangtools
These are new artifacts, they need bumped versions.
Change-Id: I170a9e99dfdaf63a4959dc3ce9f1c2caa8662da6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Fri, 20 Jul 2018 14:08:17 +0000 (16:08 +0200)]
Add forwarding transactions to binding v2
This ports the forwarding transactions from controller.
WriteTransaction::delete is removed to allow WriteTransaction to be
implemented outside its package (it conflicts with
AsyncWriteTransaction::delete).
Change-Id: I7b8c0454b788ef1c5857c7f546005dcd0b4c12a6
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Stephen Kitt [Fri, 27 Jul 2018 15:26:11 +0000 (17:26 +0200)]
Simplify code using Java 8 features
* lambda expressions
* method references
* ThreadLocal::withInitial
* Comparator::comparing
* List::sort
* Map::computeIfAbsent
Change-Id: Ia1eee88a49fe3cb7f07bd90cdaa481ecd5c10003
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Fri, 27 Jul 2018 12:10:13 +0000 (14:10 +0200)]
Bump yangtools to 2.0.9
This patch bumps yangtools to latest release.
Change-Id: I61e0f6549cf21b56bfc5b9c96860b5492c719311
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 26 Jul 2018 22:16:39 +0000 (00:16 +0200)]
Add RFC8349 models
This adds ietf-routing, ietf-ipv4-unicast-routing and
ietf-ipv6-unicast-routing.
JIRA: MDSAL-332
Change-Id: I3bda7f14c617ed1af1b505d1f8511c0bfe31f8a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 26 Jul 2018 23:17:26 +0000 (01:17 +0200)]
Detect and repair identity/grouping/typedef conflicts
We are mapping four distinct YANG namespaces onto a single Java
namespace, which is bound to cause conflicts.
Define a hierarchy of priorities (data, typedef, grouping, identity)
and rename types when a conflict is detected.
JIRA: MDSAL-332
Change-Id: I8f6e5987b2057fba5b7d1534c7688725547a146c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Jul 2018 09:25:14 +0000 (11:25 +0200)]
Remove TypeProviderImpl
This compatibility class is no longer used, remove it.
Change-Id: I408828da2ce1783203a55f98f43bbf4a24c0633a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 27 Jul 2018 01:10:33 +0000 (03:10 +0200)]
Fix actions in keyed lists
When we encounter a keyed list we end up generating an action for
the key, not for the list, which leads to a compilation error.
Change-Id: Iad9a5b449778704a3209d43011060f4a7942b9a6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 26 Jul 2018 23:20:52 +0000 (01:20 +0200)]
Correct test name
mdsal269 -> mdsal161
Change-Id: Idb9d59ad0e47a21aab63ff4f4df93b106693eeb2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 26 Jul 2018 20:16:48 +0000 (22:16 +0200)]
Add RFC8294 models
This adds ietf-routing-types and iana-routing-types.
Change-Id: I5983462c00215c1cfaa1be7a6253b545cf9d5e8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 26 Jul 2018 18:42:56 +0000 (20:42 +0200)]
Do not confuse nested type with available types
Nested types imply the same package, which is not acurate in this
context. Fix this by populating conflictingNames and mark it for
possible future improvement.
Change-Id: Icca087257eaf0c63b9a44204368dd48552da01a4
JIRA: MDSAL-365
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Tom Pantelis [Wed, 25 Jul 2018 18:39:57 +0000 (14:39 -0400)]
Remove deprecated methods from DOMDataTreeCommitCohort
Downstream users have been modified so we can remove the
deprecated default methods from DOMDataTreeCommitCohort.
Change-Id: If298a16298db1537abc0017ea75da387af6fe580
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Wed, 25 Jul 2018 22:25:21 +0000 (18:25 -0400)]
Convert CursorAware APIs to FluentFuture
Corresponding controller patch: https://git.opendaylight.org/gerrit/#/c/74478/
Change-Id: Ie7ff5318506c0d6dcb71fd5b2f205cce35c42593
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Robert Varga [Thu, 26 Jul 2018 09:34:33 +0000 (11:34 +0200)]
Fixup BuilderTemplate decomposition
This patch reworks BuilderTemplate to correctly represent its
generated class layout into GeneratedType hierarchy. This eliminates
a special-case hack in AbstractJavaGeneratedType and fixes overlap
between inherited and imported classes.
JIRA: MDSAL-365
Change-Id: I10affa8fc6e6b6447024744473e95ac1e600cd6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Wed, 18 Jul 2018 16:06:40 +0000 (18:06 +0200)]
Bump to odlparent 3.1.3
Change-Id: I032f846fcd8fb037dde7931caa712b3a24eb41b7
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Thu, 26 Jul 2018 11:05:23 +0000 (13:05 +0200)]
Add Types.builderTypeFor()
This adds a utility accessor to define parameterized builders.
Change-Id: I0de131eefb4674859210703d46b6fb4a69e80f6e
JIRA: MDSAL-365
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Thanh Ha [Wed, 25 Jul 2018 02:20:15 +0000 (22:20 -0400)]
Bootstrap Sphinx documentation
Change-Id: I29052dffa60eff9d32b94e4b43cb0888a45db393
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
Robert Varga [Tue, 24 Jul 2018 16:29:37 +0000 (18:29 +0200)]
Update internal structure to pass registrations
Within lusterSingletonServiceGroupImpl we need identity-based
lookup, which ObjectRegistration provides.
This is useful for keeping additional per-service state without
relying on user's equals() method.
JIRA: MDSAL-362
Change-Id: I01fd1f34a689a2c8f50ff7efc590f713a0212354
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 25 Jul 2018 10:12:30 +0000 (12:12 +0200)]
Fix up build breakage
This fixes up a mismerge.
Change-Id: I2364a14b93b81531f3b85f2b0cac1e5830b388b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Tom Pantelis [Tue, 24 Jul 2018 19:00:05 +0000 (15:00 -0400)]
Change DOMDataTreeCommitCohort to FluentFuture
CheckedFuture is deprecated. Since this API is already in use
I added a new method that returns FluentFuture and deprecated and
defaulted the existing one. So no downstream breakage. I will
follow-up downstream to change to the new method.
Change-Id: Ia8b76e5daed5bae55f7666b627c317cbbfac97ee
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Tom Pantelis [Tue, 24 Jul 2018 00:05:19 +0000 (20:05 -0400)]
Change DOM invokeRpc to FluentFuture
CheckedFuture is deprecated.
This breaks the controller - corresppnding patch is
https://git.opendaylight.org/gerrit/#/c/74366/
Change-Id: I08f396b872699512171a24732d9473ca96b89778
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Robert Varga [Mon, 23 Jul 2018 22:13:00 +0000 (00:13 +0200)]
Move BindingMapping
This class is used only internally in md-sal, move it
mdsal-binding-spec-util, as it is not part of the spec (as viewed
by users).
This requires creating of RegexPatterns, which is a shared component
to ensure consistency.
Change-Id: If572bb97643f28354ba5c69f0addaf0ee02388d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 15:41:19 +0000 (17:41 +0200)]
Remove BindingReflections from yang-binding
This is a utility reflection class, it should not be present in
yang-binding itself. It resides now in mdsal-binding-spec-util.
Change-Id: Ic5ecfb9f94f0199c4fe4be9f50a7f7f2977384da
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 11 Jul 2018 16:24:41 +0000 (18:24 +0200)]
Eliminate Union char[] constructor
This is a JMX-specific hack, which we no longer need to support,
remove it. This also removes getValue(), which could conflict with
user-specified type.
JIRA: MDSAL-364
Change-Id: If6e97c453beda1499722359080155720c2da1aaa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 23:11:36 +0000 (01:11 +0200)]
Add PhysAddress support
This adds converions required for efficient PhysAddress support.
Change-Id: Ia07e07361fc0fdea3cc2a2b96e65643d60aef003
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 16:39:15 +0000 (18:39 +0200)]
Optimize Ip{Address,Prefix}Builder
These builders are heavily used and are overly defensive, to the point
where they do not follow YANG specification -- which clearly states that
members need to be tried in the order of declaration.
This means there is no ambiguity between ipv4 and ipv6 and if IPv4
succeeds, that's what we'll use. This allows us to reduce number
of regex matches performed, which retaining correctness.
Also remove ugly duplication of patterns are pick them up from the pattern
constants in the class.
Change-Id: Ia35d040881e721375b240dd5848ad9501ae2e192
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 15:25:34 +0000 (17:25 +0200)]
Move BindingReflections to mdsal-binding-spec-util
This is the first stage of movement: create a copy of the class
and migrate the test suite.
Change-Id: I0d229ccd4277b917c99414dd8ba698f497629ec3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 11:18:50 +0000 (13:18 +0200)]
Move StringValueObjectFactory to mdsal-binding-spec-util
This class does not need to reside in yang-binding, move it out
into mdsal-binding-spec-util.
Change-Id: Ib2f178e579ab814cb8c8977d5740d6077d5fa9e5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 12:32:52 +0000 (14:32 +0200)]
Move DataObjectReadingUtil to mdsal-binding-spec-util
This moves access utility from yang-binding to mdsal-binding-spec-util,
as it has no place in yang-binding.
Change-Id: Ieda67f69da45183dfcd75d7828cc244839b25cde
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 12:16:39 +0000 (14:16 +0200)]
Move NotificationListenerInvoker to mdsal-dom-adapter
These classes should not be in yang-binding, as their concern lies
in runtime API realization. Move them to mdsal-dom-adapter.
Change-Id: I5fd470796e9251f6c69a8ca3568bb17ddc0ce5a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 10:43:42 +0000 (12:43 +0200)]
Move RpcServiceInvoker to mdsal-dom-adapter
These classes should not be in yang-binding, as their concern lies
in runtime API realization. Move them to mdsal-dom-adapter.
Change-Id: I5640c2f169b6569dcdbc306580768751791fd415
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 12:13:16 +0000 (14:13 +0200)]
Add NotificationListenerInvoker bridge class
This adds a migration bridge for controller, so we can safely
move NotificationListenerInvoker from yang-binding.
Change-Id: I0ec360a324fb9cb44a886efb99b85916554b437e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 23 Jul 2018 10:35:15 +0000 (12:35 +0200)]
Add RpcServiceInvoker bridge class
This adds a migration bridge for controller, so we can safely
move RpcServiceInvoker from yang-binding.
Change-Id: I6b191fc8cb331d6ceff975e9d5b401b059d02709
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>