7 years agoFix precondition string 83/29283/1
Robert Varga [Wed, 4 Nov 2015 17:30:16 +0000 (18:30 +0100)]
Fix precondition string

The string has been corrupted, fix it up.

Change-Id: I36312ca4e5ca6365b3003a2ad57ca2734d156578
Signed-off-by: Robert Varga <>
7 years agoImprove YangStoreService performance 82/29282/1
Robert Varga [Wed, 4 Nov 2015 17:23:58 +0000 (18:23 +0100)]
Improve YangStoreService performance

Simple changes to eliminate synthetic methods and unneeded duplication
of collections.

Change-Id: I370d4ed85720e2b7eb811204afa9f532b716b16d
Signed-off-by: Robert Varga <>
7 years agoDo not subclass Hashtable 81/29281/1
Robert Varga [Wed, 4 Nov 2015 14:30:43 +0000 (15:30 +0100)]
Do not subclass Hashtable

Rather than subclassing, instantiate a Hashtable and fill it.

Change-Id: Icfd4e812759874a702a2506e9090cd20535bdc50
Signed-off-by: Robert Varga <>
7 years agoBUG 3973: Add config option for Java-only leveldb 17/29217/1
Gary Wu [Tue, 3 Nov 2015 20:02:02 +0000 (12:02 -0800)]
BUG 3973:  Add config option for Java-only leveldb

Add comment in akka.conf on how to use the Java-only
version of leveldb for platforms where native leveldb
is unavailable.

Change-Id: I5693522597152ef7f86bb89d4be32e20f0582806
Signed-off-by: Gary Wu <>
7 years agoAdd leader unit test for non-voting consensus 27/29027/4
Tom Pantelis [Fri, 30 Oct 2015 01:20:24 +0000 (21:20 -0400)]
Add leader unit test for non-voting consensus

Added a test case to LeaderTest to verify a non-voting follower
does not influence replication consensus.

Also I saw intermitent test failures (in jenkins as well during first
verify build) due to a message going to dead letters shortly after
actor creation (also reported in Bug 4223). Specifically it was occurring
when the leader sent the initial AppendEntries heartbeat to a follower. This
seems like a timing issue/bug in akka when using an ActorSelection. I
added code in the TestActorFactory to use an actorSelection and call
resolveOne in a retry loop. This seems to alleviate the issue as I ran
LeaderTest over 1000 times successfully.

Change-Id: I65cb87f419c280befe2d82300a981bd8e6f88742
Signed-off-by: Tom Pantelis <>
7 years agoBug 2187: Address comments in 81/28981/3
Tom Pantelis [Thu, 29 Oct 2015 17:55:00 +0000 (13:55 -0400)]
Bug 2187: Address comments in

Addressed minor comments in

Unified the response messages and debug messages.

Added persistenceId() format param to the debug messages for additional

Change-Id: Ic1a4e852126425cf7ae67ee5b9ea301b06a3f9a8
Signed-off-by: Tom Pantelis <>
7 years agoAlways persist ServerConfigurationPayload log entries 52/28952/4
Tom Pantelis [Thu, 29 Oct 2015 14:27:28 +0000 (10:27 -0400)]
Always persist ServerConfigurationPayload log entries

We need to always persist ServerConfigurationPayload log entries
regardless of whether or not persistence is enabled for the derived
RaftActor's data.

I added a new tagging interface PersistentPayload, implemented by
ServerConfigurationPayload, to indicate a Payload
needs to always be persisted. Since log entries are persisted by
both the RaftActor and Follower behavior via the ReplicatedLog, the
logic to determine persistence based on PersistentPayload needs to be
available to both. The ReplicatedLog uses the persistence provider
contained in the RaftActorContext which is the
DelegatingPersistentDataProvider set by the RaftActor. So to keep
the rest of the code the same and keep it simple, I derived a
RaftActorDelegatingPersistentDataProvider which overrides persist to
handle the PersistentPayload logic utilizing the RaftActor's
existing PersistentDataProvider.

Change-Id: I243026b28ed57461ad92324b6947091ae74a7127
Signed-off-by: Tom Pantelis <>
7 years agoDerive MockRaftActorContext from RaftActorContextImpl 18/28818/3
Tom Pantelis [Mon, 26 Oct 2015 19:15:16 +0000 (15:15 -0400)]
Derive MockRaftActorContext from RaftActorContextImpl

I changed MockRaftActorContext to derive from RaftActorContextImpl since
it duplicates most of the functionality in RaftActorContextImpl and,
with the addition of PeerInfo, MockRaftActorContext can now provide the
same functionality as RaftActorContextImpl w/o having to duplicate it in
MockRaftActorContext. Also this will make it easier when the RaftActorContext
interface is changed.

Change-Id: Ief90232fc992a50b3f0fea5ece323a14916760f2
Signed-off-by: Tom Pantelis <>
7 years agoBUG-3381: Capture Snapshot on recovery if journal is not empty 21/27721/7
evvy [Mon, 26 Oct 2015 15:06:20 +0000 (20:36 +0530)]
BUG-3381: Capture Snapshot on recovery if journal is not empty

Change-Id: Ib1068cb6d4848d151039887b51458399ff421178
Signed-off-by: evvy <>
7 years agoAdd wait state for AddServer if snapshot in progress 25/28925/3
Tom Pantelis [Wed, 28 Oct 2015 20:06:23 +0000 (16:06 -0400)]
Add wait state for AddServer if snapshot in progress

It is possible a snapshot capture coild be in progress when we
attempt to initiate snapshot capture on AddServer. I added a wait
state to the FSM and a new message, SnapshotComplete, that is sent
by the SnapshotManager.

Added more unit test cases.

Change-Id: I119a264e03686ea70f7834e551c2fb45dd39f903
Signed-off-by: Tom Pantelis <>
7 years agoBUG 2187 - Creating ShardReplica 96/28596/9
kalaiselvik [Wed, 28 Oct 2015 12:31:57 +0000 (18:01 +0530)]
BUG 2187 - Creating ShardReplica

Creating local shard replica with a custom Raftpolicy. Informs Shard leader of the local shard.
Processes AddServerReply from shard leader.
On successful replication, makes local shard voting capable.
On replication failure, local shard is removed.

Incorporated the comments

Change-Id: Id2b90039c39211b20322bc2d141520723d44c391
Signed-off-by: kalaiselvik <>
7 years agoBUG-2187: Non voting and Uninitialized followers are not to be counted towards consensus 54/28954/1
Rajesh_Sindagi [Thu, 29 Oct 2015 15:23:35 +0000 (08:23 -0700)]
BUG-2187: Non voting and Uninitialized followers are not to be counted towards consensus

Change-Id: I1ba86cf2e2f904847ea8f819e84a3dc54fcc31d2
Signed-off-by: Rajesh_Sindagi <>
7 years agoAdd voting state to ServerConfigurationPayload 29/28829/9
Tom Pantelis [Mon, 26 Oct 2015 21:55:47 +0000 (17:55 -0400)]
Add voting state to ServerConfigurationPayload

Changed the internal state to a list of ServerInfo instances which
contain he server id and voting state.

Also removed the oldServerConfig field as it won't be needed.

Change-Id: I10b3ca8dc2ffed9b5db0a7d0f6ca74d73a837b8e
Signed-off-by: Tom Pantelis <>
7 years agoFix small bug in startup archetype 99/28899/2
Ed Warnicke [Wed, 28 Oct 2015 18:15:23 +0000 (11:15 -0700)]
Fix small bug in startup archetype

Change-Id: I83913ed9f16b38f6e6fd461b76dece1a09f4c8ca
Signed-off-by: Ed Warnicke <>
7 years agoBUG-2399: fixup tests 08/28908/2
Robert Varga [Thu, 22 Oct 2015 05:56:05 +0000 (07:56 +0200)]
BUG-2399: fixup tests

The test model specifies the top-level container as structural, yet the
tests expect it to exist when empty. Mark the container as presence,
restoring behavior expected by tests.

Change-Id: Ided99720468a8bee14d5c66342e524450f5a9050
Signed-off-by: Robert Varga <>
7 years agoIntroduce PeerInfo and VotingState 20/28720/10
Tom Pantelis [Fri, 23 Oct 2015 20:09:38 +0000 (16:09 -0400)]
Introduce PeerInfo and VotingState

