controller.git
7 years agoFix test failure in DistributedShardedDOMDataTreeTest 76/50076/1
Tom Pantelis [Thu, 5 Jan 2017 20:26:57 +0000 (15:26 -0500)]
Fix test failure in DistributedShardedDOMDataTreeTest

Introduced by the akka artery patch
(https://git.opendaylight.org/gerrit/#/c/49466/) which wasn't
rebased after https://git.opendaylight.org/gerrit/#/c/44943/
was merged.

Change-Id: I1b5c8d7124d89eb90c74290f4571c0db1d2fb4ac
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoUse Akka artery for remote transport 66/49466/10
Robert Varga [Fri, 16 Dec 2016 10:23:28 +0000 (11:23 +0100)]
Use Akka artery for remote transport

This transport is introduced in 2.4.11 and is supposed to be
faster than the TCP transport. Enabled it globally so we can
evaluate it.

Change-Id: I25234f82ac056700e8b56abaeb452c53ec5b9dbd
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-7159: eliminate use of CrossStatementSourceReactor 47/49747/5
Robert Varga [Thu, 22 Dec 2016 15:27:26 +0000 (16:27 +0100)]
BUG-7159: eliminate use of CrossStatementSourceReactor

yang-test-util provides a convenient way to parse YANG files
into a SchemaContext, without relying on the internal layout
of the yang parser. Convert tests to use these utilities,
which simplifies test setup and allows the yang parser layout
to evolve without breaking the world.

Change-Id: Icbd0556b990ea9d5ff93c34330049a9683e04970
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: Fix deadlock with TransmitQueue 24/50024/4
Robert Varga [Wed, 4 Jan 2017 15:10:57 +0000 (16:10 +0100)]
BUG-5280: Fix deadlock with TransmitQueue

TransmitQueue should not be dispatching responses while
the connection lock is being held, as a that may expose
clients to AB/BA deadlocks if the callback tries to acquire
a lock which is being held by another thread attempting
to touch the same connection (i.e. transmit).

Fix this by TransmitQueue returning the entry to be
completed and AbstractClientConnection checking its
presence and performing actual completion after it has
dropped the connection lock.

Change-Id: Ibbacb641a297bfe7d4790af8401b036285c26593
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7033: Remove payload replication short-circuits 71/49971/2
Tom Pantelis [Tue, 3 Jan 2017 12:53:08 +0000 (07:53 -0500)]
BUG-7033: Remove payload replication short-circuits

Removed the code paths in ShardDataTree#startCommit whereby it
short-circuits the call to persistPayload. This simplifies the
code in ShardDataTree. For UNMODIFIED DataTreeCandidates we still
want to replicate so followers have an accurate view of transaction
states. For the case where persistence is disabled and there are no
followers, I modified persistPayload to check those conditions and
short-circuit.

Change-Id: Ifb940f950b076b5f9cedd91c42d3e065db92a7c5
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRev the archetype to utilize the latest year for default copyright value 86/49986/1
Ryan Goulding [Tue, 3 Jan 2017 18:18:41 +0000 (13:18 -0500)]
Rev the archetype to utilize the latest year for default copyright value

The archetype still defaults copyright year to 2016.  This revs the year
to 2017.

Change-Id: I9c51d3df71c4a79331c7152ed846923d60727a69
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
7 years agoBUG 2138: Introduce DistributedShardedDOMDataTree 43/44943/61
Tomas Cere [Wed, 31 Aug 2016 15:22:30 +0000 (17:22 +0200)]
BUG 2138: Introduce DistributedShardedDOMDataTree

This is the initial patch that introduces the concept of
prefix based shards and consumer/producer api's into the
DistributedDatastore.

Each shard has a frontend registered into the ShardedDOMDataTree
that forwards calls into the DistributedDataStoreClient frontend
which then handles the actual writes into the Shard.
These ShardFrontends are then distributed into other nodes
via ShardedDataTreeActor which also handles notification of
other nodes of open Producers.

Change-Id: Ifcbd1021fdaeac7929fc547e6e32be50da9d93fc
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7033: Fix commit exception due to pipe-lining 62/49762/3
Tom Pantelis [Thu, 22 Dec 2016 21:57:22 +0000 (16:57 -0500)]
BUG-7033: Fix commit exception due to pipe-lining

The DistributedDataStoreRemotingIntegrationTest#testTransactionWithIsolatedLeader
has failed sporadically on commit with the "Store tree X and candidate
base Y differ" error due to an edge case bug with the pipe-lining. Basically
this occurs if tx 1 is pending completion of replication and tx 2 is progressed
to the COMMIT_PENDING state but the associated DataTreeCandidate has
ModificationType.UNMODIFIED. In that case we elide replication and proceed
immdiately to finishCommit which results in the error due to tx 2 committing
before tx 1. To fix it, I added a new FINISH_COMMIT_PENDING state and call
payloadReplicationComplete, which checks the head of the pendingFinishCommits
queue, when replication is elided..

Change-Id: I5a0d033df131c9c3f4e24670a02a971dec331a4d
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-7033: Follow-up to address prior comments 89/49689/2
Tom Pantelis [Wed, 21 Dec 2016 10:51:39 +0000 (05:51 -0500)]
BUG-7033: Follow-up to address prior comments

Follow-up patch to address the 2 comments in
https://git.opendaylight.org/gerrit/#/c/49384/ that were made
after merge..

Change-Id: Id9864d89637e72961fc1a259f25d541edb1b46dc
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-7033: Implement batchHint in ShardDataTree 98/49498/4
Tom Pantelis [Fri, 16 Dec 2016 21:05:15 +0000 (16:05 -0500)]
BUG-7033: Implement batchHint in ShardDataTree

Modified ShardDataTree to properly compute the batchHint flag
that is passed to persistData. Basically if the next transaction
in the pendingCommits queue is in the COMMIT_PENDING state then
batchHint is set to true. After the call to persistData the next
transaction in the pendingCommits queue is processed which, if
COMMIT_PENDING, will be batched for replication with the previous
transaction.

Change-Id: I938e98391c69d617901e7e179c93e066667c017d
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBug 7391: Fix out-of-order LeaderStateChange events 01/49701/3
Tom Pantelis [Wed, 21 Dec 2016 14:20:36 +0000 (09:20 -0500)]
Bug 7391: Fix out-of-order LeaderStateChange events

On leader transition, the current leader first sends out
LeaderTransitioning events to each follower to tell them the
current leader is being deposed. The followers send out a
LeaderStateChange event with a null leaderId which is picked
up by the ShardManager to delay subsequent transactions activity
to the shard until a new leader is elected. However it's possible
the LeaderStateChange message does not reach a follower until after
the leader transition occurs (eg due to dispatching delay in the
caller or the network). This results in a LeaderStateChange event
with a null leaderId being delivered after the LeaderStateChange
with the new leaderId. I wrote a unit test that reproduces it.

We need to handle LeaderTransitioning events in a CAS-like manner,
ie include the leaderId with the LeaderTransitioning message and
only issue the LeaderStateChange event with a null leaderId if the
current leaderId matches the leaderId in the LeaderTransitioning
message.

Change-Id: I24e8bbf7707858ac4ed62f3a979cc0403daff8ac
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-5280: fix race proxy creation and reconnect 05/49705/2
Robert Varga [Wed, 21 Dec 2016 15:11:09 +0000 (16:11 +0100)]
BUG-5280: fix race proxy creation and reconnect

ProxyHistory map insertions have to happen-before or
happen-after the reconnect attempt. This is mostly take care
of by client's inversible lock, except for the race window
when the connection lookup succeeds and the history map
is updated.

Resolve this by introducing a StampedLock, which is used
to establish order of these operations, covering the entire
createHistoryProxy() method.

Change-Id: Ibdee739c94f3a48bef3f7fb19cd2f041c0061fe2
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: fix InversibleLock race 98/49698/1
Robert Varga [Wed, 21 Dec 2016 13:17:35 +0000 (14:17 +0100)]
BUG-5280: fix InversibleLock race

Do not read latch twice, as it may end up being
cleared asynchronously. This is a typo, as the reuse
is exactly why we read the latch into a local variable.

Change-Id: If90bd157be6e20d69f158bc749f163c1008541a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7033: Add batchHint flag to RaftActor#persistData 39/49439/5
Tom Pantelis [Thu, 15 Dec 2016 15:28:07 +0000 (10:28 -0500)]
BUG-7033: Add batchHint flag to RaftActor#persistData

Added a batchHint flag where, if true, it elides sending AppendEntries
immediately. AppendEntries will be sent on the next persistData call
with batchHint false or at the next heartbeat interval.

Change-Id: Id887ab46d5147e4fb5e50e52acaa8887d4048e1d
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-7033: Implement pipe-lining in ShardDataTree 84/49384/6
Tom Pantelis [Wed, 14 Dec 2016 19:41:23 +0000 (14:41 -0500)]
BUG-7033: Implement pipe-lining in ShardDataTree

Change-Id: I54d6e741089072660a9ea6df20801b9a196e7b52
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-2138: Allow creation of prefixed ShardDataTrees 18/48218/53
Tomas Cere [Thu, 10 Nov 2016 13:41:30 +0000 (14:41 +0100)]
BUG-2138: Allow creation of prefixed ShardDataTrees

This actually starts using the storeRoot field from DataStoreContext
so we can have CDS shards rooted somewhere else than store root.

Change-Id: I304a7678f3077359e7b2c4007e73321544c6e798
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoFixup eclipse warnings in ClusterAdminRpcServiceTest 56/49556/1
Robert Varga [Mon, 19 Dec 2016 14:08:55 +0000 (15:08 +0100)]
Fixup eclipse warnings in ClusterAdminRpcServiceTest

- boxing of true/false
- potentially static private method

Change-Id: I34612b20f57c8463de3a02744e271fa2dd774728
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: split DistributedDataStore 07/48707/48
Robert Varga [Fri, 25 Nov 2016 12:55:13 +0000 (13:55 +0100)]
BUG-5280: split DistributedDataStore

Split the DistributedDataStore into two components into
an abstract base class and concretization running with
TransactionProxies. Add another concretization, which uses
DataStoreClient to instantiate requests.

Change-Id: I454eec76d54c2fd4e4ea1e5cd16d12398eec81f0
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix JMX generator unit test 42/49442/2
Robert Varga [Thu, 15 Dec 2016 16:41:31 +0000 (17:41 +0100)]
Fix JMX generator unit test

MDSAL change to use static factory methods for
instantiating well-known types has changed the way
Longs are instantiated, breaking this test. Fix it up
to reflect the change.

Change-Id: I930c04baf07005216d81cfe1e123b10b21cdc396
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: speed FrontendClientMetadataBuilder up 64/49264/6
Robert Varga [Mon, 12 Dec 2016 18:07:43 +0000 (19:07 +0100)]
BUG-5280: speed FrontendClientMetadataBuilder up

ensureHistory() boils down to a simple computeIfAbsent(),
so make it more concise by using a simple constructor lambda.

Change-Id: Ia093ced071ae5e0411633d3c4f501a4e94c5de43
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: synchronize access to local histories 27/49427/5
Robert Varga [Thu, 15 Dec 2016 13:24:47 +0000 (14:24 +0100)]
BUG-5280: synchronize access to local histories

There is a subtle race between the allocation of histories
and the reconnect process, which could allow a local history
to be created when its connection is being reestablished but
after the cohorts for the connection have already been captured.

Change-Id: I230b5c00844d8e82775efc8f70368c2f63eabb1e
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoCleanup equals() template 45/49445/2
Robert Varga [Thu, 15 Dec 2016 17:22:00 +0000 (18:22 +0100)]
Cleanup equals() template

Missing a space in 'if(' and has explicit comparison to false,
which is not needed. Clean that up.

Change-Id: I55f748935070378eab58dd11cf2fb91e8cc9628b
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: add ClientTransactionCursor 24/49424/3
Robert Varga [Thu, 15 Dec 2016 11:25:59 +0000 (12:25 +0100)]
BUG-5280: add ClientTransactionCursor

Cursor-based access is useful for new MD-SAL APIs,
expose it from ClientTransaction.

Change-Id: Iff57c9d09935181e02ab5ac3f42c9f70d9f95424
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-7033: Allow ShardDataTree to pipeline transactions 75/28775/21
Robert Varga [Sat, 24 Oct 2015 16:34:53 +0000 (18:34 +0200)]
BUG-7033: Allow ShardDataTree to pipeline transactions

InMemoryDataTree gives us the DataTreeTip, which allows another
DataTreeModificatoin to be prepared on top an uncommitted one. This
allows us to pipeline transactions if we manage our lifecycle properly.

For now this feature gives stricter abort validation, and has otherwise
no impact. In future, this allows another DataTreeModification to be
prepared and queue for persistence before replication of the previous
one finishes.

Change-Id: I7ab97c906a6403da780800edd335f74c403e5aa4
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRemove RV_RETURN_VALUE_IGNORED FB supression 59/49259/3
Robert Varga [Mon, 12 Dec 2016 17:36:31 +0000 (18:36 +0100)]
Remove RV_RETURN_VALUE_IGNORED FB supression

Turning poll() into remove() makes the warning go away.
We are also switching the cases where this is not reported
to maintain consistency and force a different error than
NPE on inconsistency (which should never happen anyway).

Change-Id: I6b7739a2e5bcd00b7745af87b9c5e180006400bd
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agofix typo sotred to sorted 01/49101/2
Jamo Luhrsen [Wed, 7 Dec 2016 18:30:13 +0000 (10:30 -0800)]
fix typo sotred to sorted

Change-Id: If1d781dd961b6ddea94cb070b7ad1a9aac37cb95
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
7 years agochaging trivial log from info to warn 00/49100/2
Jamo Luhrsen [Wed, 7 Dec 2016 18:13:01 +0000 (10:13 -0800)]
chaging trivial log from info to warn

this log message is given a lot in the dsbenchmark test and doesn't really
help, as far as I can tell.  So, I changed it to warn and hopefully made it
a little more descriptive.

Change-Id: I784f5ca12eebd531b541868b2af9b6aff08a0737
Signed-off-by: Jamo Luhrsen <jluhrsen@redhat.com>
7 years agoBug 7271: Use mdsal AbstractDOMStoreTreeChangePublisher in CDS 03/48903/4
Tom Pantelis [Thu, 1 Dec 2016 18:32:29 +0000 (13:32 -0500)]
Bug 7271: Use mdsal AbstractDOMStoreTreeChangePublisher in CDS

Modified DefaultShardDataTreeChangeListenerPublisher to derive from
the AbstractDOMStoreTreeChangePublisher in the mdsal project to get
the DataTreeCandidate batching.

Change-Id: Ic86da04a80e9db56dd234549b88f4c958b1a708c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-5280: add READY protocol 50/49250/5
Robert Varga [Mon, 12 Dec 2016 11:43:31 +0000 (12:43 +0100)]
BUG-5280: add READY protocol

In order to make chained transactions work with remoting
we need a way for the frontend to propagate the ready state
to the backend. This patch adds a READY protocol, which acts
as a preparatory stage before the 'real' protocol kicks in.

With that the backend state is properly updated to reflect
state transitions on the frontend and we do not need to play
weird future-based delays in the frontend, which would be
exceedingly complex.

Change-Id: I51a0ca0c2b900e3c6522426e5897a4fca1b9da19
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG 2138: Introduce prefix based shards into ShardManager 05/44705/48
Tomas Cere [Wed, 31 Aug 2016 15:20:38 +0000 (17:20 +0200)]
BUG 2138: Introduce prefix based shards into ShardManager

Adds the concept of shards rooted at a DOMDataTreeIdentifier
(combination of YangInstanceIdentifier and LogicalDataStore)
into the distributed datastore.

Change-Id: I43a32556000092c7e7b2ee09b334f82f38ec865b
Signed-off-by: Tomas Cere <tcere@cisco.com>
7 years agoBUG-5280: add basic concept of ClientSnapshot 27/48727/32
Robert Varga [Fri, 25 Nov 2016 12:55:13 +0000 (13:55 +0100)]
BUG-5280: add basic concept of ClientSnapshot

In order to accurately read-only transactions with ClientLocalHistory,
we need to differentiate between Transactions and Snapshots. This patch
introduces the concept, its API and backend signalling/implementation.

State keeping is reworked so it requires only a single field, which
is manipulated via an atonic updater, with null signifying state has
already been closed (or is in process of being taken care of).

Change-Id: I2f8fd5ffdff366d1948538299b96721b756c620c
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: expose queue messages during reconnect 80/48980/11
Robert Varga [Thu, 1 Dec 2016 15:28:53 +0000 (16:28 +0100)]
BUG-5280: expose queue messages during reconnect

This patch reworks the internals of AbstractClientConnection
to isolate the TransmitQueue from the rest of the logic,
so we have proper split between implementation and interface
exposed to the users.

Furthermore the public interface is slightly reworked so the
individual Proxies have access to the (locked) queue contents,
which is needed to correctly replay transaction state within
transaction chains.

Change-Id: I1c08fa06eec4dd581e07002059c5142e6b0c1ed4
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: report history which was not found 98/48998/7
Robert Varga [Mon, 5 Dec 2016 17:35:54 +0000 (18:35 +0100)]
BUG-5280: report history which was not found

We seem to have a lockign issue somewhere, which leads
to an exception being thrown in tests. Refactor the exception
to also include history identifier, so we can track it down.

Change-Id: I0826dfdc18f10103da58855bb14c269734ae47ab
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: do not cache modify responses 79/48979/5
Robert Varga [Mon, 5 Dec 2016 10:56:04 +0000 (11:56 +0100)]
BUG-5280: do not cache modify responses

Modification responses cannot be cached, as their sequence
number is changing -- which leads to cached responses being
dropped.

Change-Id: I3c4037e3a29cff3cdd193865cd98f5df152286f4
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoUse nullOrNonPositive instead of nullOrNonZero 81/48981/2
Jacky Hu [Mon, 5 Dec 2016 12:54:26 +0000 (20:54 +0800)]
Use nullOrNonPositive instead of nullOrNonZero

The method name should match it's functionality to test whether the
duration is positive or not.

Change-Id: I830d1072d5854d88a96f02a3f161456329a50be7
Signed-off-by: Jacky Hu <hudayou@hotmail.com>
7 years agoBug 7326: Fix ConcurrentModificationException in Blueprint 54/49154/4
Tom Pantelis [Fri, 9 Dec 2016 15:35:51 +0000 (10:35 -0500)]
Bug 7326: Fix ConcurrentModificationException in Blueprint

in AbstractDependentComponentFactoryMetadata.stopServiceRecipes()

tpantelis: "This is an edge case where the container is destroyed
immediately after and while it's starting up. This isn't likely to
happen in production but can happen during feature tests. I had assumed
the container would provide the protection but apparently it doesn't."

Change-Id: Id7532d30cb0a5f67fd907cb15372069d8769b247
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRemove FB suppression 39/49139/1
Robert Varga [Thu, 8 Dec 2016 09:34:26 +0000 (10:34 +0100)]
Remove FB suppression

Using .remove() instead of .poll() makes FB  shut up,
because the return value is not used for signalling
queue state.

Change-Id: I0aefc0eb7ede948b8311d12c6307137532018386
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: refactor AbstractClientConnection 64/48864/3
Robert Varga [Thu, 1 Dec 2016 10:17:53 +0000 (11:17 +0100)]
BUG-5280: refactor AbstractClientConnection

The structure of AbstractClientConnection and its subclasses
makes it hard to replay messages in a coordinated fashion. Furthermore
splitting the inflight and pending and inflight queues into separate
classes means we would have to jump through quite a few hoops
to correctly calculate backpressure.

Refactor the base class so it includes all the operations usually
performed, with remoteMaxMessages() acting as the limiter, which disables
transmission in connecting/reconnecting states.

Change-Id: If743e4913aade7ed65ba60375d8b7d12c563cb96
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoRemove MockReplicatedLogEntry 08/48808/3
Tom Pantelis [Tue, 29 Nov 2016 20:21:03 +0000 (15:21 -0500)]
Remove MockReplicatedLogEntry

This class now just inherits from SimpleReplicatedLogEntry so in no
longer needed. Changed all users to SimpleReplicatedLogEntry. The only
difference is that the term and index params are flipped in the ctors.

Change-Id: I0b32078eeb9ea45001dcd8e8aa30bfe548256e96
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoChange ReplicatedLogImplEntry to Externalizable proxy pattern 03/48803/2
Tom Pantelis [Tue, 29 Nov 2016 16:34:50 +0000 (11:34 -0500)]
Change ReplicatedLogImplEntry to Externalizable proxy pattern

The Externalizable proxy pattern decreases serialized sized as
it avoids serializing the full class info. We need to keep
ReplicatedLogImplEntry for persistence backwards compatibility.
A new SimpleReplicatedLogEntry class was added to implement the
Externalizable proxy pattern. ReplicatedLogImplEntry "readResolves"
to SimpleReplicatedLogEntry. Also, SimpleReplicatedLogEntry
implements MigratedSerializable to cause a snapshot on upgrade
enabling us to remove ReplicatedLogImplEntry in the next release.

Change-Id: Iaf5c8f6b271c3ead43a80ac905412b4cb5a9efa2
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-5280: fix transaction seal atomicity 31/48831/2
Robert Varga [Wed, 30 Nov 2016 14:07:58 +0000 (15:07 +0100)]
BUG-5280: fix transaction seal atomicity

AbstractProxyTransaction.seal() indicates that the user is done
with the transaction. This transition needs to be atomically
propagated to successors on reconnect, such that the user will
always observe sealed proxies. More importantly this state
is propagated to parent ProxyHistory, where it drives the state
machine in ClientProxyHistory -- and failing to mark the successor
as sealed will wreck that.

Unfortunately an AbstractProxyTransaction does not forward all
of the state on seal(), but rather when the resulting commit
cohort initiates commit -- which means we have to perform three-way
synchronization between seal()/(can|direct)Commit/finishReconnect,
to ensure we flush state towards the backend exactly once.

To do that, we guard the methods involved with locking for split
them into fast/slow paths and add an explicit flushState() method
by which subclasses forward their current unsent state to their
successor. This solution is correct but a bit heavy-handed, so it
will be further optimized in a follow-up patch.

Change-Id: Id5f156dc18faef5b9184c3e2e3d24f7af1b18841
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: TransactionAbortRequest is used for user aborts 30/48830/2
Robert Varga [Wed, 30 Nov 2016 14:24:51 +0000 (15:24 +0100)]
BUG-5280: TransactionAbortRequest is used for user aborts

TransactionAbortRequest is used to indicate both user abort
and 3PC abort, whereas current backend code assumed it is
only used for 3PC -- hence it required a cohort to be present.

Teach handleTransactionAbort to use a direct transaction abort
if it receives a request without having a cohort present.

Change-Id: Ia469d907edb575d5f1ee5e4f630fe1a19204032f
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix FindBugs warnings in sal-remoterpc-connector and enable enforcement 96/47696/5
Tom Pantelis [Thu, 27 Oct 2016 17:06:33 +0000 (13:06 -0400)]
Fix FindBugs warnings in sal-remoterpc-connector and enable enforcement

Warnings fixed:
  - RemoteRpcImplementation: use of 'error' known to be null
  - RpcBroker, RpcRegistry: The Creator class has non-Serializable field.
    Removed the Creator class and used Props that creates by reflection.
  - RpcBroker: use of 'result' that is marked as @Nullable
  - RpcBroker: redundant check of 'result.getErrors()' that is known to be
    non-null (marked as @Nonnull).
  - Gossiper, RemoteRpcRegistryMXBeanImpl: use entrySet iterator instead of
    keySet and get.
  - Messages: redundant specification of implements Serializable
  - LatestEntryRoutingLogic: Comparator should also implement Serializable in
    case TreeSet is serialized. This isn't the case here but it doesn't hurt
    to implement Serializable in lieu of supressing the warning.
  - LatestEntryRoutingLogic: Fixed potential null pointer de-reference in
    'compare'.

Change-Id: I8930c8975e1dd9179d78e74087b3994a365b90f8
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix FindBugs warnings in blueprint and enable enforcement 29/47629/4
Tom Pantelis [Wed, 26 Oct 2016 16:58:05 +0000 (12:58 -0400)]
Fix FindBugs warnings in blueprint and enable enforcement

Warnings fixed:
- OpendaylightNamespaceHandler(line 83): "Usage of GetResource may be unsafe
  if class is extended". Made the class final so it can't be extended.

- BlueprintContainerRestartServiceImpl(line 140): "return value of this method
  should be checked". Log warning if 'await' returns false.

Change-Id: I1473acabd0a4126f5e5d2745292fcbff9a308462
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-5280: fix problems identified by integration tests 06/48706/17
Robert Varga [Fri, 25 Nov 2016 15:16:41 +0000 (16:16 +0100)]
BUG-5280: fix problems identified by integration tests

Switching the integration test suite has flushed out couple
of problems in the implementation, notably:

- wrong formatting placeholder
- unhandled requests during replay
- uninitialized path in AbstractReadTransactionRequestProxyV1
- missing sequence number bump in local commit case
- wrong writeObject() in ReadTransactionSuccessProxyV1
- IllegalStateException thrown instead of TransactionChainClosedException
- attempt to create history=0 on the backend
- mismatched sequences during preCommit message replay
- ConcurrentModificationException during localAbort()
- missing upcalls to LocalHistory concretizations when transactions abort
  and complete
- incorrect order on enqueue/send, leading to unpaired responses

Change-Id: I252a795dadb917452b9eb6d591a5c12ca5b69a45
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoConstantSchemaAbstractDataBrokerTest, faster than AbstractDataBrokerTest 70/47770/10
Michael Vorburger [Thu, 27 Oct 2016 17:27:36 +0000 (19:27 +0200)]
ConstantSchemaAbstractDataBrokerTest, faster than AbstractDataBrokerTest

In something like AclServiceTest, of which I'm going to be writing a lot
more shortly, which runs e.g. 7 @Test methods under a fresh DataBroker,
there is no need to re-re-re-re do the bloody slow creation of
SchemaContext every time (because its content is based on the classpath,
wihch is fixed for a given single test).

This optimization approx. halfs the time e.g. for AclServiceTest, from
ca. 30s to ca. 15s.

Implemented on the train & ferry traveling back from EclipseCon ;)

