mirror of https://github.com/apache/cassandra
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
This commit is contained in:
parent
b9e2ab75f8
commit
d85f7f7c2d
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue