ovsdb.git
4 years agoUse seperate txn when quering multiple shards 20/86820/5
Chetan Arakere Gowdru [Thu, 9 Jan 2020 09:05:20 +0000 (14:35 +0530)]
Use seperate txn when quering multiple shards

Description:
The txn which been used for updating oper topo been also used to query
config topo. Changes done to use a new transaction while querying
different shards.

Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Change-Id: I90befb242c47df2bcbdcb09b92708c20a97e78c0
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Signed-off-by: xcheara <chetan.arakere@altencalsoftlabs.com>
4 years agoAvoid unnecessary bridge Oper DS read 18/86818/5
Chetan Arakere Gowdru [Thu, 9 Jan 2020 07:03:00 +0000 (12:33 +0530)]
Avoid unnecessary bridge Oper DS read

Description:
Avoid uncessary bridge Oper DS read just to get the bridge-name during
termination-point create and delete. The bridge name is already
available in the termination point parent node-id(/bridge/br-int) from
which bridge name can get fetched out.

Ex: "node-id": "ovsdb://uuid/d6f5d855-cdae-4275-bf4f-a71ee6e24ca3/bridge/br-int"

Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Change-Id: I420face0c628f118b14c5c213756075a199ea6fa
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Signed-off-by: xcheara <chetan.arakere@altencalsoftlabs.com>
4 years agoCheck for the SHARD Status before opening the OVSDB port/HwvtepSouthboundProvider... 29/83229/5
Chandra Shekar S [Wed, 24 Jul 2019 09:49:01 +0000 (15:19 +0530)]
Check for the SHARD Status before opening the OVSDB port/HwvtepSouthboundProvider intialization.

JIRA: OVSDB-484

Currently the HwvtepSouthboundProvider is intialized and the Ovsdb port is opened.
As soon as the Ovsdb port is opened the tors will connected to the HwvtepSouthboundPlugin.
The HwvtepSouthboundPlugin will process the connected tors and tries to build the topology operational
and further the topology config and tries to update these datastores.
If the topology SHARDs are not up or the SHARD leaders are not elected by this time, it ends up in the
exceptions while updating the datastores and the operational and config datastores will not be populated
with the expected data.

The fix is check for the topology config and operational SHARDs status up and Leaders for these are
elected and then initialize HwvtepSouthboundProvider and start Ovsdb port when they are up.

Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
Change-Id: Ia8599b9ed9cc3d5afbdb29a951cebee01c15ddbe

4 years agoLookup up bridge in old bridges when the port is removed 88/86188/9
Robert Varga [Wed, 4 Dec 2019 14:50:14 +0000 (15:50 +0100)]
Lookup up bridge in old bridges when the port is removed

Updated bridges may be empty, in which case we do want to fall
back to the old bridge data to pick up the old bridge data --
otherwise we would end up looking up the wrong thing.

JIRA: OVSDB-413
Change-Id: I289314481595a38911f06c0ba1fe659896cb53e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoOptimization to read the OvsdbNode from the cache. 77/85177/7
Chandra Shekar S [Wed, 16 Oct 2019 13:55:32 +0000 (19:25 +0530)]
Optimization to read the OvsdbNode from the cache.

JIRA: OVSDB-488

Currently in the OvsdbSouthboudn plugin reads the OvsdbNode from the datastore.
Reading the OvsdbNode from the datastore ineffecient.

This review is avoid the OvsdbNode 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: I1e26fa83d0edea45b39c44267488335eea75eb37

4 years agoConstrain TypedDatabaseSchema proxy argument 99/86199/19
Robert Varga [Wed, 4 Dec 2019 20:36:58 +0000 (21:36 +0100)]
Constrain TypedDatabaseSchema proxy argument

We do not operate on any old interface, arguments need to extend
TypedBaseType -- capture that in the API contract.

Change-Id: I978332ef5e0485763b8e04461aaaf12a00891466
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake sure TransactionInvokerImpl chain is properly protected 80/86280/15
Robert Varga [Fri, 6 Dec 2019 21:08:28 +0000 (22:08 +0100)]
Make sure TransactionInvokerImpl chain is properly protected

TransactionChains require single-threaded access, most notably
their close() contract requires that there be no outstanding
transactions.

There is a slight possibility of us violating this contract by
invoking close() while there is some command processing going
on.

Make sure we are properly synchronized when invoking the close()
call.

