controller.git
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>
7 years agoBug 6278: Switch to use odlparent's karaf-parent 61/47161/2
Ryan Goulding [Wed, 19 Oct 2016 17:57:04 +0000 (13:57 -0400)]
Bug 6278: Switch to use odlparent's karaf-parent

Change-Id: I6fbb35e3379b85e19f325319fddd50591a143a03
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
7 years agoBUG-6705: remove enunciate-parent 80/47080/2
Stephen Kitt [Tue, 18 Oct 2016 15:23:15 +0000 (17:23 +0200)]
BUG-6705: remove enunciate-parent

This is unused, so it seems safe to remove without deprecating it
first.

Change-Id: Id9083bdc021e127739eecca70c64be5c5e5d08d4
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoFix warnings/javadocs in sal-distributed-datastore 92/46692/2
Tom Pantelis [Fri, 7 Oct 2016 21:36:42 +0000 (17:36 -0400)]
Fix warnings/javadocs in sal-distributed-datastore

Fixed checkstyle warnings in the entity ownershiop classes. 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
 - missing period after first sentence in javadoc
 - missing first sentence in javadoc
 - missing <p/> in javadoc

Change-Id: I34d130d5f50751222d89a0b36c132bd270aba156
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix remaining CS errors in sal-akka-raft and enable enforcement 05/46805/3
Tom Pantelis [Tue, 11 Oct 2016 20:19:16 +0000 (16:19 -0400)]
Fix remaining CS errors in sal-akka-raft and enable enforcement

Some checkstyle violations were missed in previous patches which
enabling enforcement revealed.

Change-Id: I3a31b24aea69adfe8d50071fdce27fbd69c04b58
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoFix warnings in sal-akka-raft test classes 98/46798/4
Tom Pantelis [Tue, 11 Oct 2016 16:06:26 +0000 (12:06 -0400)]
Fix warnings in sal-akka-raft test classes

Fixed checkstyle warnings in the test classes. 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
 - removed use of JavaTestKit with embedded code (avoids
   having to indent code another 4 spaces). In most cases, JavaTestKit
   wasn't even used.
 - 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: I5c522e5b0383b2c5e9b0b036dc444c51f788b650
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRework MethodSerializer (+ fallout) 72/46472/2
Stephen Kitt [Thu, 22 Sep 2016 14:23:41 +0000 (16:23 +0200)]
Rework MethodSerializer (+ fallout)

The main aim of this patch is to avoid instanceof-determined behaviour
(between MethodDeclaration and MethodDefinition):
* move getThrowsExceptions() and getBody() to Method;
* make getVisibility() and getBody() Optional;
* method declarations can specify thrown exceptions (which are
  separated by commas, not spaces).

In addition, use Java 8 lambdas where appropriate in MethodSerializer
and a few places elsewhere, and use Modifier instead of String for
modifiers.

Some clean-up:
* drop inferrable type parameters;
* use new ArrayList<>() instead of Lists.newArrayList();
* use Collections.singletonList() where appropriate.

Change-Id: I9ec10bf64d366056afacce3fd4038ba92d3c4e6e
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoBug 6910: Fix anyxml node streaming 47/46747/3
Tom Pantelis [Mon, 10 Oct 2016 20:57:32 +0000 (16:57 -0400)]
Bug 6910: Fix anyxml node streaming

On output, changed AbstractNormalizedNodeDataOutput to transform the
DOMSource to a result String that is serialized to the stream. On input,
modified NormalizedNodeInputStreamReader to parse the XML string into
a org.w3c.dom.Node and create a DOMSource.

Change-Id: Ib10822c4444331351cf7f25e1f26d981f7d41dc7
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBug 6540: EOS - handle edge case with pruning pending owner change commits 38/45638/5
Tom Pantelis [Thu, 15 Sep 2016 06:14:51 +0000 (02:14 -0400)]
Bug 6540: EOS - handle edge case with pruning pending owner change commits

The previous patch https://git.opendaylight.org/gerrit/#/c/45516/ added
pruning of pending owner change commits on leader change. However there's
one edge case which wouldn't work correctly where the leader successfully
commits a transaction to add a candidate but becomes isolated when it tries
to commit the transaction to set the candidate as the owner, assuming the new
candidate is the only candidate. When the partition is healed, the owner write
transaction will be pruned and dropped thus no onwer will be selected.