We need to store the voting state for each per so I created a
PeerInfo class to include, id, address and voting state (represented by a
VotingState enum). The RaftActorContext now stores PeerInfo instances
in its peer map and added methods to access PeerInfo. As a consequence,
RaftActorContext#getPeerAddresses was no longer needed and was removed.

AbstractLeader and Candidate were modified to utilize the PeerInfo to
calculate the majority vote/min replication count, ie ignore non-voting peers.

Previously we had added a FollowerState enum and stored it in the
FollowerLogInformation. Since voting state is now stored in the
RaftActorContext peer info, I removed the FollowerState from
FollowerLogInformation to avoid redundancy and having to keep both
up to date.

Change-Id: I1394511a8db7f0b9df3ed7879c77c1f44f3b143d
Signed-off-by: Tom Pantelis <>
7 years agoBump Akka to 2.3.14 51/28851/2
Gary Wu [Tue, 27 Oct 2015 18:02:54 +0000 (11:02 -0700)]
Bump Akka to 2.3.14

Change-Id: Ia6bf3f1a4c025ec1e84662c04ccdc40c04e569a2
Signed-off-by: Gary Wu <>
7 years agoRemove checks for NormalizedNodeBuilderWrapper 73/28773/5
Robert Varga [Sat, 24 Oct 2015 11:29:44 +0000 (13:29 +0200)]
Remove checks for NormalizedNodeBuilderWrapper

Interface contract already guarantees returned objects are subclasses of
NormalizedNodeBuilderWrapper, the instanceof guards only non-nullness.

Switch to explicit assertNotNull() to reduce eclipse warnings.

Change-Id: Ibf0d73752c6e1ebeacbb10677e2f11f185098bd9
Signed-off-by: Robert Varga <>
7 years agoDo not use MoreExecutors.sameThreadExecutor() 72/28772/5
Robert Varga [Sat, 24 Oct 2015 11:25:33 +0000 (13:25 +0200)]
Do not use MoreExecutors.sameThreadExecutor()

This method is deprecated, replace it with proper service/executor.

Change-Id: I7257a28f28784313cafc250f2c2fd1c623332dec
Signed-off-by: Robert Varga <>
7 years agoMake REUSABLE_*_TL final 69/28769/5
Robert Varga [Sat, 24 Oct 2015 09:44:30 +0000 (11:44 +0200)]
Make REUSABLE_*_TL final

Since these are public static fields, they should be final to prevent
possible shenanigans.

Change-Id: I4a360e060ddde57a73118bcf3d053ce397204136
Signed-off-by: Robert Varga <>
7 years agoReduce ShardDataTree#getDataTree() callsites 29/28729/7
Robert Varga [Fri, 23 Oct 2015 12:24:39 +0000 (14:24 +0200)]
Reduce ShardDataTree#getDataTree() callsites

A lot of these callsites perform a specific function, expose those
functions without leaking the DataTree. This is needed to handle
asynchronous persistence and optimistic transaction commit.

Change-Id: I330cb4172349e0d1d8daacc3aafce7dad64cd8b2
Signed-off-by: Robert Varga <>
7 years agoDo not declare unneeded Exception throw 27/28727/5
Robert Varga [Fri, 23 Oct 2015 10:42:05 +0000 (12:42 +0200)]
Do not declare unneeded Exception throw

Fixes sonar warnings

Change-Id: I31ab95c75cf30b33c9025d6f6e4662ccc5df7a47
Signed-off-by: Robert Varga <>
7 years agoMake private methods static 26/28726/5
Robert Varga [Fri, 23 Oct 2015 10:34:58 +0000 (12:34 +0200)]
Make private methods static

These methods do not reference object state and therefore can be made

Change-Id: I416e415b90647b4f700b7893fe4f64f479271fab
Signed-off-by: Robert Varga <>
7 years agoAdd getPeerIds to RaftActorContext 18/28718/6
Tom Pantelis [Fri, 23 Oct 2015 02:50:20 +0000 (22:50 -0400)]
Add getPeerIds to RaftActorContext

For upcoming to work to add voting status to the peer info in
RaftActorContext, I added a getPeerIds method to replace calls to
getPeerAddresses as virtually all callers really just want the IDs or want
to check the size. getPeerAddresses will (likely) be removed altogether -
this is a preliminary patch.

Change-Id: I2b6f2c36dfec14ccd4bbfef35e67ed86cf3e3e45
Signed-off-by: Tom Pantelis <>
7 years agoFix resource leaks in TransactionChainProxyTest 54/28754/2
Gary Wu [Fri, 23 Oct 2015 20:40:48 +0000 (13:40 -0700)]
Fix resource leaks in TransactionChainProxyTest

Close TransactionChainProxy objects (AutoCloseable)
that were not being closed in the test cases.

Change-Id: I85b1f951545b764007bdb2e808a2438c9bd4b2b2
Signed-off-by: Gary Wu <>
7 years agoupdate leveldbjni version to support Solaris 93/25693/2
rshoaib [Sat, 22 Aug 2015 06:24:57 +0000 (23:24 -0700)]
update leveldbjni version to support Solaris

Change-Id: I46de5b3cc9c220a70a408194fb3ff709cdff1937
Signed-off-by: rshoaib <>
7 years agoBug 2187: Code cleanup and refactoring 74/28674/5
Tom Pantelis [Wed, 21 Oct 2015 22:47:31 +0000 (18:47 -0400)]
Bug 2187: Code cleanup and refactoring

I addressed remaining comments from a prior patch.

I also refactored RaftActorServerConfigurationSupport to use an FSM
similar to the SnapshotManager with some generic classes. This will
make it easier to implement RemoveServer and reuse code.

Change-Id: Id3cdcede3f9c393c878abd3e9a9d3a5e12c5fb8a
Signed-off-by: Tom Pantelis <>
7 years agoRemove unused Jersey dependencies from the controller 40/28740/2
Ryan Goulding [Fri, 23 Oct 2015 15:19:11 +0000 (11:19 -0400)]
Remove unused Jersey dependencies from the controller

The code utilizing Jersey was moved to the netconf project.  This change
removes some of the deprecated dependencies.

Change-Id: I62b944497c976b1251412d8d047ef833e69dfb0a
Signed-off-by: Ryan Goulding <>
7 years agoRemove unnecessary @SuppressWarnings 43/28743/2
Gary Wu [Fri, 23 Oct 2015 16:44:06 +0000 (09:44 -0700)]
Remove unnecessary @SuppressWarnings

Change-Id: I2b59e7f29a15298c1135c12b6bd9699205706600
Signed-off-by: Gary Wu <>
7 years agoFix resource leaks in exception handling 09/28709/3
Gary Wu [Thu, 22 Oct 2015 20:01:13 +0000 (13:01 -0700)]
Fix resource leaks in exception handling

Fix resource leaks when exceptions are
encountered during ConfigManagerActivator.start().

Change-Id: Ic12c756aa5a768add0bc62e71eed94e5b2fa5fea
Signed-off-by: Gary Wu <>
7 years agoBug 4037: Allow auto-downed node to rejoin cluster 52/27852/8
Gary Wu [Fri, 2 Oct 2015 20:12:43 +0000 (13:12 -0700)]
Bug 4037: Allow auto-downed node to rejoin cluster

This patch will detect when a node has been
auto-downed/quarantined by another node. When this
happens, the ActorSystem of the datastore will be
restarted to allow the node to rejoin the cluster.

Change-Id: I0913bf455d426b6a0fccb17eac61b74f0911fa5d
Signed-off-by: Gary Wu <>
7 years agoBug 2187: AddServer unit test and bug fixes 63/28663/3
Tom Pantelis [Wed, 21 Oct 2015 09:02:17 +0000 (05:02 -0400)]
Bug 2187: AddServer unit test and bug fixes

Follow-up patch to

Got the unit tests working and added more unit tests to cover more code.