Change-Id: Idacc7096af448dc3a935ca3aa7ea2452bbd0135e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoIsolate TransactionInvokerImpl.executeCommand() 79/86279/14
Robert Varga [Fri, 6 Dec 2019 20:35:31 +0000 (21:35 +0100)]
Isolate TransactionInvokerImpl.executeCommand()

This is a chunk of logic which is independent of its surroundings,
but requires proper locking.

JIRA: OVSDB-428
Change-Id: I7db00574a50955e3bf3531cea23ba85b80e11bdb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate TransactionInvokerImpl.transactionToCommand 78/86278/11
Robert Varga [Fri, 6 Dec 2019 20:58:39 +0000 (21:58 +0100)]
Eliminate TransactionInvokerImpl.transactionToCommand

This map holds Transaction->Command mapping, but it is always
accessed from a context which directly operates on
pendingTransactions queue.

Eliminate the need for lookups (and general HashMap overhead)
by making pendingTransactions hold a pair of transaction/command.

JIRA: OVSDB-428
Change-Id: Ic3040f770a2b3391e188b3ffa7a693776d0058b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse ArrayDeque for TransactionInvokerImpl.pendingTransactions 45/86245/26
Robert Varga [Thu, 5 Dec 2019 21:41:22 +0000 (22:41 +0100)]
Use ArrayDeque for TransactionInvokerImpl.pendingTransactions

Rework the copy logic to operate on pure Iterator, disconnecting us
from the List API. This makes the choice of interface/implementation
a much broader one -- and pick Queue/ArrayDeque. It is a much better
structure for the job at hand.

JIRA: OVSDB-428
Change-Id: I22a4da6f4194d10e0932470bf2054441a9c1d3c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoFix transaction replay logic 69/86269/15
Robert Varga [Fri, 6 Dec 2019 13:53:44 +0000 (14:53 +0100)]
Fix transaction replay logic

After adding disambiguation (previous patch), it clear there is
a day-0 Obi-Wan bug in the code, which would cause the last
command to not be replayed.

Looking at the pending queue, if the transaction failing is second,
the second and third transactions should be replayed, not just
the second.

JIRA: OVSDB-428
Change-Id: Ifbdf5ba8bad5be6103e4666d95afd615ae7d1ab9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDisambiguate TransactionInvokerImplTest assertion 77/86277/8
Robert Varga [Fri, 6 Dec 2019 19:56:47 +0000 (20:56 +0100)]
Disambiguate TransactionInvokerImplTest assertion

Do not reuse mock objects for transactions, as that means we are
asserting that one them is replayed, except that we want to be
asserting that the last transaction was replayed.

JIRA: OVSDB-428
Change-Id: If7bf37edb46cd2ce155325e257cf1a891f8b2bf5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup TransactionInvokerImplTest 68/86268/10
Robert Varga [Fri, 6 Dec 2019 13:28:14 +0000 (14:28 +0100)]
Cleanup TransactionInvokerImplTest

This unit test is overly whiteboxish, to the point it mocks internal
TransactionInvokerImpl structures. Refactor the test, exposing proper
@VisibleForTesting methods so that we do not end up modifying/mocking
structure access, but rather observe state transitions.

JIRA: OVSDB-428
Change-Id: I26b5c258b385ff1cfad34ff7d19a9589979ec4d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate TransactionInvokerImpl.successfulTransactionQueue 44/86244/16
Robert Varga [Thu, 5 Dec 2019 21:12:31 +0000 (22:12 +0100)]
Eliminate TransactionInvokerImpl.successfulTransactionQueue

This queue is actually just a hand-off between the datastore callback
thread and the central thread. There is no need for such a queue, as
we can just properly synchronize access to the critical structures.

JIRA: OVSDB-428
Change-Id: Idba05aebfa7fd35dbdb706b8bfef03e3e03d7772
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse properties to control install/deploy plugins 39/86739/1
Robert Varga [Mon, 6 Jan 2020 11:55:09 +0000 (12:55 +0100)]
Use properties to control install/deploy plugins

Rather than using full plugin configuration, just drop in properties
to control them.

Change-Id: If17d7d419e0f69d770e1cb8b39ca34ea09e036ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpgrade support of ovsdb reconciliation 72/82772/7
Chetan Arakere Gowdru [Fri, 28 Jun 2019 11:08:08 +0000 (16:38 +0530)]
Upgrade support of ovsdb reconciliation

