controller.git
2 years agoFix config-netty-config's dependencies 73/53173/2
Robert Varga [Sat, 11 Mar 2017 15:53:36 +0000 (16:53 +0100)]
Fix config-netty-config's dependencies

This artifact carries only an XML file, there is no need
to pull in the mdsal infrastructure. This fixes the karaf4
feature.xml so it does not include mdsal bundles.

Change-Id: I2433cc7574e5bf237866fd509f235c55d5fe2e13
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoUse guava-testlib's FakeTicker 59/53159/3
Robert Varga [Fri, 10 Mar 2017 16:53:20 +0000 (17:53 +0100)]
Use guava-testlib's FakeTicker

Rather than rolling our own, use the Ticker class available
in guava-testlib.

Change-Id: If3d1abec6aad20b439e19fbd48d961b7582aa607
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBug 7814: Fix InvalidActorNameException 00/53100/5
Tom Pantelis [Fri, 10 Mar 2017 23:03:11 +0000 (18:03 -0500)]
Bug 7814: Fix InvalidActorNameException

When a read tx actor is created in the Shard, the actor name is generated
as eg "shard-member-1:datastore-operational@0:19" where 0 is the instance's
static generation id and 19 is the tx id. If the tx was created from a chain,
the chain's history id is appended. So every part of the name is constant for
the controller instance except the tx id, which is generated via a counter in
AbstractTransactionContextFactory, and the history id which is also generated
via a counter. The counters do make the full tx id unique in the cluster.
However if multiple shards are involved in a single front-end transaction,
they all have the same tx id and thus the actor names generated by each shard
would be the same. It seems that's what occurred in Bug 7814. Therefore I
changed the actor name to include the shard name.

Change-Id: Iacb11bb401bd6bded38847690f8009c115ee0637
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoFix FindBugs warning around static invocation 87/52887/5
root [Mon, 6 Mar 2017 14:32:44 +0000 (15:32 +0100)]
Fix FindBugs warning around static invocation

For some reason FB does not like our copy-pasted code,
so centralize the formatting primitive into a dedicated
method.

Change-Id: Ia73c5d5b163181b476f0a8ac3eb4744e9d9538d3
Signed-off-by: root <rovarga@cisco.com>
2 years agoBug 6859: Binding generator v1 refactoring 41/53141/1
Martin Ciglan [Fri, 10 Mar 2017 13:38:13 +0000 (14:38 +0100)]
Bug 6859: Binding generator v1 refactoring

based on https://git.opendaylight.org/gerrit/#/c/53140/,
make sure Controller compiles

Change-Id: I0d16ef9a278983f94166ea427174a479dac86581
Signed-off-by: Martin Ciglan <mciglan@cisco.com>
2 years agoUnit tests for RequestFailure derived classes 79/53079/5
Ivan Hrasko [Thu, 9 Mar 2017 13:31:03 +0000 (14:31 +0100)]
Unit tests for RequestFailure derived classes

Change-Id: I3b9fb7f6707b4519ea91880a369cfba0af24eb4e
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 years agoUnit test for AveragingProgressTracker class 97/52997/7
miroslav.kovac [Wed, 8 Mar 2017 12:03:38 +0000 (13:03 +0100)]
Unit test for AveragingProgressTracker class

Change-Id: Ice50c174cfe365e171aef1b3c4485cf49356c534
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
2 years agoCache MapJoiner 92/52892/6
Robert Varga [Mon, 6 Mar 2017 15:05:09 +0000 (16:05 +0100)]
Cache MapJoiner

There is no need to instantiate the Joiner everytime we format
a map, as the instance is immmutable and thread-safe. Cache
a single object, allowing for slightly faster access.

Change-Id: Idff936f6525059d0e9abd6eae1370fd3066996a4
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBUG-5280: Invoke both close and purge at the same time 85/52885/7
Robert Varga [Mon, 6 Mar 2017 14:13:22 +0000 (15:13 +0100)]
BUG-5280: Invoke both close and purge at the same time

There is no need to gate purge step on the close step
with the current frontend code. Enqueue both steps at the same
time, improving efficiency.

Change-Id: Ia47fa598f7d3798889d03d1f70896c75eff313ea
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBug 7799: Set inactive on any flapping service error 69/53069/4
Vratko Polak [Thu, 9 Mar 2017 10:57:26 +0000 (11:57 +0100)]
Bug 7799: Set inactive on any flapping service error

Also updated the Yang model to a corresponding description.

Change-Id: Ia1d4a815ad3e03b35f4daa9a57ddb8ba610d4003
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2 years agoAdd FrontendTypeTest 34/52634/5
Andrej Mak [Thu, 2 Mar 2017 11:38:21 +0000 (12:38 +0100)]
Add FrontendTypeTest

Change-Id: Ie3129ef8b5147e8f9dfb4be51a6bfa906c5aff65
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
2 years agoAdd cds-access-client unit tests 09/53009/4
Andrej Mak [Wed, 8 Mar 2017 14:36:52 +0000 (15:36 +0100)]
Add cds-access-client unit tests

Change-Id: I9950569d45f26741022ba5a34a744b81474e662e
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
2 years agoBug 7901: Prevent null Modification in BatchedModifications 83/52883/4
Tom Pantelis [Mon, 6 Mar 2017 13:44:41 +0000 (08:44 -0500)]
Bug 7901: Prevent null Modification in BatchedModifications

Caused by: java.lang.NullPointerException
   at org.opendaylight.controller.cluster.datastore.modification.
      MutableCompositeModification.writeExternal(MutableCompositeModification.java:120)

