Remove SnapshotManager.convertSnapshot() 61/115961/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Mar 2025 10:39:21 +0000 (11:39 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Mar 2025 10:39:47 +0000 (11:39 +0100)
This is a useless indirection, just inline it into the single caller.

JIRA: CONTROLLER-2134
Change-Id: I87830a1e57623c630de037c8bfe345792c33b398
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/SnapshotManager.java

index 741284ad65727c2bec9cba0e6c126c9ff9c442e9..575123aacb242b7c458266df87cf5ee3bb2edb7c 100644 (file)
@@ -269,7 +269,7 @@ public final class SnapshotManager {
 
         final Snapshot.State snapshotState;
         try {
-            snapshotState = convertSnapshot(snapshotBytes);
+            snapshotState = snapshotCohort.deserializeSnapshot(snapshotBytes);
         } catch (IOException e) {
             LOG.debug("{}: failed to convert InstallSnapshot to state", memberId(), e);
             snapshot.callback().onFailure();
@@ -567,10 +567,6 @@ public final class SnapshotManager {
         this.snapshotCohort = requireNonNull(snapshotCohort);
     }
 
-    Snapshot.@NonNull State convertSnapshot(final ByteSource snapshotBytes) throws IOException {
-        return snapshotCohort.deserializeSnapshot(snapshotBytes);
-    }
-
     long getLastSequenceNumber() {
         return task instanceof Persist persist ? persist.lastSequenceNumber() : -1;
     }