Also fixed several bugs in the code that were failing the tests. One bug
was caused by replicating data quickly after install snapshot was
complete. On the final install snapshot chunk the follower sends an
ApplySnaphot message to persist and apply the snapshot. On the reply,
the leader assumes the follower is up-to-date and sets its next index.
However, applying the snapshot, ie updating the log and commit index, is
actually done after the async callback from the snapshot persist. In between
that time, if the leader sends the server config AppendEntries, the follower's
log is still empty and it deems itself out-of-sync and reports back failure.
This will cause the leader to eventually send a new install snaphot
which isn't which is not desirable. Also it may delay consensus for the
server config entry.

To fix this, I delayed the final InstallSnapshotReply until after the
ApplySnapshot is complete. I did this by adding a Callback to the
ApplySnapshot message which the SnapshotManager invokes.

Also the new server config was constructed without the leader's ID - it
needs to contain all members.

Also the ServerConfigurationPayload wasn't being applied in the

Another issue was that, if the leader had no peers initially, the
heartbeat wasn't scheduled so, when the new server was added, heartbeats
weren't occurring. So I change addFollower to schedule the heartbeat.

I added a test for adding a non-voting server which caused an endless
loop in AbstractLeader#handleAppendEntriesReply where it updates the
commitIndex based on the replicated count. To fix this, I added a break
if the replicatedLogEntry is null.

Change-Id: I5dff351140c611d58357cd58900bed401606038c
Signed-off-by: Tom Pantelis <>
7 years agoBUG 2187 - JMX API for create/delete shard replica 42/27742/13
kalaiselvik [Thu, 22 Oct 2015 10:19:47 +0000 (15:49 +0530)]
BUG 2187 - JMX API for create/delete shard replica

Change-Id: I48a4dcb7983f5f231e9ddc04e851950abf7c2d8a
Signed-off-by: kalaiselvik <>
7 years agoBUG-2187: Add Server - Leader Implementation 18/28018/9
Rajesh_Sindagi [Tue, 20 Oct 2015 22:38:41 +0000 (15:38 -0700)]
BUG-2187: Add Server - Leader Implementation

Processes addServer request from the follower, forwards the request
to the shard leader, if not the leader.

The follower shard replica data is brought to sync with leader by installing the snapshot from the shard leader.
On sucessful application of snapshot data, this voting but not initialized member is transitioned to voting member.
New server configuration is persisted and replicated to majority of the followers and responds back with OK message to the shard follower.

In case where the leader is unable to sync data to the follower in a configured time period, TIMEOUT message is responded back to the shard follower without adding/persisting the new server configuration.

Change-Id: I9a3870d14bb6ad532ff64f315b2e2000d8b803e2
Signed-off-by: Rajesh_Sindagi <>
7 years agoAdd cluster config yang RPCs and provider wiring 66/28366/6
Tom Pantelis [Wed, 14 Oct 2015 01:53:48 +0000 (21:53 -0400)]
Add cluster config yang RPCs and provider wiring

Added experimental RPCs, including AddShardRelica, with initial empty
implementations that return unsupported.

Change-Id: Ie8587903920760fc4555bc009c81183e8d7740e4
Signed-off-by: Tom Pantelis <>
7 years agoFix DistributedDataStoreIntegrationTest failure 95/28395/3
Tom Pantelis [Wed, 14 Oct 2015 05:42:08 +0000 (01:42 -0400)]
Fix DistributedDataStoreIntegrationTest failure

Fixed a timing issue with a test just started causing failures pretty
regularly on jenkins builds for some reason.

Change-Id: I40273574376804034fd6f14f56384cb8cae26900
Signed-off-by: Tom Pantelis <>
7 years agoAdd missing dependencies 18/28318/2
Stephen Kitt [Tue, 13 Oct 2015 08:49:33 +0000 (10:49 +0200)]
Add missing dependencies

pax-url-aether provides javax.inject and commons-codec, but they need
to be declared separately for correctness and to allow upgrades to
newer versions of pax-url-aether. can be replaced by javax.inject.Inject.

Change-Id: I0a1da43faf0345bd71c2737caaa840c396bc60ab
Signed-off-by: Stephen Kitt <>
7 years agoFix ModuleFactory not found errors 11/28211/5
Tom Pantelis [Wed, 7 Oct 2015 18:24:40 +0000 (14:24 -0400)]
Fix ModuleFactory not found errors improvements to the
config system but had the side-effect of introducing timing issues where
a ModuleFactory wasn't found when trying to push a config. The reason is
that yang schemas load earlier and much quicker than ModuleFactory's,
which are scanned from ACTIVE bundles, so the capabilities may resolve
but a ModuleFactory may not be available yet. As a result, that patch
was partially reverted for the time being.

To fix the missing ModuleFactory issue, I added retries in the
ConfigPusherImpl when a ModuleFactory isn't found, similar to the
ConflictingVersionException retries. The backend now throws a new
checked exception, ModuleFactoryNotFoundException, which is caught to
trigger a retry after a delay. Prior, it threw an
InstanceNotFoundException which was wrapped in an
IllegalArgumentException. I didn't keep the InstanceNotFoundException
b/c it can be thrown for other reasons and I wanted to distinguish
missing ModuleFactoryNotFoundException.

I derived ModuleFactoryNotFoundException from RuntimeException to avoid
having to change signatures in the call chain and thus changing the API.
Prior it threw an unchecked IllegalArgumentException anyway so it's
consistent plus other areas of the code throw unchecked exceptions along
with checked exceptions.

Since the missing ModuleFactory issue is fixed, I re-enabled scanning of
RESOLVED bundles in the ModuleInfoBundleTracker.

Change-Id: I89ff346c0a89afdfa76ce402f2cf3211ac68b5c0
Signed-off-by: Tom Pantelis <>
7 years agoBUG 4151 : Create a shared actor system 62/27562/9
Moiz Raja [Tue, 29 Sep 2015 03:26:38 +0000 (20:26 -0700)]
BUG 4151 : Create a shared actor system

This patch adds an ActorSystemProvider interface in clustering commons
with a method to get a shard ActorSystem instance which uses the
clustered data store configuration as it contains more configuration
options than the rpc connector which pretty much uses stock configuration.
I added a config yang to define an actor-system-provider-service.

I added the ActorSystemProvider implementation and actor-system-provider-impl
config yang in the distributed datastore bundle. I tried it in
sal-clustering-commmons originally but ran into akka errors re: missing
config properties and it also couldn't find the
ReadyLocalTransactionSerializer class. So to avoid chasing down those
errors I put the implementation in sal-distributed-datastore. I think
this makes sense as it is the prime user of the actor system.

I added a dependency for the ActorSystemProvider service in both
datastores modules so the ActorSystem is now injected in and passed
to the DistributedDataStoreFactory. The dependency was also added to the
RPC mpdule.

Elements for the new actor system provider service and impl were added to
the 05-clustering.xml file along with the wiring changes for the data
stores and RPC modules.

Change-Id: I79c14f84c992a2d5ac9c1f1856efbaeba3cc2b77
Signed-off-by: Moiz Raja <>
7 years agoFix Eclipse compilation warnings. 30/28030/3
Gary Wu [Wed, 7 Oct 2015 20:54:41 +0000 (13:54 -0700)]
Fix Eclipse compilation warnings.

Fix compilation warnings in DistributedDataStoreTest
that DistributedDataStores were never closed.  Also fix
NPEs on closing DistributedDataStores when the
MXBeans are uninitialized.

Change-Id: I5dcaa389e1e69f934e9016933b00be3adaf4529f
Signed-off-by: Gary Wu <>
7 years agoRemove peer address cache in ShardInformation 60/27760/4
Tom Pantelis [Thu, 1 Oct 2015 13:27:40 +0000 (09:27 -0400)]
Remove peer address cache in ShardInformation

The ShardManager caches the peer addresses in the ShardInformation and
uses it mainly to suppress PeerUp, PeerDown and PeerAddressResolved
messages to the shard for peers that don't have replicas for the shard.

This is fine with static config but With the upcoming work to dynamically
add replicas, the shard will take ownership of persisting its peers so
the ShardManager will not know about dynamic peers.

I changed the semantics of the peer addresses to initial peer addresses.
They are now only used to pass to the Shard on creation. As a result,
PeerUp, PeerDown and PeerAddressResolved messages are now always sent to
the Shard for all peers. The Shard/RaftActor decide ll whether or not to
process the peer message. I changed RaftActorContextImpl#setPeerAddress
to ignore a peerId it doesn't know about instead of throwing an ex.