Somehow a null Modification instance got added to the modifications List.
Looking at the callers of addModification, it is not clear which call site
might have been the culprit. So I added a guard in addModification against
a null input Modification and logged an error with stack trace. I also
modified getModifications to return an immutable List to prevent callers
from directly modifying the List (there was one).

Change-Id: Ic63aa9daada0548da05fe663a0d22cdcb3e7bceb
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoFix timing issue in testChangeToVotingWithNoLeader 47/53047/3
Tom Pantelis [Thu, 9 Mar 2017 05:00:12 +0000 (00:00 -0500)]
Fix timing issue in testChangeToVotingWithNoLeader

RaftActorServerConfigurationSupportTest#testChangeToVotingWithNoLeader
failed on jenkins:

  RaftActorServerConfigurationSupportTest.testChangeToVotingWithNoLeader:1213 getStatus expected:<OK> but was:<NO_LEADER>

In the following test code:

  MessageCollectorActor.clearMessages(node1Collector);

  long term = ...
  node1RaftActorRef.tell(new AppendEntries(...). ActorRef.noSender());

  // Wait for the ElectionTimeout to clear the leaderId...

  MessageCollectorActor.expectFirstMatching(node1Collector, ElectionTimeout.class)

It expects an ElectionTimeout message to occur after the AppendEntries tell
but it's possible for an ElectionTimeout message to occur in between
clearMessages and tell calls which leads to the subsequent NO_LEADER b/c the
leaderId wasn't cleared yet via a subsequent ElectionTimeout message.

The test expects the leaderId to be cleared after the AppendEntries tell so
I changed it to explicitly check for that. The fact that it's actually cleared
as a side effect of an ElectionTimeout message is an implementation detail
anyway.

Change-Id: I66eaad090d0e75fc3731e59f0a345cb04b4f2c4c
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoAdd cds-access-client unit tests 91/52891/7
Andrej Mak [Mon, 6 Mar 2017 14:53:55 +0000 (15:53 +0100)]
Add cds-access-client unit tests

Change-Id: I0f330dfd02d1562d0965a9d3a27721970d5fece8
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
2 years agoUnit test for NoProgressException class 98/52998/2
miroslav.kovac [Wed, 8 Mar 2017 09:06:24 +0000 (10:06 +0100)]
Unit test for NoProgressException class

Change-Id: I382413bbf2e088f4a55a7f1a1c0af18e4603705f
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
2 years agoUnit tests for TransactionSuccess derived classes 32/52932/13
Ivan Hrasko [Tue, 7 Mar 2017 09:42:22 +0000 (10:42 +0100)]
Unit tests for TransactionSuccess derived classes

Change-Id: I4f5a27d86875f53d1dee28350c16af79fd97eef0
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 years agoUnit tests for Request derived classes 96/52896/15
Ivan Hrasko [Mon, 6 Mar 2017 15:09:20 +0000 (16:09 +0100)]
Unit tests for Request derived classes

Change-Id: I56d98cb89bf0cc474e69a797553aace1d8c2c040
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 years agoUnit tests for AbstractRequestProxy derived classes 68/52768/17
Ivan Hrasko [Fri, 3 Mar 2017 14:34:56 +0000 (15:34 +0100)]
Unit tests for AbstractRequestProxy derived classes

Change-Id: Id7eb9c30a147496dcb765843d4eb3463402c0df5
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 years agoBUG-2138: Listener support in shard frontend 39/48739/40
Tomas Cere [Mon, 28 Nov 2016 13:30:00 +0000 (14:30 +0100)]
BUG-2138: Listener support in shard frontend

Change-Id: Icc997649ab56dc66a95d53f11c514fa3f2cc457f
Signed-off-by: Tomas Cere <tcere@cisco.com>
2 years agoBUG-2138: Create DistributedShardFrontend 29/46829/76
Tomas Cere [Wed, 7 Sep 2016 11:48:27 +0000 (13:48 +0200)]
BUG-2138: Create DistributedShardFrontend

Use the abstract shard implementations from md-sal to create
a frontend implementation of a cds shard that forwards requests
to backend shards via DistributedDatastoreClient.

Change-Id: I7a3485f414368728e71ab2746c84d7a0f83f1436
Signed-off-by: Tomas Cere <tcere@cisco.com>
2 years agoBUG 7799: Implement agent RPCs for singleton rapid un-registration testing 16/52216/8
Tomas Cere [Thu, 23 Feb 2017 15:15:23 +0000 (16:15 +0100)]
BUG 7799: Implement agent RPCs for singleton rapid un-registration testing

Change-Id: I080a8af30c2a47e2046b0235ea75055e4c4a51cf
Signed-off-by: Tomas Cere <tcere@cisco.com>
2 years agoUnit tests for controller RequestException 38/52638/9
miroslav.kovac [Thu, 2 Mar 2017 11:56:19 +0000 (12:56 +0100)]
Unit tests for controller RequestException

Change-Id: Ic8c0768a28fb9aa3656358668656a8d3b34639b1
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
2 years agoAdd unit tests for Envelope classes 15/52615/7
Andrej Mak [Thu, 2 Mar 2017 07:49:45 +0000 (08:49 +0100)]
Add unit tests for Envelope classes

Change-Id: I9d4c1034ae4bbb6531b27fa60e83d545a0d88eb9
Signed-off-by: Andrej Mak <andrej.mak@pantheon.tech>
2 years agoBug 6859 - Binding generator v1 refactoring 70/52170/12
Jakub Toth [Wed, 22 Feb 2017 12:53:39 +0000 (13:53 +0100)]
Bug 6859 - Binding generator v1 refactoring