Change-Id: Ic47f8abf9833bafcce13655b46cbce3e02aed050
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoMake sure MetricsReporter cache is constant 32/48632/2
Robert Varga [Wed, 23 Nov 2016 14:57:48 +0000 (15:57 +0100)]
Make sure MetricsReporter cache is constant

Add a missing final keyword, plus the general
auto-format.

Change-Id: I0027784b6773e4b862bc58d7cc573303dcc57b31
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 5419: Persist log entries asycnhronously 41/48441/6
Tom Pantelis [Thu, 17 Nov 2016 14:10:23 +0000 (09:10 -0500)]
Bug 5419: Persist log entries asycnhronously

Modified RaftActor#persistData to persist the ReplicatedLogEntry
using akka's persistAsync method. This is similar to the persist method
except subsequent messages are delivered prior to persistence completion.
This avoids blocking the RaftActor so it can process AppendEntriesReply
and other messages while persistence is in progress.

In addition, AbstractLeader was modified to only count itself for consensus
when persistence is complete. This required communicating the persistence
complete state to the AbstractLeader. A transient persistencePending flag was
added to the ReplicatedLogImplEntry that is set by RaftActor#persistData
prior to the persist call and is cleared when the persist callback executes.
AbstractLeader checks the flag when counting consensus. It's possible that
the persistence complete event arrives after AppendEntriesReply messages
from replicated followers so a new message, CheckConsensusReached, is sent
by the RaftActor on persistence complete to check if consensus is reached.