The other usages of the peerAddresses were to lookup the leader address.
This is now done dynamically via the ShardPeerAddressResolver.

Change-Id: Ida9738916a4a85d23198e7c095d5c73f17e2aa6c
Signed-off-by: Tom Pantelis <>
7 years agoPrepare for Karaf 3.0.4 upgrade 59/28059/2
Stephen Kitt [Thu, 8 Oct 2015 14:12:56 +0000 (16:12 +0200)]
Prepare for Karaf 3.0.4 upgrade

Pull in karaf.version from odlparent.
Drop import of org.apache.felix.service.command (apparently unused).

Change-Id: I6487ce1a52e6f51bbcdd4e332de18d4684782301
Signed-off-by: Stephen Kitt <>
7 years agoRefactor to fix unchecked cast warnings. 66/28166/3
Gary Wu [Thu, 8 Oct 2015 19:30:58 +0000 (12:30 -0700)]
Refactor to fix unchecked cast warnings.

Change-Id: I0fb6ce59707000f225ffa8d654685fbc89f8f2eb
Signed-off-by: Gary Wu <>
7 years agoFix Eclipse compilation warnings. 25/28025/2
Gary Wu [Wed, 7 Oct 2015 18:11:01 +0000 (11:11 -0700)]
Fix Eclipse compilation warnings.

Change-Id: I16921743a8cc4ac8902c1b7fffa2edfd8cba8be6
Signed-off-by: Gary Wu <>
7 years agoFix Eclipse compilation warnings. 21/28021/2
Gary Wu [Wed, 7 Oct 2015 17:32:54 +0000 (10:32 -0700)]
Fix Eclipse compilation warnings.

Change-Id: I2caddfded34638002b2e31bf4e99d1770dd03a00
Signed-off-by: Gary Wu <>
7 years agoReproduce bug 4359 78/27678/4
Moiz Raja [Wed, 30 Sep 2015 16:49:22 +0000 (09:49 -0700)]
Reproduce bug 4359

Added a couple of unit tests which demonstrates the problem
described in bug 4359 where upon recovery a node which
is previously deleted reappears on reapplying the

For some reason the problem is reproducible only when the
car is added and deleted twice and not once. I haven't
investigated why yet.

Change-Id: I5f5a656ef6fdc017a3342c8b409576a8b121b7f1
Signed-off-by: Moiz Raja <>
7 years agoPartial revert of 67/28067/2
Tom Pantelis [Wed, 7 Oct 2015 01:32:08 +0000 (21:32 -0400)]
Partial revert of

Patch made improvements
that significantly sped up config system boot and helped the SFC project
but a couple other projects are seeing a timing issue where a
ModuleFactory isn't found and the config pusher fails. This is due to
the speed up and that YangModuleInfo's are now scraped from RESOLVED bundles
and thus are available quicker but ModuleFactory's are scaped from
ACTIVE bundles.

While the ModuleFactory issue is addressed, I'll partially revert the
prior changes to go back to scanning ACTIVE bundles for YangModuleInfo.

Change-Id: Icd3a51a049a940ad60a4bd0071e3c969167275d3
Signed-off-by: Tom Pantelis <>
7 years agoAdd ShardPeerAddressResolver 06/27606/4
Tom Pantelis [Mon, 28 Sep 2015 00:14:45 +0000 (20:14 -0400)]
Add ShardPeerAddressResolver

Added a ShardPeerAddressResolver implementation that is passed to
Shard RaftActors to resolve addresses for shard peer ids. I refactored
ShardManager a bit to move the memberNameToAddress map and related code
to the ShardPeerAddressResolver.

Change-Id: I5cbef5816d9bf13a339e43008144f44fd55fc606
Signed-off-by: Tom Pantelis <>
7 years agoModify ModuleInfoBundleTracker to track RESOLVED bundles (round 2) 74/27874/4
Tom Pantelis [Fri, 2 Oct 2015 21:14:46 +0000 (17:14 -0400)]
Modify ModuleInfoBundleTracker to track RESOLVED bundles (round 2)

My first patch didn't
do well with the feature tests due the BundleContext bust wait so it
was reverted.

I went back to my original solution to confgure the ModuleInfoBundleTracker
to track RESOLVED and ModuleFactoryBundleTracker to track ACTIVE.
Originally when I tried that I had some failure due to the ModuleFactory
not loaded yet but I don't remember exactly what. This patch seems to work
fine - I've restarted karaf several times and also ran the tsdr features tests
several times successfully. Originally I did the first patch in stable/lithium
so maybe something else has changed in master or the way I did it wasn't right.

Since the initial yang module info's are now processed synchronously when the
BundleTracker is opened, I modified the ModuleInfoBundleTracker to
ensure it doesn't propagate runtime ex's. This would disrupt the
BundleTracker and the ConfigManagerActivator - if one module had an
issue the config manager wouldn't start.

For every YangModuleInfo scraped, it registers it with the
ModuleInfoRegistry. The backing impl is RefreshingSCPModuleInfoRegistry
which causes a new SchemaContext to be created from the current yang
models (via updateService). This isn't efficient - on startup, we'll get all
YangModuleInfo's in quick succession so, optimially, it should build the
SchemaContext once after open is complete. This is what the
GlobalBundleScanningSchemaServiceImpl does.

To accomplish this, I removed the call to updateService from
RefreshingSCPModuleInfoRegistry#registerModuleInfo - it is now
specifically called by ModuleInfoBundleTracker. This means the
ModuleInfoBundleTracker now references RefreshingSCPModuleInfoRegistry
instead of the ModuleInfoRegistry interface which makes it less clean.
Any other way would require changes to the ModuleInfoRegistry interface,
which I didn't want to do, or extending the interface which I didn't think that
was worth the effort. The RefreshingSCPModuleInfoRegistry is only used by

Change-Id: I20213ce8bd1dfc5109f3ef223cec8048bec92e12
Signed-off-by: Tom Pantelis <>
7 years agoFix DistributedEntityOwnershipIntegrationTest failure 24/28024/1
Tom Pantelis [Tue, 6 Oct 2015 13:43:55 +0000 (09:43 -0400)]
Fix DistributedEntityOwnershipIntegrationTest failure

Fixed intermittent failure due the follower2MockListener getting
an ownershipChanged with "false, false, true" if if the original
ownership change with "member-2 is replicated to follower2 after
the listener is registered. The test ran 100 times successfully.

Change-Id: I1f0333e3bc69cc28521bc7388d64b56d18b55544
Signed-off-by: Tom Pantelis <>
(cherry picked from commit de587f935016a300cdbeb85926c2eb677f383fc2)

7 years agoBug 4105: Fix intermittent failure in DistributedEntityOwnershipIntegrationTest 12/28012/1
Tom Pantelis [Sat, 12 Sep 2015 00:32:55 +0000 (20:32 -0400)]
Bug 4105: Fix intermittent failure in DistributedEntityOwnershipIntegrationTest

I saw a test filure on jenkins. After follower2 is stopped there will be
2 onOwnershipChange calls so the test needs to expect both.

Change-Id: I74dc583c2d40e966197315640eb189702fbabd64
Signed-off-by: Tom Pantelis <>
(cherry picked from commit a3a0417b0ee75f040fb4436602ed7ecf5585d44f)

7 years agoFix NPE in AbstractFeatureWrapper 71/27971/1
Tom Pantelis [Mon, 5 Oct 2015 16:10:23 +0000 (12:10 -0400)]
Fix NPE in AbstractFeatureWrapper

Added check in ChildAwareFeatureWrapper#getChildFeatures to verify the
feature exists in the FeaturesService to avoid NPE. This is a similar
workaround as was done in FeatureConfigPusher for a bug in karaf where
the FeaturesService may mysteriously return null for an existing feature.

Change-Id: I006cd012e919ac206d70bb4ee5754c72f0f01b32
Signed-off-by: Tom Pantelis <>
(cherry picked from commit e6076f69f57fe5918c66637414175c6229635841)

