Initial Configuration for Clustering

To try out clustering do the following,

1. Rename configuration/initial/05-clustering.xml.conf to configuration/initial/05-clustering.xml
2. Run the controller with these options

    ./run.sh -XX:MaxPermSize=512m

Change-Id: I61ede6cc083ce5fc722c44f0c127f4a03e2869d0
Signed-off-by: Moiz Raja <moraja@cisco.com>
Fixed issue where a shard for a defined module is not found

Change-Id: I5f6c82ce39f900a55519ec04a739a83ccb834e59
Signed-off-by: Moiz Raja <moraja@cisco.com>
Do not encode/decode DataChange registrations and notifications

DataChange notifications are never sent over the wire so they do not need
to be proto-buf encoded/decoded

Change-Id: Ief591bb2a2a17039c9b3ae21379eea3d562f4d98
Signed-off-by: Moiz Raja <moraja@cisco.com>
Tune replication and stabilize tests

Made following changes for replication
- Increased Heartbeat timeout to 500 milliseconds.
- Send only one entry from the replicated log to the follower in append entries

Both of these tweaks have been made to prevent election timeouts and frequent switching of leaders

Changes to tests
- Added a duration when constructing an ExpectMsg. This prevents ExpectMsg from waiting forever when
  and expected event does not occur
- Removed all Thread.sleep from the tests and replace them with waiting for a specific LogEvent this is
  a more deterministic.

Change-Id: Ie9ce0c9c73bf1b170a78879b1e2dab76f1de64df
Signed-off-by: Moiz Raja <moraja@cisco.com>
Expose the Raft State of a Shard and the name of it's Leader via JMX

Change-Id: Id8b57706902e93e0021db44533622fde283d82b4
Signed-off-by: Moiz Raja <moraja@cisco.com>