Refactor DataPersistenceProviders and RaftActor#persistence 06/17206/6
authorTom Pantelis <tpanteli@brocade.com>
Thu, 26 Mar 2015 02:22:45 +0000 (22:22 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Thu, 26 Mar 2015 08:59:57 +0000 (04:59 -0400)
commitfaad081396a7c6489d234809ca9446ab96d14504
treec66d2b3dfdfcb4e2b6d72b129d03ce22ee3f5bc9
parent84df20a29292cfb9f52acb0e0a2ebab2b996aa0b
Refactor DataPersistenceProviders and RaftActor#persistence

Refactored protected DataPersistenceProvider inner class impls to new
files for reuse in unit tests and to reduce inner code.

Also modified RaftActor so the DataPersistenceProvider is set rather
than having derived classes provide via the persistence() abstract method.
This makes it a little easier for derived RaftActors in that they don't
have to maintain a field and easier for unit tests to change the
DataPersistenceProvider impl.

Added a DelegatingPersistentDataProvider that holds the actual impl for
RaftActor. This allows the DataPersistenceProvider to be passed to
internal helper classes without having to update them if the underlyting
impl is changed.

These changes will facilitate further refactoring of code in RaftActor
into separate classes to simplify it.

Change-Id: I520b0d83635356f195e6bff33e44ac8f49e793cf
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/RaftActor.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/AbstractRaftActorIntegrationTest.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/DelegatingPersistentDataProvider.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/NonPersistentDataProvider.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/PersistentDataProvider.java [new file with mode: 0644]
opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/common/actor/AbstractUntypedPersistentActor.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/Shard.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardManager.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java