We could allow this owner write to be forwarded to the new leader since it
originated from a client candidate add request. However this could still be
problematic if, during isolation, the majority partition gets a candidate add
and commits an owner. After the partition heals the "old" owner write would be
forwarded and overwrite the previous owner. This wouldn't be catastrophic but
would incur an unnecessary owner change. I would rather keep consistent behavior
of dropping pending owner writes to a new leader.

Instead, the new leader can assign the previous leader as owner when the partition
heals. So in onPeerUp and onLeaderChange, I added code to search for all entities
with no owner and select and write an owner. Therefore when onPeerUp occurs for the
previous leader after isolation, if no other candidate was registered and became
owner, then the previous leader will be assigned as owner.

Change-Id: I213bc3ecd3d1f7ebd099702390de2277109f92c2
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoAbstractDataBrokerTestTest which actually does something 64/46564/4
Michael Vorburger [Wed, 5 Oct 2016 16:22:25 +0000 (18:22 +0200)]
AbstractDataBrokerTestTest which actually does something

Incl. verification that each @Test cleans up after itself.  We had a
suspicion that this didn't work; it turns out that it actually does and
we had another problem somewhere else.  Contributing this test still
seems useful for future non-regression.

Change-Id: I295ebde45a0c030ab74852788b45203cdf6639e0
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoBug 6918: Edit ErrorSeverity and ErrorType from() method to accept lowercase strings 50/46750/2
Andrej Mak [Tue, 11 Oct 2016 07:38:03 +0000 (09:38 +0200)]
Bug 6918: Edit ErrorSeverity and ErrorType from() method to accept lowercase strings

Change-Id: Ifbf4e3447ccd65bf476df3477e63c95748d52493
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
7 years agoUpdate to akka 2.4.11 86/46686/3
Robert Varga [Fri, 7 Oct 2016 16:03:03 +0000 (18:03 +0200)]
Update to akka 2.4.11

Akka has changed declarations, hence we need to deal with
Throwable instanceof of Exception.

Change-Id: If20161ce109a2eb1a839ec3f34b64878eac43932
Signed-off-by: Robert Varga <rovarga@cisco.com>
7 years agoFix sonar warnings in config-util. 78/46578/3
Dana Kutenicsova [Wed, 5 Oct 2016 19:41:14 +0000 (21:41 +0200)]
Fix sonar warnings in config-util.

Mostly renaming enum constants.

Change-Id: I24a3afe1281a070550ef3c8424b35ed58d3691f6
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoClean-up archetype 85/46685/2
Alexis de Talhouët [Fri, 7 Oct 2016 16:22:25 +0000 (12:22 -0400)]
Clean-up archetype

Remove all legacy archetypes to only provide one and complete
archetype. This will avoid confusion on which archetype to use,
and will also avoid using deprecated things, as some of those
archetypes aren't up-to-date.

- remove opendaylight-configfile-archetype
- remove odl-model-project
- remove opendaylight-karaf-distro
- remove opendaylight-karaf-features

Change-Id: I3aebfff60a0f27052a684583b4cd085e8105e58e
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoFixed few sonar warnings. 73/46573/5
Dana Kutenicsova [Tue, 4 Oct 2016 20:02:55 +0000 (22:02 +0200)]
Fixed few sonar warnings.

Removed static imports.

Change-Id: Ife05c6c4fc288c70624880eefbe9c5be8b47b974
Signed-off-by: Dana Kutenicsova <dana.kutenics@gmail.com>
7 years agoFix warnings and clean up javadocs in sal-akka-raft 11/46511/3
Tom Pantelis [Tue, 4 Oct 2016 19:38:58 +0000 (15:38 -0400)]
Fix warnings and clean up javadocs in sal-akka-raft

Fixed a lot of checkstyle warnings and cleaned up javadocs for the remaining
classes sal-akka-raft. Most of the warnings/changes were for:
 - white space before if/for
 - white space before beginning brace
 - line too long
 - period after first sentence in javadoc
 - missing <p/> in javadoc

