You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/05/10 19:33:03 UTC

[GitHub] [cassandra] smiklosovic commented on a diff in pull request #1615: CASSANDRA-17619: Remove expired snapshots of dropped tables after restart

smiklosovic commented on code in PR #1615:
URL: https://github.com/apache/cassandra/pull/1615#discussion_r869612488


##########
src/java/org/apache/cassandra/service/snapshot/SnapshotManager.java:
##########
@@ -116,8 +108,15 @@ public synchronized void addSnapshot(TableSnapshot snapshot)
     @VisibleForTesting
     protected synchronized void loadSnapshots()
     {
-        logger.debug("Loading snapshots");
-        snapshotLoader.get().forEach(this::addSnapshot);
+        SnapshotLoader loader = new SnapshotLoader(DatabaseDescriptor.getAllDataFileLocations());
+        addSnapshots(loader.loadSnapshots());
+    }
+
+    @VisibleForTesting
+    protected synchronized void addSnapshots(Collection<TableSnapshot> snapshots)
+    {
+        logger.debug("Adding snapshots: {}", snapshots.stream().map(s -> s.getId()).collect(Collectors.toList()));

Review Comment:
   To be explicit, this will be printed like: "Adding snapshots: ["snapshot1", "snapshot2","snapshot3"]" ?
   I think there is some joining collector which just separates it by commas and leaves brackets. I consider it to be just nicer.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org