7 years agoInitial code for RaftActorServerConfigurationSupport 57/27557/7
Tom Pantelis [Sun, 27 Sep 2015 16:32:12 +0000 (12:32 -0400)]
Initial code for RaftActorServerConfigurationSupport

Added a RaftActorServerConfigurationSupport and unit test class with
mostly initial skeleton code. In RaftActorServerConfigurationSupport,
I implemented the basic checks for leader avaialbility with
corresponding unit tests. If not the leader and there is a leader, it
forwards to the remote leader. If no leader, it returns NO_LEADER

Also in RaftActorServerConfigurationSupport, I added code for the first
steps: add the serverId/address into the RaftActorContext peer map and
add a FollowerLogInformation entry in the AbstractLeader. I added an
initialized field wih getters/setters to FollowerLogInformation. The
entry is added with initialized set to false. I also changed the
followerToLogMap in AbstractLeader to mmutable.

I also modified FollowerLogInformationImpl so it returns false for
isFollowerActive and isOkToReplicate if initialized is false. The idea
is to prevent the leader from sending log entries or a snapshot via
the heartbeat or replication. The leader will send an empty
heartbeat which should be fine. The RaftActorServerConfigurationSupport
will initiate the install snapshot directly.

I added TODO comments in RaftActorServerConfigurationSupport and the
unit test class which outline the remaining work.

I also added the ServerConfigurationPayload class to be used for the log

Change-Id: Ic11ddc99a57edb7ef70c2d4f5fa7906d6a95b35e
Signed-off-by: Tom Pantelis <>
7 years agoReturn throwable in NeverReconnectStrategy 15/27915/2
Claudio D. Gasparini [Mon, 5 Oct 2015 13:36:00 +0000 (15:36 +0200)]
Return throwable in NeverReconnectStrategy

NeverReconnectStrategy returns empty throwable instead of
passed throwabled with the failed previous
connection reasons.

Change-Id: I5695af09379f06a66c37ccf27293ff85657afeaa
Signed-off-by: Claudio D. Gasparini <>
7 years agoAdd PeerAddressResolver for raft actor 88/27588/3
Tom Pantelis [Sun, 27 Sep 2015 21:09:14 +0000 (17:09 -0400)]
Add PeerAddressResolver for raft actor

For upcoming work to dynamically add peers, the peer address may not be
known and, if the cluster MemberUp has already occurred, no
UpdatePeerAddress message will be sent. We need to be bale to
dynamically resolve peer addresses so I added a new PeerAddressResolver
interface whose instance is obtained from the ConfigParams and used by
the RaftActorContextImpl..

Change-Id: I38807b4b6a59a7cb1359d85a9550cd6e98cb13a4
Signed-off-by: Tom Pantelis <>
7 years agoBUG-4367: Use SchemaSourceProvider to retrieve sources for yang 54/27654/8
Maros Marsalek [Wed, 30 Sep 2015 13:28:23 +0000 (15:28 +0200)]
BUG-4367: Use SchemaSourceProvider to retrieve sources for yang

- Not using schema context to provide the sources anymore.
- Transform the modules into capabilities in YangStoreService instead
  of requiring the listeners to do so

Change-Id: I39a144c7472f7944cca01eeff273058aa2fe7d7a
Signed-off-by: Maros Marsalek <>
7 years agoFixed DatastoreContext not found. 48/27848/1
Tony Tkacik [Fri, 2 Oct 2015 21:47:34 +0000 (23:47 +0200)]
Fixed DatastoreContext not found.

Change-Id: Iec5807fe0e9fb270a87095fe036a2a285d564642
Signed-off-by: Tony Tkacik <>
7 years agoSpeed up GlobalBundleScanningSchemaServiceImpl close 81/27781/1
Tom Pantelis [Thu, 1 Oct 2015 21:43:24 +0000 (17:43 -0400)]
Speed up GlobalBundleScanningSchemaServiceImpl close

On close, the GlobalBundleScanningSchemaServiceImpl closes the
BundleTracker which untracks all the bundles and notifies the listener
of removed bundles. This results in a call to tryToUpdateSchemaContext
which causes the remaining yang files to be re-parsed to build a new
SchemaContext. To prevent this extra processing on shutdown, I added
a "stopping" flag to elide tryToUpdateSchemaContext the same we do
with the "starting" flag.

Signed-off-by: Tom Pantelis <>
Change-Id: I9f7c05277df9bf1ffaec1c699453020312aab203

7 years agoRevert ModuleInfoBundleTracker patches 19/27719/1
Tom Pantelis [Thu, 1 Oct 2015 06:54:45 +0000 (02:54 -0400)]
Revert ModuleInfoBundleTracker patches

Reverted patch as it
causes some feature tests to take a long time due to the busy wait.
Also it appears the ModuleFactory OSGi services are needed as the
BlankTransactionServiceTracker listens for them (I'm not clear what this
does). I'll try to figure out another way to accomplish the intent
of the reverted patch.

Change-Id: Ifc91dada86ac7feee1a0a9390a55e68d7f113153
Signed-off-by: Tom Pantelis <>
7 years agoFix ModuleFactoryBundleTracker shutdown hang 26/27626/2
Tom Pantelis [Mon, 28 Sep 2015 07:49:46 +0000 (03:49 -0400)]
Fix ModuleFactoryBundleTracker shutdown hang

If karaf is shutdown quickly after starting, the
ModuleFactoryBundleTracker#getModuleFactoryEntries method may
hang for a while trying to obtain BundleContexts. This has
been seen on jenkins with some feature tests. The ModuleFactoryBundleTracker
does a 1 min busy wait trying to obtain the BundleContext. This was done b/c the
tracker listens for RESOLVED bundles and the BundleContext isn't available
until after the bundle is started. So the busy wait was intended for startup
when bundles transition from RESOLVED -> STARTING. Once obtained, the
BundleContext is cached.

This works fine normally when all bundles start up. However, if stopped
quickly, some bundles may not have started, ie they remain in the
RESOLVED state with null BundleContext, so on shutdown when someone
calls getModuleFactoryEntries, it will busy wait and eventually timeout which
can take minutes.

What we need to do is remove the ModuleFactory entries when bundles are
stopped. The ModuleFactoryBundleTracker#removedBundle method does this
but it wasn't called on shutdown b/c it tracks RESOLVED, STARTING, ACTIVE
and STOPPING states. The solution is to remove STOPPING from the tracked states
so removedBundle will get called on transition ACTIVE -> STOPPING.
However, when transition STOPPING -> RESOLVED occurs the bundle will get
added back to the tracker and we don't want to re-add the ModuleFactory
entries. To prevent this it checks for BundleEvent type STOPPED.

Change-Id: I82889a682809d4217dc4253eb60c922209ad7242
Signed-off-by: Tom Pantelis <>
7 years agoModify ModuleInfoBundleTracker to track RESOLVED bundles 38/27138/5
Tom Pantelis [Sun, 13 Sep 2015 03:55:29 +0000 (23:55 -0400)]
Modify ModuleInfoBundleTracker to track RESOLVED bundles

I've seen issues where a yang-generated class that exists in another
bundle isn't found on startup when a module config is pushed.
Specifically I've seen it when registering RPC implementations. The
BindingDOMRpcProviderServiceAdapter uses the
BindingToNormalizedNodeCodec get the RPC schema and it can fail to
get the RPC input class.

The BindingToNormalizedNodeCodec calls the BindingRuntimeContext to
obtain schema classes which in turn uses the ClassLoadingStrategy OSGi
service to load classes. The backing implementation of
ClassLoadingStrategy is the ModuleInfoBackedContext supplied by the
config manager bundle. This is backed by the ModuleInfoBundleTracker
which scrapes yang files from bundles. However it listens for ACTIVE
bundles. A while ago the GlobalBundleScanningSchemaServiceImpl was
(correctly) changed to listen for RESOLVED bundles which fixed startup
timing issues. It makes sense to also change the
ModuleInfoBundleTracker to listen for RESOLVED bundles so all existing
yang models are loaded on startup prior to use.