Description:
When Upgrade in process, the config DS may not be fully populated when
reconciliaiton is triggered. This will result in uncessaary deletion on tunnels
(as config and oper DS are compared and delta changes will be pushed to switch).
Changes are done to postpone the reconcilaiton task until upgrade flag is set to false.

Testing Steps.

1) Karaf up and running and tunnels created.
2) Set upgade flag to true.
PUT http://localhost:8181/restconf/config/odl-serviceutils-upgrade:upgrade-config
{
  "upgrade-config": {
    "upgradeInProgress": true
  }
}
3) Close karaf terminal(kill karaf process)
4) Don’t clear data/instance/journal/snapshots
5) del-manager on switches and delete tunnels manually on switches.
6) Start karaf and wait DPN connects.
7) Check the tunnel are not recreated by reconciliation process.
8) Set upgradeInProgress=false and check the tunnels re-created back

Change-Id: Id6cc8e1a3aa5e139597fa3071d536e1f5ac0802f
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Signed-off-by: xcheara <chetan.arakere@altencalsoftlabs.com>
4 years agoNaming Anonymous Threads in OVSDB 52/85752/6
xcheara [Fri, 1 Nov 2019 23:14:55 +0000 (04:44 +0530)]
Naming Anonymous Threads in OVSDB

JIRA : OVSDB-454

Description:
There are few Anonymous Threads created in OVSDB. It will be difficult to
identify which component created these threads based on the logs
available.

Changes done to provide proper Name to these Threads when created which
helps to easily identify the component owner of such threads.

Signed-off-by: xcheara <chetan.arakere@altencalsoftlabs.com>
Change-Id: I061abd449f81c7cc2c7c847cb1a0f82d62d7e654
Signed-off-by: xcheara <chetan.arakere@altencalsoftlabs.com>
4 years agoRemove powermock overrides 46/86446/1
Robert Varga [Mon, 16 Dec 2019 23:43:52 +0000 (00:43 +0100)]
Remove powermock overrides

powermock should now be working out of the box, allowing us to
minimize dependencies.

Change-Id: I1d9d7541f46b68cfd026a768feedfdf2f0865c9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove ARIES-1923 workaround 41/86441/1
Robert Varga [Mon, 16 Dec 2019 21:07:49 +0000 (22:07 +0100)]
Remove ARIES-1923 workaround

We now have proper monkey-patch in place and can therefore remove
this workaround.

Change-Id: Ia66faa79b1b0592bc0b45b066ea57f7a7a3c3269
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent/yangtools/mdsal to 6.0.3/4.0.3/5.0.6 72/86372/3
Robert Varga [Thu, 12 Dec 2019 07:04:22 +0000 (08:04 +0100)]
Bump odlparent/yangtools/mdsal to 6.0.3/4.0.3/5.0.6

Pick up the latest upgrades and fixes.

Change-Id: I2f3f76c8746fa2b01c5d1f639ef1b6c419435cf6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove ConnectionReconciliationTask type safety 38/86238/3
Robert Varga [Thu, 5 Dec 2019 13:29:33 +0000 (14:29 +0100)]
Improve ConnectionReconciliationTask type safety

We require InstanceIdentifier<Node> and OvsdbNodeAugmentation
config data, make sure to reflect that in the API.

JIRA: OVSDB-413
Change-Id: I8d6a86cf455e3ff05f0851def22d6520adabf5d2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoImprove BridgeConfigReconciliationTask type safety 37/86237/2
Robert Varga [Thu, 5 Dec 2019 13:22:04 +0000 (14:22 +0100)]
Improve BridgeConfigReconciliationTask type safety

We really want InstanceIdentifier<Node>, make sure we require that
in the constructor.

Change-Id: Ide8e17e46afe983389b7617afda9982257d283db
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup ReconciliationTask 36/86236/2
Robert Varga [Thu, 5 Dec 2019 13:20:52 +0000 (14:20 +0100)]
Cleanup ReconciliationTask

This is a simple upkeep, converting primarily converting to use
Objects.requireNonNull().

JIRA: OVSDB-413
Change-Id: I0ccf60e14899f90a7f8eead9bf8f75ae94d30857
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd support for Controller.type 03/86203/4
Robert Varga [Thu, 5 Dec 2019 11:25:30 +0000 (12:25 +0100)]
Add support for Controller.type

This mirrors the schema update done in
https://github.com/openvswitch/ovs/commit/c66be90bd9a04bc98e8ef32f684a3d7283379f66#diff-01f05b225090c4067284ed798ed23f05
and shipping with OVS 2.12.0.