Change-Id: If34a5f395d52e17b2737464a2e2403f56a520c43
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-5280: add executionTimeNanos 86/48686/16
Robert Varga [Fri, 25 Nov 2016 00:06:20 +0000 (01:06 +0100)]
BUG-5280: add executionTimeNanos

In order to properly measure impact of requests on the backend
we nead some indication of the complexity involved in servicing
the request. It is not feasible to estimate this by analyzing
the request itself, hence we provide a way for the backend to
communicate how complex it found a request to be back to the
frontend.

Since this measure excludes actor inbox and transport latency,
the frontend can use this measure to weigh the relative complexity
compared to other requests in has sent.

Change-Id: Ia7f435ff8a7fd995a90261b128832c340026de6d
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: add SimpleDataStoreClientBehavior 92/48292/32
Robert Varga [Sat, 12 Nov 2016 03:58:46 +0000 (04:58 +0100)]
BUG-5280: add SimpleDataStoreClientBehavior

Module-based sharding has a more complex run-time
strategy than the CDT sharding, which instantiates
a client-per-shard.

Create a dedicated behavior and resolver to take
advantage of this simplification.

Change-Id: I289e0c8d914f1ab9a9d8992b4f3a7bd4451af3f9
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoCheckstyle compliant src/main|test/resources 12/48712/2
Michael Vorburger [Fri, 25 Nov 2016 18:24:36 +0000 (19:24 +0100)]
Checkstyle compliant src/main|test/resources