Based on transfer of Binding generator v1 from
Yangtools project to MDSAL in past, we need to finalize
this process by refactoring package naming:
org.opendaylight.yangtools       -> org.mdsal.binding
org.opendaylight.yangtools.sal -> org.mdsal.binding

Refactoring changes in MDSAL, see:
https://git.opendaylight.org/gerrit/#/c/52107

By using of Binding generator v1, this change needs to be addressed in
Controller project.

- refactoring itself
- add META-INF to gitignore

Change-Id: Ib7ec1b39466c0c814459bcbc2adce437b2a0ca64
Signed-off-by: Jakub Toth <jatoth@cisco.com>
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBug 7795: Do not prescribe notification throttling mechanism 84/52884/2
Vratko Polak [Mon, 6 Mar 2017 14:01:10 +0000 (15:01 +0100)]
Bug 7795: Do not prescribe notification throttling mechanism

https://git.opendaylight.org/gerrit/#/c/52320
uses NotificationPublishService#putNotification
which returns void, not Future.

Change-Id: I88c3898b014820168d5748174c9112daa42acbde
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2 years agoUnit tests for AbstractLocalTransactionRequest derived classes 98/52498/8
Ivan Hrasko [Wed, 1 Mar 2017 12:59:55 +0000 (13:59 +0100)]
Unit tests for AbstractLocalTransactionRequest derived classes

Change-Id: I34978326821bf6b8cc7604ee284f2fda20585618
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 years agoBug 6856: Rpc definition should implicitly define input/output 54/52754/2
Igor Foltin [Fri, 3 Mar 2017 10:59:12 +0000 (11:59 +0100)]
Bug 6856: Rpc definition should implicitly define input/output

The yangtools patch for this bug required a minor change in mdsal's
binding generator v1 to maintain compatibility. The mdsal patch has
already been merged. The binding generator v1 now generates classes
for input and output statement only if they are explicitly declared
in the model. As a consequence, a minor adjustement has to be made
in BindingToNormalizedNodeCodec's findRpcMethod().

This patch needs to be merged to unblock the distribution-check job
in the yangtools patch.

Change-Id: I6ed0e57aae35987ae943c8aa7a4a79861af04f7a
Signed-off-by: Igor Foltin <ifoltin@cisco.com>
2 years agoFix spacing in project pom.xml for archetype 76/52676/2
Ryan Goulding [Thu, 2 Mar 2017 21:49:04 +0000 (16:49 -0500)]
Fix spacing in project pom.xml for archetype

Change-Id: I76eaa43699fcb1e192c54586cc84cfff1297b281
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
2 years agoFix archetype spacing so it falls within acceptable horizontal width guidelines 81/52681/2
Ryan Goulding [Thu, 2 Mar 2017 22:38:29 +0000 (17:38 -0500)]
Fix archetype spacing so it falls within acceptable horizontal width guidelines

Several poms had extremely long lines.  This fixes the long lines.

Change-Id: I0f93436ac2dd3c27c0bbea31f82c649c8874f880
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
2 years agoModify archetype to enable checkstyle failOnError by default 77/52677/2
Ryan Goulding [Thu, 2 Mar 2017 21:53:49 +0000 (16:53 -0500)]
Modify archetype to enable checkstyle failOnError by default

As a community, we want to try our best to influence new projects to write
clean, consistent code.  As such, we really ought to enable checkstyle failOnError
for projects that are generated using the startup archetype.  This change does
that;  projects can still turn this off, but it requires manual opt out.

By default, we should really try to influence failOnError so people write
good looking code.

Change-Id: If740df92cbc3d8ff8a0169d323028415e239a15a
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
2 years agoEnable fail on checkstyle violation for archetype code 75/52675/2
Ryan Goulding [Thu, 2 Mar 2017 21:42:42 +0000 (16:42 -0500)]
Enable fail on checkstyle violation for archetype code

Change-Id: I949a8704d7c09a59f21011c2e91778c9f37b31f4
Signed-off-by: Ryan Goulding <ryandgoulding@gmail.com>
2 years agoBUG 7798 - Implement agent RPCs for singleton RPC registration testing 84/52184/4
Tomas Cere [Wed, 22 Feb 2017 18:06:37 +0000 (19:06 +0100)]
BUG 7798 - Implement agent RPCs for singleton RPC registration testing

This implements get-singleton-constant and it's lifecycle control rpc's
used for testing.

Change-Id: If4412070aee143fdf3b05479c484c44b90a486d4
Signed-off-by: Tomas Cere <tcere@cisco.com>
2 years agoBUG 7797 - Implement agent RPCs for routed RPC testing 17/52117/6
Tomas Cere [Mon, 20 Feb 2017 13:22:19 +0000 (14:22 +0100)]
BUG 7797 - Implement agent RPCs for routed RPC testing

This implements routed get-constant and it's lifecycle
controlling rpc's.

Change-Id: I8ce04c5e62758a80ab5fc01921ad59c4373aeb3f
Signed-off-by: Tomas Cere <tcere@cisco.com>
2 years agoBUG-5280: handle TransactionPurgeRequest replay 97/52497/2
Jakub Morvay [Wed, 1 Mar 2017 12:29:50 +0000 (13:29 +0100)]
BUG-5280: handle TransactionPurgeRequest replay

Handle TransactionPurgeRequest in RemoteProxyTransaction