Change-Id: I3658c182293e8bfe40a16d6e4178199f10836424
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd support for OpenVSwitch.dpdk_{initialized,version} 02/86202/3
Robert Varga [Thu, 5 Dec 2019 11:19:23 +0000 (12:19 +0100)]
Add support for OpenVSwitch.dpdk_{initialized,version}

This mirrors the schema update done in
https://github.com/openvswitch/ovs/commit/3e52fa5644cde2eba56c48355d5664e992992bf2#diff-01f05b225090c4067284ed798ed23f05
and shipping with OVS 2.10.0.

Change-Id: Id584401401bb7f81dc8af5a11eb79ffae7c2932d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd support for Port.cvlans 01/86201/4
Robert Varga [Thu, 5 Dec 2019 10:17:42 +0000 (11:17 +0100)]
Add support for Port.cvlans

This mirrors the schema update done in
https://github.com/openvswitch/ovs/commit/fed8962aff57f552163ef718cc1b0db582f2295e#diff-01f05b225090c4067284ed798ed23f05
and shipping with OVS 2.8.0.

Change-Id: I98bdbd35261ba76fb6d73e20efe003ef8a6c90ae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd support for Port.protected 98/86198/5
Robert Varga [Thu, 5 Dec 2019 10:08:24 +0000 (11:08 +0100)]
Add support for Port.protected

This mirrors the database update done in
https://github.com/openvswitch/ovs/commit/ced947ae5d1b9678930b11233b9716ddcb84666a#diff-01f05b225090c4067284ed798ed23f05
and shipping in OVS 2.7.0.

Change-Id: Id4345501ff8d627aa86f08336e82d2500fedd0ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd support for Interface.mtu_request 97/86197/5
Robert Varga [Thu, 5 Dec 2019 10:06:21 +0000 (11:06 +0100)]
Add support for Interface.mtu_request

This mirrors the schema update done in
https://github.com/openvswitch/ovs/commit/56abcf497b5615d2c30f62bec5af81a38145ecbc#diff-01f05b225090c4067284ed798ed23f05
and shipping in OVS 2.7.8.

Change-Id: I6f942f5356e6f049f77aba52e8000b9472329b48
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd support for Mirror.snaplen 96/86196/5
Robert Varga [Thu, 5 Dec 2019 10:02:26 +0000 (11:02 +0100)]
Add support for Mirror.snaplen

This mirrors the database update made here:
https://github.com/openvswitch/ovs/commit/1356dbd12125200c319a7d420660e72293baa8ec#diff-01f05b225090c4067284ed798ed23f05
and shipping in OVS 2.6.0.

Change-Id: I598f79c949ac977dca680d47e1d5b1a44270a131
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpeed up inputQueue interaction 43/86243/5
Robert Varga [Thu, 5 Dec 2019 20:52:08 +0000 (21:52 +0100)]
Speed up inputQueue interaction

The while() loop here is an open-coded Queue.drainTo(). Read the API
and lead a happy life (knowing the thread contention is much lower
now).

This should help with our ability to drain the input queue more
quickly as we will have less cacheline thrashing.

JIRA: OVSDB-428
Change-Id: I53f3b24fb354dd0b727de26cc55890a70994ae8f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake ChannelInitializers inner classes 71/86171/7
Robert Varga [Tue, 3 Dec 2019 21:37:12 +0000 (22:37 +0100)]
Make ChannelInitializers inner classes

Rather than using an anonymous class to initialize functionity,
define two specializations, making this much more cleaner.

Change-Id: Ia8c9af727e80619cc06102856a4fedebeafcdc54
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoGet rid of useless (Hwvtep)SouthboundProvider thread 66/86166/9
Robert Varga [Tue, 3 Dec 2019 20:36:44 +0000 (21:36 +0100)]
Get rid of useless (Hwvtep)SouthboundProvider thread

The thread instantiated here is useless and the comment is misleading:
ListenerRegistration.close() is specified to be safe in any context
and idempotent. Just get rid of the thread and close the registration
immediately.

This flushes out an immediate problem, where the test would deadlock
due to base test using directExecutor() for DTCLs -- i.e. simulating
execution which does not happen in production. To deal with that we
switch the test to use asynchronous DTCLs and add a simple synchronization
loop to wait for DTCL to trigger.