The ModuleFactoryBundleTracker piggy-backs the ModuleInfoBundleTracker
to load ModuleFactory instances needed by the config system. It
registers ModuleFactory instances as OSGi services, which are consumed by the
BundleContextBackedModuleFactoriesResolver, however this fails for a
RESOLVED bundle b/c it doesn't have a BundleContext yet (apparently this
is set when the bundle is started/activated). To fix this, I refactored
BundleContextBackedModuleFactoriesResolver and
ModuleFactoryBundleTracker a bit. The ModuleFactoryBundleTracker no
longer registers ModuleFactory instances as OSGi services. Instead it
maintains a list of ModuleFactory/Bundle entries which the
BundleContextBackedModuleFactoriesResolver directly uses to build the
resulting factories map for the ConfigRegistry. A bundle may still not
have a BundleContext at that point so, to safe guard against that, I
added a busy wait for BundleContext.

Change-Id: Ia7bd39f635e3473e6e84011163a0768865c9a931
Signed-off-by: Tom Pantelis <>
7 years agoAdd election info to Snapshot 95/27495/6
Tom Pantelis [Sat, 26 Sep 2015 15:13:06 +0000 (11:13 -0400)]
Add election info to Snapshot

When a snaphot is saved we delete all prior applied data entries from
the journal. However this also has the side-effect of also deleting prior
UpdateElectionTerm entries so, on restart, we lose the election term
info. We need to persist the election term wih the Snapshot.

Change-Id: I0ed140de1868cc03a28cfbc1d6eb909fe4dbc252
Signed-off-by: Tom Pantelis <>
7 years agoAdd Raft AddServer message and reply 14/27514/4
Tom Pantelis [Sun, 27 Sep 2015 01:35:54 +0000 (21:35 -0400)]
Add Raft AddServer message and reply

Change-Id: I59499ab0f0b7c202a309af0412a0c0ae38494d8b
Signed-off-by: Tom Pantelis <>
7 years agoAdd getOwnershipState method to EntityOwnershipService 51/27551/2
Tom Pantelis [Fri, 25 Sep 2015 02:05:24 +0000 (22:05 -0400)]
Add getOwnershipState method to EntityOwnershipService

Added a new method to gte the current ownership state for an entity.
This was requested for OF clustering.

The DistributedEntityOwnershipService obtains the EntityOwnershipShard's
DataTree via a new message GetShardDataTree and reads the entity's owner
leaf in order to build the resulting EntityOwnershipState. The DataTree
is obtained once and cached.

Change-Id: Ib4aa2f4e5370d8d5183908b836417936a51458f7
Signed-off-by: Tom Pantelis <>
(cherry picked from commit dd6976c24f12c7cef7bed8fa6bc645dc699dda4f)

7 years agoYangInstanceIdentifier::toInstance() -> build() 31/27531/2
Stephen Kitt [Mon, 28 Sep 2015 12:25:07 +0000 (14:25 +0200)]
YangInstanceIdentifier::toInstance() -> build()

::toInstance() is gone, which breaks the build.

Change-Id: I51662dd351bf5b02441f58291e85e0e1729d7785
Signed-off-by: Stephen Kitt <>
7 years agoAlways persist and recover election term info 91/27491/9
Tom Pantelis [Sat, 26 Sep 2015 11:27:52 +0000 (07:27 -0400)]
Always persist and recover election term info

With data persistence disabled, this also disabled persistence/recovery
of election term info. This was an oversight - we need to persist and
recover election term info regardless.

Change-Id: I48d33ca5d3b7d95e2aeb8ed7f9c8d5f1aa401ece
Signed-off-by: Tom Pantelis <>
7 years agoRevert "Remove obsolete artifacts from commons.opendaylight" 67/27467/2
Venkatrangan Govindarajan [Fri, 25 Sep 2015 20:29:04 +0000 (20:29 +0000)]
Revert "Remove obsolete artifacts from commons.opendaylight"

This reverts commit 0ff87783a0fb2ab7bd60daf4a399bb8933af244a.

Change-Id: Id9151032657453c816b3dab63bb8982e4b2e8030
Signed-off-by: gvrangan <>
7 years agoRemoved properties from parent pom. 70/26970/4
Tony Tkacik [Tue, 15 Sep 2015 09:45:29 +0000 (11:45 +0200)]
Removed properties from parent pom.

Change-Id: I0b5836369b8be33c88abd491a644364d9c92be55
Signed-off-by: Tony Tkacik <>
7 years agoRemoved unnecessary commons.parent. 69/26969/4
Tony Tkacik [Tue, 15 Sep 2015 09:18:56 +0000 (11:18 +0200)]
Removed unnecessary commons.parent.

Change-Id: Idc3dcdf859bd11edb53a5faa641206a8d9fac1c0
Signed-off-by: Tony Tkacik <>
7 years agoBug 4327 - Fixed DataTreeChangeListener registration in PingPongDataBroker 96/27296/3
Michal Polkorab [Tue, 22 Sep 2015 14:34:06 +0000 (16:34 +0200)]
Bug 4327 - Fixed DataTreeChangeListener registration in PingPongDataBroker

 - delegate broker was incorrectly queried for DOMDataTreeChangeService
 - it must ask for supported extensions instead of instanceof
 - this is lithium branch fix,
   beryllium change:

Change-Id: Ie1757c762018e7188d76a7728f2f8ea52293d73f
Signed-off-by: Michal Polkorab <>
7 years agoRemove expensive uses of Calendar.getInstance() 81/25981/3
Stephen Kitt [Tue, 25 Aug 2015 16:07:50 +0000 (18:07 +0200)]
Remove expensive uses of Calendar.getInstance()

nanoTime() is used instead of currentTimeMillis() to avoid issues with
leap seconds.

Change-Id: Idbfcd994424c91a384c47fe0ad12bc6a7ea33972
Signed-off-by: Stephen Kitt <>
7 years agoRemove obsolete artifacts from commons.opendaylight 89/27189/2
Stephen Kitt [Fri, 18 Sep 2015 14:39:47 +0000 (16:39 +0200)]
Remove obsolete artifacts from commons.opendaylight

commons.opendaylight includes a few obsolete artifacts in its
dependency management: features-base, features-adsal, and
features-nsf. This patch removes them.

Change-Id: Ief98dce25d66439fea23e231470583b971f27756
Signed-off-by: Stephen Kitt <>
7 years agoBug 4202: Migrate also toaster to use mdsal project 69/27369/1
Vratko Polak [Wed, 23 Sep 2015 17:33:28 +0000 (19:33 +0200)]
Bug 4202: Migrate also toaster to use mdsal project

This only changes dependency feature omitted from Change 26079,
perhaps Java edits are also needed to keep toaster working.

Also, git has somehow enforced change of line endings everywhere.

Change-Id: I810fba0ae7a55e123dd6f78ba23a7e77a7118b57
Signed-off-by: Vratko Polak <>
7 years agoBug 4202 - Migrate archetypes to use MD-SAL Project 50/27250/1
adetalhouet [Tue, 22 Sep 2015 01:41:31 +0000 (21:41 -0400)]
Bug 4202 - Migrate archetypes to use MD-SAL Project

Change-Id: Ic5fa0913c3332a20cbe97bc4c6ea64edc7549a1d
Signed-off-by: adetalhouet <>
7 years agoBUG-865: remove YangInstanceIdentifier.toInstance() 63/27163/1
Robert Varga [Fri, 18 Sep 2015 13:59:48 +0000 (15:59 +0200)]
BUG-865: remove YangInstanceIdentifier.toInstance()

This removes the use of a deprecated method.

Change-Id: I46f9a3e3a8c9741fa603aa04e2673a13c6fb5c92
Signed-off-by: Robert Varga <>
7 years agoAdd test scope to karaf-empty artifact in akka feature test pom 49/27149/3
Tomas Cere [Fri, 18 Sep 2015 09:11:09 +0000 (11:11 +0200)]
Add test scope to karaf-empty artifact in akka feature test pom

Change-Id: Ida85537eac861814bf4d137718d4a168036dcc1f
Signed-off-by: Tomas Cere <>
7 years agoAdd "documentation" flags for WriteTransaction 98/25398/6
Stephen Kitt [Tue, 18 Aug 2015 08:37:53 +0000 (10:37 +0200)]
Add "documentation" flags for WriteTransaction

In WriteTransaction, the createMissingParents argument to put() and
merge() is a boolean, which results in code like

    ...put(store, path, data, true);