Change-Id: Ic7dc38ddedb3ed642eb8581cc223269c1bf36408
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoFix javadocs and enable doclint 83/48683/4
Robert Varga [Thu, 24 Nov 2016 22:56:18 +0000 (23:56 +0100)]
Fix javadocs and enable doclint

This eliminates the doclint suppression and fixes up javadoc, so they
work with Java 8 out of the box.

Change-Id: I7294f0dcd570e3e3c445e54cc8989078175d05d7
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 5419: Add persistAsync method to DataPersistenceProvider 40/48440/2
Tom Pantelis [Thu, 17 Nov 2016 07:03:26 +0000 (02:03 -0500)]
Bug 5419: Add persistAsync method to DataPersistenceProvider

Change-Id: I7558cdbc59bb3db1d2ea6311ff37eec47efff92e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBug 7180 - error-severity and error-type values should be lowercase 26/48326/9
Jakub Morvay [Mon, 14 Nov 2016 15:41:26 +0000 (16:41 +0100)]
Bug 7180 - error-severity and error-type values should be lowercase

Add String value fields to ErrorSeverity and ErrorType enums that
contain lowercase names of enums. Enums' string value getter methods
return these lowercase values.

Change-Id: I1509a7bbae4811025a5bbba11e9b2f0c0cc75b50
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoBUG-5280: add AbstractClientConnection 10/44910/72
Robert Varga [Tue, 30 Aug 2016 15:57:41 +0000 (17:57 +0200)]
BUG-5280: add AbstractClientConnection

