Change remaining SnapshotSelectionCriteria to prioritize timestamp
[controller.git] / opendaylight / md-sal / cds-access-client / src / main / java / org / opendaylight / controller / cluster / access / client / SavingClientActorBehavior.java
index 5fc3ef38841d51c811ea792d55677a145590b1b0..58a10776f4b6723303c42eeae05024c841ad1f44 100644 (file)
@@ -39,14 +39,15 @@ final class SavingClientActorBehavior extends RecoveredClientActorBehavior<Initi
         } else if (command instanceof SaveSnapshotSuccess) {
             LOG.debug("{}: got command: {}", persistenceId(), command);
             SaveSnapshotSuccess saved = (SaveSnapshotSuccess)command;
-            context().deleteSnapshots(new SnapshotSelectionCriteria(saved.metadata().sequenceNr(),
+            context().deleteSnapshots(new SnapshotSelectionCriteria(scala.Long.MaxValue(),
                     saved.metadata().timestamp() - 1, 0L, 0L));
             return this;
         } else if (command instanceof DeleteSnapshotsSuccess) {
             LOG.debug("{}: got command: {}", persistenceId(), command);
         } else if (command instanceof DeleteSnapshotsFailure) {
             // Not treating this as a fatal error.
-            LOG.warn("{}: failed to delete prior snapshots", persistenceId(), ((DeleteSnapshotsFailure) command).cause());
+            LOG.warn("{}: failed to delete prior snapshots", persistenceId(),
+                    ((DeleteSnapshotsFailure) command).cause());
         } else {
             LOG.debug("{}: stashing command {}", persistenceId(), command);
             context().stash();
@@ -56,4 +57,4 @@ final class SavingClientActorBehavior extends RecoveredClientActorBehavior<Initi
         context().unstash();
         return context().createBehavior(myId);
     }
-}
\ No newline at end of file
+}