Change-Id: I99a3cd08af10d46acecd0e22f04d54b95e2287d9
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoRemove <prerequisites><maven> from 4 archetype pom.xml 42/46642/2
Michael Vorburger [Thu, 6 Oct 2016 23:26:28 +0000 (01:26 +0200)]
Remove <prerequisites><maven> from 4 archetype pom.xml

This is no longer required now that odlparent specified this
(and, more importantly, odlparent also specifies
the maven-enforcer-plugin).

https://git.opendaylight.org/gerrit/#/c/46597/ did a manual
clean up in netvirt related to this.  This change is to
make sure that this doesn't creep back in.

Change-Id: I1a85018c710989bda990d6d9cfa4e168bd4103c0
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoFix warnings/javadocs in sal-distributed-datastore 39/46639/4
Tom Pantelis [Thu, 6 Oct 2016 22:46:11 +0000 (18:46 -0400)]
Fix warnings/javadocs in sal-distributed-datastore

First off, I apologize for the size of this patch. There's a ton of classes
in this project and I didn't even get to all of them (will follow-up). While
a lot of files were touched, the changes were mostly small.

Fixed a lot of checkstyle warnings and cleaned up javadocs. 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
 - missing period after first sentence in javadoc
 - missing first sentence in javadoc
 - missing <p/> in javadoc

Change-Id: Id56d874a8fbcbbc9285279a71c0a5aba393653a9
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoConfigurable update-strategy for clusteredAppConfig 86/44386/6
Vishal Thapar [Fri, 19 Aug 2016 10:00:43 +0000 (15:30 +0530)]
Configurable update-strategy for clusteredAppConfig

Any change to application's config data results in restart of the
blueprint container. This change adds an attribute that allows different
applications to disable this restart.

Attribute added: update-strategy
Values: reload, none.
Default: reload

Change-Id: Ie0c7501f8b5c84970a46ca8f02d7f77caf913a0a
Signed-off-by: Vishal Thapar <vishal.thapar@ericsson.com>
7 years agoFix warnings and javadocs in sal-akka-raft 65/45865/4
Tom Pantelis [Tue, 20 Sep 2016 03:54:44 +0000 (23:54 -0400)]
Fix warnings and javadocs in sal-akka-raft

Fixed a lot of checkstyle warnings and cleaned up javadocs for classes in the
org.opendaylight.controller.cluster.raft package.

Change-Id: I67dd997701fe6eaf6c87e77954a4c1d4aa5fda69
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBUG-6341: use common Coda Hale Metrics 36/43736/4
Stephen Kitt [Thu, 11 Aug 2016 15:09:18 +0000 (17:09 +0200)]
BUG-6341: use common Coda Hale Metrics

This depends on https://git.opendaylight.org/gerrit/43717

Change-Id: I39f26964836b3c2b2fd4e54f06b8761743812b12
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoMechanical code cleanup (sal-binding-broker) 82/46082/4
Stephen Kitt [Thu, 22 Sep 2016 16:19:18 +0000 (18:19 +0200)]
Mechanical code cleanup (sal-binding-broker)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: Ia9ab5959dab860bc8220aff4390ca62c87ec8ecf
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoClean up to remove controller/opendaylight/commons/checkstyle 89/45589/3
Michael Vorburger [Wed, 14 Sep 2016 15:20:20 +0000 (17:20 +0200)]
Clean up to remove controller/opendaylight/commons/checkstyle

