7 years agoUse a static YangInstanceIdentifier in AbstractEntityOwnerChangeListener 13/36813/3
Robert Varga [Tue, 29 Mar 2016 12:35:47 +0000 (14:35 +0200)]
Use a static YangInstanceIdentifier in AbstractEntityOwnerChangeListener

This will force reuse of the same YangInstanceIdentifier across instances.

Change-Id: Iec33a79267e059ee7fad694a50f74dc2de87035b
Signed-off-by: Robert Varga <>
7 years agoFix ShardManagerInfo JMX registration error 94/36794/3
Tom Pantelis [Tue, 29 Mar 2016 12:56:43 +0000 (08:56 -0400)]
Fix ShardManagerInfo JMX registration error

The ShardManagerInfo mbean is failing to register with error:
"ShardManagerInfo does not implement DynamicMBean, and neither
follows the Standard MBean conventions". To be a standard MBean, the
implementation class must be in the same package as the MBean
interface. However recent refactoring moved the ShardManagerInfo
class to a new package so I moved both the ShardManagerMBean class to
the org.opendaylight.controller.cluster.datastore.shardmanager package.

Change-Id: I77870e7cf8274f3e99e116d6f18949ac3cf26e41
Signed-off-by: Tom Pantelis <>
7 years agoSplit out AbstractBuilder and rename it 13/36613/6
Robert Varga [Wed, 23 Mar 2016 15:06:13 +0000 (16:06 +0100)]
Split out AbstractBuilder and rename it

This is a DTO-like class, not really a Builder with .build() method. Split it out
of its enclosing class and rename it to AbstractShardManagerCreator.

Change-Id: I891fc685c2d9776384294a708336b32eb34011b5
Signed-off-by: Robert Varga <>
7 years agoRefactor MessageTracker 11/36511/5
Robert Varga [Mon, 21 Mar 2016 19:34:12 +0000 (20:34 +0100)]
Refactor MessageTracker

This patch updates MessageTracker implementation with the following:
- lower overhead when dealing with StopWatch under normal conditions
- prevent Context from being instantiated from the outside
- use a Ticker instance for reliable testing
- use Stopwatch.isRunning() instead of explicit done/enable boolean
- properly reset interval timer when expected message is received
- add explicit @NotThreadSafe and @Beta annotations
- move currentMessage to CurrentMessageContext

Change-Id: Idd553a39a8fb885a5c05e391cb4ae45384a59f07
Signed-off-by: Robert Varga <>
7 years agoMove MessageTracker to sal-clustering-commons 10/36510/5
Robert Varga [Mon, 21 Mar 2016 16:58:54 +0000 (17:58 +0100)]
Move MessageTracker to sal-clustering-commons

Message tracker is useful outside of the data store, move it to commons. This will allow
us to use it in RaftActor's recovery code.

Change-Id: Ia1d8074d6dad7ea051d3650cd417cc773292506c
Signed-off-by: Robert Varga <>
7 years agoDrop -XX:MaxPermSize 81/35981/2
Stephen Kitt [Wed, 9 Mar 2016 11:21:48 +0000 (12:21 +0100)]
Drop -XX:MaxPermSize

This is no longer supported in Java 8.

Change-Id: Ic421500c6d6d1432a0fa893799b1155d76eb6502
Signed-off-by: Stephen Kitt <>
7 years agoMove SwitchShardBehaviorMessage to shardmanager package 53/36653/4
Robert Varga [Wed, 23 Mar 2016 16:17:59 +0000 (17:17 +0100)]
Move SwitchShardBehaviorMessage to shardmanager package

This message is only used internally by the ShardManager, move it to its
package and limit visibility.

Change-Id: I4c546f214cfcfa2e460cd6e78131e27a6d3bd4d7
Signed-off-by: Robert Varga <>
7 years agoMove ShardManagerSnapshot to new package 98/36598/4
Robert Varga [Wed, 23 Mar 2016 13:27:17 +0000 (14:27 +0100)]
Move ShardManagerSnapshot to new package

This creates a copy of the ShardManagerSnapshot in the new package and uses
readResolve() to perform migration.

Change-Id: I976adbaafd74de64a90d3970e17ce4ea52bdbe40
Signed-off-by: Robert Varga <>
7 years agoInitialized visitedAddresses to a smaller list 54/36654/4
Robert Varga [Wed, 23 Mar 2016 15:37:04 +0000 (16:37 +0100)]
Initialized visitedAddresses to a smaller list

Adds final keyword to force initialization and provide a hint that
the list will have a single entry.

