This is an automated email from the ASF dual-hosted git repository.

edimitrova pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit d85f7f7c2dd4b9bbdb44bc96235e6a8bc3ff3967
Author: Ekaterina Dimitrova <ekaterina.dimitr...@datastax.com>
AuthorDate: Thu Feb 3 00:19:28 2022 -0500

    Transfer parameters to the newly introduced configuration framework (2)
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, 
Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                                 | 4 ++--
 src/java/org/apache/cassandra/config/Config.java                    | 4 ++--
 src/java/org/apache/cassandra/config/DatabaseDescriptor.java        | 6 +++---
 .../org/apache/cassandra/config/SmallestDataStorageKibibytes.java   | 2 +-
 .../org/apache/cassandra/config/SmallestDataStorageMebibytes.java   | 2 +-
 .../org/apache/cassandra/config/SmallestDurationMilliseconds.java   | 2 +-
 src/java/org/apache/cassandra/config/SmallestDurationMinutes.java   | 2 +-
 src/java/org/apache/cassandra/config/SmallestDurationSeconds.java   | 2 +-
 src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java       | 2 +-
 .../cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java      | 4 ++--
 10 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 1d7998a..884a432 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -697,7 +697,7 @@ index_summary_resize_interval_in_minutes: 60
 # impacting read latencies. Almost always a good idea on SSDs; not
 # necessarily on platters.
 trickle_fsync: false
-trickle_fsync_interval_in_kb: 10240
+trickle_fsync_interval: 10240KiB
 
 # TCP port, for commands and data
 # For security reasons, you should not expose this port to the internet.  
Firewall it if needed.
@@ -930,7 +930,7 @@ compaction_throughput: 64MiB/s
 # are completely written, and used in place of the prior sstables for
 # any range that has been written. This helps to smoothly transfer reads 
 # between the sstables, reducing page cache churn and keeping hot rows hot
-sstable_preemptive_open_interval_in_mb: 50
+sstable_preemptive_open_interval: 50MiB
 
 # When enabled, permits Cassandra to zero-copy stream entire eligible
 # SSTables between nodes, including every component.
diff --git a/src/java/org/apache/cassandra/config/Config.java 
b/src/java/org/apache/cassandra/config/Config.java
index eb67be1..7602118 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -318,9 +318,9 @@ public class Config
 
     public volatile boolean incremental_backups = false;
     public boolean trickle_fsync = false;
-    public int trickle_fsync_interval_in_kb = 10240;
+    public SmallestDataStorageKibibytes trickle_fsync_interval = new 
SmallestDataStorageKibibytes("10240KiB");
 
-    public volatile int sstable_preemptive_open_interval_in_mb = 50;
+    public volatile SmallestDataStorageMebibytes 
sstable_preemptive_open_interval = new SmallestDataStorageMebibytes("50MiB");
 
     public volatile boolean key_cache_migrate_during_compaction = true;
     public Long key_cache_size_in_mb = null;
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java 
b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 102a587..297e619 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -2824,11 +2824,11 @@ public class DatabaseDescriptor
 
     public static int getSSTablePreemptiveOpenIntervalInMB()
     {
-        return conf.sstable_preemptive_open_interval_in_mb;
+        return conf.sstable_preemptive_open_interval.toMebibytesAsInt();
     }
     public static void setSSTablePreemptiveOpenIntervalInMB(int mb)
     {
-        conf.sstable_preemptive_open_interval_in_mb = mb;
+        conf.sstable_preemptive_open_interval = 
SmallestDataStorageMebibytes.inMebibytes(mb);
     }
 
     public static boolean getTrickleFsync()
@@ -2838,7 +2838,7 @@ public class DatabaseDescriptor
 
     public static int getTrickleFsyncIntervalInKb()
     {
-        return conf.trickle_fsync_interval_in_kb;
+        return conf.trickle_fsync_interval.toKibibytesAsInt();
     }
 
     public static long getKeyCacheSizeInMB()
diff --git 
a/src/java/org/apache/cassandra/config/SmallestDataStorageKibibytes.java 
b/src/java/org/apache/cassandra/config/SmallestDataStorageKibibytes.java
index e298ba5..375af29 100644
--- a/src/java/org/apache/cassandra/config/SmallestDataStorageKibibytes.java
+++ b/src/java/org/apache/cassandra/config/SmallestDataStorageKibibytes.java
@@ -23,7 +23,7 @@ package org.apache.cassandra.config;
  * not to lose precision while converting to smaller units (until we migrate 
those parameters to use internally the smallest
  * supported unit) we restrict those parameters to use only kibibytes or 
larger units. (CASSANDRA-15234)
  */
