BUG-8327: deprecate sal.core.api.model.SchemaService
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / ShardRecoveryCoordinator.java
index e87f083fb1ad283190ba74aee77b48ce966bcb60..a916ea6dead760219d536e0061ac01c35c99a879 100644 (file)
@@ -34,11 +34,11 @@ class ShardRecoveryCoordinator implements RaftActorRecoveryCohort {
     private final ShardDataTree store;
     private final String shardName;
     private final Logger log;
-    private final byte[] restoreFromSnapshot;
+    private final Snapshot restoreFromSnapshot;
 
     private boolean open;
 
-    ShardRecoveryCoordinator(final ShardDataTree store,  final byte[] restoreFromSnapshot, final String shardName,
+    ShardRecoveryCoordinator(final ShardDataTree store,  final Snapshot restoreFromSnapshot, final String shardName,
             final Logger log) {
         this.store = Preconditions.checkNotNull(store);
         this.shardName = Preconditions.checkNotNull(shardName);
@@ -86,7 +86,7 @@ class ShardRecoveryCoordinator implements RaftActorRecoveryCohort {
     /**
      * Applies a recovered snapshot to the data store.
      *
-     * @param snapshotBytes the serialized snapshot
+     * @param snapshotState the serialized snapshot
      */
     @Override
     @SuppressWarnings("checkstyle:IllegalCatch")
@@ -109,15 +109,15 @@ class ShardRecoveryCoordinator implements RaftActorRecoveryCohort {
     }
 
     @Override
-    public byte[] getRestoreFromSnapshot() {
+    public Snapshot getRestoreFromSnapshot() {
         return restoreFromSnapshot;
     }
 
     @Override
     @Deprecated
-    public State deserializePreCarbonSnapshot(byte[] from) {
+    public State deserializePreCarbonSnapshot(final byte[] from) {
         try {
-            return new ShardSnapshotState(ShardDataTreeSnapshot.deserialize(from));
+            return new ShardSnapshotState(ShardDataTreeSnapshot.deserializePreCarbon(from));
         } catch (IOException e) {
             log.error("{}: failed to deserialize snapshot", shardName, e);
             throw Throwables.propagate(e);