Introduce a connection concept. This is a replacement for
the request queue, as it turns out we do need the concept
of a full connection (e.g. generational logic).

This comes from the need to sensibly switch behaviors
as the locality of the backend leader changes.

This patch implements two sets of strategies for dealing
with reconnect:

The first one assumes long-lived state and is used for
proxies dealing with histories. Here we make sure to
reinstantiate and replace them in a map, as we want
new transactions to follow the new semantic and we do not
want to tear histories down or follow inefficient paths.

The second one assumes short-lived state and is used for
proxies dealing with individual transactions. Transactions
are assumed to come and go rapidly and therefore we
do not replace the proxies in maps (as they will be
short-lived), but rather forwards operations to successors.

The first strategy has a higher access cost, but its state
is always fully uptodate when reconnect finishes, while
the second strategy favor access time, but operations end
up "trailing" and will be forwarded (and hence inefficient)
until the transaction completes.

Change-Id: I7fd9e21c749f55b91229bf0b671c8dcf2e4d5982
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBUG-5280: implement backend message handling 32/41032/75
Robert Varga [Wed, 29 Jun 2016 16:08:11 +0000 (18:08 +0200)]
BUG-5280: implement backend message handling

This patch adds message routing on the backend so messages
earlier in the patch series get handled correctly.

Change-Id: Ie0ecfc1c8ce3c3b52b5b9c4986dd01444c2a719a
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoBug 6969 - Memory leak during bundle tree restart 84/48284/11
Alexis de Talhouët [Tue, 15 Nov 2016 18:55:33 +0000 (13:55 -0500)]
Bug 6969 - Memory leak during bundle tree restart

There are two root causes for that memory leak:

-  Retention on BlueprintContainer when desotrying them before "quiescing"
them:
Restarting a set of bundles requires cooperation between them to avoid
having retention on services due to on-going call, processing.
As OSGi APIs don't provide such functionality, the Quiesce APIs where
created, ensuring all calls to be finished before actually shutting down
the bundle. Once the set of bundles are quiesced, e.g. shut down, they
can safely be destroyed.

- Retention on the TopoProcessingProviderImpl due to unreleased resources:
https://git.opendaylight.org/gerrit/#/c/48283/

Change-Id: I0af4a27ac7c87f1cc158313f0497158733a045a5
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoFix FindBugs warnings in sal-distributed-datastore and enable enforcement 48/47548/6
Tom Pantelis [Tue, 25 Oct 2016 16:27:57 +0000 (12:27 -0400)]
Fix FindBugs warnings in sal-distributed-datastore and enable enforcement

Several warnings were suppressed via annotation with justification provided.
Other warnings that were fixed:
 - remove redundant implements in several classes
 - "The referenced methods have names that differ only by capitalization"
   warnings. This is checked across all classes for consistency. The main
   offender was getTransactionID vs. getTransactionId. I changed all methods
   to getTransactionId and associated fields to transactionId.
 - unsynchronized access to a field where access is synchronized
   elsewhere (in DataTreeChangeListenerProxy and DatastoreContextIntrospector).
 - catching Exception instead of catching more specific exception types that
   are thrown from the try block.
 - unconfirmed casts - verify via Preconditions check to avoid warning
 - unnecessarily calling toString() on a String instance
 - synchronizing an AtomicInteger instance (in ThreePhaseCommitCohortProxy) -
   not an issue in this case but changed to synchronize a separate Object
   in lieu of supressing the warning.
 - unsynchronized to SimpleDateFormat which isn't thread-safe (in ShardStats).
 - potential null-pointer access of 'shard' in ShardStats - changed to pass
   'shard' to the ctor in lieu of setter.
 - calling String#getBytes w/o specifying encoding (in DataTreeModificationOutput).
 - privileged access to create ClassLoader in ActorSystemProviderImpl although not
   likely a SecurityManager would ever be present.

Change-Id: I0a87208f3f200fbe4f78e950c21419fbab154d94
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRefactor DocumentedException class 22/48322/4
Jakub Morvay [Mon, 14 Nov 2016 15:19:47 +0000 (16:19 +0100)]
Refactor DocumentedException class

