BUG 2185 : Make the Custom Raft Policy externally configurable 10/24810/4
authorMoiz Raja <moraja@cisco.com>
Wed, 22 Jul 2015 02:11:10 +0000 (19:11 -0700)
committerGerrit Code Review <gerrit@opendaylight.org>
Tue, 1 Sep 2015 19:32:46 +0000 (19:32 +0000)
commite08568ddef3a5455b6b477e6672b8629f6935c20
tree02d0cf2ff7599a5c71e26d03ad40302e32979762
parente22f23e06c02a9a70b7c72a269df86cc2407ffc5
BUG 2185 : Make the Custom Raft Policy externally configurable

A class which implements RaftPolicy needs to be set
to customize the behavior. I am hoping that this will be a barrier
to people unintentionally breaking the default raft policy as
they would need to know the internals of clustering in order to
supply a valid class.

I added two configurable raft policy classes for the two known
use cases,

- org.opendaylight.controller.cluster.datastore.policy.TestOnlyRaftPolicy
- org.opendaylight.controller.cluster.datastore.policy.TwoNodeClusterRaftPolicy.

Change-Id: Ic3cc2f27754c37e85c3be8a863764fc88ec84399
Signed-off-by: Moiz Raja <moraja@cisco.com>
(cherry picked from commit 1ef2f7321202ef77b5cfd0ca430e6a58cb07331e)
12 files changed:
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/ConfigParams.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImpl.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActorContextImpl.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/DefaultConfigParamsImplTest.java [new file with mode: 0644]
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/policy/TestRaftPolicy.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/datastore.cfg
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContext.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/policy/TestOnlyRaftPolicy.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/policy/TwoNodeClusterRaftPolicy.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedConfigDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/distributed_datastore_provider/DistributedOperationalDataStoreProviderModule.java
opendaylight/md-sal/sal-distributed-datastore/src/main/yang/distributed-datastore-provider.yang