Change-Id: Icf467361b949e02ba5c02d8e8630dbff7519d330
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
2 years agoAdd artifact name formatting used by autorelease 22/52522/3
Thanh Ha [Wed, 1 Mar 2017 17:49:35 +0000 (12:49 -0500)]
Add artifact name formatting used by autorelease

As recommended by the autorelease project we're now requesting projects
use a specific format for their <name> definitions in their pom files.
Please refer to the Trello link for further details.

Trello: https://trello.com/c/EGYoCYXX
Change-Id: I5a074b3f21e72283a8ad6dcd82f9dc6fbcf67fa6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2 years agoAdd .gitreview to startup archetype 20/52520/3
Thanh Ha [Wed, 1 Mar 2017 17:33:02 +0000 (12:33 -0500)]
Add .gitreview to startup archetype

All projects should have a .gitreview so let's initialize them with one.

Change-Id: I081af4f977cd91760e4ae38de97a765413a1399b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2 years agoTurn opendaylight/md-sal/pom.xml into an aggregator 22/52422/7
Robert Varga [Tue, 28 Feb 2017 21:29:15 +0000 (22:29 +0100)]
Turn opendaylight/md-sal/pom.xml into an aggregator

This pom is not referenced in code artifacts anymore, we can stop
pulling in unnecessary stuff.

Change-Id: I4f5db9ba2c1ef7874bb5c593714fb4977541638d
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup samples/toaster-provider/pom.xml 38/52438/3
Robert Varga [Wed, 1 Mar 2017 00:40:42 +0000 (01:40 +0100)]
Cleanup samples/toaster-provider/pom.xml

Do not depend on aggreator pom.

Change-Id: I9a9e368e48dbeadb6739a965cfe991f5173a635d
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup samples/toaster-consumer/pom.xml 37/52437/3
Robert Varga [Wed, 1 Mar 2017 00:37:30 +0000 (01:37 +0100)]
Cleanup samples/toaster-consumer/pom.xml

Do not depend on aggreator pom.

Change-Id: I6d4fed36ed5c32eb6a1523c81003f34e373ca52d
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup samples/clustering-test-app/provider/pom.xml 36/52436/3
Robert Varga [Wed, 1 Mar 2017 00:33:58 +0000 (01:33 +0100)]
Cleanup samples/clustering-test-app/provider/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: Ia6909ae141c5b0f327ccb8c12d92ec35e11a5913
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-dom-broker/pom.xml 87/52387/7
Robert Varga [Tue, 28 Feb 2017 16:31:52 +0000 (17:31 +0100)]
Cleanup sal-dom-broker/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I8afef926aa791c55b30f418b78eaf045db521778
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-binding-dom-it/pom.xml 21/52421/3
Robert Varga [Tue, 28 Feb 2017 21:26:43 +0000 (22:26 +0100)]
Cleanup sal-binding-dom-it/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I54340799a12db0f65e0c99284e16040c6b50fab9
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup benchmark-data-store/pom.xml 20/52420/3
Robert Varga [Tue, 28 Feb 2017 21:21:12 +0000 (22:21 +0100)]
Cleanup benchmark-data-store/pom.xml

Restructuring to not inherit from aggregator pom. Also bump JMH
while we're here.

