Robert Varga [Wed, 15 Jan 2020 13:27:27 +0000 (14:27 +0100)]
Bump to odlparent-5.0.5/yangtools-3.0.9/mdsal-4.0.11
Pick up latest fixes.
Change-Id: I815d5d6e5db5f0c95da9d8573cba7f35490c6ebb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 12 Dec 2019 07:32:52 +0000 (08:32 +0100)]
Bump odlparent/yangtools/mdsal to 5.0.4/3.0.7/4.0.8
Pick up the latest upgrades and fixes.
Change-Id: I9ce990af859e97e6530ceb495e91fcb2d8bec021
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 1 Dec 2019 13:34:50 +0000 (14:34 +0100)]
Rework TypedRowInvocationHandler invocation path
Performing schema lookup/validation is something we usually do only
once for a particular schema and then we can freely perform invocation.
Introduce MethodDispatch{Invoker,Prototype} constructs. MethodDispatch
serves as a the result of reflective analysis of a particular access
class.
When TypedDatabaseSchema accesses that class, the MethodDispatch
is loaded from a global cache and is bound to the schema, resulting
in an Invoker map. That map is then used to dispatch InvocationHandler
requests to the appropriate logic.
Change-Id: Ic97751992fea97b01a6fcfd124edbe783bc86e1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
726107ed803ed48519e256e6f274e543ff6def25)
Robert Varga [Mon, 2 Dec 2019 02:50:45 +0000 (03:50 +0100)]
Migrate TyperUtils.getTableSchema() users
TypedDatabaseSchema has the same capability, migrate users as they
have this functionality at their fingertip.
Change-Id: I51fa3edb2cfda6894f9f9354ee3ab8dc9bdf7c17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
76d89535ee9378bea060593183097b87efaf59c3)
Robert Varga [Mon, 2 Dec 2019 01:49:07 +0000 (02:49 +0100)]
Simplify exception instantiation
There is no point in splitting message format, turn a static utility
method to a direct constructor.
Change-Id: I630fa4742f717abe4be021f86d8d78ff76679ef4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
fc03b6e08559777b39a707732fe0df0e06c72ef2)
Robert Varga [Sun, 1 Dec 2019 18:09:17 +0000 (19:09 +0100)]
Migrate TyperUtils methods to TypedDatabaseSchemaImpl
TyperUtils are utterly stateless while TypedDatabaseSchema can
provide schema binding. Migrate method implementatios there, leaving
a simple lookup compability layer in TyperUtils.
Change-Id: If533c8fd8fe0027e8ca67dcd474b8b92fbadd767
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6ebb6f84f55a7dbc8a0474f8dc8687ffd3e92a08)
Robert Varga [Sun, 1 Dec 2019 11:17:01 +0000 (12:17 +0100)]
Make OvsdbClient return TypedDatabaseSchemas
Centralizing type-safety in client is beneficial in that the users
can use type mapping directly, without having to go through
TyperUtils.
Change-Id: I0f620e515ecb7f9bd140155c046a2c4bf9dc447f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
3d306908d81236b04c17434a89e931fe37d2df65)
Robert Varga [Sun, 1 Dec 2019 10:33:02 +0000 (11:33 +0100)]
Extract TypedRowInvocationHandler
The InvocationHandler used in TyperUtils has significant
functionality, which we want to further extend/optimize. Split it
out into its own class.
Change-Id: I6406150799d805b2c2e0867a37205f54ec1c10bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
0d6be18102aeb3031144c98e05a52d0c17a3afee)
Robert Varga [Mon, 2 Dec 2019 01:09:25 +0000 (02:09 +0100)]
Eliminate OvsdbClientImpl duplication
CPD is pointing out a trivial duplication of monitor(). Fix that
by properly reusing the more flexible version().
Change-Id: I6bfd80ada7d8d2b1fe3f20007d933dd9be9c03b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
ca0b5c323802f0b9d9f88c3df8b648f6e444c605)
Robert Varga [Sun, 1 Dec 2019 10:04:32 +0000 (11:04 +0100)]
De-confuse InvocationHandler and target methods
Having hashCode()/equals()/toString() implemented in InvocationHandler
could lead to confusing the handler with the object being proxied. It
furthermore violates equality contract requirement of being reflexive
-- the handler ends up being equal to other implementations of proxied
interface, but any other implementation would either have to handle
it specifically, or will determined it being non-equal.
Clean up the confusion by renaming the methods and have default
implementations take over. This is explicitly fine, as we do not have
any code accessing the handler directly, only through the proxy.
This also eliminates the need to suppress warnings.
Change-Id: Iac42d09b5a44716e8293c6b1e9003a780efae6f8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
2cf87f876c50a276f6e5ddafc2fb44d5b6c26fbd)
Robert Varga [Sun, 1 Dec 2019 09:45:47 +0000 (10:45 +0100)]
Hide TyperUtils.extractRowUpdates()
This is an internal utility method not used anywhere else, hide
it.
Change-Id: Ie3d7f0d7d2496bb17f323bb5f0848fc88a61b511
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
66489f05a0ea64c09f5f33d64e5ec5a8ebbd1f69)
Robert Varga [Sat, 30 Nov 2019 12:27:24 +0000 (13:27 +0100)]
Add TypedReflections
We have multiple places which are accessing annotation-based type
information. This provides a single place to obtain that information.
As we have proper encapsulation, add caches for table/column
versions. Since we are dealing with Version, this class is updated
to be immutable and provide a Range<Version> factory.
Change-Id: I5c2f1d3553392cbd222a1927fdd36564f895475b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
fe88fed9e88ee27a191143678ac3598296597a12)
Robert Varga [Sun, 1 Dec 2019 11:30:18 +0000 (12:30 +0100)]
Add @NonNull annotation to OvsdbConnectionListener.connected()
Eclipse warns about users overriding unconstrained parameter here,
and we know the instance will not be null. Propagate @NonNull to
the API specification, fixing warnings.
This also fixes similar warnings in other places.
Change-Id: I6cf71c4c0495ba0358157ee12e92b9a7a665b92c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
fa1a9e6b5f2f67d1bb30b2313e83ab49f1fb60f8)
Robert Varga [Sat, 30 Nov 2019 11:22:10 +0000 (12:22 +0100)]
Add TypedDatabaseSchema
This adds a new entrypoint for performing typed operations on top
of DatabaseSchema. The implementation fowards to TyperUtils, allowing
transition away from those utilities.
OvsdbClientImpl is update to always return TypedDatabaseSchema and
use it to implement its interface.
Change-Id: I6e31f418b2acdebdca01181522b6bb7966061617
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6660b3672c5c76b305cc27ea4721ebbc9910dddb)
Robert Varga [Sat, 30 Nov 2019 10:04:23 +0000 (11:04 +0100)]
Turn DatabaseSchema into an interface
This moves all the implementation details out into a separate class,
allowing DatabaseSchema interface to be extended with additional
functionality.
Change-Id: Ib7a0124993cb89bb448b3c08bda6c6de0fea1dde
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
2d789da44333849b2bb2a93fbf7ae22abbbcfb29)
Robert Varga [Sat, 30 Nov 2019 08:26:00 +0000 (09:26 +0100)]
Make TableSchema/DatabaseSchema immutable
Having schemas completely immutable is beneficial, as we can
propagate invariants properly. This patch makes TableSchema
and DatabaseSchema use immutable maps internally, making sure
the final bit is achieved.
Change-Id: Ie7c9fd4aa9cba7f0af88c8886400e8e5c804d6af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
085195eebbac3ef2c4d2dcff483ac542eaa9163a)
Robert Varga [Fri, 29 Nov 2019 15:27:50 +0000 (16:27 +0100)]
Split out BaseTypeFactories
Instantiating BaseTypes with complex definition is a prime example
of where either a builder or a factory pattern is appropriate. Given
we are dealing with a few types with very few customizations, this
patch applies the factory pattern to the problem.
This makes all BaseType subclasses properly immutable and has the
benefit of squashing instances to singletons when they are not
otherwise customized.
Change-Id: I86d09324624c1e5b1a73a0be31269f2233fc15b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
03b5422f041607c1a8af9f7b19eb4616d8471f9c)
Robert Varga [Fri, 29 Nov 2019 14:56:12 +0000 (15:56 +0100)]
Use singleton BaseType instances for simple definitions
We have two distinct cases for a type definition. It is either
a simple reference without any further constraints or it is
customized in some way.
This patch separates the two codepaths, making the former use
singleton instances.
Change-Id: Ic9e63f2320a429bda076e4ae25eea97e5242a52c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
a0a58e9b8e707c05d2e4e827e378e24c132868d7)
Robert Varga [Fri, 29 Nov 2019 13:38:06 +0000 (14:38 +0100)]
Split out BaseTypes
This splits out and hides concrete BaseType classes, hiding them
and untangling BaseType.fromJson() instantiation. This makes object
lifecycle more clear, allowing for future optimization.
Change-Id: I60630b3cd7b02d6e9c241d6e666550ae041c96f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
928af1722dda135d86f78508e5faedc452c250e9)
Robert Varga [Mon, 2 Dec 2019 14:59:39 +0000 (15:59 +0100)]
Do not use reflection in TransactCommandAggregator
We are using a simple dispatch to instantiate a known list of
commands. Rather than using reflection, we wire the internal array
to point directly to constructors, allowing us to invoke them without
reflection -- speeding them up, as access checking is not performed
at all. Also fixes a deprecation warning with Java 11.
Change-Id: I3061c3f1ae3a1a4dcc5a3887915ddca9ae6cf2c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
9ad72607d311b7c003611fa0a1cb6d2a15d15ae6)
Robert Varga [Tue, 3 Dec 2019 14:27:29 +0000 (15:27 +0100)]
Reuse StringEncoders for all connections
StringEncoder is stateless and therefore can be shared across multiple
channel pipelines. Create a single instance for use by all connections.
Change-Id: I660cb90ac3de0476f5637d6a53a8c49826c71f1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 3 Dec 2019 13:35:27 +0000 (14:35 +0100)]
Reuse MappingJsonFactory across all sessions
Heap dump analysis shows we are keeping a per-connection
MappingJsonFactory, which also means we have an ObjectMapper
associated with each connection.
Both MappingJsonFactory and ObjectMapper are documented as
thread-safe and noted to be best shared. Make sure we use a single
instance across all connections.
Change-Id: Ic13ea538eecba9a08d4dba9ac617f2f29abeaba7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 29 Nov 2019 11:58:38 +0000 (12:58 +0100)]
Cleanup HwvtepConnectionManager.getHwvtepGlobalTableEntry()
Rework the flow of this method to get rid of unneeded null
initializer, making the results in error paths clearer.
Change-Id: If7361c71aefd78ae08a385dcfa7e312ad22f2d5d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
83915d7ac784277b1df79bbc34ffa22a5c74369d)
Robert Varga [Fri, 29 Nov 2019 11:29:08 +0000 (12:29 +0100)]
Do not allow DatabaseSchema name/version to be mutated
The setters to do so are not used anywhere, eliminate them, making
it clear these two fields are final.
Change-Id: I817dfb0cc0791c2ad91671b6d5e637c8ae8a0d92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
e93883f2dcf0bc9db2aee076ca851932b6549fc1)
Robert Varga [Fri, 29 Nov 2019 11:23:54 +0000 (12:23 +0100)]
Do not allow TableSchema columns to be directly set
This makes it obvious that the collection is largely controlled
by TableSchema, bringing it another step closer to being immutable.
Change-Id: Iacb375c3cafbe687966729626fe30a3d08e8f31e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6ad4ee4a708a10734161a52afb903e6797991937)
Robert Varga [Fri, 29 Nov 2019 10:47:31 +0000 (11:47 +0100)]
Refactor ColumnType
This factors out the two known implementations, hiding them from
public view in process. Parsing from JSON is factored out so that
we do not have blank singletons just to hook parsing.
Change-Id: I3dd7b110fb0ca3fe18ef879a2c3d24523fc43419
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
a8293448cde818eb893470991b9bc179e181dbce)
Robert Varga [Fri, 29 Nov 2019 10:24:05 +0000 (11:24 +0100)]
Cleanup ColumnSchema
Fields should be private (making it obvious they are final) and
the fromJson() method should be properly generic.
Change-Id: Ic38e4179f1108f41882bd336b3a03b339d435f9c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
347d025f789d5a53f0d24d114905cd6fefd6c311)
Robert Varga [Fri, 29 Nov 2019 10:18:13 +0000 (11:18 +0100)]
Add generated serialVersionUUID to exceptions
Exceptions are serializable and therefore should have a serial
version. Fixes Eclipse warnings pointing this out.
Change-Id: I2cf04412709cf3214b53aa3ac5dc40f332f67295
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
8b8f15eaed3f4ff2e4acba53e04f2c34b6861e2f)
Robert Varga [Fri, 29 Nov 2019 09:27:52 +0000 (10:27 +0100)]
Make GenericTableSchema.fromJson() a factory method
This method is called from precisely one place, which is creating
a new object for the call. Turn allocation around, taking a step
towards immutable schemas.
Change-Id: I97c44da72bc3b63260941bcf7d480a9c0c9e3a4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
f74cb36d4df75f1fcf20014166061e627849a9b0)
Robert Varga [Fri, 29 Nov 2019 09:08:26 +0000 (10:08 +0100)]
Move ObjectMapper to JsonRpcEndpoint
JSON mapping is an implementation detail of JsonRpcEndpoint, hence
move it to that class, allowing us to shed a field and statically
bind to it.
Change-Id: Ie0a314b3aa6c830d9cc5936eb4ec948823ba351c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
6ea8a455e8f3e1a2a099be256f97257a82dde409)
Robert Varga [Thu, 28 Nov 2019 20:52:24 +0000 (21:52 +0100)]
Improve schemas population
Fetching the schema is an asynchronous process, which means we could
end up with competing requests overwriting the schema. Make sure to
re-check presence when the resolution process completes.
Change-Id: I0a7076b7a476394d4815f3c8f544be7a9ffaddd8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
0faae677b33efe1dd5bec783f8e57c5c0a10cdc4)
Robert Varga [Thu, 28 Nov 2019 13:39:59 +0000 (14:39 +0100)]
Turn JsonRpcEndpoint into a proper OvsdbRPC implementation
The Netty wiring and invocation handling is quite arcane here, relying
mostly on reflection to perform dispatch.
There is only a single direct user JsonRpcEndpoint, which expects
a OvsdbRPC to be exposed from it. Furthermore it is obvious that
JsonRpcEndpoint has a 1:1 correspondence with JsonRpcServiceBinderHandler
and that the invocation context used to pass request processing relies
on Netty Channel instance -- to which the JsonRpcEndpoint is already
bound.
This integrates JsonRpcServiceBinderHandler into JsonRpcEndpoint,
thus making the fusion obvious, eliminating the need to pass Object
context between the two.
Furthermore we eliminate JsonRpcEndpoint.getClient() and opt to make
JsonRpcEndpoint implement OvsdbRPC, providing a very clear connection
between the two and completely eliminating use of reflection in the
process.
Change-Id: I1cfcf784330fdf6e30a55fcaff6f5bd716d987e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
fc3bf4c16d4bd71512ca991fcfc95d804c73c05e)
Robert Varga [Thu, 28 Nov 2019 12:59:02 +0000 (13:59 +0100)]
Reuse ObjectMapper across all connections
ObjectMapper is documented to be safe for sharing, make sure we
reuse a single instance across all connections.
Change-Id: Ia3ebbe1eb4772efaa1f68c0b0d4ee721431325b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
4d598cffc88333c551be88e45cef27f932b800bf)
Robert Varga [Thu, 28 Nov 2019 12:57:04 +0000 (13:57 +0100)]
Use a constant ObjectMapper in UpdateNotificationDeser
Rather than instantiating a fresh mapper for each request,
share a single pre-configured instance.
Change-Id: I231165f82dc950ae9e3adbfb816da123139cc878
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
4402e56b96f9d64e23efec322c42e6d2d7d5f3bb)
Robert Varga [Thu, 28 Nov 2019 12:49:05 +0000 (13:49 +0100)]
Use proper constant in JsonUtils
We are not using the Mapper here at all, just the writer. Make sure
we retain only the writer and make it a proper constant (to allow
JIT to do constant propagation).
Change-Id: I7df2a6234511c9dbf51509c495a59e642173fffe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
7b32c396b165fbecd707afb0d8753885816eaeed)
Robert Varga [Thu, 28 Nov 2019 12:45:04 +0000 (13:45 +0100)]
Do not reconfigure ObjectMapper in FutureTransformUtils
This is a shared ObjectMapper, which will be reconfigured on first
access -- we can do that upfront and save some cycles from the fast
path.
Change-Id: Ibdf27ff194350b96ee6aadeaa9725d4cfdc6e9db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
d2410c0a3da59dfa11f03a74bc01f252db4894a5)
Robert Varga [Sun, 3 Nov 2019 08:16:31 +0000 (09:16 +0100)]
Bump to odlparent-5.0.3/yangtools-3.0.6/mdsal-4.0.7
This picks up latest upgrades and fixes.
Change-Id: I5e4d4536f156b55d2d1288820814c3b4297fd58c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Fri, 1 Nov 2019 06:04:49 +0000 (06:04 +0000)]
Bump versions by x.y.(z+1)
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I0e993a834e21b27b65ba32b05f8c01ab52fd3338
Robert Varga [Mon, 28 Oct 2019 07:25:36 +0000 (08:25 +0100)]
Do not use Foo.toString() when logging
This was spotted in a JFR run, where JsonRpcEndpoint would consume
a lot of CPU formatting a logging object. Eliminate calls to toString()
in logging arguments, as the framework will call these when really
needed.
Change-Id: Id077c285074c1fd8012539ab7c144ddc4b286376
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
10119331189066c009db4f0000a39ae586cc164c)
Robert Varga [Sat, 14 Sep 2019 06:43:15 +0000 (08:43 +0200)]
Bump mdsal to 4.0.6
This picks up latest fixes.
Change-Id: I64e1f277bd00e132f40647eb0a2e7fc00eb56705
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
4c017cf986fc102fc80ba546e84d89c4f5bf7c6a)
Robert Varga [Sat, 14 Sep 2019 06:42:38 +0000 (08:42 +0200)]
Bump odlparent to 5.0.2
This bumps odlparent to pick up latest references.
Change-Id: I73af7ad69f686cb5bacc6ccfe0f57d226a43994b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
a2e6226b0c6fd4012fa9fa668a24b291e186acb2)
Robert Varga [Sat, 14 Sep 2019 06:49:02 +0000 (08:49 +0200)]
Fix checkstyle
This fixes up checkstyle violations.
Change-Id: I7ee4391b58eef76954157deb11b611a3837d0960
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
27d66a4602fca44386e6ab733b3d7748f9120b11)
jenkins-releng [Wed, 18 Sep 2019 09:13:26 +0000 (09:13 +0000)]
Bump versions by x.y.(z+1)
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I2c3c3739d32a5ef29a554b7c3efd386285000dbf
Anushka Bhandari [Mon, 19 Aug 2019 19:38:11 +0000 (01:08 +0530)]
Change in the version name
Signed-off-by: Anushka Bhandari <anushka16134@iiitd.ac.in>
Change-Id: Idbaa8efe65626d1077bcd83b64675ad256a7b56b
Robert Varga [Thu, 15 Aug 2019 08:44:20 +0000 (10:44 +0200)]
Bump mdsal to 4.0.4
This brings in latest fixes.
Change-Id: I59f89ef4fe76ef16fcdc9b59f8d9b50aa0849847
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Tue, 13 Aug 2019 02:47:27 +0000 (02:47 +0000)]
Update .gitreview to stable/sodium
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I256f041b5cb69fa797e18846e570b03c91814e39
Robert Varga [Thu, 18 Jul 2019 16:18:20 +0000 (18:18 +0200)]
Bump mdsal to 4.0.3
This bumps mdsal to 4.0.3, bringing in latest fixes and improvements.
Change-Id: Ie8e03aab1f31edf80bc9f1d7896c334c9d83be8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 18 Jul 2019 16:14:02 +0000 (18:14 +0200)]
Bump odlparent to 5.0.1
This picks up the latest upgrades.
Change-Id: If6006a94197839a9718cd5eae16b0a025913af93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Chandra Shekar S [Tue, 30 Jul 2019 10:08:03 +0000 (15:38 +0530)]
Optimization to read the HwvtepNode from the cache.
JIRA: OVSDB-485
Currently in the HwvtepSouthbound plugin reads the HwvtepNode from the datastore.
Reading the HwvtepNode from the datastore ineffecient, even the same info
is present in HwvtepSouthbound plugin cache.
This review is avoid the HwvtepNode reads from the datastore and get it from the cache.
If the node is not present in the cache, then read from datastore.
Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
Change-Id: I1f15ff31b195a79a1725e63882512b87d40c5838
Nobin Mathew [Tue, 11 Sep 2018 06:06:10 +0000 (11:36 +0530)]
OVSDB-486 Fix Null Pointer Exception in OVSDB
Fix for Null Pointer Exception
Change-Id: I93227ab66df4529a9b8c127c4b41096335424cc3
Signed-off-by: Nobin Mathew <nobin.mathew@ericsson.com>
Chetan Arakere Gowdru [Wed, 19 Jun 2019 06:12:32 +0000 (11:42 +0530)]
Avoid Bulk Topology Read During Reconciliation.
Description:
During Reconciliation, The full config network-topology DS is queried
which is not efficient. Currently, only br-int is managed in
network-toplogy config DS(by genius) which will only be resynced.
Changes are done to query only the list of bridges for a given connected
switch (configurable vi param - bridges-reconciliation-inclusion-list) from
topology config instead of querying the full topology from config DS and
filtering the bridges specific to connected Switch.Following
implementation been provided(to keep the existing behaviour)
(1) Both "bridge-reconciliation-inclusion-list" and "bridge-reconciliation-exclusion-list" are empty.
it means it will keep the default behavior of reconciling on all bridges.
(2) Only "bridge-reconciliation-inclusion-list" has list of bridge.
than plugin will only reconcile specified bridges.
(3) Only "bridge-reconciliation-exclusion-list" has list of bridge.
than plugin will reconcile all the bridge, except excluding the specified bridges.
(4) Both bridge-reconciliation-inclusion-list and bridge-reconciliation-exclusion-list has bridges specified.
this is invalid scenario, so it should log the warning saying this is not valid configuration,
but plugin will give priority to "bridge-reconciliation-exclusion-list" and reconcile all the bridges
except the one specified in the exclusion-list.
JIRA: OVSDB-459
Change-Id: Ife8055bcc10bcb6deb2fd8e0b5444bdf194f1460
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Chandra Shekar S [Tue, 2 Jul 2019 10:09:41 +0000 (15:39 +0530)]
Karaf cli command to display the hwvtep cache data
JIRA: OVSDB-482
The hwvtep configuration data is pushed to the tor by the hwvtep plugin.
The hwvtep plugin has the caches (config and operational caches) which holds
the hwvtep configuration. The hwvtep configuration push to the tor is also
dependent on the data that is present in caches.
For ex : To push the vlanbinding data to the PhysicalPort , the operational
cache is checked first, if present in the operational cache get the uuid of
that PhysicalPort and the send/push the vlanbinding to the tor.
Today it is hard to know/check what is present in the cache. In case if there
any issue in updating the cache, it is hard to debug/analyse the issue as no way
to know what is present in the cache.
If we have mechanism/cli command which gives the information of the hwvtep
caches, it will be very helpful to debug or analyze such cache missing issues.
This is for adding the karaf cli command which displays the hwvtep caches contents.
This command has two options :
1. Hwvtep nodeid as the input. Displays cache information of input hwvtep node.
2. Without any input. Displays the cache information of all hwvtep nodes.
Change-Id: I4301a784d83aa28f5ef4737fc44d052f323e11df
Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
Chandra Shekar S [Thu, 27 Jun 2019 13:04:35 +0000 (18:34 +0530)]
Optimizatoin to get the nodeIid from the DeviceOperCache in HwvtepPhysicalPortUpdateCommand
JIRA: OVSDB-482
Description :
Currently in HwvtepPhysicalPortUpdateCommand while updating the terminationpoint the
nodeIid/switchIid is retrieved from the incoming event data, if not present in the
incoming event data, it is retrieved from the DataStore by looking/looping at all
switches for that node which is ineffecient. The logic has chances of throwing NPE when
there are no PhisicalSwitches present for that node in the DataStore.
The change is to retrieve the nodeIid from the deviceOperCache , if not present get it from the
DataStore. The change also contains the handling of the NPE while retrieving the data from DataStore
Change-Id: Ifbfad7eb9cdac1c2eedb29ea9eb2a303ac8a9a3c
Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
Chandra Shekar S [Wed, 26 Jun 2019 10:18:44 +0000 (15:48 +0530)]
Hwvtep TransactionHistory improvements.
JIRA: OVSDB-481
The change in this review is to improve the format of the Hwvtep TransctionHistory hwvtep:txlog command
1. The hwvtep:txlog output is not logging/printing the date correctly. The date that is getting
printed is the date at which the command is executed , not the date at the transaction is looged.
Change has the fix for date issue.
2. The hwvtep:txlog output format is printing the complete instance identifier information of the nodes.
making the command output clumsy and hard to read.
ex :
Printing for iid KeyedInstanceIdentifier{targetType=interface org.opendaylight.yang.gen.v1.urn.tbd.
params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node, path=
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology,
org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.
Topology[key=TopologyKey{_topologyId=Uri{_value=hwvtep:1}}],org.opendaylight.yang.gen.v1.urn.tbd.
params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node[key=NodeKey{_nodeId=
Uri{_value=hwvtep://uuid/
3b0fb1b3-6449-4fa7-b6ac-
0db437fe144e}}]]}
Update the output format only to print the node id : "hwvtep://uuid/
3b0fb1b3-6449-4fa7-b6ac-
0db437fe144e"
3. Update the TransctionHistory for the missing tables/objects like LogicalSwitch and Physical Port etc.
4. Added more logging of Transctions.
Change-Id: Ia5e8984fb414944820140acae69dd64104ee9619
Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
Nobin Mathew [Wed, 6 Jun 2018 17:12:38 +0000 (22:42 +0530)]
Spec for OVSDB reconciliation
JIRA: OVSDB-459
Change-Id: I913814e61a2bfc1a10bdbc4c65b3108208108cd1
Signed-off-by: Nobin Mathew <nobin.mathew@ericsson.com>
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Robert Varga [Fri, 21 Jun 2019 05:36:01 +0000 (07:36 +0200)]
Remove use of StringBuffer
StringBuilder is a faster replacement, use that instead of
StringBuffer.
Change-Id: I5baafddeefff469796cd33dea7056cc0d6a5f6c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Yi Yang [Wed, 5 Jun 2019 03:10:48 +0000 (23:10 -0400)]
Update docs/ovsdb-user-guide.rst and README
odl-ovsdb-openstack has been moved to netvirt and changed as
odl-netvirt-openstack, so update it to reflect current status.
JIRA: OVSDB-480
Change-Id: Ied1268898d0adc63894250b9733a974140bc31c4
Signed-off-by: Yi Yang <yangyi01@inspur.com>
Robert Varga [Fri, 31 May 2019 14:15:19 +0000 (16:15 +0200)]
Bump mdsal to 4.0.2
This picks up the latest fixes.
Change-Id: I60557d40e4ae849ea73f3232f20f7032205dbe65
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 1 May 2019 11:50:28 +0000 (13:50 +0200)]
Bump mdsal to 4.0.1
This bumps mdsal to 4.0.1.
Change-Id: I23245cdccf757cf2c1c19a6774cc5fbb71382343
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 14 May 2019 09:47:54 +0000 (11:47 +0200)]
Allow SouthboundUtils to work with MdsalUtils
SouthboundUtils are being used by downstreams, who want to migrate
to MD-SAL APIs. Allow SouthboundUtils to work with both
ControllerMdsalUtils and MdsalUtils.
Change-Id: Iab6e48c060942e56db111755c08cd15206d38695
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 15 Nov 2018 07:41:42 +0000 (08:41 +0100)]
Cleanup OvsdbDataTreeChangeListener
This patch restructures the logic a bit, so that it does not invoke
getData{After,Before}() multiple times, fixing Eclipse warnings and
improving performance.
Furthermore augmentation handling is refactored so that the two
cases (node/bridge) are handled in an if cascade, preserving type
safety.
Finally updateConnections() is refactored to use a switch statement
instead of multiple if conditions, which shows that delete of the
entire node are not handled -- a FIXME is placed there.
Change-Id: If5663ebd2944d7fe83c4928b96cedc0db0f90e19
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Apr 2019 23:10:20 +0000 (01:10 +0200)]
Bump mdsal to 4.0.0
This bumps mdsal to 4.0.0 as part of Sodium MRI.
Change-Id: I7c4c8956623072e402371147e58e9cc2a2e4bf78
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Apr 2019 23:09:29 +0000 (01:09 +0200)]
Bump odlparent to 5.0.0
This bumps odlparent to 5.0.0 as part of Sodium MRI, also migrates
simple use of JSR305 to JDT.
Change-Id: Ie115a811e9f1a13e0ed4d3e1008270b589b4bdcc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Apr 2019 23:21:08 +0000 (01:21 +0200)]
Fix logging arguments
These are issues pointed out by updated SpotBugs, fix them up.
Change-Id: I2e740a1e23b96cbe12e4a49b0ca306876c5a713b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 8 Apr 2019 23:16:05 +0000 (01:16 +0200)]
Remove use of deprecated Guava methods
Pass down MoreExecutors.directExecutor() to future-proof the code.
Change-Id: Iaf847f2dbcce63bac685d5a22a35fc9b8085d06d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 14:18:49 +0000 (15:18 +0100)]
Upgrade powermock to 2.0.0
This upgrades powermock to version 2.0.0, also updating tests to
match nulls being returned through mocks.
JIRA: OVSDB-476
Change-Id: I54beb2db411cff0e126c8e8208ff9ee1530437ab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 18:30:46 +0000 (19:30 +0100)]
Fix static mocking in TransactUtilsTest
Change static mocks to doReturn().when(...) mocking style, which
allows them to properly work with Mockito 2.
Change-Id: Ie5b2f0223fd67b942a5c77cd56f5ccaa4fa870e1
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 17:34:13 +0000 (18:34 +0100)]
Fix SouthboundUtilTest
Use PowerMockito.doReturn() to correctly mock static method invocation,
enabling the test to pass.
Change-Id: I7d999ed1ca3720877ea8ee9e6d59a267604f3409
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 17:13:12 +0000 (18:13 +0100)]
Remove unnecessary stubbing
This fixes interop with Mockito 2, allowing the suite to pass
further.
Change-Id: I22c65f2b3a0f732c2b6bea6554ad4d75aa520f82
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 16:47:09 +0000 (17:47 +0100)]
Fix OvsdbConnectionManagerTest
Fix mock returns to use proper types, so this works with Mockito2,
too.
Change-Id: I277ade6a61978bd829c437fb9a90fc91d58045f2
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 16:26:19 +0000 (17:26 +0100)]
Fix OvsdbManagersRemovedCommandTest
Use proper mocking to return non-null values when intercepting
methods.
Change-Id: Ic70d6696ce869d91d8de72859130f758d68de830
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 15:18:16 +0000 (16:18 +0100)]
Fix OvsdbConnectionInstanceTest
Remove unnecessary stubbing and fix any()/mock() confusion.
JIRA: OVSDB-476
Change-Id: I7621f67e3af5d1191c0a51e3356d257263991202
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 16:30:09 +0000 (17:30 +0100)]
Fix OpenVSwitchUpdateCommandTest
There is some unnecessary stubbing, remove it to ease migration.
JIRA: OVSDB-476
Change-Id: Ie8222eaa524a5fabb9b054e6076a3377708c7248
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 15:48:15 +0000 (16:48 +0100)]
Remove ProtocolUpdateCommandTest
This test is not verifying anything, remove it.
Change-Id: I81ebccd450d888adfd66420f90cfbcd907996c4d
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 11 Mar 2019 14:23:38 +0000 (15:23 +0100)]
Remove OvsdbControllerRemovedCommandTest
This test is using partial mocking to the point of not checking
anything real and actually verifies incorrect internal method
signatures. Remove it.
JIRA: OVSDB-476
Change-Id: I04e67ff6937e84cdc55e1347e407596df8605c99
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Fri, 8 Feb 2019 10:11:03 +0000 (11:11 +0100)]
Use JDT annotations instead of JSR-305
This reduces our dependencies on javax.annotation, which end up
causing problems with Java 11.
Change-Id: Ied3be5b9677bef722c008b2828950bb12ae84678
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Mon, 11 Feb 2019 16:13:09 +0000 (17:13 +0100)]
Do not workaround MDSAL errors
This code masked an MD-SAL failure to account for UNMODIFIED nodes,
which luckily had no effect. Upstream has this fix in the pipeline,
this patch removes the workaround.
Change-Id: I150a50c46e3272a0b099030f4424628ed983edff
JIRA: MDSAL-422
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 7 Feb 2019 12:32:34 +0000 (13:32 +0100)]
Reduce use of powermockito
Remove unneeded supressions and mocking, with judicious reuse
of existing methods, @VisibleForTesting and similar.
Change-Id: If6aff32331d2a50752f5cd2ef981abe4d49f0af5
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 7 Feb 2019 13:38:48 +0000 (14:38 +0100)]
Remove useless tests
These tests are not asserting anything at all, remove them to reduce
static mocking proliferation for no value whatsoever.
Change-Id: I53b21da97d7b9c7cf6e64543e6fe73f2c08267e9
JIRA: OVSDB-476
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 7 Feb 2019 10:43:00 +0000 (11:43 +0100)]
Reduce use of powermockito
Rather than mucking with powermock, use Mockito's partial mocking
on a real instance of HwvtepConnectionManager.
Also proper application of @VisibleForTesting and ovsdbClient mocking
allows us to not mock HwvtepConnectionInstance at all.
We also have a simple utility for setting final fields, use that
to reset Operations static field -- allowing us to not use powermock
in DataChangeListenerTestBase at all.
JIRA: OVSDB-476
Change-Id: I6c321c0455fb886dc0029b2a321f73eb3ba150d1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 4 Feb 2019 21:24:32 +0000 (22:24 +0100)]
Remove odlparent overrides
This removes unneeded overrides of odlparent-exported artifacts.
Change-Id: I7ee16354e180609babc65b1fb0a80d005489355b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 4 Feb 2019 21:05:05 +0000 (22:05 +0100)]
Switch to spotbugs plugin
findbugs does not work JDK9+, switch to spotbugs.
Change-Id: I2672369099c7298c67f9d50acec2bbdb882fb1d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 4 Feb 2019 21:02:10 +0000 (22:02 +0100)]
Upgrade powermock utils/
This upgrades powermock and fixes up warnings around mockito
being deprecated.
Change-Id: I74fe7b16b223ee9bab966478f6a653281634b8d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
jenkins-releng [Fri, 1 Feb 2019 13:06:31 +0000 (13:06 +0000)]
Bump versions by x.y.(z+1)
Change-Id: I21c38dd91233b8652a2a15d0cc9badb08c9e1931
Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Robert Varga [Wed, 30 Jan 2019 16:19:53 +0000 (17:19 +0100)]
Remove duplicate artifact declarations
This fixes a few maven warnings about artifacts being declared
multiple times.
Change-Id: Ib6a7a31931883009868f6e4150a8cb0ed5718fd6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Tue, 29 Jan 2019 14:56:45 +0000 (15:56 +0100)]
utils: migrate to the mdsal DataBroker
This duplicates controller-based classes temporarily, so that we can
migrate hwvtepsouthbound and southbound separately.
Change-Id: I1ed7c137423deb149320df86f0abc090e1182df5
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Stephen Kitt [Tue, 29 Jan 2019 10:02:25 +0000 (11:02 +0100)]
library: migrate to the mdsal DataBroker
Change-Id: I0540965fe40521dd2d18e2206fb2bb874e2f1e72
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Stephen Kitt [Tue, 29 Jan 2019 17:34:23 +0000 (18:34 +0100)]
Add missing annotation dependencies for Java 11
Change-Id: I552dc74b2bb6832cc5419f309470a43430294443
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Harshini [Mon, 21 Jan 2019 08:40:49 +0000 (14:10 +0530)]
use annotations instead of XML for Blueprint
JIRA: OVSDB-474
Change-Id: Ie40dacf4b4a745d77d83bdc7e1b95fecad4fd276
Signed-off-by: Harshini <hm@luminanetworks.com>
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Stephen Kitt [Tue, 22 Jan 2019 08:50:39 +0000 (09:50 +0100)]
Bump to mdsal 3.0.6
Change-Id: Id4a938a3e8d8669b972df17ddf1d76f91ca686d0
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Mon, 21 Jan 2019 09:25:09 +0000 (10:25 +0100)]
Bump mdsal to 3.0.5
This aligns with odlparent-4.0.9 and yangtools-2.1.8.
Change-Id: I1800398e0f1cfbfc263164ea6eff878423d31b98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Fri, 18 Jan 2019 15:33:50 +0000 (16:33 +0100)]
Bump to odlparent 4.0.9
Change-Id: Iabeeaae5001bb0fba3c84d22cedd82444b60f7b8
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Robert Varga [Thu, 10 Jan 2019 15:53:07 +0000 (16:53 +0100)]
Bump mdsal to 3.0.4
This realigns odlparent/yangtools/mdsal and brings in the latest
improvements.
Change-Id: I6db0663fcf132b9e01839c2cc14dc611ea75aa60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Wed, 2 Jan 2019 10:24:57 +0000 (11:24 +0100)]
Bump odlparent to 4.0.8
Change-Id: Ieee47dc9a810d99311bb1bfdeedc71655a612cab
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Vishal Thapar [Fri, 4 Jan 2019 12:51:53 +0000 (18:21 +0530)]
Fix controller for ptcp manager
If a ptcp manager is set on OVS, we configure
controller through conneciton info. There are two
issues with this code today:
1. Doesn't work well for IPv6.
2. Doesn't check if connection is to same port
as configured in ptcp manager.
So we end up with an improper controller configured
basde on ptcp even if we already configured correct
ones from manager entries.
JIRA: OVSDB-475
Change-Id: Ic69be0a9a6f2fd96085b60cdc3ccb9f1022b54a8
Signed-off-by: Vishal Thapar <vthapar@redhat.com>
Robert Varga [Thu, 3 Jan 2019 14:14:08 +0000 (15:14 +0100)]
Migrate NumberUtils.isNumber()
This method is deprecated, use its replacement, isCreatable().
Change-Id: I47a6dc48e5da306f8a1c2fa2e0a19ca034756c28
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 3 Jan 2019 13:20:24 +0000 (14:20 +0100)]
Remove use StringUtils
Guava provides equivalent functionality, use that instead of
commons-lang3.
Change-Id: Ide5fb6606ea51d6a65518e5e57422b11c259d86a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 24 Dec 2018 17:50:29 +0000 (18:50 +0100)]
Bump mdsal to 3.0.3
This brings in latest fixes and alignes with odlparent-4.0.5.
Change-Id: I4626267cb5d322378e87b82045dd4f080a747e35
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Stephen Kitt [Fri, 21 Dec 2018 09:11:21 +0000 (10:11 +0100)]
Bump to odlparent 4.0.5
Change-Id: Ib2f5fd0e462e8a1efdefc2e4e94acc109c688c19
Signed-off-by: Stephen Kitt <skitt@redhat.com>
Stephen Kitt [Tue, 13 Nov 2018 13:31:20 +0000 (14:31 +0100)]
Use targeted node type for bridge name search
The IdentifiableItem we're looking for when checking for a bridge name
is Node; this changes isBridgeOnOvsdbNode() to look for that
directly. If also changes toString() to a match-specific method to
avoid the temptation to use it for other purposes.
Change-Id: Ib20e2c909098af9e0643f12805d98c5f2a66b651
JIRA: OVSDB-470
Signed-off-by: Stephen Kitt <skitt@redhat.com>