Bug 2264: Use streaming for snapshots 20/14620/3
authortpantelis <tpanteli@brocade.com>
Thu, 29 Jan 2015 13:35:59 +0000 (08:35 -0500)
committertpantelis <tpanteli@brocade.com>
Sun, 1 Feb 2015 17:15:13 +0000 (12:15 -0500)
commitcfc94248aa44307e7dc9aaefcb6748c478f93138
tree9eee92d8b68a790706d22d1ab5dc05cbccc73951
parent0d4c11af06567b4692b8894bbe2cac16cb4db0ad
Bug 2264: Use streaming for snapshots

The NormalizedNode snapshot payload is now streamed.

On the Shard side, added a new message CreateSnapsot to the
ShardReadTransaction to read the data tree root, serialize it, and
return a CaptureSnapshotReply message. On createSnapshot, the Shard
now sends the CreateSnapsot message to the read-only tx actor instead
of a ReadData message. This moves the serialization out of the Shard.

On the RaftActor side, the Snapshot class remained the same as it stores
a byte[] and is already Serializable. The CaptureSnapshotReply now
stores a byte[] instead of ByteString. The internal RaftActor code for
capture and apply snapshot was changed to use/pass byte[] to eliminate
the overhead of converting to/from ByteString.

Change-Id: Id12677441dce54bebbb5b71c68cf457d7c915ba1
Signed-off-by: tpantelis <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/main/java/org/opendaylight/controller/cluster/raft/base/messages/CaptureSnapshotReply.java
opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.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/ShardReadTransaction.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardRecoveryCoordinator.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateSnapshot.java [new file with mode: 0644]
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/utils/SerializationUtils.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java
opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTransactionTest.java