Change-Id: I1e9321ddc4812d2057872c52d14408ed3ca7b57b
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup messagebus-config/pom.xml 19/52419/3
Robert Varga [Tue, 28 Feb 2017 21:17:27 +0000 (22:17 +0100)]
Cleanup messagebus-config/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: Iced30e9e93219d2d8f8b9b120acd5c19defb7bab
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup messagebus-util/pom.xml 18/52418/3
Robert Varga [Tue, 28 Feb 2017 21:14:55 +0000 (22:14 +0100)]
Cleanup messagebus-util/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I04d535223796e5a720061c1c9064a6bd0cf32e13
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup messagebus-api/pom.xml 17/52417/4
Robert Varga [Tue, 28 Feb 2017 21:10:46 +0000 (22:10 +0100)]
Cleanup messagebus-api/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I993304d208e9075356a870cf64903d967309fbae
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-dom-broker-config/pom.xml 95/52395/6
Robert Varga [Tue, 28 Feb 2017 17:11:57 +0000 (18:11 +0100)]
Cleanup sal-dom-broker-config/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I6b42355cf066e0bfcc254cd699ac229e1fd08a3e
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-dom-xsql-config/pom.xml 14/52414/4
Robert Varga [Tue, 28 Feb 2017 20:55:20 +0000 (21:55 +0100)]
Cleanup sal-dom-xsql-config/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: Ifa7d6e269ac6e0cad63733b0e843d603e8846ab2
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-test-model/pom.xml 15/52415/3
Robert Varga [Tue, 28 Feb 2017 21:04:33 +0000 (22:04 +0100)]
Cleanup sal-test-model/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I5558773fa0d50249d04f2dc3db3f20574749de1f
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-karaf4-xsql/pom.xml 13/52413/5
Robert Varga [Tue, 28 Feb 2017 20:52:45 +0000 (21:52 +0100)]
Cleanup sal-karaf4-xsql/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: Ic199d697e21eb128c76899ead573d2cf99ebc5e1
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-karaf-xsql/pom.xml 12/52412/5
Robert Varga [Tue, 28 Feb 2017 20:50:29 +0000 (21:50 +0100)]
Cleanup sal-karaf-xsql/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I0a220347d38f5841e463587445de4ab4057a1267
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-cluster-admin-impl/pom.xml 11/52411/5
Robert Varga [Tue, 28 Feb 2017 20:43:45 +0000 (21:43 +0100)]
Cleanup sal-cluster-admin-impl/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I53a65e1464166a1b41d28f3902b77f4b85f2717b
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-dummy-distributed-datastore/pom.xml 10/52410/5
Robert Varga [Tue, 28 Feb 2017 20:39:19 +0000 (21:39 +0100)]
Cleanup sal-dummy-distributed-datastore/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I6687a39750e46509cc562bb117b172ad5f180915
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-distributed-datastore/pom.xml 09/52409/5
Robert Varga [Tue, 28 Feb 2017 19:59:50 +0000 (20:59 +0100)]
Cleanup sal-distributed-datastore/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: Ide54ea429ae04a2ef37c9ae5d53a2df5ae4a8d74
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-clustering-config/pom.xml 05/52405/6
Robert Varga [Tue, 28 Feb 2017 18:43:59 +0000 (19:43 +0100)]
Cleanup sal-clustering-config/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I83a4306384851d2f00750d9138a1ceb0d0213a21
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-clustering-commons/pom.xml 04/52404/6
Robert Varga [Tue, 28 Feb 2017 18:41:03 +0000 (19:41 +0100)]
Cleanup sal-clustering-commons/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I1c6271b4da4a44a373a997cc8b73d01d63bb07e3
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-inmemory-datastore/pom.xml 03/52403/6
Robert Varga [Tue, 28 Feb 2017 18:35:51 +0000 (19:35 +0100)]
Cleanup sal-inmemory-datastore/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I6928baaae0d75bcbb9e36ae62c866f0a0c20f958
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-akka-raft-example/pom.xml 02/52402/6
Robert Varga [Tue, 28 Feb 2017 18:28:29 +0000 (19:28 +0100)]
Cleanup sal-akka-raft-example/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I88b2595c9782863b92220821c86171f1eaaf39db
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-akka-raft/pom.xml 00/52400/6
Robert Varga [Tue, 28 Feb 2017 18:15:31 +0000 (19:15 +0100)]
Cleanup sal-akka-raft/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I0084848fc3740534c8c7be9fb25276a72c26d837
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-connector-api/pom.xml 99/52399/6
Robert Varga [Tue, 28 Feb 2017 17:52:35 +0000 (18:52 +0100)]
Cleanup sal-connector-api/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: Ida0cb93cd4e8c4686dfe3cbeaa461854c09d0f59
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup md-sal-config/pom.xml 97/52397/6
Robert Varga [Tue, 28 Feb 2017 17:41:21 +0000 (18:41 +0100)]
Cleanup md-sal-config/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I4e405690483186536b5a5d1e3b616c5e60c29964
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-binding-config/pom.xml 96/52396/5
Robert Varga [Tue, 28 Feb 2017 17:38:44 +0000 (18:38 +0100)]
Cleanup sal-binding-config/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I4f798f19aaa9fef02e32f7eee742f56102353eb0
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-dom-config/pom.xml 94/52394/4
Robert Varga [Tue, 28 Feb 2017 17:05:03 +0000 (18:05 +0100)]
Cleanup sal-dom-config/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I15135d18e18ec39fefeb4d9d197f9d72fcba93c6
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-binding-util/pom.xml 93/52393/4
Robert Varga [Tue, 28 Feb 2017 16:54:42 +0000 (17:54 +0100)]
Cleanup sal-binding-util/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I2154c0182f454c6f19d36a4942ba9eed26ab0ba6
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-binding-broker/pom.xml 91/52391/4
Robert Varga [Tue, 28 Feb 2017 16:50:16 +0000 (17:50 +0100)]
Cleanup sal-binding-broker/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I31567e831a0b7025ab2238d43f125286d19d7f7f
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-binding-api/pom.xml 90/52390/4
Robert Varga [Tue, 28 Feb 2017 16:46:38 +0000 (17:46 +0100)]
Cleanup sal-binding-api/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I58ff436710b36f06ce8a65141665845deff11e7e
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-schema-service/pom.xml 89/52389/4
Robert Varga [Tue, 28 Feb 2017 16:37:35 +0000 (17:37 +0100)]
Cleanup sal-schema-service/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: Ifa4de2f09dbf9bf718da86b1de802765cda7cf7b
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-dom-spi/pom.xml 88/52388/4
Robert Varga [Tue, 28 Feb 2017 16:34:27 +0000 (17:34 +0100)]
Cleanup sal-dom-spi/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I6a65bd147f0268668d7ffc0ab0b832a6c4d4e14b
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBug 7521: Add custom local snapshot store 78/51078/16
Tom Pantelis [Thu, 26 Jan 2017 16:49:43 +0000 (11:49 -0500)]
Bug 7521: Add custom local snapshot store

Akka's LocalSnapshotStore serializes to a byte[] before persisting
to the file so we need to write our LocalSnapshotStore that serializes
directly to the file. I patterned the code after akka's LocalSnapshotStore,
mainly translated from scala.

Akka's LocalSnapshotStore wraps the payload data in a Snapshot class
and uses the SnapshotSerializer which locates the serializer for the payload
class and writes some header data before delegating to the payload
serializer. To handle backwards compatibility for a snapshot previously
serialized with akka's format, java de-serialization will detect and fail
with an invalid stream header, in which case we fall back and try
de-serialization via the SnapshotSerializer.

Akka has a standard test suite in SnapshotStoreSpec for testing custom
snapshot store plugins. I derived a LocalSnapshotStoreSpecTest class
that does the setup and teardown with SnapshotStoreSpec doing the rest.
SnapshotStoreSpec uses ScalaTest stuff so need to be run with scala's
JUnitRunner.

