Bug 5740: Add ControlMessage interface to raft messages Added 'implements ControlMessage' for all RaftRPCs and other messages related to raft that should have higher priority. Change-Id: Ie699531ef67d9cbcf7cbdec0422dd2e6faafebaa Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Bug 5740: Remove Serializable where not necessary Some raft message classes are Serializable but they don't need to be as they're only sent locally. Change-Id: Ibd052b9a4589dd2476b30c51e301b3dd609df750 Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
Fix incorrect readResolve signatures In several Serializable classes the return type of the readResolve method is the class. However this is incorrect - the return type must be Object or it is not recognized by the serialization framework. Eclipse actually flags the incorrect signature with the "unused" warning but the warning was suppressed in the code. Using the correct Object return type, Eclipse doesn't issue the warning. Change-Id: Id53182925fa48879f1f754c3f25361fb846b23ca Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
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 <rovarga@cisco.com>
Add serialVersionUID to Serializable classes Each serializable class withouth serialVersionUID produces an eclipse warning. It also means that the class has undefined versioning and cannot be be upgraded -- this patch fixes all such classes. Change-Id: I57696f47b312517acd44799e10850f4887dab2e5 Signed-off-by: Robert Varga <rovarga@cisco.com>
Add replication capability to Shard This commit integrates the distributed data store with our Raft implementation. Shard now extends RaftActor which provides it the replication capabilities required. Other notable changes are, - The FindPrimary algorithm has been changed to find the first replica for a shard. The shard then forwards requests to create a transaction or transaction chain to the leader - Changed the package name for Raft internal messages from "internal" to "base" to be more BND tool friendly - Fix some issues with Serialization of Raft messages - Create a NoOpTransaction when no Primary can be found. The commit for this transaction will always fail. The NoOpTransaction returns absent for reads in all cases. - Add PeerAddressResolution capability to Raft. What this basically does is given a static configuration where a shard has 'n' peers, you can pass the names of those peers to the shard and resolve their addresses at a later time. This allows the Shard to ensure consensus even in a situation where it is the first one to come up but it's peers are still not running Change-Id: I3087deb5eb4418cd629a707ba14f43858db1f463 Signed-off-by: Moiz Raja <moraja@cisco.com>