JIRA: OVSDB-454
Change-Id: I2e86acb9eb30529fcd5d5675005d6c81bd804ba5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate OvsdbDataTreeChangeListenerTest 79/86179/3
Robert Varga [Wed, 4 Dec 2019 10:13:30 +0000 (11:13 +0100)]
Migrate OvsdbDataTreeChangeListenerTest

This migrates to use non-deprecated AbstractConcurrentDataBrokerTest,
which allows proper background processing of DTCLs.

JIRA: OVSDB-454
Change-Id: Ic98369564e3d45fdc38e6bbc992b548fe97ba360
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoEliminate server startup threads 65/86165/5
Robert Varga [Tue, 3 Dec 2019 20:27:35 +0000 (21:27 +0100)]
Eliminate server startup threads

These were necessary to clean up the server loop groups, but that
is no longer necessary as they have separate lifecycle. Now the
threads serve only the purpose for asynchronous start, which is
easily done with ChannelFutureLister.

Change-Id: I4eaff47cabde3c2551a65d288da455701b920485
JIRA: OVSDB-454
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd support for using epoll Netty transport 62/86162/12
Robert Varga [Tue, 3 Dec 2019 15:54:47 +0000 (16:54 +0100)]
Add support for using epoll Netty transport

Since we have GlobalNettyContext, we can easily provide the necessary
glue to select either epoll(7) or java.nio backend based on availability.

JIRA: OVSDB-331
Change-Id: Id79e13e21dd5bc2358b7a9567bd145a4ca166a39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd NettyBootstrapFactory to hold OVSDB network threads 61/86161/13
Robert Varga [Tue, 3 Dec 2019 15:26:59 +0000 (16:26 +0100)]
Add NettyBootstrapFactory to hold OVSDB network threads

OvsdbConnectionService is rather bad at using threads efficiently,
as each individual client creates its own EventLoopGroup, which is
not shared with anyone.

This refactors bootstrap generation, so that it is tied to a global
thread factory.

JIRA: OVSDB-411
Change-Id: Ie16e123fa3de87fd4f148c54e610515db3f1de9e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoReuse StringEncoders for all connections 46/86146/3
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>
4 years agoReuse MappingJsonFactory across all sessions 43/86143/3
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>
4 years agoDo not use reflection in TransactCommandAggregator 04/86104/2
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>
4 years agoFix NPEs in HwvtepOperGlobalListener 02/86102/3
Robert Varga [Mon, 2 Dec 2019 13:26:52 +0000 (14:26 +0100)]
Fix NPEs in HwvtepOperGlobalListener

A connection may not be available form HwvtepConnectionManager, in
which case we would end up throwing a NPE, which floods logs
in HwvtepDataChangeListenerTest. Fix that by checking for missing
connection.

Change-Id: I61a729266948fa1f7cf5eea1ff9c9a674cbad51e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake HwvtepTableReader.alltables a constant 41/86141/3
Robert Varga [Tue, 3 Dec 2019 11:11:29 +0000 (12:11 +0100)]
Make HwvtepTableReader.alltables a constant

This array is treated as a constant source of a stream, turn it
into a proper constant, sharing it among all instances.

Change-Id: Iab1416086deb923fa65d805c075b7acffebb999e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse a singleton list in HwvtepTableReader 40/86140/3
Robert Varga [Tue, 3 Dec 2019 11:06:15 +0000 (12:06 +0100)]
Use a singleton list in HwvtepTableReader

Rather than allocating a full-blown ArrayList, use only a singleton,
saving some memory.

Change-Id: I7505ae7b061d8a410a8df7ef9458e83c560823e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd TableSchema.getColumnList() 39/86139/3
Robert Varga [Tue, 3 Dec 2019 11:01:38 +0000 (12:01 +0100)]
Add TableSchema.getColumnList()

There are a number of callers which need to populate the columns
as a List. This adds a simple cached wrapper to allow in-place
reuse of the backing collection.

Change-Id: I3add766905b0a5d520b5cdc8f551fca411e7b137
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRemove unneeded @SuppressWarnings 37/86137/2
Robert Varga [Tue, 3 Dec 2019 10:04:08 +0000 (11:04 +0100)]
Remove unneeded @SuppressWarnings

Eclipse is pointing these suppressions as superfluous, remove them.