I also added a regular LocalSnapshotStoreTest class to cover a few cases
that SnapshotStoreSpec doesn't.

Change-Id: I1ca11682f37aa39d60d3ce57c874c299627e8ca6
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoCleanup sal-dom-api/pom.xml 86/52386/1
Robert Varga [Tue, 28 Feb 2017 15:51:42 +0000 (16:51 +0100)]
Cleanup sal-dom-api/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I3951d52d2ca0d5ceeff75c90e88b7df7b67467c5
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-common-util/pom.xml 85/52385/1
Robert Varga [Tue, 28 Feb 2017 15:42:52 +0000 (16:42 +0100)]
Cleanup sal-common-util/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: Idf48e57dfbfa10098a56406a5f04119791227107
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoCleanup sal-common-impl/pom.xml 84/52384/1
Robert Varga [Tue, 28 Feb 2017 15:23:18 +0000 (16:23 +0100)]
Cleanup sal-common-impl/pom.xml

Restructuring to not inherit from aggregator pom.

Change-Id: I41041a301b50fadad816116f63afced39ffc73b5
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoAdd odlparent-lite to mdsal-artifacts/pom.xml 83/52383/1
Robert Varga [Tue, 28 Feb 2017 15:55:42 +0000 (16:55 +0100)]
Add odlparent-lite to mdsal-artifacts/pom.xml

All our poms should be inheriting from odlparent, make sure this
is the case for artifacts, too.

Change-Id: I5f8c01469a9e08c9d61507596585a8a4f842a5f0
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoReplace dlux with dluxapps features 24/50224/2
Daniel Malachovsky [Tue, 10 Jan 2017 19:59:01 +0000 (20:59 +0100)]
Replace dlux with dluxapps features

Renaming is due to DLUX project split.
Also, replacing yangui feature with yangman, new, redesigned and restyled
application.

https://wiki.opendaylight.org/view/Weather#Rename_some_odl-dlux-.2A_features_to_odl-dluxapps-.2A

Change-Id: I8b75df0885d4c7453bd46c127ebcd9a63670e03a
Signed-off-by: Daniel Malachovsky <dmalacho@cisco.com>
2 years agoFix NPE in YangTextSchemaSourceSerializationProxy#getRepresentation 37/52337/4
Jakub Morvay [Tue, 28 Feb 2017 07:28:01 +0000 (08:28 +0100)]
Fix NPE in YangTextSchemaSourceSerializationProxy#getRepresentation

According to its general contract, when revision is not found,
SourceIdentifier#getRevision method returns null. Wrap revision in
Optional#fromNullable to avoid possible NPE.

Change-Id: I78f544374f179c9486cc8dd09cbcf1eea379e1e9
Signed-off-by: Jakub Morvay <jmorvay@cisco.com>
2 years agoBUG 7796: Implement agent RPCs for global RPC testing 74/52074/6
Tomas Cere [Thu, 16 Feb 2017 14:53:43 +0000 (15:53 +0100)]
BUG 7796: Implement agent RPCs for global RPC testing

This implements the get-constant and it's lifecycle
control rpc's from the lowlevel mdsal test model.

Change-Id: I2da89b73d289b8fe6bf95aeaba34e7fb50032f7e
Signed-off-by: Tomas Cere <tcere@cisco.com>
2 years agoFix parent declaration 94/52294/2
Robert Varga [Mon, 27 Feb 2017 11:27:57 +0000 (12:27 +0100)]
Fix parent declaration

bundle-parent is from mdsal project, it should have an empty
relativePath declartion.

Change-Id: I3d460a5acca297fce1089088781dae9057038542
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBUG-5280: add {Create,Close,Purge}LocalHistoryPayload 26/39426/73
Robert Varga [Wed, 25 May 2016 15:44:53 +0000 (17:44 +0200)]
BUG-5280: add {Create,Close,Purge}LocalHistoryPayload

This patch introduces three new payloads which deal with replicating
local histories to followers. These are persisted whenever a transaction
chain (e.g. local history) is created or closed cleanly on the shard
leader. Followers can use these to track transaction chains and pick up
processing in case of a leader failover.

Change-Id: I3fe5ac153c88f23f9b871bd23cb04a8e2410af91
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBUG-5280: handle TransactionPurgeRequest replay 12/52212/3
Robert Varga [Thu, 23 Feb 2017 13:59:55 +0000 (14:59 +0100)]
BUG-5280: handle TransactionPurgeRequest replay

We need to handle purging requests on reconnect, too.

Change-Id: I02acaf2dd7d9209f48148f76b3ca3aa4bbc64b5e
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBug 7840: Remove version in BucketStoreActor#removeBucket() 60/52260/2
Vratko Polak [Fri, 24 Feb 2017 18:21:20 +0000 (19:21 +0100)]
Bug 7840: Remove version in BucketStoreActor#removeBucket()

Change-Id: Ic5d2c04260a0a53e72d9569eee18c1fba50c367b
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2 years agoRemove unneeded SuppressWarnings 14/52214/2
Robert Varga [Thu, 23 Feb 2017 14:09:59 +0000 (15:09 +0100)]
Remove unneeded SuppressWarnings

These are not needed and in fact generate Eclipse warnings
themselves.

Change-Id: I4105c4a8d0fd0094be283a88a92a00415fa54add
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoYang models for system testing low level MD-SAL operations 77/51477/27
Vratko Polak [Tue, 21 Feb 2017 14:54:29 +0000 (15:54 +0100)]
Yang models for system testing low level MD-SAL operations

Not every operation is easily available from Restconf.
This defines and agent application to control the tested operations from Java.

