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


##########
src/java/org/apache/cassandra/tools/nodetool/ClearSnapshot.java:
##########
@@ -43,34 +46,60 @@ public class ClearSnapshot extends NodeToolCmd
     @Option(title = "clear_all_snapshots", name = "--all", description = 
"Removes all snapshots")
     private boolean clearAllSnapshots = false;
 
+    @Option(title = "older_than", name = "--older-than", description = "Clear 
snapshots older than specified time period.")
+    private String olderThan;
+
+    @Option(title = "older_than_timestamp", name = "--older-than-timestamp", 
description = "Clear snapshots older than specified timestamp.")
+    private Long olderThanTimestamp;
+
     @Override
     public void execute(NodeProbe probe)
     {
-        if(snapshotName.isEmpty() && !clearAllSnapshots)
+        if (snapshotName.isEmpty() && !clearAllSnapshots)
             throw new RuntimeException("Specify snapshot name or --all");
 
-        if(!snapshotName.isEmpty() && clearAllSnapshots)
+        if (!snapshotName.isEmpty() && clearAllSnapshots)

Review Comment:
   I added test for illegal arguments and their combinations to cover it all.
   
   Btw I noticed that in the current clearsnapshot command we can not clear per 
table, it was always like that, only per keyspace. But still, we might be 
interested only in one keyspace and not the others on --all flag so the above 
logic still holds.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to