Change-Id: I8c562faa5ce6f6303ab11717e55b624a31720281
Signed-off-by: Robert Varga <>
7 years agoAdd **/yang-gen-config/** to checkstyle ignore path 20/36220/3
Thanh Ha [Mon, 14 Mar 2016 21:08:13 +0000 (17:08 -0400)]
Add **/yang-gen-config/** to checkstyle ignore path

Change-Id: I4080cd5a5c6d2ccd9374af9979ff2fca76e607ab
Signed-off-by: Thanh Ha <>
7 years agoAdd yang-jmx-generator dependency 19/36219/3
Thanh Ha [Mon, 14 Mar 2016 20:45:35 +0000 (16:45 -0400)]
Add yang-jmx-generator dependency

When building in parallel sal-dom-xsql fails due to
yang-jmx-generator missing. This implies that yang-jmx-generator is
actually a dependency.

Change-Id: I624d4026d8182c12a147830ded0391eca25b0f62
Signed-off-by: Thanh Ha <>
7 years agoUse range import for odl-akka-* 23/36823/1
Robert Varga [Tue, 29 Mar 2016 16:22:41 +0000 (18:22 +0200)]
Use range import for odl-akka-*

We do not need akka.version, but should use a version range import.

Change-Id: Ib7d2f4233945023fe3b12cdcce01e4a345a35dc8
Signed-off-by: Robert Varga <>
7 years agoRemove DelegatingRaftActorBehavior 60/36160/11
Robert Varga [Tue, 15 Mar 2016 13:32:58 +0000 (14:32 +0100)]
Remove DelegatingRaftActorBehavior

The delegate is leaked through various methods, implementations of which already have access
to the current behavior if it were available from RaftActorContext. Simplify calling

Change-Id: I9e27f68e55f28a9afd446abff91fbb38dd26c011
Signed-off-by: Robert Varga <>
7 years agoEnlarge critical section to cover processNextTransaction() 49/36749/2
Robert Varga [Thu, 24 Mar 2016 18:59:49 +0000 (19:59 +0100)]
Enlarge critical section to cover processNextTransaction()

As it turns out the critical section is not sufficient to cover the case
when the user thread performs a submit/allocate/submit in the time window
between us releasing the in-flight transaction and taking the lock: we would
have to re-check inflightTx after taking the lock.

Since we are going to take the lock anyway, reverse the order of operations
by making processNextTransaction() synchronized, which means the user
thread will not be able to submit the transaction even when it observes
inflightTx as null outside the lock.

Change-Id: I688ceb5e8aae28f5e582b64e6bbaa64c9699c7f5
Signed-off-by: Robert Varga <>
7 years agoMove ShardManager into its own package 90/36590/7
Robert Varga [Wed, 23 Mar 2016 12:29:04 +0000 (13:29 +0100)]
Move ShardManager into its own package

ShardManager contains quite a few classes, which are not used by the rest
of the data store. Some of them are in their own files, some of them are
hosted in

This first step allows us to isolate related functionality without leaking
it to the rest of the package, separating internal an external interfaces.

Change-Id: I955296d739d962d912eadf0507c317b0a8e71deb
Signed-off-by: Robert Varga <>
7 years agoForward pending transactions on leadership change 99/35199/9
Tom Pantelis [Mon, 22 Feb 2016 01:41:16 +0000 (20:41 -0500)]
Forward pending transactions on leadership change

If the current leader is deposed for some reason and it has pending
tx's, on leader change, the tx's will now be converted to
BatchedModifications messages and forwarded to the new leader in the
ready state so the new leader can complete the commits. Previously
they were aborted and failed.

In addition, if there's a current transaction that had already been
canCommitted and possibly preCommitted, CanCommitTransaction and
CommitTransaction messages will also be sent to the new leader appropriately.

Change-Id: I9bbd68856586c15464f4ca0e844f040c6bb5f30a
Signed-off-by: Tom Pantelis <>
7 years agoImplement change to voting with no leader 23/32723/12
Tom Pantelis [Wed, 13 Jan 2016 21:17:28 +0000 (16:17 -0500)]
Implement change to voting with no leader

Implemented a special case where on a voting state change from
non-voting to voting, if there's no leader, it will try to elect a
leader in order to apply the change and progress.

This is to handle a use case where one has 2 geographically-separated
3-node clusters, one a primary and the other a backup such that if the
primary cluster is lost, the backup can take over. In this scenario,
there's a logical 6-node cluster where the primary sub-cluster is
configured as voting and the backup sub-cluster as non-voting such
that the primary cluster can  make progress without consensus from
the backup cluster while still replicating to the backup. On fail-over
to the backup, a request would be sent to a member of the backup
cluster to flip the voting states, ie make the backup sub-cluster
voting and the lost primary non-voting. However since the primary
majority cluster is lost, there would be no leader to apply, persist and
replicate the server config change.

Therefore, if the server processing the request is currently non-voting
and is to be changed to voting and there is no current leader, it will
try to elect itself the leader by applying the new server config change in
the RaftActorContext and sending an ElectionTimeout. If it's elected
leader, it persists and replicates the new server config. If no leader
change occurs within the election timeout period, it reverts the server
config change and tries to forward the change request to another server
with the same voting state change. In this manner, the intent is to elect
the newly voting server that has the most up to date log.

Change-Id: I67b5b2d3a97745dbe9a8215f9a28f3a840f2a0db
Signed-off-by: Tom Pantelis <>
7 years agoAdd a few toString() methods 05/36105/2
Stephen Kitt [Fri, 11 Mar 2016 10:14:44 +0000 (11:14 +0100)]
Add a few toString() methods

These help when converting to DataTree ;-).

Change-Id: I9b0fdb428ebe0265cb4321bd6ee31dedb4811950
Signed-off-by: Stephen Kitt <>
7 years agoUse partial mocking for FollowerTest 68/36568/1
Robert Varga [Tue, 22 Mar 2016 17:57:58 +0000 (18:57 +0100)]
Use partial mocking for FollowerTest

This patch removes the need for a subclass and some explicit casts.

Change-Id: I19a30266f8690ffcc68f70e949d88101db6552ae
Signed-off-by: Robert Varga <>
7 years agoMake AbstractRaftActorBehavior.state() final 66/36566/1
Robert Varga [Tue, 22 Mar 2016 17:38:46 +0000 (18:38 +0100)]
Make AbstractRaftActorBehavior.state() final

This removes the potential inconsistency in IsolatedLeader, where the internal
field (state) would be seen as Leader whereas the reported value (state()) would be

Change-Id: I079f934e31bb52b306ccc21e16b6c23442e87ce4
Signed-off-by: Robert Varga <>
7 years agoDecouple RaftState and RaftActorBehaviors 65/36565/1
Robert Varga [Tue, 22 Mar 2016 17:04:56 +0000 (18:04 +0100)]
Decouple RaftState and RaftActorBehaviors

This patch makes RaftState (which is a RAFT concept) independent of
behaviors (which are an implementation detail). This will allow us to
freeze RaftState and make it more widely available.

Change-Id: I70b4e7f762e3cb20a6c7b865f1a0c1f46f9a3d33
Signed-off-by: Robert Varga <>
7 years agoMake SwitchShardBehavior transport RaftState 57/36557/1
Robert Varga [Tue, 22 Mar 2016 14:38:14 +0000 (15:38 +0100)]
Make SwitchShardBehavior transport RaftState

Instead of passing around generic strings (and potential failures from that),
make sure the message carries a proper raft state.

Change-Id: Id2c97773464d2a643f67a391247d58917c62d0c4
Signed-off-by: Robert Varga <>
7 years agoFixup ShardManagerInfo constants 56/36556/1
Robert Varga [Tue, 22 Mar 2016 14:34:51 +0000 (15:34 +0100)]
Fixup ShardManagerInfo constants

Use an ImmutableList for allowed states and make the JMX category a proper constant.

Change-Id: I72fe41b55a0534e72d8aa4a7128c0506339d0a19
Signed-off-by: Robert Varga <>
7 years agoFix wait for schema in BindingToNormalizedNodeCodec 81/35881/7
Tom Pantelis [Mon, 7 Mar 2016 11:20:13 +0000 (06:20 -0500)]
Fix wait for schema in BindingToNormalizedNodeCodec

The wait for schema mechanism does not work. A few issues were fixed:

 - FutureSchema did not add the FutureSchemaPredicate instances to the
   postponedOperations list so they always timed out.

 - The waitForSchema method in BindingToNormalizedNodeCodec checked for
   !futureSchema.waitForSchema so it only successfully returned on

 - There was a timing issue in FutureSchema where a context update could
   occur just prior to adding a postponed operation to the list, in
   which case the operation may timeout if the new update contained the
   postponed criteria and another update didn't occur in time. To
   alleviate this, the sychronization was tighted up and runtime context
   is now stored in FutureSchema instead of BindingToNormalizedNodeCodec.

 - The runtimeContext field needs to be volatile.

I also added a wait if the runtimeContext was null b/c
onGlobalContextUpdated hadn't been initially notified yet.

Added unit tests to cover the wait for schema mechanism.

Change-Id: I7155dae021453d085f89d13dfd4b069178dd2fc8
Signed-off-by: Tom Pantelis <>
7 years agoStop logging complete data tree on prepare/commit failure 57/36457/2
Moiz Raja [Fri, 18 Mar 2016 19:29:50 +0000 (12:29 -0700)]
Stop logging complete data tree on prepare/commit failure

Sometimes the data tree modification is so large that just trying to create
the buffer to hold the message can make the controller run out of memory. Plus
it's rarely useful to have a log filled with data which obfuscates other
important log messages. This patch still logs the data tree modification at
trace level.

Change-Id: I76bff9f7e836ee5eff347b0b77e2817f441ab953
Signed-off-by: Moiz Raja <>
7 years agoUse instanceof instead of .class.isInstance() 98/36298/2
Robert Varga [Wed, 16 Mar 2016 15:16:35 +0000 (16:16 +0100)]
Use instanceof instead of .class.isInstance()

These two are equivalent and using instanceof is more consistent with the rest
of the code.

Change-Id: I0493a94a09f66e19afb503afd05682692fba1b40
Signed-off-by: Robert Varga <>
7 years agoHandle snapshot support messages first 97/36297/2
Robert Varga [Wed, 16 Mar 2016 13:50:56 +0000 (14:50 +0100)]
Handle snapshot support messages first

This checks with snapshot snapshot support first, making the code a bit
more readable.

Change-Id: I1a9ea097d71b2f28771e19b2b1979ebff0f15e7a
Signed-off-by: Robert Varga <>
7 years agoRemove duplicate 'return true' statements 96/36296/2
Robert Varga [Wed, 16 Mar 2016 13:48:12 +0000 (14:48 +0100)]
Remove duplicate 'return true' statements

Instead of having each case return true, make it the default return
from the method and use the last else branch to return false.

Change-Id: I545d2f2c19ef8a10b693a0e904766141bc5db34e
Signed-off-by: Robert Varga <>
7 years agoDo not allow overrides of onReceive{Command,Recover} 92/36292/3
Robert Varga [Wed, 16 Mar 2016 13:21:16 +0000 (14:21 +0100)]
Do not allow overrides of onReceive{Command,Recover}

We already have protected methods to handle these cases, do not allow
overrides, as they create confusion around which method does what.

Change-Id: I3d6e9b9c4dc72a53471bf60324e4c7f36845ed5b
Signed-off-by: Robert Varga <>
7 years agoBug 2562: Binding Data Codec: Incorrectly deserialized unkeyed list from NormalizedNode 35/36435/2
Filip Gregor [Fri, 18 Mar 2016 10:21:03 +0000 (11:21 +0100)]
Bug 2562: Binding Data Codec: Incorrectly deserialized unkeyed list from NormalizedNode

added test show that this is no longer an issue

Change-Id: I3f84b0ebc71d1fef85068e2ff7b06a78c397e4c8
Signed-off-by: Filip Gregor <>
7 years agoFix forwarding in Shard.handleBatchedModifications 21/35121/6
Tom Pantelis [Fri, 19 Feb 2016 21:40:52 +0000 (16:40 -0500)]
Fix forwarding in Shard.handleBatchedModifications

Addressed the TODO in Shard.handleBatchedModifications to handle the
case where the BatchedModifications is not the first batch when leadership
changes and the BatchedModifications needs to be forwarded to the new
leader. Added code in ShardCommitCoordinator to reconstruct all previous
BatchedModifications messages, if needed, from the transaction
DataTreeModification, honoring the max batched modification count.

Change-Id: I4fecb71be91aee24072086e1565437a69c20c8d9
Signed-off-by: Tom Pantelis <>
7 years agoImplement ChangeServersVotingStatus message in RafActor 11/32511/8
Tom Pantelis [Tue, 12 Jan 2016 23:21:15 +0000 (18:21 -0500)]
Implement ChangeServersVotingStatus message in RafActor

Added a new ChangeServersVotingStatus message to change servers to/from
voting members. The leader updates its local peer info and persists and
replicates a new ServerConfigurationPayload with the appropriate voting
states. If the leader changes to non-voting it steps down as leader by
initiating a leadership transfer.

Change-Id: If073e4665cb1a270aae6e3dce36a6b3e900d0282
Signed-off-by: Tom Pantelis <>
7 years agoFix intermittent unit test failures 40/36440/1
Tom Pantelis [Fri, 18 Mar 2016 04:22:27 +0000 (00:22 -0400)]
Fix intermittent unit test failures

Change-Id: I2ef68b48de8da4cc7d82a91263976295458d011a
Signed-off-by: Tom Pantelis <>
7 years agoBug 5485: Improve DataTreeModification pruning on recovery 13/36013/5
Tom Pantelis [Wed, 9 Mar 2016 04:07:02 +0000 (23:07 -0500)]
Bug 5485: Improve DataTreeModification pruning on recovery

Modified the PruningDataTreeModification and NormalizedNodePruner to
validate path and node QNames via the SchemaContext instead of just
namespaces. This allows migration support for any element to be removed
from a yang hierarchy.

Also handled SchemaValidationFailedException on ready which can happen
with writes which don't immediately validate the sctructure as merge
does. The modification tree is re-applied with pruning.

Change-Id: I8c4f84fbaa93563ce6741d7a3e15855f7fc4940f
Signed-off-by: Tom Pantelis <>
7 years agoBug 5460: Fix snaphots on follower 74/36274/2
Tom Pantelis [Tue, 15 Mar 2016 23:51:58 +0000 (19:51 -0400)]
Bug 5460: Fix snaphots on follower

Added a callback to the appendAndPersist call in Follower to call

Added checks in ReplicationAndSnapshotsIntegrationTest to verify the
followers snapshot along with the leader.

Change-Id: Ie71f1b16152541d069f9d005ba669cb1e5771dd1
Signed-off-by: Tom Pantelis <>
7 years agoConvert toaster-it to use mdsal-it 74/36074/9
Tom Pantelis [Thu, 10 Mar 2016 11:48:43 +0000 (06:48 -0500)]
Convert toaster-it to use mdsal-it

I recently added an mdsal dependency to another project and it caused
the toaster-it test to fail. There was no useful output to troubleshoot,
just that some bundles failed to resolve.

It turns out the mdsal dependency and all its dependencies would need to be
added to the hard-coded bundle configuration for the test. This will be ongoing
issue every time a new dependency is added that might affect the toaster test.

To alleviate this I converted the test from manually installing bundles to use
the mdsal-it functionality which installs features into the
opendaylight-karaf-empty distro.

I also changed AbstractConfigTestBase to override the pax logging to
append to stdout, otherwise most output goes to karaf.log. This is helpful to
troubleshoot failures.

Change-Id: I1dd9150c6e617e491458560fe4b360d37548f264
Signed-off-by: Tom Pantelis <>
7 years agoFix intermittent RaftActorLeadershipTransferCohortTest failure 58/36158/2
Tom Pantelis [Fri, 11 Mar 2016 23:44:55 +0000 (18:44 -0500)]
Fix intermittent RaftActorLeadershipTransferCohortTest failure

Change-Id: I4c58f6545d7ef7667c7fcf42f5dda82345ab1167
Signed-off-by: Tom Pantelis <>
7 years agoAdd Maven Site generation data 22/36022/4
Thanh Ha [Thu, 10 Mar 2016 02:04:09 +0000 (21:04 -0500)]
Add Maven Site generation data

Add the necessary configuration to allow new projects to automatically
have Maven Site generation enabled when they use the startup-archetype.

Change-Id: Icfd69505bb01f3e8f895a7fef4147d4d8779de9d
Signed-off-by: Thanh Ha <>
7 years agoFix yangtools version in startup archetype 21/36021/3
Thanh Ha [Thu, 10 Mar 2016 01:46:39 +0000 (20:46 -0500)]
Fix yangtools version in startup archetype

Yangtools version for Boron should be 1.0.0-SNAPSHOT.

Change-Id: I2109eb26d8de717ecfa212d1448456a4048e9191
Signed-off-by: Thanh Ha <>
7 years agoChange default version to 0.1.0-SNAPSHOT 20/36020/4
Thanh Ha [Thu, 10 Mar 2016 01:35:02 +0000 (20:35 -0500)]
Change default version to 0.1.0-SNAPSHOT

With semantic versioning a project's initial version should not start
with 1.0.0-SNAPSHOT. Changing it to 0.1.0-SNAPSHOT so that a project can
start off with the recommended value.


Change-Id: Id3b99a9a5ccb2d68be02cc6faa0d4253e5b80f80
Signed-off-by: Thanh Ha <>
7 years agoBump default copyright year to 2016 19/36019/4
Thanh Ha [Thu, 10 Mar 2016 01:34:20 +0000 (20:34 -0500)]
Bump default copyright year to 2016

Change-Id: I1d520d0c0b18002921f1f45768f62cdf58214cfb
Signed-off-by: Thanh Ha <>
7 years agoImprove formatting for visual satisfaction 18/36018/4
Thanh Ha [Thu, 10 Mar 2016 01:29:08 +0000 (20:29 -0500)]
Improve formatting for visual satisfaction

Formatting for the startup poms improved to be more visually appealing
and easier to read.

Change-Id: Ibdd3828f712eed1e6864bbbbcbb316bf4e5962ac
Signed-off-by: Thanh Ha <>
7 years agoBug 4823: Offload generation of DCNs from Shard 96/34096/5
Tom Pantelis [Thu, 4 Feb 2016 06:39:20 +0000 (01:39 -0500)]
Bug 4823: Offload generation of DCNs from Shard

Generation of data change notifications can be expensive with large
lists which can block the Shard actor for many seconds. This processing
was offloaded to other actors to free up the Shard, one for DCLs and the
other for DTCLs. I separated the 2 types of listeners b/c DCN generation
is much more expensive than DTCs so at least DTCLs aren't held up by

Change-Id: I1bfb5d572c793f8eb703ebf0a7fd9bf628747168
Signed-off-by: Tom Pantelis <>
7 years agoDo not guard simple logging with isXXXEnabled() 18/36118/1
Robert Varga [Fri, 11 Mar 2016 12:30:52 +0000 (13:30 +0100)]
Do not guard simple logging with isXXXEnabled()

There is not benefit in the guards, making them pure overhead.

Change-Id: I75e310a2f08e5650db436bb4a7f46d85cbde313d
Signed-off-by: Robert Varga <>
7 years agoRemove commented-out logging 16/36116/1
Robert Varga [Fri, 11 Mar 2016 12:07:26 +0000 (13:07 +0100)]
Remove commented-out logging

Remove commented-out logging lines and do not condition simple logging
on isDebugEnabled().

Change-Id: I648ee585a4cf2e4a4dfabecdcf0ce833906b4dac
Signed-off-by: Robert Varga <>
7 years agoFix issues with LeastLoadedCandidateSelectionStrategy 14/33714/3
Moiz Raja [Wed, 27 Jan 2016 22:43:39 +0000 (14:43 -0800)]
Fix issues with LeastLoadedCandidateSelectionStrategy

LLCSS degenerates into a round robin owner allocator when
ownership changes. This patch fixes that issue as follows,

- Consider the statistics that are collected using the DTL
  only as initialStatistics which are passed to the Strategy
  when it is created
- When Leadership changes clear all the strategies so that
  they get freshly created with the right initial statistic
- Modify the newOwner method on Strategy to
    - pass the currentOwner for the entity, for the current
      owner we decrease the ownership statistic
    - remove the statistics passed to it as it would no longer
      be required. Due to this removal we also get rid of all
      the CRUD which we had added to check if the passed in
      stats were actually greater than the local stats which
      anyway did not work.

Change-Id: I754f0459051687a95056857044777ca6eebbcd93
Signed-off-by: Moiz Raja <>
7 years agoRemoved unnecessary file. 83/35083/3
Tony Tkacik [Fri, 19 Feb 2016 13:33:09 +0000 (14:33 +0100)]
Removed unnecessary file.

Change-Id: I1dfe4ec5a2ccca36f44d68c1639f28572425b831
Signed-off-by: Tony Tkacik <>
7 years agoClean up DistributedEntityOwnershipService instantiation 01/35501/9
Robert Varga [Sat, 27 Feb 2016 01:30:06 +0000 (02:30 +0100)]
Clean up DistributedEntityOwnershipService instantiation

Most validation checks are done in customValidation(). Also add more
resilency to possible interactions with ConfigAdmin service.

The lambda conversion comes courtesy Eclipse on-save autoconvert.

A lot of this code needs to go away.

Change-Id: Ifaf4416015996be9a7716a2620f16a56b74d12b5
Signed-off-by: Robert Varga <>
7 years agoDo not duplicate candidate list 45/35545/3
Robert Varga [Mon, 29 Feb 2016 11:45:52 +0000 (12:45 +0100)]
Do not duplicate candidate list

Iterables.getLast() provides an efficient way of getting the last item
from a collection, without the need to duplicate it.

Change-Id: I49b0bc827bffc0adb616cf516438bad7526ad141
Signed-off-by: Robert Varga <>
7 years agoDo not use String.toString() 42/35542/3
Robert Varga [Mon, 29 Feb 2016 11:36:17 +0000 (12:36 +0100)]
Do not use String.toString()

Use Strings.isNullOrEmpty instead of open-coding the check, also add
preconditions for fields and eliminate a String.toString() call.

Change-Id: Ic25a60511514ea623d1d9bdde9675faec8d538f8
Signed-off-by: Robert Varga <>
7 years agoBUG-4964: Bump to akka-2.4.1 24/32524/19
Robert Varga [Wed, 13 Jan 2016 20:42:04 +0000 (21:42 +0100)]
BUG-4964: Bump to akka-2.4.1

This updates the imports and adapts to API changes. Requires Java 8 to
work. Also bumps netty to 3.10.5, as that is what remoting requires.

Change-Id: I3a3886ac75496d07ec03ae561a6df03ecaa5ad0c
Signed-off-by: Robert Varga <>
7 years agoModify toaster example to use DataTreeChangeListener 09/35209/3
Tom Pantelis [Mon, 22 Feb 2016 04:22:43 +0000 (23:22 -0500)]
Modify toaster example to use DataTreeChangeListener

Change-Id: I88e16026247d4e4f979eb795f5c5ea33857ac66f
Signed-off-by: Tom Pantelis <>
7 years agoFix ConcurrentModificationEx in RpcRegistry.onBucketsUpdated 14/35714/2
Tom Pantelis [Thu, 3 Mar 2016 17:52:47 +0000 (12:52 -0500)]
Fix ConcurrentModificationEx in RpcRegistry.onBucketsUpdated

This was introduced by a recent patch. onBucketsUpdated iterates the
routesUpdateCallbacks however one of the callbacks in receiveGetRouter
removes itself from the list causing the ConcurrentModificationEx.

I changed onBucketsUpdated to first copy the list to an array to prevent

Change-Id: I44c9a89b4b433f711cf4f90bf28e6955d8784f5f
Signed-off-by: Tom Pantelis <>
7 years agoRemove unused obsolete concepts code. 87/35087/4
Tony Tkacik [Fri, 19 Feb 2016 13:38:25 +0000 (14:38 +0100)]
Remove unused obsolete concepts code.

Change-Id: I7898e6ced3938ff245cbc9d4861bdce23e909d30
Signed-off-by: Tony Tkacik <>
7 years agoRemoved non-building code. 84/35084/3
Tony Tkacik [Fri, 19 Feb 2016 13:36:06 +0000 (14:36 +0100)]
Removed non-building code.

Change-Id: Ic7ddbb76b3485704ffc48602c3081122cdd03d72
Signed-off-by: Tony Tkacik <>
7 years agoMove JMX generator out of src/main 52/35052/3
Robert Varga [Fri, 19 Feb 2016 10:06:00 +0000 (11:06 +0100)]
Move JMX generator out of src/main

Move generated files to target/generated-sources/config-binding to make
sure we do not emit generated source files to src/main, where they run
risk of being added to SCM.

Change-Id: Idc8733dbfd5b125c96bfb49069a908174bfeefd0
Signed-off-by: Robert Varga <>
7 years agoUse {{VERSION}} for config files 20/35320/3
Robert Varga [Wed, 24 Feb 2016 10:16:01 +0000 (11:16 +0100)]
Use {{VERSION}} for config files

This detects failure to include a dependency, ensuring a failure.

Change-Id: I350a47ad7d844e0e61c818da796810c4ea1000dd
Signed-off-by: Robert Varga <>
7 years agoBUG-4329: remove references to JDT 58/35358/1
Robert Varga [Wed, 24 Feb 2016 20:43:18 +0000 (21:43 +0100)]
BUG-4329: remove references to JDT

Since we have migrated the lonely test using JDT, we can now remove
references to it.

Change-Id: Ic814ba20e11ce95e5d25260be4c7cebcd5a21565
Signed-off-by: Robert Varga <>
7 years agoFix broken downstream features 17/35317/1
Robert Varga [Wed, 24 Feb 2016 09:18:36 +0000 (10:18 +0100)]
Fix broken downstream features

factoryakkaconf needs to be spelled out in the dependency of

Change-Id: I71e7cff1076fc63c08f6debefc72107046f8337f
Signed-off-by: Robert Varga <>
7 years agoBug 4866: Add wait/retries for routed RPCs 75/34175/4
Tom Pantelis [Fri, 5 Feb 2016 07:42:54 +0000 (02:42 -0500)]
Bug 4866: Add wait/retries for routed RPCs

If a routed RPC is registered on one node it takes a little time for the
route to propagate via gossip to other nodes. If another node tries to
invoke the RPC prior to propagation it fails. To alleviate this timing
issue, I added wait/retries via a timer in the RpcRegistry for the
FindRouters message. As routes are updated via gossip, it retries the
FindRouters request. If the timer triggers, it sends back an empty list.
The timer period is 10 times the gossip tick interval (500ms * 10 = 5s).

Change-Id: Iaafcfb4c93cde44f62f6645c8b8684102ac0d0db
Signed-off-by: Tom Pantelis <>
7 years agoFix sporadic failures in ClusterAdminRpcServiceTest 85/35285/2
Tom Pantelis [Tue, 23 Feb 2016 18:10:21 +0000 (13:10 -0500)]
Fix sporadic failures in ClusterAdminRpcServiceTest

The testAddShardReplica is failing sporadically indirectly due to The leader's payload
version was -1 so a transaction's BatchedModifications instance was
serialized to the legacy protobuf message type and thus wasn't delivered.

The underlying problem is that RaftActor.updateConfigParams
needs to pass the previous leader's payload version when re-constructing
the Follower instance on RaftPolicy change.

Change-Id: Id6b8da98c145f2e265dddbc1b27384d54e400370
Signed-off-by: Tom Pantelis <>
7 years agoBug 5329: Add factory akka.conf 53/34553/5
Tom Pantelis [Fri, 12 Feb 2016 14:08:15 +0000 (09:08 -0500)]
Bug 5329: Add factory akka.conf

Added a factory akka.conf file that is shipped to
configuration/factory/akka.conf. This file contains all the necessary
akka settings. Modified the FileAkkaConfigurationReader to load the
existing configuration/initial/akka.conf file with the factory file as
the fallback. In this manner akka will overlay/merge the initial file
with the factory file. I pared down the initial file to only contain the
settings that users would normally set or configure to setup a cluster,
ie hostname, port, seed-nodes, roles.

In the features.xml, the factory file is configured to always overwrite
so changes are picked up on upgrade. We still preserve the initial file.

Change-Id: I8e80161e21d0ad0e26f1efa1023c670b3a5ef6bc
Signed-off-by: Tom Pantelis <>
7 years agoRemove unused org.opendaylight.controller.xml.codec package/classes 14/35114/5
Tom Pantelis [Fri, 19 Feb 2016 16:12:17 +0000 (11:12 -0500)]
Remove unused org.opendaylight.controller.xml.codec package/classes

The org.opendaylight.controller.xml.codec utility classes in
sal-clustering-commons are no longer used so remove them. They were
originally used by the remote RPC code for conversion of the legacy
CompositeNode class which has since been removed. The code referencing
CompositeNode et al was removed from these classes but unused
remnants were left behind.

Change-Id: Ic8f880c8075f076549bb822f6dfbaaad81595ed1
Signed-off-by: Tom Pantelis <>
7 years agoFix TerminationMonitor to reference correct Monitor class 13/35113/5
Tom Pantelis [Fri, 19 Feb 2016 15:46:37 +0000 (10:46 -0500)]
Fix TerminationMonitor to reference correct Monitor class

The TerminationMonitor actor listens for messages of type
but the AbstractUntypedActor sends a message of type
TerminationMonitor was changed to reference the right class and
org.opendaylight.controller.cluster.datastore.messages.Monitor was

Change-Id: Ie0e8dd4face529c3b40e1227fec575a8bd4c9425
Signed-off-by: Tom Pantelis <>
7 years agoRemoved unused class NonPersistent 12/35112/4
Tom Pantelis [Fri, 19 Feb 2016 14:38:10 +0000 (09:38 -0500)]
Removed unused class NonPersistent

Change-Id: I9d50829fc254307127980bd4304e40d0e600f09f
Signed-off-by: Tom Pantelis <>
7 years agoRemove returnSerialized from ForwardedReadyTransaction 00/35100/4
Tom Pantelis [Fri, 19 Feb 2016 13:48:00 +0000 (08:48 -0500)]
Remove returnSerialized from ForwardedReadyTransaction

With the removal of the pre-Lithium transaction messages, the
returnSerialized field in ForwardedReadyTransaction is no longer used
and thus was removed.

Change-Id: I4a23ed77ee1960d3bb634511a2222dfcd213062f
Signed-off-by: Tom Pantelis <>
7 years agoChange BatchedModifications to extend VersionedExternalizableMessage 97/35097/8
Tom Pantelis [Fri, 19 Feb 2016 13:23:07 +0000 (08:23 -0500)]
Change BatchedModifications to extend VersionedExternalizableMessage

To be consistent with other transaction messages, changed
BatchedModifications to extend VersionedExternalizableMessage
via MutableCompositeModification.

Change-Id: I7dbf39f59b0e6263c38a062826eb6341b7cb16d1
Signed-off-by: Tom Pantelis <>
7 years agoRemove clientTxVersion from ShardTransaction 96/35096/5
Tom Pantelis [Fri, 19 Feb 2016 11:59:21 +0000 (06:59 -0500)]
Remove clientTxVersion from ShardTransaction

With the removal of the pre-Lithium transaction messages,
ShardTransaction et al no longer need the clientTxVersion passed on
creation so this field was removed. When readying a tx, the version is
obtained from the BatchedModifications.

Change-Id: I96835f51f3665d205f93f6d98fd9497be5159510
Signed-off-by: Tom Pantelis <>
7 years agoFix unit test errors due to Mockito upgrade 11/35211/2
Tom Pantelis [Mon, 22 Feb 2016 05:08:52 +0000 (00:08 -0500)]
Fix unit test errors due to Mockito upgrade

The Mockito version was recently upgraded which causes some unit tests
to fail. Mockito no longer support never() used with timeout() so
workaround that.

Change-Id: I861e3ea198a630347b8de4c915d49b2718cc3d2c
Signed-off-by: Tom Pantelis <>
7 years agoSwitch aggregator to odlparent-lite 50/35150/3
Robert Varga [Sun, 21 Feb 2016 15:36:27 +0000 (16:36 +0100)]
Switch aggregator to odlparent-lite

Change-Id: Ib3711fc7eb6efab3ff6bd711195b227ad88c6205
Signed-off-by: Robert Varga <>
7 years agoBUG-4329: switch to javaparser 53/35153/2
Robert Varga [Sun, 21 Feb 2016 16:07:10 +0000 (17:07 +0100)]
BUG-4329: switch to javaparser

Instead of using Eclipse JDT, which has not been published in ages, use
comgithub.javaparser, which supports Java 8 and is quite convenient.

Change-Id: I30d3975679b6b24952eabe5488fbce2db49ab0e6
Signed-off-by: Robert Varga <>
7 years agoBUG-2912: Better document DataChangeScope.ONE 11/34911/4
Colin Dixon [Tue, 16 Feb 2016 18:06:50 +0000 (13:06 -0500)]
BUG-2912: Better document DataChangeScope.ONE

Provides information about the way this scope interacts with lists in and the
binding independent data tree that might be counterintuitive when compared with
a binding aware view of the same data.

Change-Id: If966331b4daa5a88be61fb2efea65a4b69495b0b
Signed-off-by: Colin Dixon <>
7 years agoFix missing bundle 48/35148/1
Robert Varga [Sun, 21 Feb 2016 15:33:04 +0000 (16:33 +0100)]
Fix missing bundle

Change-Id: I9b8c0ca660e0101a2459f92dd16e36727f8ab9c3
Signed-off-by: Robert Varga <>
7 years agoFix sporadic ShardManagerTest failures 28/34928/3
Tom Pantelis [Wed, 17 Feb 2016 18:55:20 +0000 (13:55 -0500)]
Fix sporadic ShardManagerTest failures

Some of the tests fail sporadically. Most were alleviated by:

  - using tell on an actor rather than calling receiveCommand directly
  - using the normal fork/join dispatcher for creating TestActors instead
    of the default CallingThread dispatcher.

After the changes the tests ran over 200 times successfully.

Change-Id: Ib2c7c3b6dace9e89dff54eccc58a2b8aabad75de
Signed-off-by: Tom Pantelis <>
7 years agoBinding Codecs support of APPEARED,DISAPPEARED. 58/35058/2
Tony Tkacik [Fri, 19 Feb 2016 10:55:13 +0000 (11:55 +0100)]
Binding Codecs support of APPEARED,DISAPPEARED.

In BE two new modification types were introduced for
structural containers, but binding codecs were not
updated accordingly.

Frontend mapping is simple:

Change-Id: I62810c501234a62343150c328c6f2802402669c5
Signed-off-by: Tony Tkacik <>
7 years agoRemove target-ide override 51/35051/2
Robert Varga [Fri, 19 Feb 2016 09:55:09 +0000 (10:55 +0100)]
Remove target-ide override

This was here for historic reasons. The interaction between IDE and
command-line maven are under-defined and this does not really solve

Change-Id: I77978199113f458e483a87241bf267975b4d9de3
Signed-off-by: Robert Varga <>
7 years agoMake sure yang-maven-plugin executes in eclipse 23/34823/2
Robert Varga [Wed, 17 Feb 2016 12:37:38 +0000 (13:37 +0100)]
Make sure yang-maven-plugin executes in eclipse

Turn ignore into execute.

Change-Id: I231d6ff528987d07488320b95db9342d37c02354
Signed-off-by: Robert Varga <>
7 years agoReduce reliance on NormalizedNodeInputStreamReader 51/34851/2
Robert Varga [Wed, 17 Feb 2016 16:55:57 +0000 (17:55 +0100)]
Reduce reliance on NormalizedNodeInputStreamReader

Use NormalizedNodeDataInput instead.

Change-Id: I8c16fcdd1f69354a2616fe89b5a368feea1d3090
Signed-off-by: Robert Varga <>
7 years agoHide NormalizedNodeOutputStreamWriter 47/34847/6
Robert Varga [Wed, 17 Feb 2016 15:17:32 +0000 (16:17 +0100)]
Hide NormalizedNodeOutputStreamWriter

This is an internal implementation class, hide it.

Change-Id: Ib79d5a48dcf967f832b7130b981e5c22a593ef80
Signed-off-by: Robert Varga <>
7 years agoRemove InputStream constructors 41/34841/4
Robert Varga [Wed, 17 Feb 2016 16:30:42 +0000 (17:30 +0100)]
Remove InputStream constructors

These are not used anywhere, remove them and simplify callers.

Change-Id: I1b7f28c8fb73903da2c3ddfe59defba56c44e364
Signed-off-by: Robert Varga <>
7 years agoNormalizedNodeDataOutput should be AutoCloseable 46/34846/3
Robert Varga [Wed, 17 Feb 2016 15:13:09 +0000 (16:13 +0100)]
NormalizedNodeDataOutput should be AutoCloseable

We expect to use autocloseable in implementations, make sure this this
reflected upwards.

Change-Id: Ia7e6b27e514cf04e24b0cdf161510a035846ba12
Signed-off-by: Robert Varga <>
7 years agoRemove implements NormalizedNodeStreamWriter declaration 45/34845/3
Robert Varga [Wed, 17 Feb 2016 15:11:40 +0000 (16:11 +0100)]
Remove implements NormalizedNodeStreamWriter declaration

AbstractNormalizedNodeDataOutput already implements this class, no need
to declare it twice.

Change-Id: I4b217d00fe8054ce777b91b35157443438e65a54
Signed-off-by: Robert Varga <>
7 years agoRemove NormalizedNodeStreamReader 42/34842/2
Robert Varga [Wed, 17 Feb 2016 14:47:20 +0000 (15:47 +0100)]
Remove NormalizedNodeStreamReader

This class has been superseded by NormalizedNodeDataInput, remove it.

Change-Id: I11c915f4aff6ca217e096c42ba1115043a99a3ab
Signed-off-by: Robert Varga <>
7 years agoFollow-up to protobuff deprecation 38/34638/11
Robert Varga [Sun, 14 Feb 2016 22:34:49 +0000 (23:34 +0100)]
Follow-up to protobuff deprecation

Mark elements dealing with compatibility as @Deprecated. Reduces the
warning surface significantly.

Change-Id: I969c7b185cf6fbf570fe4d4d0332cff60eb0e4ca
Signed-off-by: Robert Varga <>
7 years agoRemove unused variant of newShardProps() 24/34624/12
Robert Varga [Sun, 14 Feb 2016 02:22:11 +0000 (03:22 +0100)]
Remove unused variant of newShardProps()

This signature is unused, remove it to squash an eclipse warning.

Change-Id: I804961bfded0734a02fd00fb69979bb8b5b8feab
Signed-off-by: Robert Varga <>
7 years agoAdd SendInstallSnapshot javadoc 18/34618/12
Robert Varga [Sun, 14 Feb 2016 00:31:46 +0000 (01:31 +0100)]
Add SendInstallSnapshot javadoc

First cut at describing mechanics. Also make the class final and
annonate nullness.

Change-Id: I94119ab818713110dfab199b0e3f9e9608cfd583
Signed-off-by: Robert Varga <>
7 years agoClean AbstractServerChangeReply up 22/34622/9
Robert Varga [Sun, 14 Feb 2016 01:32:58 +0000 (02:32 +0100)]
Clean AbstractServerChangeReply up

This is an abstract base class, make it abstract and non-instantiable
from outside of the world. It introduces public API, hence we cannot
hide it.

Also switch to using MoreObjects.ToStringHelper, as that allows us to
unify toString().

Change-Id: I21bdd4d0815a50393519414449c7e7eb7179b077
Signed-off-by: Robert Varga <>
7 years agoBug 4627: Fix premature RO tx cleanup 57/34757/1
Tom Pantelis [Tue, 16 Feb 2016 04:45:36 +0000 (23:45 -0500)]
Bug 4627: Fix premature RO tx cleanup

For the RO tx PhantomReference cleanup mechanism, modified
RemoteTransactionContextSupport to pass the front-end client
TransactionProxy instance as the referent to the
FinalizablePhantomReference. Previously we were passing the
RemoteTransactionContextSupport instance which is only reachable via
a hard reference until the primary shard actor is obtained and thus may
be eligible for GC while the TransactionProxy is still in use.

Change-Id: Ib2808b4ba8113a5722f9ee422434a89adaf775fe
Signed-off-by: Tom Pantelis <>
7 years agoBug 4823: Use tx commit timeout for BatchedModifications 98/34298/3
Tom Pantelis [Mon, 8 Feb 2016 21:50:23 +0000 (16:50 -0500)]
Bug 4823: Use tx commit timeout for BatchedModifications

When sending BatchedModifications messages to the shard we use the
general operation timeout which is 5 sec. We should instead use the
transaction commit timeout to be consistent with the other transaction
messages (ReadyLocalTransaction, CanCommitTransaction etc).

Change-Id: I26bead59c29ee198f677838c5adb3614e3795a04
Signed-off-by: Tom Pantelis <>
7 years agoMake RequestVoteReply final 21/34621/6
Robert Varga [Sun, 14 Feb 2016 00:44:39 +0000 (01:44 +0100)]
Make RequestVoteReply final

Concrete message, it should never be subclassed.

Change-Id: Ie48a8cace763e1184ab47990136c5e5db3d453cf
Signed-off-by: Robert Varga <>
7 years agoDocument RaftRPC 19/34619/5
Robert Varga [Sun, 14 Feb 2016 00:36:31 +0000 (01:36 +0100)]
Document RaftRPC

Add some basic javadocs.

Change-Id: I1cd1a37e3979c497705baf3a2b508c058f1022ec
Signed-off-by: Robert Varga <>
7 years agoTurn OperationState into an abstract class 17/34617/4
Robert Varga [Sun, 14 Feb 2016 00:06:03 +0000 (01:06 +0100)]
Turn OperationState into an abstract class

This is an internal state class, no need to make it an interface. This
should make for faster dispatch, as methods offsets in vtable are fixed.

Change-Id: I3438a17485104b43647c91b7c6272dad5862cbb9
Signed-off-by: Robert Varga <>
7 years agoTurn SendHeartBeat into a singleton 16/34616/4
Robert Varga [Sat, 13 Feb 2016 23:53:53 +0000 (00:53 +0100)]
Turn SendHeartBeat into a singleton

There is no additional data, turn it into a singleton.

Change-Id: I5d562d798d27ba80e2b4de31a16faae80a3eaad3
Signed-off-by: Robert Varga <>
7 years agoTurn LeaderTransitioning into a singleton 15/34615/4
Robert Varga [Sat, 13 Feb 2016 23:49:14 +0000 (00:49 +0100)]
Turn LeaderTransitioning into a singleton

The message does not carry any state and can be made a singleton.

Change-Id: Iadcbe0cb8de949dbc57240772bcfd9ddf23d42ad
Signed-off-by: Robert Varga <>
7 years agoHide IsolatedLeaderCheck message 14/34614/4
Robert Varga [Sat, 13 Feb 2016 23:44:36 +0000 (00:44 +0100)]
Hide IsolatedLeaderCheck message

IsolatedLeaderCheck is a Leader-internal implementation detail. Do not
publish it to the outside world. Since it does not carry any state, we
can replace it by a simple object instance.

Change-Id: I6f9061e8141f499c590fd079f6c57e39f8b022d2
Signed-off-by: Robert Varga <>
7 years agoMake FollowerInitialSyncUpStatus final 13/34613/4
Robert Varga [Sat, 13 Feb 2016 23:24:06 +0000 (00:24 +0100)]
Make FollowerInitialSyncUpStatus final

Change-Id: Ie39c26f077311e0ec5b9dd9b8734bdfabf26b581
Signed-off-by: Robert Varga <>
7 years agoTurn ElectionTimeout into a proper singleton 12/34612/4
Robert Varga [Sat, 13 Feb 2016 23:19:41 +0000 (00:19 +0100)]
Turn ElectionTimeout into a proper singleton

There is no need to instantiate this object multiple times. Turn it into
a singleton. Also add a bit of javadocs.

Change-Id: Ied90a43ec297409b8074875d305d7f74e1b37ce4
Signed-off-by: Robert Varga <>
7 years agoMake NOOP_CALLBACK internal constant 08/34608/5
Robert Varga [Sat, 13 Feb 2016 22:01:14 +0000 (23:01 +0100)]
Make NOOP_CALLBACK internal constant

There are no outside users, make this a proper final constant and hide

Change-Id: I06638758787b3fd0994b5d51fb4f2b2e5718aa57
Signed-off-by: Robert Varga <>
7 years agoBUG-5247: notify listeners for entities which are not owned 79/34179/19
Robert Varga [Fri, 5 Feb 2016 17:45:40 +0000 (18:45 +0100)]
BUG-5247: notify listeners for entities which are not owned

Rather than broadcasting just the 'up' state, notify listeners about all
state we know of.

Change-Id: Iaae6db925a321aad420fa0ee8bdf8b56b5d2a29e
Signed-off-by: Robert Varga <>
7 years agoMake GetSnapshot final and add a link 07/34607/5
Robert Varga [Sat, 13 Feb 2016 21:32:40 +0000 (22:32 +0100)]
Make GetSnapshot final and add a link

With a private consructor, this class is really final. Also add a
Javadoc reference to the response message.

Change-Id: I2cf9cf7d4b750597ac2dc122ee9d6412831522bd
Signed-off-by: Robert Varga <>