There are FIXMEs and TODOs left, to be fixed later,
probably together with Java implementation.
Merging this early will allow Changes for Bugs 7796-7807
to be implemented independently (as opposed to forming a single chain).

Change-Id: Icb9616c156f56f8706a24abe31e5ac097a65cf73
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2 years agoPrepare config-it-base for Karaf 4 89/52189/4
Lorand Jakab [Wed, 22 Feb 2017 20:47:25 +0000 (22:47 +0200)]
Prepare config-it-base for Karaf 4

Downstreams using mdsal-it-parent as their integration test parent will
not be able to migrate their IT to a Karaf 4 based distribution without
this change.

See also https://git.opendaylight.org/gerrit/#/c/51450/

Change-Id: I572151bcf16fb9864f59dd446952ab13a12b295f
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
2 years agoFix Javadoc 80/52080/2
Robert Varga [Mon, 20 Feb 2017 15:39:31 +0000 (16:39 +0100)]
Fix Javadoc

The argument reference was not updated, fix that.

Change-Id: Ib35ed59105c7090291c733725c8a85d384a1a288
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBug 7521: Convert byte[] to ShardManagerSnapshot in DatastoreSnapshot 06/51006/7
Tom Pantelis [Wed, 25 Jan 2017 13:04:57 +0000 (08:04 -0500)]
Bug 7521: Convert byte[] to ShardManagerSnapshot in DatastoreSnapshot

Created a new ShardManagerSnapshot class in the persisted package
which is now stored in the DatastoreSnapshot in lieu of a
serialized byte[]. The previous ShardManagerSnapshot class was
deprecated and readResolves to the new class.

Change-Id: I1ae363e9711cf3bef6b6dd6257fa56bd41465bf3
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoBug 7521: Convert DatastoreSnapshot.ShardSnapshot to store Snapshot 24/50924/9
Tom Pantelis [Tue, 24 Jan 2017 09:19:45 +0000 (04:19 -0500)]
Bug 7521: Convert DatastoreSnapshot.ShardSnapshot to store Snapshot

Converted the new DatastoreSnapshot.ShardSnapshot class to store a
Snapshot instance instead of a serialized byte[] so the Snapshot
can be serialized directly to the file when saved.

The prior DatastoreSnapshotList was deprecated and readResolves to
the new DatastoreSnapshotList.

Change-Id: I656eca93bfed07ae99055c67cc3f195b25ea2b11
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoBug 7521: Move DatastoreSnapshotList et al to persisted package 45/50845/9
Tom Pantelis [Mon, 23 Jan 2017 17:02:45 +0000 (12:02 -0500)]
Bug 7521: Move DatastoreSnapshotList et al to persisted package

The serialized format of DatastoreSnapshotList et al will be changing
so new classes were added to the persisted package in preparation.
The current classes are deprecated and will readResolve to the new
classes.

Change-Id: Ib6aa600a71f52253b93ab0e4a82f6f56baafbfd9
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoBug 7521: Add FileBackedOutputStream and use for snapshot chunking 69/50769/13
Tom Pantelis [Sun, 22 Jan 2017 05:38:05 +0000 (00:38 -0500)]
Bug 7521: Add FileBackedOutputStream and use for snapshot chunking

Added a FileBackedOutputStream class, similar to the one in guava except:
  - allows for the temp dir to be confgured
  - keeps track of the count of bytes written for efficiency
  - uses a PhantomReference to delete the temp file instead of using finalize.

FileBackedOutputStream is now used in chunking the snapshop on the leader
side and re-assembling on the follower side.

Change-Id: Ieea4bc1388ffe18d6803783d2bb714089716b7b1
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoBUG-5280: emit DestroyLocalHistory and PurgeLocalHistory requests 54/51954/3 54/51954/4
Robert Varga [Thu, 16 Feb 2017 12:38:34 +0000 (13:38 +0100)]
BUG-5280: emit DestroyLocalHistory and PurgeLocalHistory requests

In order to properly prune local histories from the backend we need
to issue destroy/purge requests as the history is finalized.

Change-Id: I303937ba7afa594e83c4a944d16886ee98e3036c
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBUG-5280: add a transction purge step 30/51930/5
Robert Varga [Wed, 15 Feb 2017 22:34:48 +0000 (23:34 +0100)]
BUG-5280: add a transction purge step

Backend needs to be informed about the client completing the transaction,
so it can remove any state trakcing the result of the transaction.

Since the frontend has no remaining state to transfer, there is no legal
way for the frontend to ever reference it (aside the purge request itself),
which always succeeds.

Change-Id: Ia957f0879114eede394b76184620a38cd5967955
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoBug 7746: Fix intermittent EOS test failure and synchronization 41/51941/3
Tom Pantelis [Thu, 16 Feb 2017 09:20:11 +0000 (04:20 -0500)]
Bug 7746: Fix intermittent EOS test failure and synchronization

Modified the EntityOwnershipListenerSupport class to be thread-safe
utilizing a ReadWriteLock to guard access to the listenerActorMap
and entityTypeListenerMap. While updates are only done by the
EntityOwnershipShard and thus aren't concurrent, read access occurs
concurrently via the EntityOwnershipChangeListener which runs in its
own actor sandbox. I also factored out an
EntityOwnershipChangePublisher interface with the read-only access
methods used by EntityOwnershipChangeListener to make it clear
that EntityOwnershipShard is the only mutator.