Main reason for finally doing this longer overdue clean-up now is that
it appears that the odlparent Checkstyle rules are not effective (in-IDE
and likely also on CLI, not tested) for controller projects such as
md-sal/binding-broker (where a number of violations should have shown
but didn't); and I suspect this may because of a precedence conflict
with these (old) Checkstyle rules, which now are not needed anymore.

Unless I'm missing something, normally (hopefully) this should have no
remaining impact anywhere outside of controller; I have done a
(relatively quick) grep for all 3 of "commons.checkstyle.version" &
"<artifactId>checkstyle" & "checkstyle-logging.xml" (all of which this
removes) in all of autorelease, and have found a few references in 3 old
projects (lacp, alto, netconf; note that netide, ttp used to have
dependencies to controller's checkstyle, but those project have
meanwhile cleaned that up themselves), which the linked changes
will have removed, so... should now be OK.

Change-Id: If6484abd36b01c49c5da5bf277809fb053da0001
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
7 years agoMove sal-remote to sal-rest-connector 76/44576/5
Alexis de Talhouët [Tue, 23 Aug 2016 22:29:28 +0000 (18:29 -0400)]
Move sal-remote to sal-rest-connector

This module is only used by sal-rest-connnector bundle,
moreover, it is intended to create notification stream
and/or register a data change event which is done using
RESTCONF, thus it make sense to move it to the appropriate
project.
I beleive this is a leftover of the migration that happened
when controller was splitted out..

This is the associated patch in Netconf project:
https://git.opendaylight.org/gerrit/#/c/44575/

Change-Id: Ied4bb2b4b04d36298ca14f9f7926e4aa52de7be2
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoMechanical code cleanup (sal-akka-raft) 84/46084/3
Stephen Kitt [Thu, 22 Sep 2016 16:21:18 +0000 (18:21 +0200)]
Mechanical code cleanup (sal-akka-raft)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: I02567e9b21a73406863797a5a4eaa257e6eb20f2
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoUse the diamond operator in generated Java 77/35977/2
Stephen Kitt [Wed, 9 Mar 2016 11:12:44 +0000 (12:12 +0100)]
Use the diamond operator in generated Java

Now that javaparser is used to verify the generated code, use <>.

Change-Id: I9ef5ad62108b91eba8565329386f96c777b03cdf
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoBug 6540: EOS - Prune pending owner change commits on leader change 16/45516/4
Tom Pantelis [Thu, 8 Sep 2016 14:16:53 +0000 (10:16 -0400)]
Bug 6540: EOS - Prune pending owner change commits on leader change

When the shard leader is isolated, it attempts to re-assign ownership for down
peers. However, since it's isolated, it can't commit the modifications. If the
majority partition elects a new leader, when the partition is healed, the old
leader tries to forward the pending owner change commits to the new leader.
However this is problematic as the criteria used to determine the new owner is
stale and owner changes should only be committed by a valid leader. Since the
old leader is no longer the leader, it should not forward pending owner change
commits. However it still should forward local candidate change commits.

So I modified EntityOwnershipShardCommitCoordinator#onStateChange to iterate
the pending Modifications and remove WRITE modifications for the owner leaf
when the shard has transitioned to having a remote leader.

I also fixed an issue in EntityOwnershipShard#onCandidateRemoved that was
intermittently revealed by unit tests. Say candidate1 and candidate2 are
removed quickly for an entity and candidate1 is the current owner.
onCandidateRemoved is called for candidate1 and commits an update to write
candidate2 as the owner. If the write commit is still pending when
onCandidateRemoved is called for candidate2, the current owner will still
be candidate1 and the "message.getRemovedCandidate().equals(currentOwner)"
check will fail and thus the owner isn't cleared and candidate2 will remain
as owner. This results in a node being the owner w/o being in the candidate
list. (This patch may fix Bug 6672 as well)

A new testLeaderIsolation case was added to EntityOwnershipShardTest. Also I
reworked the tests and removed the use of the MockFollower and MockLeader
actors for consistency and also so the tests use the real EOS shard.

Change-Id: I5039b07d02f8571ee2d1affb0f364ea278641e91
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBug 6540: Fix journal issues on leader changes 15/45515/4
Tom Pantelis [Fri, 9 Sep 2016 18:08:03 +0000 (14:08 -0400)]
Bug 6540: Fix journal issues on leader changes

Fixed a couple issues with journal syncing on leader changes and isolation.

Consider the scenario where a leader is isolated and the majority partition elects
a new leader and both sides of the partition attempt to commit entries independently.
Say the term was 1 and last journal index was 2 prior to isolation and was replicated
to all followers and applied to state. After isolation, the isolated leader appends a
new entry with index 3 and attempts to replicate but fails to reach consensus.
Meanwhile, the new leader appends its own new entry with index 3 and is successfully
replicated to the remaining follower and applied to state. The commitIndex in the
majority partition is now 3. The new leader attempts to send AppendEntries to the
isolated leader but doesn't get any replies so it marks it as inactive.

When the partition is healed, the isolated leader converts to follower when it hears
from the new leader with the higher term. Since the new leader has marked the isolated
leader as inactive, the initial AppendEntries that the previous leader sees will have
no entries and the leaderCommitIndex will be 3. This is greater than the current
commitIndex 2 so the previous leader will update its commitIndex to 3 and apply its
entry with index 3 to the state. However this entry was from the previous term 1 which
was not replicated to a majority of the nodes and conflicts with the new leader's entry
with index 3 and term 2. This is a violation of raft.

This violation occurs as a result of the new leader not sending any entries until it
knows the follower is active. This is for efficiency to avoid continuously trying to
send entries when a follower is down. This is fine however the leader should not send
its current commit index either since it doesn't know the state of the follower. The
intention of the empty AppendEntries in this case is to re-establish connectivity with
the follower and thus should not cause any state change in the follower. Therefore I
changed the code to send leaderCommitIndex as -1 if the follower is inactive.

The other case where the leader purposely sends an empty AppendEntries is when the
leader is in the process of installing a snapshot on a follower, as indicated by the
presence of a LeaderInstallSnapshotState instance in the FollowerLogInformation. The
empty AppendEntries is still sent at the heartbeat interval to prevent an election
timeout in case the snapshot capture/transfer is delayed. Again, the AppendEntries
should not cause any state change in the follower so I also changed the leader to send
-1 for the leaderCommitIndex. As a result, I also changed it so that the leader
immeditely records a LeaderInstallSnapshotState instance in the FollowerLogInformation
when it initiates the async snapshot capture. Previously this was done when the capture
completed and the RaftActor sent the SendInstallSnapshot message to the leader
behavior. However it may take some time to capture the snapshot and intervening AppendEntries heart beats may be sent to the follower.

The other issue in the above scenario is that the conflict with entry 3 is not
immediately detected. On the first AppendEntries, the previous leader reports back
a successful reply with lastLogIndex 3 and lastLogTerm 1 b/c the previous
index (2) and term (1) didn't conflict. The new leader sets the previous leader's
match index to 3 and thinks index 3 has been replicated to all the followers and
trims its in-memory log at index 2. Eventually when the next entry with index 4 is
replicated, the previous leader will detect the conflict as the leader's previous
log index 3 and term 2 will be sent in the next AppendEntries. The new leader will
backtrack and eventually install a snapshot to sync the previous leader however
it's inefficient and should be unnecessary. The leader should detect the conflict
immediately on the first AppendEntries reply. So I changed handleAppendEntriesReply
to check that the follower's lastLogTerm matches the leader's term for that index.
If not, the leader sets the follower's next index to lastLogTerm - 1. This prevents
the leader from trimming its log and the next AppendEntries will include the
conflicting entry which the follower will remove/replace.

Change-Id: I7a0282cc4078f33ffd049e4a0eb4feff6230510d
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBug 6540: Move LeaderInstallSnapshotState to FollowerLogInformation 14/45514/3
Tom Pantelis [Fri, 9 Sep 2016 21:36:03 +0000 (17:36 -0400)]
Bug 6540: Move LeaderInstallSnapshotState to FollowerLogInformation

AbstractLeader maintains a Map of followerId -> LeaderInstallSnapshotState
in parallel to the Map of followerId -> FollowerLogInformation. It makes
sense to move the LeaderInstallSnapshotState into the FollowerLogInformation
instead of maintaining 2 Maps.

Change-Id: Ia0b58fad9bb2fde42d8c1ba4b0f7aae4eb11abb5
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBug 6540: Refactor FollowerToSnapshot to its own class 13/45513/2
Tom Pantelis [Fri, 9 Sep 2016 18:10:47 +0000 (14:10 -0400)]
Bug 6540: Refactor FollowerToSnapshot to its own class

Refactored FollowerToSnapshot to its own class and renamed to
LeaderInstallSnapshotState. This will facilitate subsequent patches.

Change-Id: Ie2540ddce1869a9972c8f3d547b0567c3d663aff
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
7 years agoBug 6794 - Deprecate eventbus, async-eventbus and fixed-threadpool 38/46138/6
Alexis de Talhouët [Fri, 23 Sep 2016 15:46:58 +0000 (11:46 -0400)]
Bug 6794 - Deprecate eventbus, async-eventbus and fixed-threadpool

Those modules aren't used anymore, I couldn't find any reference of them,
expect some in netconf regarding the fixed-threadpool. But those
reference are coming from big xml test files that I suppose are pretty odl.

This deprecation notice is to warn potential downstream consumer that those
are now deprecated, and that those will be removed in next release, Nitrogen.

Change-Id: I8810b39a632c2d4c678c31bb46b8284aa33593f2
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoBug 6795 - Deprecated sal-dom-xsql 39/46139/3
Alexis de Talhouët [Fri, 23 Sep 2016 15:50:45 +0000 (11:50 -0400)]
Bug 6795 - Deprecated sal-dom-xsql

This deprecation notice is to warn potential downstream consumer that
those are now deprecated, and that those will be removed in next release,
Nitrogen.

Change-Id: I1a81f76f3b6bc5a976e0422548a117b7a25bead5
Signed-off-by: Alexis de Talhouët <adetalhouet@inocybe.com>
7 years agoMechanical code cleanup (sal-remoterpc-connector) 67/46067/3
Stephen Kitt [Thu, 22 Sep 2016 15:22:45 +0000 (17:22 +0200)]
Mechanical code cleanup (sal-remoterpc-connector)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: I502b5887cadb1a7cdbc42e7b817495f9c767a4a1
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoMechanical code cleanup (commons) 65/46065/3
Stephen Kitt [Thu, 22 Sep 2016 15:08:38 +0000 (17:08 +0200)]
Mechanical code cleanup (commons)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: If1805b63e52c1ab0c68983e7856e7ccf184cb2a9
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoMechanical code cleanup (sal-binding-api) 83/46083/3
Stephen Kitt [Thu, 22 Sep 2016 16:20:18 +0000 (18:20 +0200)]
Mechanical code cleanup (sal-binding-api)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: Ia2f892083eb30b898fbd544ec62620ee6976a553
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoMechanical code cleanup (sal-akka-raft-example) 90/46090/3
Stephen Kitt [Thu, 22 Sep 2016 16:31:07 +0000 (18:31 +0200)]
Mechanical code cleanup (sal-akka-raft-example)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: Ie8f6cd7df4287d427e9ecb8174bcd8c79a80c4de
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoMechanical code cleanup (sal-common-impl) 91/46091/3
Stephen Kitt [Thu, 22 Sep 2016 16:32:09 +0000 (18:32 +0200)]
Mechanical code cleanup (sal-common-impl)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: I94484029e3967dfb16343e61432f0945659c14b3
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoMechanical code cleanup (sal-common-api) 86/46086/3
Stephen Kitt [Thu, 22 Sep 2016 16:23:57 +0000 (18:23 +0200)]
Mechanical code cleanup (sal-common-api)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: I710395170295960e00d46ceb9540994c9c49c96e
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoMechanical code cleanup (sal-connector-api) 87/46087/3
Stephen Kitt [Thu, 22 Sep 2016 16:26:25 +0000 (18:26 +0200)]
Mechanical code cleanup (sal-connector-api)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: I7771fe4533469229b319c5d0590d26922a389f9e
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoMechanical code cleanup (sal-distributed-datastore) 70/46070/3
Stephen Kitt [Thu, 22 Sep 2016 15:28:27 +0000 (17:28 +0200)]
Mechanical code cleanup (sal-distributed-datastore)

* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: I3eb023d9f5b34ce83e69c746efd1ff464bfd6789
Signed-off-by: Stephen Kitt <skitt@redhat.com>
7 years agoCode cleanup (sal-common-util) 74/46074/3
Stephen Kitt [Thu, 22 Sep 2016 15:45:37 +0000 (17:45 +0200)]
Code cleanup (sal-common-util)

* Remove unnecessary type specifiers (use Java 7 <>)
* Inline unnecessary temporary variables

Change-Id: I8600988018fd15a711ba4b63d8b947127fb64d7a
Signed-off-by: Stephen Kitt <skitt@redhat.com>