Change-Id: If4caebcb02d338c4bfff4eef2724bce11e0798f2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoCleanup WhereClausuleGetters 10/86110/2
Robert Varga [Tue, 3 Dec 2019 01:08:46 +0000 (02:08 +0100)]
Cleanup WhereClausuleGetters

The implementation heree could use some love:
- define a dedicated interface place upper bound on polymorphism
- capture InstanceIdentifier type to remove a few casts
- cache associated table in object, removing the need for an
  explicit lookup

Change-Id: Ibd807010ab847d2961bfecb47e262180eac72728
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse ClassToInstanceMap for tables 09/86109/1
Robert Varga [Tue, 3 Dec 2019 00:35:25 +0000 (01:35 +0100)]
Use ClassToInstanceMap for tables

This pattern makes it explicit to understand the mapping is
immutable and allows us to remove casts due to use of getInstance().

Change-Id: I6038adb8e4fcda16ab3cfd6c42cf175746130030
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUse an immutable global type Map 08/86108/1
Robert Varga [Tue, 3 Dec 2019 00:27:38 +0000 (01:27 +0100)]
Use an immutable global type Map

Rather than instantiating and populating this map for each
reader, use a simple constant map. Also clean up map type safety
a bit.

Change-Id: Ia70a9651e3bf27821b937964b63c80d47c7f07a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoSpeed up HwvtepTableReader.readAllTables() 07/86107/1
Robert Varga [Tue, 3 Dec 2019 00:09:25 +0000 (01:09 +0100)]
Speed up HwvtepTableReader.readAllTables()

There are two issues here:
- we are using Map.compute() which has needless stores
- we are allocating two capturing lambdas to do that

This refactors the code to use plain imperative style instead
of a stream pipeline. Furthermore it uses a fluent
Map.computeIfAbsent() which results in use of a single
non-capturing lamda.

Change-Id: Iaa92c132bb47076717d9efd3fda50061ecacf085
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake RowUpdate immutable and final 06/86106/1
Robert Varga [Tue, 3 Dec 2019 00:06:33 +0000 (01:06 +0100)]
Make RowUpdate immutable and final

Setters are not used anywhere, let's make sure it stays that way,
turning RowUpdate into a plain record.

Change-Id: I596225f70f8232865bac52af3946132f984a7cea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRowUpdate should be a static class 05/86105/1
Robert Varga [Mon, 2 Dec 2019 23:51:41 +0000 (00:51 +0100)]
RowUpdate should be a static class

RowUpdate does not reference any TableUpdate state, hence it should
be static. This allows users to shorten their references, as they
do not need to qualify TableUpdate specialization.

Change-Id: I0be3a88623a43df4eaa8abd74ff2ca6732a88e57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMake TransactionBuilder type-aware 01/86101/7
Robert Varga [Mon, 2 Dec 2019 12:33:50 +0000 (13:33 +0100)]
Make TransactionBuilder type-aware

This centralizes dispatch to TyperUtils, so that users do not have
to type out acquisition of schema and acquisition of wrapper.

This also allows interception of most calls via normal mocking, as
we can hook into the TransactionBuilder instance -- thus reducing
the need for static mocking.

Change-Id: I9a244be8164ff2dfc1f51edc80b70c4dab635848
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoRework TypedRowInvocationHandler invocation path 84/86084/24
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>
4 years agoMigrate TyperUtils.getTableSchema() users 96/86096/8
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>
4 years agoSimplify exception instantiation 91/86091/4
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>
4 years agoMigrate TyperUtils methods to TypedDatabaseSchemaImpl 86/86086/11
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>
4 years agoMake OvsdbClient return TypedDatabaseSchemas 83/86083/10
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>
4 years agoExtract TypedRowInvocationHandler 81/86081/12
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>
4 years agoEliminate OvsdbClientImpl duplication 90/86090/5
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>
4 years agoUse String.getBytes(CharSet) 89/86089/4
Robert Varga [Mon, 2 Dec 2019 00:46:22 +0000 (01:46 +0100)]
Use String.getBytes(CharSet)

Modernizer is point out this improved method, use it instead of
String-specified charset.