Deprecate ErrorType and ErrorSeverity getTagValue methods. Add new
replacement getTypeValue and getSeverityValue methods respectively.

Change-Id: If7915c65e72a26bfd6c676bb17c94c896cc0c5e2
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
7 years agoFix CS warnings in blueprint and enable enforcement 05/47605/2
Tom Pantelis [Wed, 26 Oct 2016 12:25:33 +0000 (08:25 -0400)]
Fix CS warnings in blueprint and enable enforcement

Fixed checkstyle warnings and enabled enforcement. Most of the
warnings/changes were for:
 - white space before if/for/while/catch
 - variable name too short
 - line too long
 - illegal catching of Exception

Change-Id: I2a9eb1dc47f46a2c56dc2415ee9ebb73ec7d18c4
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRemoved sonar warnings. 06/46706/5
Dana Kutenicsova [Wed, 5 Oct 2016 20:38:38 +0000 (22:38 +0200)]
Removed sonar warnings.

Change-Id: I53136e343bd54e9f0a687044037bc61deebb05b4
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoRemoved sonar warnings. 05/46705/5
Dana Kutenicsova [Wed, 5 Oct 2016 20:20:13 +0000 (22:20 +0200)]
Removed sonar warnings.

Change-Id: Ia29cb315308f0bb153447b8961b7dd9f2562ca65
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoFix CS warnings in sal-remoterpc-connector and enable enforcement 90/47690/4
Tom Pantelis [Thu, 27 Oct 2016 15:42:39 +0000 (11:42 -0400)]
Fix CS warnings in sal-remoterpc-connector and enable enforcement

Fixed checkstyle warnings and enabled enforcement. Most of the
warnings/changes were for:
 - white space before if/for/while/catch
 - white space before beginning brace
 - line too long
 - illegal catching of Exception (suppressed)
 - variable name too short
 - indentation
 - local vars/params hiding a field
 - remove unused vars
 - convert functional interfaces to lambdas (eclipse save action)
 - missing period after first sentence in javadoc
 - adding final for locals declared too far from first usage

Change-Id: I222d003cb07810434cb7f62420b4a9157f1d3027
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-5280: fix a thinko around sealed transactions 74/48274/3
Robert Varga [Fri, 11 Nov 2016 18:30:13 +0000 (19:30 +0100)]
BUG-5280: fix a thinko around sealed transactions

Proxy transaction should check for not being sealed.

Change-Id: I7e7163d762a520a1899b09aa4fea4d10ab5e98c7
Signed-off-by: Tomas Cere <tcere@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoUse odlparent for archetype to inherit the version 51/47651/4
Alexis de Talhouët [Thu, 27 Oct 2016 03:29:45 +0000 (23:29 -0400)]
Use odlparent for archetype to inherit the version

maven-checkstle-plugin needs the version from odlparent.
Explicity declaring odlparent instead of odlparent-lite
removes maven warning at compile time.

Change-Id: I8393af1a25cbcc13ff10d7f5be375352af2b4caf
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoRemoved sonar warnings. 04/46704/4
Dana Kutenicsova [Wed, 5 Oct 2016 20:03:08 +0000 (22:03 +0200)]
Removed sonar warnings.

Change-Id: I030527e8d6ec5762e63707b157b77a4f21683bbb
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoReplace target/ by ${project.build.directory}/ for target-ide/ 63/48163/1
Michael Vorburger [Wed, 9 Nov 2016 14:11:25 +0000 (15:11 +0100)]
Replace target/ by ${project.build.directory}/ for target-ide/

Change-Id: I868a1e33be1e0a3ca4b4f913f6d1d1f1bd282283
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoChanges for akka 2.4.11 63/47763/3
Tom Pantelis [Mon, 31 Oct 2016 02:37:42 +0000 (22:37 -0400)]
Changes for akka 2.4.11

- Fixed compile error in MeteringBehavior as signature of onReceive now
  declares Throwable.

- Fixed intermittent failure in
  ShardManagerGetSnapshotReplyActorTest#testGetSnapshotTimeout. On failure,
  the actor would not get the ReceiveTimeout message from akka. However,
  oddly the test didn't fail if just testGetSnapshotTimeout was run - it
  would only fail if run with at least one of the other 2 tests. I tried
  creating a different ActorSystem for each test but that didn't fix it.
  I finally narrowed it down to creating the actors via the TestActorFactory
  although the exact reason is unknown. The tests don't really need to use
  the TestActorFactory so I remove its use.

- Fixed intermittent failure in
  ShardTransactionTest#testShardTransactionInactivity. This was the same issue
  as the ShardManagerGetSnapshotReplyActorTest, i.e. the actor would not get
  the ReceiveTimeout message when no other message was sent. I found the
  TestActorFactory was again the culprit. I narrowed it down to the
  verifyActorReady method which creates an ActorSelection and sends an
  Identify message. This was put in to work around messages intermittently
  going to dead letters shortly after actor creaton. It seems this code
  somehow may interfere with the ReceiveTimeout functionality. So to workaround
  this, I allowed the caller to elide the verifyActorReady call.

Change-Id: Ic8474def917414fa9bbe0f19b30b213f3052a1aa
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFixup javadoc 16/47816/2
Robert Varga [Tue, 1 Nov 2016 23:01:41 +0000 (00:01 +0100)]
Fixup javadoc

This adds a wee bit more information and corrects a method
reference -- it should not be #readResolve, but #writeReplace.

Change-Id: I8654960e3cbcaac1bc308a7d93e2e762b284111b
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix wrong groupId name 23/47823/3
Robert Varga [Wed, 2 Nov 2016 09:54:30 +0000 (10:54 +0100)]
Fix wrong groupId name

Commit fac268302e4261bb8b42143476692563cbdf149b changed
the model's groupId, breaking autorelease. Repair the damage.

Change-Id: Ib4440cba0ec2c66097b247edf59321d2a56cd354
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agotarget-ide/ support by resourceBaseDir using ${project.build.directory} 13/47813/2
Michael Vorburger [Tue, 1 Nov 2016 20:44:28 +0000 (21:44 +0100)]
target-ide/ support by resourceBaseDir using ${project.build.directory}

without explicitly setting this,
org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
defaults to hard-coded target/generated-sources/spi for
META-INF/services/org.opendaylight.yangtools.yang.binding.YangModelBindingProvider
instead of target-ide.

Minor: Also add target-ide/ to .gitignore of this git repository.

Change-Id: I330646f5a4e71cda021697410d452298a4127f4f
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBug 7065 - Add sal-cluster-admin-impl to mdsal-artifacts 96/47796/4
Alexis de Talhouët [Tue, 1 Nov 2016 13:36:14 +0000 (09:36 -0400)]
Bug 7065 - Add sal-cluster-admin-impl to mdsal-artifacts

Change-Id: I3c81a6da476e4760c7516124c8c68b855f0851f6
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoReplace target/ by ${project.build.directory}/ for target-ide/ 81/47781/2
Michael Vorburger [Mon, 31 Oct 2016 14:01:33 +0000 (15:01 +0100)]
Replace target/ by ${project.build.directory}/ for target-ide/

