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 2019/11/11 16:12:16 UTC

[GitHub] [cassandra] iamaleksey commented on a change in pull request #381: CASSANDRA-13019 Ratelimited snapshots

iamaleksey commented on a change in pull request #381: CASSANDRA-13019 Ratelimited snapshots
URL: https://github.com/apache/cassandra/pull/381#discussion_r344781517
 
 

 ##########
 File path: src/java/org/apache/cassandra/db/ColumnFamilyStore.java
 ##########
 @@ -1708,14 +1708,18 @@ public ClusteringComparator getComparator()
 
     public void snapshotWithoutFlush(String snapshotName)
     {
-        snapshotWithoutFlush(snapshotName, null, false);
+        snapshotWithoutFlush(snapshotName, null, false, null);
     }
 
     /**
      * @param ephemeral If this flag is set to true, the snapshot will be cleaned during next startup
      */
-    public Set<SSTableReader> snapshotWithoutFlush(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral)
+    public Set<SSTableReader> snapshotWithoutFlush(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral, RateLimiter rateLimiter)
     {
+        if (rateLimiter == null)
+            rateLimiter = RateLimiter.create(DatabaseDescriptor.getSnapshotLinksPerSecond() == 0 ?
 
 Review comment:
   Pull this logic out, next to `DatabaseDescriptor#{get,set}SnapshotLinksPerSecond`? So that the special meaning of `0` is apparent and the logic isn't copied three extra times?

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


With regards,
Apache Git Services

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