Change-Id: I852152d52566e41b8363c06d8c007a7d1448c305
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDe-confuse InvocationHandler and target methods 80/86080/8
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>
4 years agoHide TyperUtils.extractRowUpdates() 79/86079/9
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>
4 years agoAdd TypedReflections 77/86077/12
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>
4 years agoAdd @NonNull annotation to OvsdbConnectionListener.connected() 82/86082/2
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>
4 years agoAdd TypedDatabaseSchema 76/86076/6
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>
4 years agoTurn DatabaseSchema into an interface 75/86075/3
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>
4 years agoMake TableSchema/DatabaseSchema immutable 74/86074/2
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>
4 years agoSplit out BaseTypeFactories 71/86071/5
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>
4 years agoUse singleton BaseType instances for simple definitions 68/86068/3
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>
4 years agoSplit out BaseTypes 67/86067/2
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>
4 years agoCleanup HwvtepConnectionManager.getHwvtepGlobalTableEntry() 65/86065/2
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>
4 years agoDo not allow DatabaseSchema name/version to be mutated 64/86064/1
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>
4 years agoDo not allow TableSchema columns to be directly set 63/86063/1
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>
4 years agoRefactor ColumnType 62/86062/2
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>
4 years agoCleanup ColumnSchema 61/86061/1
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>
4 years agoAdd generated serialVersionUUID to exceptions 60/86060/1
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>
4 years agoMake GenericTableSchema.fromJson() a factory method 59/86059/4
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>
4 years agoMove ObjectMapper to JsonRpcEndpoint 58/86058/2
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>
4 years agoImprove schemas population 55/86055/3
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>
4 years agoTurn JsonRpcEndpoint into a proper OvsdbRPC implementation 46/86046/8
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>
4 years agoReuse ObjectMapper across all connections 45/86045/2
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>
4 years agoUse a constant ObjectMapper in UpdateNotificationDeser 44/86044/1
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>
4 years agoUse proper constant in JsonUtils 42/86042/1
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>
4 years agoDo not reconfigure ObjectMapper in FutureTransformUtils 41/86041/1
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>
4 years agodelete reconciliation support on termination points 07/82707/12
Chetan Arakere Gowdru [Tue, 25 Jun 2019 08:55:28 +0000 (14:25 +0530)]
delete reconciliation support on termination points

Descripion:
There exists chances of stale tunnel-ports left over under following
scenario.

1) DPN connected and Tunnel configuration pushed in by ODL.
2) DPN disconnected and Tunnel Configuation delete by ODL from
network-topology config DS.
3) On DPN connecting back, there exists stale tunnelport port on this
DPN.

Following Changes are done to handle delete reconciliation support.

1) Configure "created_by:odl" on tunnel port in OVS(Port, Interface)
which will be pushed by ovsdb plugin.
2) During reconcilation, compare the termination points available in
config and oper DS and trigger delete of those stale termination points
of Oper DS which are set with "created_by:odl"

JIRA: OVSDB-459

Change-Id: I9356d5ef0af44334c97b6cf3632d4ce9fd2070aa
Signed-off-by: Chetan Arakere Gowdru <chetan.arakere@altencalsoftlabs.com>
Signed-off-by: xcheara <chetan.arakere@altencalsoftlabs.com>
4 years agoBump to odlparent-6.0.1/yangtools-4.0.2/mdsal-5.0.4 32/85632/2
Robert Varga [Wed, 6 Nov 2019 16:32:25 +0000 (17:32 +0100)]
Bump to odlparent-6.0.1/yangtools-4.0.2/mdsal-5.0.4

This picks up latest upgrades and fixes.

Change-Id: I8db358b0af81394a561071d98bffea168dda47cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate MockitoJUnitRunner 58/84458/2
Robert Varga [Sat, 14 Sep 2019 19:00:39 +0000 (21:00 +0200)]
Migrate MockitoJUnitRunner

This migrates from org.mockito.runners.MockitoJUnitRunner to
org.mockito.junit.MockitoJUnitRunner.

Change-Id: I7311c18d01dd51f3ddaa5397c7f61ee3c143cb7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoDo not use Foo.toString() when logging 00/85400/1
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>
4 years agoBump mdsal to 5.0.3 69/85069/1
Robert Varga [Fri, 11 Oct 2019 14:13:26 +0000 (16:13 +0200)]
Bump mdsal to 5.0.3

This bumps mdsal to 5.0.3 to workaround issues with Blueprint
injection.

Change-Id: I848c9220ce06ec7b4af304ab64948bdc30257dbd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoAdd a workaround for ARIES-1923 56/85056/1
Robert Varga [Fri, 11 Oct 2019 12:10:24 +0000 (14:10 +0200)]
Add a workaround for ARIES-1923

The services here may fail to resolve, causing problems downsteam.
This fixes up the issue by dropping target Java version to 10.