Change-Id: I3b6ae82beb1401d378c4896ae34c93d6008c4e52
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoRemove config module archetype dependency from config-artifacts 99/47799/2
Alexis de Talhouët [Tue, 1 Nov 2016 15:19:45 +0000 (11:19 -0400)]
Remove config module archetype dependency from config-artifacts

Follow-up from https://git.opendaylight.org/gerrit/#/c/47652/

I missed the config-artifacts dependency, hence the merge job failed.
This will fix it.

Change-Id: I659a7e145fdeb9b04133da16a48451f12299bfc6
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoFix FindBugs warnings in cds-access-api and enable enforcement 73/47473/4
Tom Pantelis [Tue, 25 Oct 2016 05:41:17 +0000 (01:41 -0400)]
Fix FindBugs warnings in cds-access-api and enable enforcement

Several warnings are suppressed with justification provided.

Change-Id: I39b860013677d045bb8e8dbd722c9b41406285ac
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRemove config module archetype 52/47652/4
Alexis de Talhouët [Thu, 27 Oct 2016 03:36:56 +0000 (23:36 -0400)]
Remove config module archetype

Change-Id: Ie9c7eb41441594ba15928ab918406ea3ca9ef07a
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoBug 7065 - sal-cluster-admin not export java binding inteface in MANIFEST.MF 88/47788/2
Geng Xingyuan [Mon, 31 Oct 2016 22:07:20 +0000 (06:07 +0800)]
Bug 7065 - sal-cluster-admin not export java binding inteface in MANIFEST.MF

decoupling cluster-admin api and impl.
export cluster-admin java binding api

Change-Id: Iac19d722bd805310ba8eb1dcd1341b0b1e5741bd
Signed-off-by: Geng Xingyuan <geng.xingyuan@zte.com.cn>
7 years agoRemove completely opendaylight/commons/opendaylight 50/47650/5
Alexis de Talhouët [Thu, 27 Oct 2016 03:23:57 +0000 (23:23 -0400)]
Remove completely opendaylight/commons/opendaylight

Change-Id: Ia6966b58c9e568ed9c60511f596c88affb658279
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoDo not use opendaylight/commons/opendaylight as parent 47/47647/15
Alexis de Talhouët [Thu, 27 Oct 2016 03:13:26 +0000 (23:13 -0400)]
Do not use opendaylight/commons/opendaylight as parent

Change-Id: I9a858c90274c7c82bac75fc7931a10c1ff707ef8
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoRemove SerializationUtils in sal-distributed-datastore 65/47765/1
Tom Pantelis [Mon, 31 Oct 2016 03:07:24 +0000 (23:07 -0400)]
Remove SerializationUtils in sal-distributed-datastore

This class was moved to sal-clustering-commons however there was a lone
user in netconf so we had to temporarily keep the sal-distributed-datastore
version until the netconf user was switched over.

Change-Id: Ie6db146a93b5688fce2f0888394261ebc25507f7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRemove legacy NormalizedNode serialization classes 39/47639/3
Tom Pantelis [Wed, 26 Oct 2016 18:55:01 +0000 (14:55 -0400)]
Remove legacy NormalizedNode serialization classes

Removed the pre-Lithium protobuff-based NormalizedNode classes and
related classes as they are no longer used.

Change-Id: I6ae34c9f3778f31bfa26cb4b6d30f3f3eb1f6fc8
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoUse NormalizedNode streaming serialization in sal-remoterpc-connector 38/47638/3
Tom Pantelis [Wed, 26 Oct 2016 18:59:03 +0000 (14:59 -0400)]
Use NormalizedNode streaming serialization in sal-remoterpc-connector

Converted the code in sal-remoterpc-connector to use the NormalizedNode
streaming classes for serialization instead of the legacy protobuff-based
serialization.

Change-Id: Ia08ccf9c9b569a8e70c7fb345946b7f02c46be5e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoMove SerializationUtils to sal-clustering-commons 37/47637/2
Tom Pantelis [Wed, 26 Oct 2016 19:05:20 +0000 (15:05 -0400)]
Move SerializationUtils to sal-clustering-commons

Moved the SerializationUtils class from saldistributed-datastore to
sal-clustering-commons for re-use (will be used in sal-remoterpc-connector).

Change-Id: I0f1775152ffd2badd5468c5b6321e3274b319736
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRemove pre-Lithium serialization support in sal-distributed-datastore 34/47634/2
Tom Pantelis [Wed, 26 Oct 2016 18:06:11 +0000 (14:06 -0400)]
Remove pre-Lithium serialization support in sal-distributed-datastore

We've had 3 releases since Helium so it should be safe to remove the
backwards compatible serialization support for the old format utilized by
NormalizedNodeToNodeCodec. It's not likely any user would have persisted
data in the old format in production (mainly b/c clustering was essentially
beta at best) but, in Boron, persisted journals will get snapshotted anyway
in the post-Helium format due to message migration.

Change-Id: I3fba07748b798962b7816878a791cf50a97e5a50
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-5280: move transactions keeping to history 09/44909/20
Robert Varga [Wed, 31 Aug 2016 09:43:21 +0000 (11:43 +0200)]
BUG-5280: move transactions keeping to history

Keeping transaction map in directly in DistributedDataStoreClientBehavior
is not consistent and will create problems when replaying state during
reconnect.

This patch moves transaction tracking into AbstractClientHistory, allowing
DistributedDataStoreClientBehavior to only track open histories. It also
makes locking more consistent, as transaction instantiation is completely
encapsulated in the AbstractClientHistory from which it is created.

Change-Id: I9fc031437a9d8c33df6f9e7294dd392f58965f3d
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix FindBugs warnings in sal-cluster-admin and enable enforcement 00/47600/3
Tom Pantelis [Wed, 26 Oct 2016 11:30:26 +0000 (07:30 -0400)]
Fix FindBugs warnings in sal-cluster-admin and enable enforcement

Change-Id: I14db0675fd5e48555a61bfde0517615474a0c8c3
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix FindBugs warnings in cds-access-client and enable enforcement 72/47472/3
Tom Pantelis [Tue, 25 Oct 2016 05:12:12 +0000 (01:12 -0400)]
Fix FindBugs warnings in cds-access-client and enable enforcement

Change-Id: I295538aa4af61c1eec81fd5b9143c5514bf17f2e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix CS warnings in cds-access-api and enable enforcement 59/47459/4
Tom Pantelis [Mon, 24 Oct 2016 20:43:22 +0000 (16:43 -0400)]
Fix CS warnings in cds-access-api and enable enforcement

Fixed checkstyle warnings and enabled enforcement. Most of the
warnings/changes were for:
 - variable name too short
 - correct ordering of @Nonnull annotations
 - line too long
 - suppressing CS RedundantModifier warning for ctors where public is needed
   for packaged-scoped classes that implement Externalizable
 - adding protected to ctors for packaged-scoped abstract classes that
   implement Externalizable to avoid CS RedundantModifier warning
 - local vars/params hiding a field
 - putting overloaded methods close to one another

