Refactor Register*ListenerReply classes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardSnapshotCohort.java
index 93e1d873579f0c02446b666f897cfcae640db525..455c874229f3c1c86fd6c3fcfc5609a6c81a91bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2015, 2017 Brocade Communications Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -65,7 +65,10 @@ class ShardSnapshotCohort implements RaftActorSnapshotCohort {
     @Override
     public void createSnapshot(final ActorRef actorRef, final Optional<OutputStream> installSnapshotStream) {
         // Forward the request to the snapshot actor
-        ShardSnapshotActor.requestSnapshot(snapshotActor, store.takeStateSnapshot(), installSnapshotStream, actorRef);
+        final ShardDataTreeSnapshot snapshot = store.takeStateSnapshot();
+        log.debug("{}: requesting serialization of snapshot {}", logId, snapshot);
+
+        ShardSnapshotActor.requestSnapshot(snapshotActor, snapshot, installSnapshotStream, actorRef);
     }
 
     @Override
@@ -94,8 +97,8 @@ class ShardSnapshotCohort implements RaftActorSnapshotCohort {
     }
 
     @Override
-    public State deserializeSnapshot(ByteSource snapshotBytes) throws IOException {
-        try (final ObjectInputStream in = new ObjectInputStream(snapshotBytes.openStream())) {
+    public State deserializeSnapshot(final ByteSource snapshotBytes) throws IOException {
+        try (ObjectInputStream in = new ObjectInputStream(snapshotBytes.openStream())) {
             return new ShardSnapshotState(ShardDataTreeSnapshot.deserialize(in));
         }
     }