Change-Id: I226ba17183aa202209bbfbbe9ae2b87af7103383
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 5.0.2 42/84442/8
Robert Varga [Sat, 14 Sep 2019 06:57:45 +0000 (08:57 +0200)]
Bump mdsal to 5.0.2

This bumps mdsal to 5.0.2 as part of Magnesium MRI.

Change-Id: I93e10e95b7a241d678829afb732e2adef82c1a24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump odlparent to 6.0.0 41/84441/6
Robert Varga [Sat, 14 Sep 2019 06:57:23 +0000 (08:57 +0200)]
Bump odlparent to 6.0.0

This bumps odlparent to 6.0.0 as part of Magnesium MRI.

Change-Id: I084c6a32c4facafd85e3b87c6d8a9a29a33848a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoUpdate docs header to Magnesium in the master 15/83815/2
Anushka Bhandari [Tue, 20 Aug 2019 16:53:10 +0000 (22:23 +0530)]
Update docs header to Magnesium in the master

Should be Magnesium on master and Sodium on stable/sodium.

Signed-off-by: Anushka Bhandari <anushka16134@iiitd.ac.in>
Change-Id: Ib32db17f852043beadda5932c300b16dbe431e79

4 years agoCheck TP type rather than doing a blind cast 69/84569/3
Robert Varga [Sun, 22 Sep 2019 01:26:22 +0000 (03:26 +0200)]
Check TP type rather than doing a blind cast

Here we have a blind cast, which does not go through:

[main] WARN org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactUtils - Failed to add to Transaction Histroy
java.lang.ClassCastException: org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint$$$codecImpl cannot be cast to org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactUtils.addLocatorToTransactionHistory(TransactUtils.java:270)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactUtils.createPhysicalLocatorSet(TransactUtils.java:139)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.setLocatorSet(McastMacsRemoteUpdateCommand.java:135)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.doDeviceTransaction(McastMacsRemoteUpdateCommand.java:93)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.doDeviceTransaction(McastMacsRemoteUpdateCommand.java:1)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.AbstractTransactCommand.processDependencies(AbstractTransactCommand.java:125)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.onConfigUpdate(McastMacsRemoteUpdateCommand.java:78)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.updateMcastMacRemote(McastMacsRemoteUpdateCommand.java:65)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.McastMacsRemoteUpdateCommand.execute(McastMacsRemoteUpdateCommand.java:55)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactCommandAggregator.execute(TransactCommandAggregator.java:73)
at org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactInvokerImpl.invoke(TransactInvokerImpl.java:41)
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance.transact(HwvtepConnectionInstance.java:132)
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepConnectionInstance.transact(HwvtepConnectionInstance.java:104)
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepDataChangeListener.updateData(HwvtepDataChangeListener.java:178)
at org.opendaylight.ovsdb.hwvtepsouthbound.HwvtepDataChangeListener.onDataTreeChanged(HwvtepDataChangeListener.java:81)
at org.opendaylight.controller.md.sal.binding.impl.BindingDOMDataTreeChangeListenerAdapter.onDataTreeChanged(BindingDOMDataTreeChangeListenerAdapter.java:43)

Rather than incurring this, perform an instanceof check and debug
ignored data.

Change-Id: Icc3d1abe5afd2b9b60c7632606551904b7d27af7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoMigrate to use ArgumentMatchers 70/84570/2
Robert Varga [Sun, 22 Sep 2019 01:34:38 +0000 (03:34 +0200)]
Migrate to use ArgumentMatchers

org.mockito.Matchers.any() has been deprecated, use its newer
equivalent.

Change-Id: I46e4dd8000ab5a047da8414b5e9707b5f5e3b056
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
4 years agoBump mdsal to 4.0.6 38/84438/5
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>
4 years agoBump odlparent to 5.0.2 37/84437/4
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>
4 years agoFix checkstyle 36/84436/1
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>
4 years agoBump mdsal to 4.0.4 30/83730/1
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>
4 years agoBump versions by x.y.(z+1) 54/83554/1
jenkins-releng [Mon, 12 Aug 2019 16:14:13 +0000 (16:14 +0000)]
Bump versions by x.y.(z+1)

Signed-off-by: jenkins-releng <jenkins-releng@opendaylight.org>
Change-Id: I876601792e0d95e76362d9fed8c1f2c9b0c4d553

4 years agoBump mdsal to 4.0.3 39/83139/3
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>