which isn't immediately readable to neophytes. This patch adds two
client code can be written as

    ...put(store, path, data, CREATE_MISSING_PARENTS);

instead (but without introducing an enum).

The FAIL_ON_MISSING_PARENTS constant also documents the behaviour in
the other path; I named it based on the pre-condition check in
AbstractWriteTransaction (which results in an IllegalArgumentException
if a parent is missing).

Change-Id: Ic95b5e4f3d8574f0014cdf6a00a77013b94b00cc
Signed-off-by: Stephen Kitt <>
7 years agoYang code generator cleanup 70/25570/5
Stephen Kitt [Fri, 21 Aug 2015 11:26:10 +0000 (13:26 +0200)]
Yang code generator cleanup

Two axes:
* make the generated code slightly better
* make the generator code slightly better

Fixes in generator code:
* fields which can be local variables
* map overwrite detection using put()'s return value
* logging with exceptions
* using File's parent/child handling instead of concatenating strings
* if (condition) { return true; } else { return false; }
* if (... == false) -> if (!...)
* interface method declarations are public by default
* Collections.singletonList() instead of Arrays.asList() for
  single-item collections
* StringBuilder instead of StringBuffer
* String concatenation instead of straight-forward StringBuilder
  (i.e. non-conditional append() calls)
* typos: hierarchchical -> hierarchical, intends -> indents
* drop unused parameter from
* when processing only values in a map, use .values() rather than
* split StringBuilder::append(a + b) into two ::append() calls
* clean up the method parameter construction in MethodSerializer (to
  avoid deleting the ", " at the end)

Fixes in generated code:
* use { } as requested the Checkstyle rules
* handle empty service interface sets explicitly

It would be nice to use the <> operator without specifying the type
where possible, but the Eclipse AST parser used in the unit tests is
too old for this (so the generated code is correct and works
elsewhere, but fails the unit tests).

Change-Id: I725ce8d98f9ee389d394772733663ecacaccf8fa
Signed-off-by: Stephen Kitt <>
7 years agoBug 4317: Added the version of yang-maven-plugin. 13/27013/2
Hideyuki Tai [Tue, 15 Sep 2015 18:45:35 +0000 (11:45 -0700)]
Bug 4317: Added the version of yang-maven-plugin.

In the pom.xml of config-parent, the version of yang-maven-plugin was
missing. In the result, Maven downloaded the latest release version
(0.7.1-Lithium-SR1) of yang-maven-plugin, although the latest SNAPSHOT
version (0.8.0-SNAPSHOT) was expected here.
This patch added the version of yang-maven-plugin, and specified the
latest SNAPSHOT version for it.

Change-Id: I9a30aa4fc3c80d81c9342664135be484a219493d
Signed-off-by: Hideyuki Tai <>
7 years agoSplit {copyright} into {copyright-year} and {copyright} 41/26941/5
Flavio Fernandes [Mon, 14 Sep 2015 21:53:17 +0000 (17:53 -0400)]
Split {copyright} into {copyright-year} and {copyright}

With this change, archetype will explicitly use year for copyright to
ensure check style does not fail.

Patch set 3: replace (c) with © symbol
Patch set 4: add default values for copyright-year and version

Change-Id: I5b4bdfc273d578afafd7555a96e5a1fe732677bb
Signed-off-by: Flavio Fernandes <>
7 years agoBUG-2399: take into account new ModificationTypes 10/27110/5
Robert Varga [Thu, 17 Sep 2015 03:42:46 +0000 (05:42 +0200)]
BUG-2399: take into account new ModificationTypes

When structural containers come and go we can see APPEARED/DISAPPEARED

Patch set 5: fix build

Change-Id: Ic3da43398163a01e21adc013586949026075e3c0
Signed-off-by: Robert Varga <>
7 years agoFixed properties not expanded in features.xml 35/27135/3
Tony Tkacik [Thu, 17 Sep 2015 18:40:58 +0000 (20:40 +0200)]
Fixed properties not expanded in features.xml

Change-Id: I8bf4c30be1e6c427cfd9aff8afe5f465a666dc22
Signed-off-by: Tony Tkacik <>
7 years agoBug-4214 - Add support for configurable snapshot chunk size. 13/26413/3
Shaleen Saxena [Mon, 31 Aug 2015 02:25:19 +0000 (22:25 -0400)]
Bug-4214 - Add support for configurable snapshot chunk size.

Added a new variable in the distributed-datastore-provider.yang. This
will be used to configure the snapshot chunk size. Added various
setters/getters to the DatastoreContext. The support for this variable
was added to JMX as well, so that the value can be seen via JConsole.
Moreover, added tests in DatastoreContextTest.

Also fixed a recurring typo in sal-akka-raft. Snapshot was spelled as
snaphot (missing s in shot).

This code was unit tested with different entries in datastore.cfg. Also
tested the case where no special value was provided in datastore.cfg,
and the default value was shown in jconsole.

Change-Id: Ie754075cc25f9eadf01cc65aee726735144c1794
Signed-off-by: Shaleen Saxena <>
(cherry picked from commit f3c38988cc31e07bab473cace946aebf5152c61f)

7 years agoBug 4202: Migration to use mdsal project 79/26079/14
Tony Tkacik [Mon, 7 Sep 2015 10:30:22 +0000 (12:30 +0200)]
Bug 4202: Migration to use mdsal project

Migrated controller to use MD-SAL provided
Java Binding instead of YANG-Tools provided JAVA

This migration deals only with compile time and
in runtime.

Updated following features
  - features-config
  - features-config-netty
  - features-config-persister
  - features-mdsal
  - features-extras
  - features-protocol-framework

to use
  - Java Binding hosted in MD-SAL project
  - features-parent from odlparent

Change-Id: Iba40d74d118e212c9a57fa28711bbbe339fe1bbd
Signed-off-by: Tony Tkacik <>
7 years agoBUG-865: remove the use of ModificationType.MERGE 07/27107/2
Robert Varga [Thu, 17 Sep 2015 03:34:55 +0000 (05:34 +0200)]
BUG-865: remove the use of ModificationType.MERGE

This event is deprecated and is not produced, remove references to it.

Change-Id: I181168a923929a53806164b5ffd530db2c18c299
Signed-off-by: Robert Varga <>
7 years agoBUG 2298: Ask Git to normalize line endings 66/12466/4
Jozef Behran [Mon, 3 Nov 2014 15:08:07 +0000 (16:08 +0100)]
BUG 2298: Ask Git to normalize line endings

Added file attributes configuration file to make GIT aware
of which files are textual and which are binary and allow
it to normalize the line endings in the textual files
without the developers needing to do any special setup on
their Git installation.

Change-Id: I2d4e9fb4eeeab2893209741781e13c7cdfe1b01d
Signed-off-by: Jozef Behran <>
7 years agoRemove sonar.branch property 77/26277/3
Thanh Ha [Tue, 1 Sep 2015 16:48:23 +0000 (12:48 -0400)]
Remove sonar.branch property

This property isn't being used and actually causes build failure in
Sonar 5.x.

Change-Id: Ie3e25b0ed17d699305bc860fdd8a7f12c03d50d8
Signed-off-by: Thanh Ha <>
7 years agoUpgrade archetype-packaging plugin to 2.4 56/26956/2
Stephen Kitt [Tue, 15 Sep 2015 07:01:18 +0000 (09:01 +0200)]
Upgrade archetype-packaging plugin to 2.4

Change-Id: I97ffeb769cbba79389859405e8898c9dd88a1527
Signed-off-by: Stephen Kitt <>
7 years agoFuture-proof the dummy JAR construction 59/26859/3
Stephen Kitt [Fri, 11 Sep 2015 15:48:08 +0000 (17:48 +0200)]
Future-proof the dummy JAR construction

The shade plugin needs a JAR, and the contents of the project
contribute to a standard JAR rather than a test JAR. Add a JAR goal to
the maven-jar-plugin so the shade plugin can find its artifact
(otherwise the build breaks with forthcoming version upgrades).