-public class SmallestDataStorageKibibytes extends DataStorageSpec
+public final class SmallestDataStorageKibibytes extends DataStorageSpec
 {
     /**
      * Creates a {@code SmallestDataStorageKibibytes} of the specified amount 
of seconds and provides the smallest
diff --git 
a/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java 
b/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
index effc9a8..8f54936 100644
--- a/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
+++ b/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
@@ -23,7 +23,7 @@ package org.apache.cassandra.config;
  * not to lose precision while converting to smaller units (until we migrate 
those parameters to use internally the smallest
  * supported unit) we restrict those parameters to use only mebibytes or 
larger units. (CASSANDRA-15234)
  */
-public class SmallestDataStorageMebibytes extends DataStorageSpec
+public final class SmallestDataStorageMebibytes extends DataStorageSpec
 {
     /**
      * Creates a {@code SmallestDataStoragemebibytes} of the specified amount 
of seconds and provides the smallest
diff --git 
a/src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java 
b/src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java
index cf6ef1b..3fc564b 100644
--- a/src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java
+++ b/src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java
@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
  * not to lose precision while converting to smaller units (until we migrate 
those parameters to use internally the smallest
  * supported unit) we restrict those parameters to use only Milliseconds or 
larger units. (CASSANDRA-15234)
  */
-public class SmallestDurationMilliseconds extends DurationSpec
+public final class SmallestDurationMilliseconds extends DurationSpec
 {
     /**
      * Creates a {@code SmallestDurationMilliseconds} of the specified amount 
of milliseconds and provides the smallest
diff --git a/src/java/org/apache/cassandra/config/SmallestDurationMinutes.java 
b/src/java/org/apache/cassandra/config/SmallestDurationMinutes.java
index d68230f..5099239 100644
--- a/src/java/org/apache/cassandra/config/SmallestDurationMinutes.java
+++ b/src/java/org/apache/cassandra/config/SmallestDurationMinutes.java
@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
  * not to lose precision while converting to smaller units (until we migrate 
those parameters to use internally the smallest
  * supported unit) we restrict those parameters to use only Minutes or larger 
units. (CASSANDRA-15234)
  */
-public class SmallestDurationMinutes extends DurationSpec
+public final class SmallestDurationMinutes extends DurationSpec
 {
     /**
      * Creates a {@code SmallestDurationMinutes} of the specified amount of 
minutes and provides the smallest
diff --git a/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java 
b/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
index 6ca8266..f8ab4ad 100644
--- a/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
+++ b/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
  * not to lose precision while converting to smaller units (until we migrate 
those parameters to use internally the smallest
  * supported unit) we restrict those parameters to use only Seconds or larger 
units. (CASSANDRA-15234)
  */
-public class SmallestDurationSeconds extends DurationSpec
+public final class SmallestDurationSeconds extends DurationSpec
 {
     /**
      * Creates a {@code SmallestDurationSeconds} of the specified amount of 
seconds and provides the smallest
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java 
b/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
index a3d5ae9..06b5dcd 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
@@ -36,7 +36,7 @@ import org.apache.cassandra.utils.NativeLibrary;
 import org.apache.cassandra.utils.concurrent.Transactional;
 
 /**
- * Wraps one or more writers as output for rewriting one or more readers: 
every sstable_preemptive_open_interval_in_mb
+ * Wraps one or more writers as output for rewriting one or more readers: 
every sstable_preemptive_open_interval
  * we look in the summary we're collecting for the latest writer for the 
penultimate key that we know to have been fully
  * flushed to the index file, and then double check that the key is fully 
present in the flushed data file.
  * Then we move the starts of each reader forwards to that point, replace them 
in the Tracker, and attach a runnable
diff --git 
a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
 
b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
index e1169e0..528da31 100644
--- 
a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ 
b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
@@ -89,10 +89,10 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DataStorageSpec.inKibibytes(1024), 
config.hinted_handoff_throttle);
         assertEquals(DataStorageSpec.inKibibytes(1024), 
config.batchlog_replay_throttle);
         assertEquals(DurationSpec.inMilliseconds(10000), 
config.hints_flush_period);
-        assertEquals(DataStorageSpec.inMebibytes(128), 
config.max_hints_file_size);
+        assertEquals(DataStorageSpec.inMebibytes(128), 
config.max_hints_file_size);*/
         assertEquals(DataStorageSpec.inKibibytes(10240), 
config.trickle_fsync_interval);
         assertEquals(DataStorageSpec.inMebibytes(50), 
config.sstable_preemptive_open_interval);
-        assertNull( config.key_cache_size);
+        /*assertNull( config.key_cache_size);
         assertEquals(DataStorageSpec.inMebibytes(0), config.row_cache_size);
         assertNull(config.counter_cache_size);
         assertNull(config.networking_cache_size);

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to