The testFunctionalityWithThreeNodes case failed intermittently b/c
it's possible for the follower2MockListener to get notified of a
pre-existing entity on registration twice if the prior owner change
is replicated and the EntityOwnershipChangeListener triggers concurrently
with the registration and the timing is just right. I added verification
of ownership sync to follower2 pior to registration to make it
deterministic and avoid the sporadic timing failures.

Change-Id: Icc197d0c23135ca69b56eac1702f249e8e60e66e
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoFix intermittent failure in testCloseCandidateRegistrationInQuickSuccession 15/51915/3
Tom Pantelis [Wed, 15 Feb 2017 16:02:57 +0000 (11:02 -0500)]
Fix intermittent failure in testCloseCandidateRegistrationInQuickSuccession

java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
  at com.google.common.base.Absent.get(Absent.java:47)
  at org.opendaylight.controller.cluster.datastore.entityownership.DistributedEntityOwnershipIntegrationTest.testCloseCandidateRegistrationInQuickSuccession(DistributedEntityOwnershipIntegrationTest.java:512)

Code:

if (!leaderEntityOwnershipService.getOwnershipState(ENTITY1).isPresent()
  || leaderEntityOwnershipService.getOwnershipState(ENTITY1).get() ==
                                               EntityOwnershipState.NO_OWNER

The code inlines calls to getOwnershipState so it's possible the first call
returns a present Optional and the second call returns absent which leads to
the failure. It's safer to capture the Optional in a lcoal var.

Change-Id: I9baa120efc9924dc820435dd63217b4598731a13
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoCompile-time dependencies matter 23/51923/1
Vratko Polak [Wed, 15 Feb 2017 18:13:44 +0000 (19:13 +0100)]
Compile-time dependencies matter

Not sure whether this is a proper fix.
This is an analogy of https://git.opendaylight.org/gerrit/#/c/51921/1

Change-Id: I4173cb756e40c1111e8fc29c0f370f8bdef1652b
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
2 years agoCleanup warnings around methods being potentially static 00/51900/2
Robert Varga [Wed, 15 Feb 2017 11:13:36 +0000 (12:13 +0100)]
Cleanup warnings around methods being potentially static

These are private methods and they do not touch state, hence they
can be made static.

Change-Id: I1d9adf70d9121e01b2ac8e03a1198c1ba73716fb
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agoClean MockClusterWrapper up 99/51899/2
Robert Varga [Wed, 15 Feb 2017 11:08:55 +0000 (12:08 +0100)]
Clean MockClusterWrapper up

- use immutable set builder directly
- do not use deprecated UniqueAddress constructor

Change-Id: I6905f1feb46302e36a246938a7e0189b82025ede
Signed-off-by: Robert Varga <rovarga@cisco.com>
2 years agosal-distributed-datastore Checkstyle fixes (for next version) 89/51389/4
Michael Vorburger [Fri, 3 Feb 2017 10:58:51 +0000 (11:58 +0100)]
sal-distributed-datastore Checkstyle fixes (for next version)

Even though sal-distributed-datastore currentla already has CS
enforcement, these violations don't show up in the build, but I see them
as red in Eclipse; I think this must be becaues the CS version used in
the Eclipse plugin-in is more recent than the CS used in odlparent, and
one of the existing activated checks got a little more stringent.

Cleaning this up thus helps both to (a) not have read in Eclipse; (b)
pave the way to upgrade Checkstyle in odlparent some day.

Change-Id: Ib5649a95a1b26b5791f2c3f3f83924b569f965a2
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
2 years agoUsage of Collections.unmodifiableCollection is unsafe 83/51883/1
Tom Pantelis [Wed, 15 Feb 2017 05:06:39 +0000 (00:06 -0500)]
Usage of Collections.unmodifiableCollection is unsafe

This is a follow-up to https://git.opendaylight.org/gerrit/#/c/51583/
wrt a review comment questioning why I returned a new ArrayList instead
of returning the Set directly. One reason was to avoid mutation of the
internal set by the caller but also to capture the state of the set at
that point in time and avoid concurrent mods which may not be safe.
Where a concurrent set is used, it would be thread-safe to return the
set directly but the set may by modified as the caller is iterating it
which may not be desired. For the other class whose set is a keySet
from a non-threadsafe Map, the caller could get a ConcurrentMod
exception while iterating. Based on the review, I changed the call
sites to return a Collections.unmodifiableCollection but this is also
incorrect and is susceptible to the same issues as that impl reads-thru
to the underlying collection. Therefore I changed the call sites back
to returning a new ArrayList.

Change-Id: I504f38c5bfc4c707180ac301eb10acd0ac24f872
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoAdd OnDemandShardState to report additional Shard state 83/51583/6
Tom Pantelis [Tue, 7 Feb 2017 21:48:03 +0000 (16:48 -0500)]
Add OnDemandShardState to report additional Shard state

Extended the OnDemandRaftState with OnDemandShardState to include
additional Shard state, including DTCL, DCL, and commit cohort actors.
This will enable us to report thus info from the JMX bean as it's useful
for debugging to have visibility into what listeners and cohorts
are registered.

The actors now also store the registered path. Both the instance and path
will be queried for debugging.

Change-Id: Iaa6c27c9aba3b5c0223199e6a3fc21bc54da95ba
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
2 years agoAdd more info logging in sal-akka-raft 53/51753/6
Tom Pantelis [Sat, 11 Feb 2017 15:52:17 +0000 (10:52 -0500)]
Add more info logging in sal-akka-raft

Added more info logging for abnormal and infrequent code paths in
the raft behaviors to help in troubleshooting as these paths are
sometimes involved when something goes wrong.

Change-Id: I3017c81c2ef7100ca8a9477285ca637355c05e87
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.