Change-Id: If4853eb81208134d536040de8e6e934b38ef762f
Signed-off-by: Stephen Kitt <>
7 years agoBUG-865: remove use of DefaultDataTreeCandidate 51/27051/1
Robert Varga [Wed, 16 Sep 2015 12:52:03 +0000 (14:52 +0200)]
BUG-865: remove use of DefaultDataTreeCandidate

The functionality is available via utility method in DataTreeCandidates,
so use that instead.

Change-Id: I44bab58e39ad226c198f3ada1140152be1e4b4aa
Signed-off-by: Robert Varga <>
7 years agoBUG-865; do not use DurationStatsTracker 46/27046/1
Robert Varga [Wed, 16 Sep 2015 12:40:22 +0000 (14:40 +0200)]
BUG-865; do not use DurationStatsTracker

The class has been deprecated, use the alternative.

Change-Id: I29bd049450c0d5e6b3c2a8801538213c58f37c62
Signed-off-by: Robert Varga <>
7 years agoBug 4105: Remove EntityOwnershipCandidate 50/26950/2
Tom Pantelis [Fri, 11 Sep 2015 20:13:24 +0000 (16:13 -0400)]
Bug 4105: Remove EntityOwnershipCandidate

It was decided that we really don't need to pass an
EntityOwnershipCandidate listener when registering a candidate. Since
apps would most likely create a singleton EntityOwnershipCandidate for
all registerCandidate calls, they might as well register the singleton
listener once via registerListener. This simplifies the interface and
also simplifies OF clustering b/c they need an EntityOwnershipListener
anyway for device node cleanup.

Change-Id: I9fb7d68c1ffbf932c9d0e18efef604c1b05fdf96
Signed-off-by: Tom Pantelis <>
(cherry picked from commit 6b0f9975b09044b7c3c8877ae2d2d06f0a29894a)

7 years agoBug 4094: Fix DCNs on initial registration 49/26949/2
Tom Pantelis [Wed, 19 Aug 2015 02:07:52 +0000 (22:07 -0400)]
Bug 4094: Fix DCNs on initial registration

For DataChangeListener, I modified the code to use a
ResolveDataChangeEventsTask to resolve the initial changed event. It
was noted in Bug 4094 to read the registration path up to the first
wildcard. However this did not work. ResolveDataChangeEventsTask
expects the candidate root path and "after" data to be the tree root
to match the structure of the ListenerTree. When a transaction is
committed, the resulting DataTreeCandidate always points to the root.
So I had to read the root path in ShardDataTree. I could've optimized
for non-wildcarded path registrations but I think wildcarded path
registrations will be the norm anyway.

I added a new method, notifyOfInitialData, in ShardDataTree. Because I
had to create a new ListenerTree with the single registration, I
needed to know the path and scope of the original registration so I
changed several method signatures from the general ListenerRegistration
to the specific DataChangeListenerRegistration which provides access to
the path and scope. However we also have an actor class by that name so
to avoid confusion I renamed the actor class to

DataTreeChangeListener was implemented similarly.

Change-Id: I0ab88d0991761c058b6af81d6d26402ff370b78e
Signed-off-by: Tom Pantelis <>
(cherry picked from commit 0a7e13a8c7fed697800c792698cfef32b2ef0d11)

7 years agoRemove sal-rest-connector artifacts 18/26818/4
Thanh Ha [Fri, 11 Sep 2015 05:41:08 +0000 (01:41 -0400)]
Remove sal-rest-connector artifacts

Bug: 4292
Change-Id: I1601e55765c0a5664c1b0cb3e0ef261a0d522f59
Signed-off-by: Thanh Ha <>
7 years agoFixed relativePaths. 97/26597/5
Tony Tkacik [Mon, 7 Sep 2015 10:30:22 +0000 (12:30 +0200)]
Fixed relativePaths.

Change-Id: I12ba628df83fc0fb7d472039bc3c3002e9708f87
Signed-off-by: Tony Tkacik <>
7 years agoBug 4105: Add hasOwner param to EntityOwnershipListener#ownershipChanged 98/26898/2
Tom Pantelis [Fri, 11 Sep 2015 04:13:51 +0000 (00:13 -0400)]
Bug 4105: Add hasOwner param to EntityOwnershipListener#ownershipChanged

OF clustering needs to know when the last candidate is removed for an
entity so it can clean up inventory. We decided to add a new param,
hasOwner, passed to EntityOwnershipListener#ownershipChanged to indicate if
there is at least one remaining candidate and current owner when a
controller node loses ownership. So if
wasOwner=true && isOwner=false && hasOwner=false, the OF code can
remove the device node from inventory.

To simplify the EntityOwnershipListener#ownershipChanged interface and
to allow for possible future parameters w/o breaking the interface, the
parameters are now encapsulated in an EntityOwnershipChanged DTO. There
already was the same EntityOwnershipChanged class in
sal-distributed-datastore - this class was removed.

Change-Id: I07375f154ac55d34062380ad6d0b30d970bd28e7
Signed-off-by: Tom Pantelis <>
(cherry picked from commit 061d4edabfb421ec79d1dc7afe4163aa52828450)

7 years agoDo not override dependency plugin version 40/26240/3
Robert Varga [Mon, 31 Aug 2015 15:16:50 +0000 (17:16 +0200)]
Do not override dependency plugin version

Version 2.6 is ancient and does not work at least here. Remove the
explicit override and inherit the version from odlparent.

Change-Id: Iabd3a603ae9d2faf0fe2a4c7d8ce43b0cc9428ae
Signed-off-by: Robert Varga <>
7 years agoBUG 4291 : odl-clustering-test-app feature must depend on odl-mdsal-broker 31/26831/1
Moiz Raja [Fri, 11 Sep 2015 01:33:38 +0000 (18:33 -0700)]
BUG 4291 : odl-clustering-test-app feature must depend on odl-mdsal-broker

When odl-clustering-test-app feature depends on odl-mdsal-broker-local the
distributed-entity-ownership service does not get resolved.

Change-Id: I0240ea6b210ec5966f680f786a706365b4f6502c
Signed-off-by: Moiz Raja <>
(cherry picked from commit b079e20e9a9f3ac133f4b5871d6c9158d016ab6a)

7 years agoBug 4105: Fixed feature test failure due to missing dependency. 22/26822/1
Shigeru Yasuda [Fri, 11 Sep 2015 08:06:51 +0000 (17:06 +0900)]
Bug 4105: Fixed feature test failure due to missing dependency.

features-mdsal was missing dependency on sal-clustering-config
(type=xml, classifier=entityownershipconfig).

Change-Id: Ifa1380a1071ae3c7b730e79c4e1c8ff09dbe15e2
Signed-off-by: Shigeru Yasuda <>
7 years agoBug 4105: Remove candidates on PeerDown 08/26808/1
Tom Pantelis [Tue, 18 Aug 2015 06:59:47 +0000 (02:59 -0400)]
Bug 4105: Remove candidates on PeerDown

Currently on PeerDown, the EntityOwnershipShard selects a new owner for
the entities owned by the down node and leaves the down node as a
candidate. If the down node is the only candidate, the owner is cleared.
On PeerUp, it selects a new owner for those entities whose owner is clear.
This was done to handle network partition so a node's candidates remain
registered and are re-assigned when the partition is healed.

Howver this has potential issues when a node is actually
stopped/restarted. It's possible, on restart, that the node doesn't
register a candidate for an entity that it had previously registered for.
So it may get ownership of an entity for which it has no registered

To alleviate this, I changed it to remove all the down node's candidates
on PeerDown. If the node was stopped/restarted, then it will
re-register candidates based on local client requests. This case will be
the norm. To handle network partition, when healed, the follower node
will get the replicated commits for its candidate removals from the
leader. So on Candidate removed, it re-adds its removed candidate if it
has a registered EntityOwnershipCandidate.

I realized that one can register a DOMDataTreeChangeListener for a leaf
node. So I simplified EntityOwnerChangeListener to listen for the owner
leaf instead of the entity path. This avoids the extra notifications
when candidayes are added/removed. I actually did this originally b/c I
thought there was a bug when listening at the entity level which turned
out there wasn't but I left it in as an improvement.

I also added the shard's logId to the listener and support classes for
better debugging of unit tests.

Change-Id: I75d2567ce54b9129eee052ba521c8a71777289b6
Signed-off-by: Tom Pantelis <>