Change-Id: Ib85e15f21118f3484ccb8e945e8257ae3e3278bc
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix FindBugs warnings in sal-akk-raft 05/46905/8
Tom Pantelis [Thu, 13 Oct 2016 15:58:23 +0000 (11:58 -0400)]
Fix FindBugs warnings in sal-akk-raft

Fixed FindBugs warnings in sal-akk-raft and enabled the maven plugin to
run and fail the build on violations. Some warnngs were suppressed with
justification provided.

Change-Id: I96b4bb58e6f5a6c3d3d14dadb9567df58ef5905f
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix FindBugs warnings in sal-clustering-commons 19/46919/4
Tom Pantelis [Thu, 13 Oct 2016 22:20:56 +0000 (18:20 -0400)]
Fix FindBugs warnings in sal-clustering-commons

Fixed FindBugs warnings in sal-clustering-commons and enabled the maven plugin to
run and fail the build on violations.

For some reason, the plugin sometimes creates a local .fbExcludeFilterFile that
is a copy of the one in odlparent. It may be that it doesn't always clean it up
at the end. So I added it to the .gitignore

Change-Id: Id1ad5582f533bd4bfe714e54ae1e79d00a411552
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix remaining CS warnings in sal-distributed-datastore 99/47499/3
Tom Pantelis [Tue, 25 Oct 2016 12:04:08 +0000 (08:04 -0400)]
Fix remaining CS warnings in sal-distributed-datastore

Fixed remaining warnings and enabled enforcement. Most of the
warnings/changes were for:
 - white space before beginning brace
 - line too long
 - illegal catching of Exception (suppressed)
 - variable name too short
 - javadoc issues

Change-Id: I5ae5cf9276e0884595137d551a311e8322b2e25e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix CS warnings in cds-access-client and enable enforcement 71/47471/3
Tom Pantelis [Tue, 25 Oct 2016 04:49:04 +0000 (00:49 -0400)]
Fix CS warnings in cds-access-client and enable enforcement

Fixed checkstyle warnings and enabled enforcement. Most of the
warnings/changes were for:
 - variable name too short
 - correct ordering of @Nonnull annotations
 - line too long
 - javadocs

Change-Id: Ib888dbf909282079bff6320ce718d5a4da3ed31a
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix unit test CS warnings in sal-distributed-datastore 83/47483/3
Tom Pantelis [Tue, 25 Oct 2016 10:04:11 +0000 (06:04 -0400)]
Fix unit test CS warnings in sal-distributed-datastore

Fixed checkstyle warnings in unit tests. Most of the
warnings/changes were for:
 - white space before if/for/while/catch
 - white space before beginning brace
 - line too long
 - illegal catching of Exception (suppressed)
 - illegal throwing of Throwable (changed to Exception)
 - variable name too short
 - indentation, mostly due to nested code inside anonymous JavaTestKit
   instances
 - separator wrapping: '.', '+', '&&' should be on a new line
 - local vars/params hiding a field
 - putting overloaded methods close to one another
 - remove unused vars
 - convert functional interfaces to lambdas (eclipse save action)
 - adding final for locals declared too far from first usage

Also 3 classes are no longer used so I removed them rather than fix warnings.

Change-Id: Ie1507e36c67a2b58f7efb62378212976b962f9fe
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRevert "Clean-up pom.xml layout" 67/47467/1
Alexis de Talhouët [Mon, 24 Oct 2016 23:48:05 +0000 (19:48 -0400)]
Revert "Clean-up pom.xml layout"

Since this got merged, I'm facing issue building the project correctly, it's
failing in samples/toaster-it and runtime is broken because of mess-up classpath.
If others are facing the same issue, this should be merged.

I'll rework the overall patch later.

This reverts commit 8a637013c102c11323230dae08fa4407863945d6.

Change-Id: I61aae87439736d0163e6b4c49d8753052b28bac0
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoClean-up pom.xml layout 91/46691/12
Alexis de Talhouët [Fri, 7 Oct 2016 21:26:17 +0000 (17:26 -0400)]
Clean-up pom.xml layout

Do not depend on opendaylight/commons/opendaylight/pom.xml

Change-Id: Ic7313dc6b703739a6c14b1f0cd1a37ba3b7827af
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoFix CS warnings in sal-cluster-admin and and enable enforcement 61/46861/3
Tom Pantelis [Thu, 13 Oct 2016 06:30:53 +0000 (02:30 -0400)]
Fix CS warnings in sal-cluster-admin and and enable enforcement

Fixed checkstyle warnings and enabled enforcement. Most of the
warnings/changes were for:
 - white space before if/for/while/catch
 - line too long
 - illegal catching of Exception (suppressed)
 - adding final for locals declared too far from first usage

Change-Id: I0b78c01398a1c62220980e0c8ad22db288208d59
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFully specify distribution.opendaylight-karaf 19/47319/2
Stephen Kitt [Fri, 21 Oct 2016 08:59:50 +0000 (10:59 +0200)]
Fully specify distribution.opendaylight-karaf

... and karaf-parent while we're at it.

This is necessary in particular to put distribution.opendaylight-karaf
back in org.opendaylight.controller, and allow controller to merge
again...

Change-Id: I277b21f31168e6cb22ac4b332c26475debd8974d
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoReplace target/ by ${project.build.directory}/ to make target-ide/ possible 81/47181/2
Michael Vorburger [Thu, 20 Oct 2016 00:04:51 +0000 (02:04 +0200)]
Replace target/ by ${project.build.directory}/ to make target-ide/ possible

Change-Id: Id67a0a6b447a237dd727d2b9ba47c735fc759b81
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoFix CS warnings in sal-clustering-commons and enable enforcement 53/46853/4
Tom Pantelis [Wed, 12 Oct 2016 20:28:13 +0000 (16:28 -0400)]
Fix CS warnings in sal-clustering-commons and enable enforcement

Fixed checkstyle warnings and enabled enforcement. Most of the
warnings/changes were for:
 - white space before if/for/while/catch
 - white space before beginning brace
 - line too long
 - illegal catching of Exception (suppressed)
 - variable name too short
 - indentation
 - local vars/params hiding a field
 - putting overloaded methods close to one another
 - remove unused vars
 - convert functional interfaces to lambdas (eclipse save action)
 - empty catch block - added comment or Throwables.propagate as appropriate
 - missing period after first sentence in javadoc
 - missing first sentence in javadoc
 - adding final for locals declared too far from first usage

Change-Id: I0a6690f97820e8fb670f209221d8e4e2f1cf5d8b
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoDo not wrap Guava as a bundle in features' definition 01/47101/2
Alexis de Talhouët [Tue, 18 Oct 2016 21:38:35 +0000 (17:38 -0400)]
Do not wrap Guava as a bundle in features' definition

As it will refresh the bundle when the feature is loaded,
because it will certainly be already installed, and hence
will refresh all bundles depending on Guava.

Also, this is not necessary.

This patch is not directly tied to BUG-6956 but it's a result of it

Change-Id: I79a3adac4dd8d21757f8c7756b0239413ee55589
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>