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 2021/06/08 20:44:07 UTC

[GitHub] [cassandra] fibersel commented on a change in pull request #1046: [CASSANDRA-16451] Add ability to ttl snapshots

fibersel commented on a change in pull request #1046:
URL: https://github.com/apache/cassandra/pull/1046#discussion_r647779872



##########
File path: src/java/org/apache/cassandra/tools/nodetool/Snapshot.java
##########
@@ -63,6 +67,13 @@ public void execute(NodeProbe probe)
 
             Map<String, String> options = new HashMap<String,String>();
             options.put("skipFlush", Boolean.toString(skipFlush));
+            if (null != ttl) {
+                Duration d = Duration.from(ttl);
+                // ttl for snapshot must be at least 1 minute
+                if (d.getMonths() == 0 && d.getDays() == 0 && d.getNanoseconds() < d.NANOS_PER_MINUTE)

Review comment:
       @pauloricardomg told me to use this class:
   https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/cql3/Duration.java
   
   It does not supply such method.




-- 
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.

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