You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ed...@apache.org on 2022/02/06 03:44:13 UTC

[cassandra] branch trunk updated (da47849 -> 9f56bf4)

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

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


    from da47849  Remove Windows-specific classes and related code
     new db9f7a6  Add new custom types and unit  tests for configuration patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new 9c6b382  Backward compatibility framework for configuration parameters patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new 5bb4bab  DataRate parameters transition to the new framework Fix the DB descriptorRefTest which failed on the previous commit patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new a3258d6  Transfer parameters to the newly introduced configuration framework (1) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new b9e2ab7  Extend DurationSpec and DataStorageSpec for smallest unit and transfer denylist parameters to the new framework patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new d85f7f7  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
     new 755fd94  Transfer parameters to the newly introduced configuration framework (3) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new ed48f3c  Transfer parameters to the newly introduced configuration framework (4) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new 1315d0c  Transfer parameters to the newly introduced configuration framework (5) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new 2313825  Transfer parameters to the newly introduced configuration framework (6) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new 6d52036  Transfer parameters to the newly introduced configuration framework (7) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new c51a7c6  Bulk change of units around the code to support the move to the new configuration framework patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
     new 9f56bf4  Remove old Duration class in favor of DurationSpec class patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

The 13 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .build/build-rat.xml                               |   2 +-
 CHANGES.txt                                        |   1 +
 NEWS.txt                                           |   6 +
 conf/cassandra.yaml                                | 462 +++++------
 doc/native_protocol_v4.spec                        |   4 +-
 doc/native_protocol_v5.spec                        |   4 +-
 pylib/cassandra-cqlsh-tests.sh                     |   4 +-
 src/java/org/apache/cassandra/auth/AuthConfig.java |   6 +-
 .../apache/cassandra/auth/AuthenticatedUser.java   |   2 +-
 src/java/org/apache/cassandra/auth/Roles.java      |   2 +-
 .../apache/cassandra/batchlog/BatchlogManager.java |  10 +-
 .../apache/cassandra/cache/AutoSavingCache.java    |   2 +-
 .../org/apache/cassandra/cache/CaffeineCache.java  |   2 +-
 .../org/apache/cassandra/cache/ChunkCache.java     |   5 +-
 .../org/apache/cassandra/cache/OHCProvider.java    |   2 +-
 .../apache/cassandra/cache/SerializingCache.java   |   2 +-
 .../cassandra/cache/SerializingCacheProvider.java  |   2 +-
 src/java/org/apache/cassandra/config/Config.java   | 315 +++++---
 .../org/apache/cassandra/config/Converters.java    | 138 ++++
 .../org/apache/cassandra/config/DataRateSpec.java  | 378 +++++++++
 .../apache/cassandra/config/DataStorageSpec.java   | 438 ++++++++++
 .../cassandra/config/DatabaseDescriptor.java       | 888 +++++++++++----------
 src/java/org/apache/cassandra/config/Duration.java | 276 -------
 .../org/apache/cassandra/config/DurationSpec.java  | 387 +++++++++
 .../apache/cassandra/config/EncryptionOptions.java |  41 +-
 src/java/org/apache/cassandra/config/Replaces.java |   9 +-
 .../org/apache/cassandra/config/ReplacesList.java  |   2 +-
 .../config/SmallestDataStorageKibibytes.java       |  55 ++
 .../config/SmallestDataStorageMebibytes.java       |  66 ++
 .../config/SmallestDurationMilliseconds.java       |  57 ++
 .../cassandra/config/SmallestDurationMinutes.java  |  57 ++
 .../cassandra/config/SmallestDurationSeconds.java  |  86 ++
 .../cassandra/config/YamlConfigurationLoader.java  | 135 +++-
 .../org/apache/cassandra/cql3/QueryProcessor.java  |  15 +-
 .../cassandra/cql3/functions/UDFunction.java       |   4 +-
 .../cassandra/cql3/statements/BatchStatement.java  |   4 +-
 .../statements/schema/CreateIndexStatement.java    |   2 +-
 .../statements/schema/CreateViewStatement.java     |   2 +-
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   9 +-
 src/java/org/apache/cassandra/db/ColumnIndex.java  |  12 +-
 src/java/org/apache/cassandra/db/Keyspace.java     |   8 +-
 src/java/org/apache/cassandra/db/Memtable.java     |   4 +-
 .../org/apache/cassandra/db/RowIndexEntry.java     |  20 +-
 .../commitlog/AbstractCommitLogSegmentManager.java |   2 +-
 .../db/commitlog/CommitLogSegmentManagerCDC.java   |   2 +-
 .../db/commitlog/GroupCommitLogService.java        |   2 +-
 .../cassandra/db/compaction/CompactionManager.java |  10 +-
 .../cassandra/db/compaction/CompactionTask.java    |   4 +-
 .../db/compaction/LeveledCompactionStrategy.java   |   8 +-
 .../cassandra/db/compaction/SSTableSplitter.java   |   6 +-
 .../SplittingSizeTieredCompactionWriter.java       |   4 +-
 .../apache/cassandra/db/marshal/AbstractType.java  |   2 +-
 .../db/partitions/AtomicBTreePartition.java        |   2 +-
 .../rows/UnfilteredRowIteratorWithLowerBound.java  |   2 +-
 .../apache/cassandra/db/virtual/SettingsTable.java |  31 +-
 .../org/apache/cassandra/hadoop/ConfigHelper.java  |  10 +-
 .../cassandra/hadoop/cql3/CqlBulkRecordWriter.java |   2 +-
 .../cassandra/hadoop/cql3/CqlInputFormat.java      |   4 +-
 .../cassandra/hints/HintsDispatchExecutor.java     |   2 +-
 .../org/apache/cassandra/hints/HintsReader.java    |   2 +-
 .../apache/cassandra/hints/HintsWriteExecutor.java |   4 +-
 .../org/apache/cassandra/hints/HintsWriter.java    |   4 +-
 .../cassandra/index/sasi/conf/IndexMode.java       |   2 +-
 .../cassandra/io/sstable/CQLSSTableWriter.java     |  15 +-
 .../org/apache/cassandra/io/sstable/IndexInfo.java |   2 +-
 .../cassandra/io/sstable/IndexSummaryBuilder.java  |   2 +-
 .../cassandra/io/sstable/IndexSummaryManager.java  |   4 +-
 .../io/sstable/IndexSummaryManagerMBean.java       |   2 +-
 .../io/sstable/IndexSummaryRedistribution.java     |   6 +-
 .../org/apache/cassandra/io/sstable/SSTable.java   |   2 +-
 .../cassandra/io/sstable/SSTableRewriter.java      |   6 +-
 .../io/sstable/format/big/BigTableWriter.java      |   2 +-
 .../org/apache/cassandra/io/util/FileUtils.java    |  32 +-
 .../cassandra/io/util/SequentialWriterOption.java  |   6 +-
 .../cassandra/net/AsyncStreamingOutputPlus.java    |   4 +-
 .../org/apache/cassandra/net/InboundSockets.java   |   2 +-
 .../apache/cassandra/net/OutboundConnection.java   |   2 +-
 .../apache/cassandra/repair/ValidationManager.java |   2 +-
 .../apache/cassandra/schema/CompressionParams.java |   2 +-
 .../apache/cassandra/schema/PartitionDenylist.java |   6 +-
 .../cassandra/service/ActiveRepairService.java     |  20 +-
 .../service/ActiveRepairServiceMBean.java          |   5 +
 .../org/apache/cassandra/service/CacheService.java |  12 +-
 .../org/apache/cassandra/service/StorageProxy.java |  16 +-
 .../apache/cassandra/service/StorageService.java   | 115 ++-
 .../cassandra/service/StorageServiceMBean.java     |  25 +-
 .../service/snapshot/SnapshotManifest.java         |   4 +-
 .../apache/cassandra/streaming/StreamManager.java  |  36 +-
 .../apache/cassandra/streaming/StreamSession.java  |   4 +-
 .../streaming/StreamingDataOutputPlus.java         |   2 +-
 .../org/apache/cassandra/tools/LoaderOptions.java  |  12 +-
 src/java/org/apache/cassandra/tools/NodeProbe.java |  22 +-
 .../apache/cassandra/tools/StandaloneScrubber.java |   4 +-
 .../tools/nodetool/GetColumnIndexSize.java         |   2 +-
 .../tools/nodetool/GetCompactionThroughput.java    |   4 +-
 .../tools/nodetool/GetInterDCStreamThroughput.java |   6 +-
 .../tools/nodetool/GetStreamThroughput.java        |   6 +-
 .../org/apache/cassandra/tools/nodetool/Info.java  |   4 +-
 .../tools/nodetool/SetBatchlogReplayThrottle.java  |   2 +-
 .../tools/nodetool/SetColumnIndexSize.java         |   6 +-
 .../tools/nodetool/SetCompactionThroughput.java    |   4 +-
 .../nodetool/SetHintedHandoffThrottleInKB.java     |   4 +-
 .../tools/nodetool/SetInterDCStreamThroughput.java |   4 +-
 .../tools/nodetool/SetStreamThroughput.java        |   4 +-
 .../apache/cassandra/tools/nodetool/Snapshot.java  |   4 +-
 .../apache/cassandra/utils/memory/BufferPools.java |   4 +-
 .../cassandra/utils/memory/NativeAllocator.java    |   4 +-
 .../cassandra/utils/memory/SlabAllocator.java      |   4 +-
 test/conf/cassandra-murmur.yaml                    |  16 +-
 ...ed_parameters_names.yaml => cassandra-old.yaml} |   7 +-
 test/conf/cassandra-seeds.yaml                     |  12 +-
 ...dra-sslcontextfactory-invalidconfiguration.yaml |  20 +-
 test/conf/cassandra-sslcontextfactory.yaml         |  20 +-
 test/conf/cassandra.yaml                           |  22 +-
 test/conf/cassandra_encryption.yaml                |  26 +-
 test/conf/unit-test-conf/test-native-port.yaml     |  16 +-
 .../cassandra/distributed/impl/InstanceConfig.java |  10 +-
 .../test/AbstractNetstatsBootstrapStreaming.java   |   8 +-
 .../test/BootstrapBinaryDisabledTest.java          |   4 +-
 .../cassandra/distributed/test/CASAddTest.java     |   4 +-
 .../apache/cassandra/distributed/test/CASTest.java |  53 +-
 .../cassandra/distributed/test/CountersTest.java   |   2 +-
 .../cassandra/distributed/test/GroupByTest.java    |   6 +-
 .../test/HintedHandoffNodetoolTest.java            |   8 +-
 .../test/InternodeEncryptionOptionsTest.java       |   6 +-
 .../distributed/test/LargeColumnTest.java          |  14 +-
 .../distributed/test/MessageFiltersTest.java       |   2 +-
 ...WithEntireSSTablesCompressionStreamingTest.java |   2 +-
 .../test/NetstatsRepairStreamingTest.java          |   4 +-
 .../cassandra/distributed/test/NodeToolTest.java   |   2 +-
 .../distributed/test/PartitionDenylistTest.java    |   8 +-
 .../test/ReadRepairEmptyRangeTombstonesTest.java   |   5 +-
 .../distributed/test/ReadRepairQueryTypesTest.java |   5 +-
 .../cassandra/distributed/test/ReadRepairTest.java |   2 +-
 .../test/ring/ReadsDuringBootstrapTest.java        |   4 +-
 .../trackwarnings/RowIndexSizeWarningTest.java     |   4 +-
 .../upgrade/CompactStorageUpgradeTest.java         |   2 +-
 .../upgrade/MixedModeAvailabilityTestBase.java     |   5 +-
 .../upgrade/MixedModeConsistencyTestBase.java      |   5 +-
 .../upgrade/MixedModeMessageForwardTest.java       |   3 +-
 .../LongLeveledCompactionStrategyTest.java         |   8 +-
 .../io/sstable/CQLSSTableWriterLongTest.java       |   2 +-
 .../cassandra/streaming/LongStreamingTest.java     |  20 +-
 .../microbench/ZeroCopyStreamingBenchmark.java     |   2 +-
 .../cassandra/simulator/ClusterSimulation.java     |  12 +-
 .../apache/cassandra/config/DataRateSpecTest.java  | 136 ++++
 .../cassandra/config/DataStorageSpecTest.java      | 141 ++++
 .../config/DatabaseDescriptorRefTest.java          |  19 +-
 .../cassandra/config/DatabaseDescriptorTest.java   | 116 +--
 .../apache/cassandra/config/DurationSpecTest.java  | 160 ++++
 .../org/apache/cassandra/config/DurationTest.java  |  60 --
 .../LoadOldYAMLBackwardCompatibilityTest.java      |  94 ++-
 .../cassandra/config/ParseAndConvertUnitsTest.java | 111 +++
 .../config/SmallestDataStorageKibibytesTest.java   |  27 +-
 .../config/SmallestDataStorageMebibytesTest.java   |  27 +-
 .../config/SmallestDurationMillisecondsTest.java   |  48 ++
 .../config/SmallestDurationMinutesTest.java        |  52 ++
 .../config/SmallestDurationSecondsTest.java        |  50 ++
 .../config/YamlConfigurationLoaderTest.java        |   8 +-
 test/unit/org/apache/cassandra/cql3/CQLTester.java |   7 +-
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |   6 +-
 .../cql3/validation/entities/JsonTest.java         |   4 +-
 .../validation/entities/SecondaryIndexTest.java    |  10 +-
 .../miscellaneous/CrcCheckChanceTest.java          |   2 +-
 .../org/apache/cassandra/db/DirectoriesTest.java   |   7 +-
 .../unit/org/apache/cassandra/db/KeyCacheTest.java |   8 +-
 .../unit/org/apache/cassandra/db/RowCacheTest.java |  10 +-
 .../commitlog/CommitLogSegmentManagerCDCTest.java  |   8 +-
 .../cassandra/db/commitlog/CommitLogTest.java      |   4 +-
 .../db/compaction/CompactionsCQLTest.java          |   8 +-
 .../compaction/LeveledCompactionStrategyTest.java  |  10 +-
 .../db/streaming/CassandraStreamManagerTest.java   |   4 +-
 .../db/virtual/CredentialsCacheKeysTableTest.java  |   2 +-
 .../virtual/JmxPermissionsCacheKeysTableTest.java  |   2 +-
 .../NetworkPermissionsCacheKeysTableTest.java      |   2 +-
 .../db/virtual/PermissionsCacheKeysTableTest.java  |   2 +-
 .../db/virtual/RolesCacheKeysTableTest.java        |   2 +-
 .../apache/cassandra/index/sasi/SASICQLTest.java   |   6 +-
 .../CompressedSequentialWriterReopenTest.java      |   2 +-
 .../cassandra/io/sstable/CQLSSTableWriterTest.java |  10 +-
 .../cassandra/io/sstable/IndexSummaryTest.java     |   4 +-
 .../cassandra/io/sstable/LargePartitionsTest.java  |  34 +-
 .../cassandra/io/sstable/SSTableLoaderTest.java    |   4 +-
 .../io/sstable/SSTableWriterTestBase.java          |   2 +-
 .../apache/cassandra/io/util/FileUtilsTest.java    |  20 +-
 .../cassandra/io/util/RandomAccessReaderTest.java  |   4 +-
 .../net/AsyncStreamingOutputPlusTest.java          |   8 +-
 .../apache/cassandra/net/MessagingServiceTest.java |   4 +-
 .../org/apache/cassandra/repair/ValidatorTest.java |  16 +-
 .../cassandra/service/ClientWarningsTest.java      |   2 +-
 .../cassandra/service/PartitionDenylistTest.java   |   8 +-
 .../cassandra/service/ProtocolBetaVersionTest.java |   2 +-
 .../service/snapshot/SnapshotManifestTest.java     |   4 +-
 .../cassandra/streaming/StreamManagerTest.java     |  92 +--
 .../cassandra/streaming/StreamRateLimiterTest.java |  32 +-
 .../tools/StandaloneSplitterWithCQLTesterTest.java |   6 +-
 .../tools/nodetool/SetGetColumnIndexSizeTest.java  |  14 +-
 ...st.java => SetGetCompactionThroughputTest.java} |  41 +-
 ...etEntireSSTableInterDCStreamThroughputTest.java |  12 +-
 .../SetGetEntireSSTableStreamThroughputTest.java   |  12 +-
 .../SetGetInterDCStreamThroughputTest.java         |  26 +-
 .../tools/nodetool/SetGetStreamThroughputTest.java |  26 +-
 .../cassandra/transport/CQLConnectionTest.java     |   4 +-
 .../org/apache/cassandra/utils/MerkleTreeTest.java |  10 +-
 .../cassandra/utils/memory/BufferPoolTest.java     |   6 +-
 .../io/sstable/StressCQLSSTableWriter.java         |  12 +-
 .../apache/cassandra/stress/CompactionStress.java  |  16 +-
 .../operations/userdefined/SchemaInsert.java       |   2 +-
 208 files changed, 4406 insertions(+), 2000 deletions(-)
 create mode 100644 src/java/org/apache/cassandra/config/Converters.java
 create mode 100644 src/java/org/apache/cassandra/config/DataRateSpec.java
 create mode 100644 src/java/org/apache/cassandra/config/DataStorageSpec.java
 delete mode 100644 src/java/org/apache/cassandra/config/Duration.java
 create mode 100644 src/java/org/apache/cassandra/config/DurationSpec.java
 create mode 100644 src/java/org/apache/cassandra/config/SmallestDataStorageKibibytes.java
 create mode 100644 src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
 create mode 100644 src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java
 create mode 100644 src/java/org/apache/cassandra/config/SmallestDurationMinutes.java
 create mode 100644 src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
 rename test/conf/{cassandra_deprecated_parameters_names.yaml => cassandra-old.yaml} (93%)
 create mode 100644 test/unit/org/apache/cassandra/config/DataRateSpecTest.java
 create mode 100644 test/unit/org/apache/cassandra/config/DataStorageSpecTest.java
 create mode 100644 test/unit/org/apache/cassandra/config/DurationSpecTest.java
 delete mode 100644 test/unit/org/apache/cassandra/config/DurationTest.java
 create mode 100644 test/unit/org/apache/cassandra/config/ParseAndConvertUnitsTest.java
 copy src/java/org/apache/cassandra/config/ConfigurationLoader.java => test/unit/org/apache/cassandra/config/SmallestDataStorageKibibytesTest.java (59%)
 copy src/java/org/apache/cassandra/config/ConfigurationLoader.java => test/unit/org/apache/cassandra/config/SmallestDataStorageMebibytesTest.java (59%)
 create mode 100644 test/unit/org/apache/cassandra/config/SmallestDurationMillisecondsTest.java
 create mode 100644 test/unit/org/apache/cassandra/config/SmallestDurationMinutesTest.java
 create mode 100644 test/unit/org/apache/cassandra/config/SmallestDurationSecondsTest.java
 copy test/unit/org/apache/cassandra/tools/nodetool/{SetGetStreamThroughputTest.java => SetGetCompactionThroughputTest.java} (61%)

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


[cassandra] 06/13: 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

Posted by ed...@apache.org.
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 <ek...@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-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[cassandra] 04/13: Transfer parameters to the newly introduced configuration framework (1) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 a3258d66bcc9f946304c19d59e75d2721126303e
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Tue Feb 1 17:14:17 2022 -0500

    Transfer parameters to the newly introduced configuration framework (1)
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                | 20 +++++------
 pylib/cassandra-cqlsh-tests.sh                     |  4 +--
 src/java/org/apache/cassandra/config/Config.java   | 33 +++++++++++------
 .../cassandra/config/DatabaseDescriptor.java       | 40 ++++++++++-----------
 .../apache/cassandra/config/EncryptionOptions.java | 41 +++++++++++-----------
 .../cassandra/cql3/functions/UDFunction.java       |  4 +--
 .../statements/schema/CreateIndexStatement.java    |  2 +-
 .../statements/schema/CreateViewStatement.java     |  2 +-
 .../apache/cassandra/db/virtual/SettingsTable.java |  2 +-
 .../org/apache/cassandra/net/InboundSockets.java   |  2 +-
 .../apache/cassandra/net/OutboundConnection.java   |  2 +-
 test/conf/cassandra-murmur.yaml                    |  8 ++---
 test/conf/cassandra-seeds.yaml                     |  4 +--
 ...dra-sslcontextfactory-invalidconfiguration.yaml |  8 ++---
 test/conf/cassandra-sslcontextfactory.yaml         |  8 ++---
 test/conf/cassandra.yaml                           |  8 ++---
 test/conf/unit-test-conf/test-native-port.yaml     |  4 +--
 .../cassandra/distributed/test/CountersTest.java   |  2 +-
 .../cassandra/distributed/test/GroupByTest.java    |  6 ++--
 .../test/InternodeEncryptionOptionsTest.java       |  6 ++--
 .../upgrade/CompactStorageUpgradeTest.java         |  2 +-
 .../LoadOldYAMLBackwardCompatibilityTest.java      | 17 +++++----
 test/unit/org/apache/cassandra/cql3/ViewTest.java  |  6 ++--
 .../apache/cassandra/index/sasi/SASICQLTest.java   |  6 ++--
 .../apache/cassandra/net/MessagingServiceTest.java |  4 +--
 25 files changed, 128 insertions(+), 113 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 8741b9b..265bf38 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -1059,7 +1059,7 @@ slow_query_log_timeout_in_ms: 500
 #
 # Warning: It is generally assumed that users have setup NTP on their clusters, and that clocks are modestly in sync, 
 # since this is a requirement for general correctness of last write wins.
-#cross_node_timeout: true
+# internode_timeout: true
 
 # Set keep-alive period for streaming
 # This node will send a keep-alive message periodically with this period.
@@ -1225,7 +1225,7 @@ server_encryption_options:
     # optional: true
     # If enabled, will open up an encrypted listening socket on ssl_storage_port. Should only be used
     # during upgrade to 4.0; otherwise, set to false.
-    enable_legacy_ssl_storage_port: false
+    legacy_ssl_storage_port_enabled: false
     # Set to a valid keystore if internode_encryption is dc, rack or all
     keystore: conf/.keystore
     keystore_password: cassandra
@@ -1311,13 +1311,13 @@ tracetype_repair_ttl: 604800
 # INFO level
 # UDFs (user defined functions) are disabled by default.
 # As of Cassandra 3.0 there is a sandbox in place that should prevent execution of evil code.
-enable_user_defined_functions: false
+user_defined_functions_enabled: false
 
 # Enables scripted UDFs (JavaScript UDFs).
-# Java UDFs are always enabled, if enable_user_defined_functions is true.
+# Java UDFs are always enabled, if user_defined_functions_enabled is true.
 # Enable this option to be able to use UDFs with "language javascript" or any custom JSR-223 provider.
-# This option has no effect, if enable_user_defined_functions is false.
-enable_scripted_user_defined_functions: false
+# This option has no effect, if user_defined_functions_enabled is false.
+scripted_user_defined_functions_enabled: false
 
 # Enables encrypting data at-rest (on disk). Different key providers can be plugged in, but the default reads from
 # a JCE-style keystore. A single keystore can hold multiple keys, but the one referenced by
@@ -1528,19 +1528,19 @@ report_unconfirmed_repaired_data_mismatches: false
 
 # Enables materialized view creation on this node.
 # Materialized views are considered experimental and are not recommended for production use.
-enable_materialized_views: false
+materialized_views_enabled: false
 
 # Enables SASI index creation on this node.
 # SASI indexes are considered experimental and are not recommended for production use.
-enable_sasi_indexes: false
+sasi_indexes_enabled: false
 
 # Enables creation of transiently replicated keyspaces on this node.
 # Transient replication is experimental and is not recommended for production use.
-enable_transient_replication: false
+transient_replication_enabled: false
 
 # Enables the used of 'ALTER ... DROP COMPACT STORAGE' statements on this node.
 # 'ALTER ... DROP COMPACT STORAGE' is considered experimental and is not recommended for production use.
-enable_drop_compact_storage: false
+drop_compact_storage_enabled: false
 
 # Whether or not USE <keyspace> is allowed. This is enabled by default to avoid failure on upgrade.
 #use_statements_enabled: true
diff --git a/pylib/cassandra-cqlsh-tests.sh b/pylib/cassandra-cqlsh-tests.sh
index 7904166..b147194 100755
--- a/pylib/cassandra-cqlsh-tests.sh
+++ b/pylib/cassandra-cqlsh-tests.sh
@@ -101,8 +101,8 @@ fi
 
 ccm remove test || true # in case an old ccm cluster is left behind
 ccm create test -n 1 --install-dir=${CASSANDRA_DIR}
-ccm updateconf "enable_user_defined_functions: true"
-ccm updateconf "enable_scripted_user_defined_functions: true"
+ccm updateconf "user_defined_functions_enabled: true"
+ccm updateconf "scripted_user_defined_functions_enabled: true"
 
 version_from_build=$(ccm node1 versionfrombuild)
 export pre_or_post_cdc=$(python -c """from distutils.version import LooseVersion
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 4f6e27e..0485cc1 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -114,7 +114,8 @@ public class Config
     public Integer streaming_connections_per_host = 1;
     public Integer streaming_keep_alive_period_in_secs = 300; //5 minutes
 
-    public boolean cross_node_timeout = true;
+    @Replaces(oldName = "cross_node_timeout", converter = Converters.IDENTITY, deprecated = true)
+    public boolean internode_timeout = true;
 
     public volatile long slow_query_log_timeout_in_ms = 500L;
 
@@ -401,16 +402,22 @@ public class Config
      */
     public Long prepared_statements_cache_size_mb = null;
 
-    public boolean enable_user_defined_functions = false;
-    public boolean enable_scripted_user_defined_functions = false;
+    @Replaces(oldName = "enable_user_defined_functions", converter = Converters.IDENTITY, deprecated = true)
+    public boolean user_defined_functions_enabled = false;
+    @Replaces(oldName = "enable_scripted_user_defined_functions", converter = Converters.IDENTITY, deprecated = true)
+    public boolean scripted_user_defined_functions_enabled = false;
 
-    public boolean enable_materialized_views = false;
+    @Replaces(oldName = "enable_materialized_views", converter = Converters.IDENTITY, deprecated = true)
+    public boolean materialized_views_enabled = false;
 
-    public boolean enable_transient_replication = false;
+    @Replaces(oldName = "enable_transient_replication", converter = Converters.IDENTITY, deprecated = true)
+    public boolean transient_replication_enabled = false;
 
-    public boolean enable_sasi_indexes = false;
+    @Replaces(oldName = "enable_sasi_indexes", converter = Converters.IDENTITY, deprecated = true)
+    public boolean sasi_indexes_enabled = false;
 
-    public volatile boolean enable_drop_compact_storage = false;
+    @Replaces(oldName = "enable_drop_compact_storage", converter = Converters.IDENTITY, deprecated = true)
+    public volatile boolean drop_compact_storage_enabled = false;
 
     public volatile boolean use_statements_enabled = true;
 
@@ -423,17 +430,21 @@ public class Config
      * When you disable async UDF execution, users MUST pay attention to read-timeouts since these may indicate
      * UDFs that run too long or forever - and this can destabilize the cluster.
      */
-    public boolean enable_user_defined_functions_threads = true;
+    // Below parameter is not presented in cassandra.yaml but to be on the safe side that no one was directly using it
+    // I still added backward compatibility (CASSANDRA-15234)
+    @Replaces(oldName = "enable_user_defined_functions_threads", converter = Converters.IDENTITY, deprecated = true)
+    public boolean user_defined_functions_threads_enabled = true;
     /**
      * Time in milliseconds after a warning will be emitted to the log and to the client that a UDF runs too long.
-     * (Only valid, if enable_user_defined_functions_threads==true)
+     * (Only valid, if user_defined_functions_threads_enabled==true)
      */
     public long user_defined_function_warn_timeout = 500;
     /**
      * Time in milliseconds after a fatal UDF run-time situation is detected and action according to
      * user_function_timeout_policy will take place.
-     * (Only valid, if enable_user_defined_functions_threads==true)
+     * (Only valid, if user_defined_functions_threads_enabled==true)
      */
+    //No need of unit conversion as this parameter is not exposed in the yaml file
     public long user_defined_function_fail_timeout = 1500;
     /**
      * Defines what to do when a UDF ran longer than user_defined_function_fail_timeout.
@@ -441,7 +452,7 @@ public class Config
      * - 'die' - i.e. it is able to emit a warning to the client before the Cassandra Daemon will shut down.
      * - 'die_immediate' - shut down C* daemon immediately (effectively prevent the chance that the client will receive a warning).
      * - 'ignore' - just log - the most dangerous option.
-     * (Only valid, if enable_user_defined_functions_threads==true)
+     * (Only valid, if user_defined_functions_threads_enabled==true)
      */
     public UserFunctionTimeoutPolicy user_function_timeout_policy = UserFunctionTimeoutPolicy.die;
 
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 021b0c6..622a825 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -790,10 +790,10 @@ public class DatabaseDescriptor
         {
             conf.server_encryption_options.applyConfig();
 
-            if (conf.server_encryption_options.enable_legacy_ssl_storage_port &&
+            if (conf.server_encryption_options.legacy_ssl_storage_port_enabled &&
                 conf.server_encryption_options.tlsEncryptionPolicy() == EncryptionOptions.TlsEncryptionPolicy.UNENCRYPTED)
             {
-                throw new ConfigurationException("enable_legacy_ssl_storage_port is true (enabled) with internode encryption disabled (none). Enable encryption or disable the legacy ssl storage port.");
+                throw new ConfigurationException("legacy_ssl_storage_port_enabled is true (enabled) with internode encryption disabled (none). Enable encryption or disable the legacy ssl storage port.");
             }
         }
         Integer maxMessageSize = conf.internode_max_message_size_in_bytes;
@@ -1724,12 +1724,12 @@ public class DatabaseDescriptor
 
     public static boolean hasCrossNodeTimeout()
     {
-        return conf.cross_node_timeout;
+        return conf.internode_timeout;
     }
 
     public static void setCrossNodeTimeout(boolean crossNodeTimeout)
     {
-        conf.cross_node_timeout = crossNodeTimeout;
+        conf.internode_timeout = crossNodeTimeout;
     }
 
     public static long getSlowQueryTimeout(TimeUnit units)
@@ -3074,22 +3074,22 @@ public class DatabaseDescriptor
 
     public static boolean enableUserDefinedFunctions()
     {
-        return conf.enable_user_defined_functions;
+        return conf.user_defined_functions_enabled;
     }
 
     public static boolean enableScriptedUserDefinedFunctions()
     {
-        return conf.enable_scripted_user_defined_functions;
+        return conf.scripted_user_defined_functions_enabled;
     }
 
     public static void enableScriptedUserDefinedFunctions(boolean enableScriptedUserDefinedFunctions)
     {
-        conf.enable_scripted_user_defined_functions = enableScriptedUserDefinedFunctions;
+        conf.scripted_user_defined_functions_enabled = enableScriptedUserDefinedFunctions;
     }
 
     public static boolean enableUserDefinedFunctionsThreads()
     {
-        return conf.enable_user_defined_functions_threads;
+        return conf.user_defined_functions_threads_enabled;
     }
 
     public static long getUserDefinedFunctionWarnTimeout()
@@ -3102,45 +3102,45 @@ public class DatabaseDescriptor
         conf.user_defined_function_warn_timeout = userDefinedFunctionWarnTimeout;
     }
 
-    public static boolean getEnableMaterializedViews()
+    public static boolean getMaterializedViewsEnabled()
     {
-        return conf.enable_materialized_views;
+        return conf.materialized_views_enabled;
     }
 
-    public static void setEnableMaterializedViews(boolean enableMaterializedViews)
+    public static void setMaterializedViewsEnabled(boolean enableMaterializedViews)
     {
-        conf.enable_materialized_views = enableMaterializedViews;
+        conf.materialized_views_enabled = enableMaterializedViews;
     }
 
-    public static boolean getEnableSASIIndexes()
+    public static boolean getSASIIndexesEnabled()
     {
-        return conf.enable_sasi_indexes;
+        return conf.sasi_indexes_enabled;
     }
 
-    public static void setEnableSASIIndexes(boolean enableSASIIndexes)
+    public static void setSASIIndexesEnabled(boolean enableSASIIndexes)
     {
-        conf.enable_sasi_indexes = enableSASIIndexes;
+        conf.sasi_indexes_enabled = enableSASIIndexes;
     }
 
     public static boolean isTransientReplicationEnabled()
     {
-        return conf.enable_transient_replication;
+        return conf.transient_replication_enabled;
     }
 
     public static void setTransientReplicationEnabledUnsafe(boolean enabled)
     {
-        conf.enable_transient_replication = enabled;
+        conf.transient_replication_enabled = enabled;
     }
 
     public static boolean enableDropCompactStorage()
     {
-        return conf.enable_drop_compact_storage;
+        return conf.drop_compact_storage_enabled;
     }
 
     @VisibleForTesting
     public static void setEnableDropCompactStorage(boolean enableDropCompactStorage)
     {
-        conf.enable_drop_compact_storage = enableDropCompactStorage;
+        conf.drop_compact_storage_enabled = enableDropCompactStorage;
     }
 
     public static long getUserDefinedFunctionFailTimeout()
diff --git a/src/java/org/apache/cassandra/config/EncryptionOptions.java b/src/java/org/apache/cassandra/config/EncryptionOptions.java
index 616d344..6c26e8d 100644
--- a/src/java/org/apache/cassandra/config/EncryptionOptions.java
+++ b/src/java/org/apache/cassandra/config/EncryptionOptions.java
@@ -579,12 +579,13 @@ public class EncryptionOptions
         }
 
         public final InternodeEncryption internode_encryption;
-        public final boolean enable_legacy_ssl_storage_port;
+        @Replaces(oldName = "enable_legacy_ssl_storage_port", deprecated = true)
+        public final boolean legacy_ssl_storage_port_enabled;
 
         public ServerEncryptionOptions()
         {
             this.internode_encryption = InternodeEncryption.none;
-            this.enable_legacy_ssl_storage_port = false;
+            this.legacy_ssl_storage_port_enabled = false;
         }
 
         public ServerEncryptionOptions(ParameterizedClass sslContextFactoryClass, String keystore,
@@ -592,20 +593,20 @@ public class EncryptionOptions
                                        List<String> cipher_suites, String protocol, List<String> accepted_protocols,
                                        String algorithm, String store_type, boolean require_client_auth,
                                        boolean require_endpoint_verification, Boolean optional,
-                                       InternodeEncryption internode_encryption, boolean enable_legacy_ssl_storage_port)
+                                       InternodeEncryption internode_encryption, boolean legacy_ssl_storage_port_enabled)
         {
             super(sslContextFactoryClass, keystore, keystore_password, truststore, truststore_password, cipher_suites,
             protocol, accepted_protocols, algorithm, store_type, require_client_auth, require_endpoint_verification,
             null, optional);
             this.internode_encryption = internode_encryption;
-            this.enable_legacy_ssl_storage_port = enable_legacy_ssl_storage_port;
+            this.legacy_ssl_storage_port_enabled = legacy_ssl_storage_port_enabled;
         }
 
         public ServerEncryptionOptions(ServerEncryptionOptions options)
         {
             super(options);
             this.internode_encryption = options.internode_encryption;
-            this.enable_legacy_ssl_storage_port = options.enable_legacy_ssl_storage_port;
+            this.legacy_ssl_storage_port_enabled = options.legacy_ssl_storage_port_enabled;
         }
 
         @Override
@@ -680,7 +681,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withKeyStore(String keystore)
@@ -689,7 +690,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withKeyStorePassword(String keystore_password)
@@ -698,7 +699,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withTrustStore(String truststore)
@@ -707,7 +708,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withTrustStorePassword(String truststore_password)
@@ -716,7 +717,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withCipherSuites(List<String> cipher_suites)
@@ -725,7 +726,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withCipherSuites(String ... cipher_suites)
@@ -734,7 +735,7 @@ public class EncryptionOptions
                                                truststore_password, Arrays.asList(cipher_suites), protocol,
                                                accepted_protocols, algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withProtocol(String protocol)
@@ -743,7 +744,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withAcceptedProtocols(List<String> accepted_protocols)
@@ -752,7 +753,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withAlgorithm(String algorithm)
@@ -761,7 +762,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withStoreType(String store_type)
@@ -770,7 +771,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withRequireClientAuth(boolean require_client_auth)
@@ -779,7 +780,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withRequireEndpointVerification(boolean require_endpoint_verification)
@@ -788,7 +789,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withOptional(boolean optional)
@@ -797,7 +798,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withInternodeEncryption(InternodeEncryption internode_encryption)
@@ -806,7 +807,7 @@ public class EncryptionOptions
                                                truststore_password, cipher_suites, protocol, accepted_protocols,
                                                algorithm, store_type, require_client_auth,
                                                require_endpoint_verification, optional, internode_encryption,
-                                               enable_legacy_ssl_storage_port).applyConfigInternal();
+                                               legacy_ssl_storage_port_enabled).applyConfigInternal();
         }
 
         public ServerEncryptionOptions withLegacySslStoragePort(boolean enable_legacy_ssl_storage_port)
diff --git a/src/java/org/apache/cassandra/cql3/functions/UDFunction.java b/src/java/org/apache/cassandra/cql3/functions/UDFunction.java
index 55a2d45..7323fec 100644
--- a/src/java/org/apache/cassandra/cql3/functions/UDFunction.java
+++ b/src/java/org/apache/cassandra/cql3/functions/UDFunction.java
@@ -425,9 +425,9 @@ public abstract class UDFunction extends AbstractFunction implements ScalarFunct
     public static void assertUdfsEnabled(String language)
     {
         if (!DatabaseDescriptor.enableUserDefinedFunctions())
-            throw new InvalidRequestException("User-defined functions are disabled in cassandra.yaml - set enable_user_defined_functions=true to enable");
+            throw new InvalidRequestException("User-defined functions are disabled in cassandra.yaml - set user_defined_functions_enabled=true to enable");
         if (!"java".equalsIgnoreCase(language) && !DatabaseDescriptor.enableScriptedUserDefinedFunctions())
-            throw new InvalidRequestException("Scripted user-defined functions are disabled in cassandra.yaml - set enable_scripted_user_defined_functions=true to enable if you are aware of the security risks");
+            throw new InvalidRequestException("Scripted user-defined functions are disabled in cassandra.yaml - set scripted_user_defined_functions_enabled=true to enable if you are aware of the security risks");
     }
 
     static void initializeThread()
diff --git a/src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java b/src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java
index ae60f24..56cc2f9 100644
--- a/src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/schema/CreateIndexStatement.java
@@ -84,7 +84,7 @@ public final class CreateIndexStatement extends AlterSchemaStatement
     {
         attrs.validate();
 
-        if (attrs.isCustom && attrs.customClass.equals(SASIIndex.class.getName()) && !DatabaseDescriptor.getEnableSASIIndexes())
+        if (attrs.isCustom && attrs.customClass.equals(SASIIndex.class.getName()) && !DatabaseDescriptor.getSASIIndexesEnabled())
             throw new InvalidRequestException("SASI indexes are disabled. Enable in cassandra.yaml to use.");
 
         KeyspaceMetadata keyspace = schema.getNullable(keyspaceName);
diff --git a/src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java b/src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java
index 26ffeee..4297d9c 100644
--- a/src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/schema/CreateViewStatement.java
@@ -111,7 +111,7 @@ public final class CreateViewStatement extends AlterSchemaStatement
 
     public Keyspaces apply(Keyspaces schema)
     {
-        if (!DatabaseDescriptor.getEnableMaterializedViews())
+        if (!DatabaseDescriptor.getMaterializedViewsEnabled())
             throw ire("Materialized views are disabled. Enable in cassandra.yaml to use.");
 
         /*
diff --git a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
index cc91152..fa302b0 100644
--- a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
+++ b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
@@ -189,7 +189,7 @@ final class SettingsTable extends AbstractVirtualTable
         {
             EncryptionOptions.ServerEncryptionOptions server = (EncryptionOptions.ServerEncryptionOptions) value;
             result.row(f.getName() + "_internode_encryption").column(VALUE, server.internode_encryption.toString());
-            result.row(f.getName() + "_legacy_ssl_storage_port").column(VALUE, Boolean.toString(server.enable_legacy_ssl_storage_port));
+            result.row(f.getName() + "_legacy_ssl_storage_port").column(VALUE, Boolean.toString(server.legacy_ssl_storage_port_enabled));
         }
     }
 
diff --git a/src/java/org/apache/cassandra/net/InboundSockets.java b/src/java/org/apache/cassandra/net/InboundSockets.java
index 573cccb..58cd88e 100644
--- a/src/java/org/apache/cassandra/net/InboundSockets.java
+++ b/src/java/org/apache/cassandra/net/InboundSockets.java
@@ -217,7 +217,7 @@ class InboundSockets
         InboundConnectionSettings       settings = template.withDefaults();
         InboundConnectionSettings legacySettings = template.withLegacySslStoragePortDefaults();
 
-        if (settings.encryption.enable_legacy_ssl_storage_port)
+        if (settings.encryption.legacy_ssl_storage_port_enabled)
         {
             out.add(new InboundSocket(legacySettings));
 
diff --git a/src/java/org/apache/cassandra/net/OutboundConnection.java b/src/java/org/apache/cassandra/net/OutboundConnection.java
index c2aecb0..821521b 100644
--- a/src/java/org/apache/cassandra/net/OutboundConnection.java
+++ b/src/java/org/apache/cassandra/net/OutboundConnection.java
@@ -1199,7 +1199,7 @@ public class OutboundConnection
                  * is made before the endpointToVersion table is initially constructed or out
                  * of date (e.g. if outbound connections are established for gossip
                  * as a result of an inbound connection) and can result in the wrong outbound
-                 * port being selected if configured with enable_legacy_ssl_storage_port=true.
+                 * port being selected if configured with legacy_ssl_storage_port_enabled=true.
                  */
                 int knownMessagingVersion = messagingVersion();
                 if (knownMessagingVersion != messagingVersion)
diff --git a/test/conf/cassandra-murmur.yaml b/test/conf/cassandra-murmur.yaml
index 75c1917..06507e4 100644
--- a/test/conf/cassandra-murmur.yaml
+++ b/test/conf/cassandra-murmur.yaml
@@ -38,7 +38,7 @@ concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
-enable_user_defined_functions: true
-enable_scripted_user_defined_functions: true
-enable_sasi_indexes: true
-enable_materialized_views: true
+user_defined_functions_enabled: true
+scripted_user_defined_functions_enabled: true
+sasi_indexes_enabled: true
+materialized_views_enabled: true
diff --git a/test/conf/cassandra-seeds.yaml b/test/conf/cassandra-seeds.yaml
index 2673461..5e016cb 100644
--- a/test/conf/cassandra-seeds.yaml
+++ b/test/conf/cassandra-seeds.yaml
@@ -39,5 +39,5 @@ concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
-enable_user_defined_functions: true
-enable_scripted_user_defined_functions: true
+user_defined_functions_enabled: true
+scripted_user_defined_functions_enabled: true
diff --git a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
index 15a4c92..e528d27 100644
--- a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
+++ b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
@@ -71,12 +71,12 @@ concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
-enable_user_defined_functions: true
-enable_scripted_user_defined_functions: true
+user_defined_functions_enabled: true
+scripted_user_defined_functions_enabled: true
 prepared_statements_cache_size_mb: 1
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
 stream_throughput_outbound: 23841823841858MiB/s
-enable_sasi_indexes: true
-enable_materialized_views: true
+sasi_indexes_enabled: true
+materialized_views_enabled: true
 file_cache_enabled: true
diff --git a/test/conf/cassandra-sslcontextfactory.yaml b/test/conf/cassandra-sslcontextfactory.yaml
index 3fcb536..26cea35 100644
--- a/test/conf/cassandra-sslcontextfactory.yaml
+++ b/test/conf/cassandra-sslcontextfactory.yaml
@@ -74,12 +74,12 @@ concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
-enable_user_defined_functions: true
-enable_scripted_user_defined_functions: true
+user_defined_functions_enabled: true
+scripted_user_defined_functions_enabled: true
 prepared_statements_cache_size_mb: 1
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
 stream_throughput_outbound: 23841858MiB/s
-enable_sasi_indexes: true
-enable_materialized_views: true
+sasi_indexes_enabled: true
+materialized_views_enabled: true
 file_cache_enabled: true
diff --git a/test/conf/cassandra.yaml b/test/conf/cassandra.yaml
index 3ed919d..bd5a1b8 100644
--- a/test/conf/cassandra.yaml
+++ b/test/conf/cassandra.yaml
@@ -42,14 +42,14 @@ concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
-enable_user_defined_functions: true
-enable_scripted_user_defined_functions: true
+user_defined_functions_enabled: true
+scripted_user_defined_functions_enabled: true
 prepared_statements_cache_size_mb: 1
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
 stream_throughput_outbound: 23841858MiB/s
-enable_sasi_indexes: true
-enable_materialized_views: true
+sasi_indexes_enabled: true
+materialized_views_enabled: true
 enable_drop_compact_storage: true
 file_cache_enabled: true
 auto_hints_cleanup_enabled: true
diff --git a/test/conf/unit-test-conf/test-native-port.yaml b/test/conf/unit-test-conf/test-native-port.yaml
index 58cd383..8db2ad4 100644
--- a/test/conf/unit-test-conf/test-native-port.yaml
+++ b/test/conf/unit-test-conf/test-native-port.yaml
@@ -42,8 +42,8 @@ concurrent_compactors: 4
 compaction_throughput_mb_per_sec: 0
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
-enable_user_defined_functions: true
-enable_scripted_user_defined_functions: true
+user_defined_functions_enabled: true
+scripted_user_defined_functions_enabled: true
 prepared_statements_cache_size_mb: 1
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
diff --git a/test/distributed/org/apache/cassandra/distributed/test/CountersTest.java b/test/distributed/org/apache/cassandra/distributed/test/CountersTest.java
index 7cc632f..29ce511 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/CountersTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/CountersTest.java
@@ -45,7 +45,7 @@ public class CountersTest extends TestBaseImpl
 
     private static void testUpdateCounter(boolean droppedCompactStorage) throws Throwable
     {
-        try (Cluster cluster = Cluster.build(2).withConfig(c -> c.with(GOSSIP, NATIVE_PROTOCOL).set("enable_drop_compact_storage", true)).start())
+        try (Cluster cluster = Cluster.build(2).withConfig(c -> c.with(GOSSIP, NATIVE_PROTOCOL).set("drop_compact_storage_enabled", true)).start())
         {
             cluster.schemaChange("CREATE KEYSPACE k WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}");
 
diff --git a/test/distributed/org/apache/cassandra/distributed/test/GroupByTest.java b/test/distributed/org/apache/cassandra/distributed/test/GroupByTest.java
index cab3fee..d75b6ba 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/GroupByTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/GroupByTest.java
@@ -42,7 +42,7 @@ public class GroupByTest extends TestBaseImpl
     @Test
     public void groupByWithDeletesAndSrpOnPartitions() throws Throwable
     {
-        try (Cluster cluster = init(builder().withNodes(2).withConfig((cfg) -> cfg.set("enable_user_defined_functions", "true")).start()))
+        try (Cluster cluster = init(builder().withNodes(2).withConfig((cfg) -> cfg.set("user_defined_functions_enabled", "true")).start()))
         {
             cluster.schemaChange(withKeyspace("CREATE TABLE %s.tbl (pk int, ck text, PRIMARY KEY (pk, ck))"));
             initFunctions(cluster);
@@ -69,7 +69,7 @@ public class GroupByTest extends TestBaseImpl
     @Test
     public void groupByWithDeletesAndSrpOnRows() throws Throwable
     {
-        try (Cluster cluster = init(builder().withNodes(2).withConfig((cfg) -> cfg.set("enable_user_defined_functions", "true")).start()))
+        try (Cluster cluster = init(builder().withNodes(2).withConfig((cfg) -> cfg.set("user_defined_functions_enabled", "true")).start()))
         {
             cluster.schemaChange(withKeyspace("CREATE TABLE %s.tbl (pk int, ck text, PRIMARY KEY (pk, ck))"));
             initFunctions(cluster);
@@ -96,7 +96,7 @@ public class GroupByTest extends TestBaseImpl
     @Test
     public void testGroupByWithAggregatesAndPaging() throws Throwable
     {
-        try (Cluster cluster = init(builder().withNodes(2).withConfig((cfg) -> cfg.set("enable_user_defined_functions", "true")).start()))
+        try (Cluster cluster = init(builder().withNodes(2).withConfig((cfg) -> cfg.set("user_defined_functions_enabled", "true")).start()))
         {
             cluster.schemaChange(withKeyspace("CREATE TABLE %s.tbl (pk int, ck int, v1 text, v2 text, v3 text, primary key (pk, ck))"));
             initFunctions(cluster);
diff --git a/test/distributed/org/apache/cassandra/distributed/test/InternodeEncryptionOptionsTest.java b/test/distributed/org/apache/cassandra/distributed/test/InternodeEncryptionOptionsTest.java
index 1462b03..b06f02a 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/InternodeEncryptionOptionsTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/InternodeEncryptionOptionsTest.java
@@ -55,7 +55,7 @@ public class InternodeEncryptionOptionsTest extends AbstractEncryptionOptionsImp
                   ImmutableMap.builder().putAll(validKeystore)
                   .put("internode_encryption", "none")
                   .put("optional", false)
-                  .put("enable_legacy_ssl_storage_port", "true")
+                  .put("legacy_ssl_storage_port_enabled", "true")
                   .build());
         }).createWithoutStarting())
         {
@@ -113,7 +113,7 @@ public class InternodeEncryptionOptionsTest extends AbstractEncryptionOptionsImp
                   ImmutableMap.builder().putAll(validKeystore)
                               .put("internode_encryption", "none")
                               .put("optional", true)
-                              .put("enable_legacy_ssl_storage_port", "true")
+                              .put("legacy_ssl_storage_port_enabled", "true")
                               .build());
         }).createWithoutStarting())
         {
@@ -148,7 +148,7 @@ public class InternodeEncryptionOptionsTest extends AbstractEncryptionOptionsImp
                   ImmutableMap.builder().putAll(validKeystore)
                               .put("internode_encryption", "none")
                               .put("optional", true)
-                              .put("enable_legacy_ssl_storage_port", "true")
+                              .put("legacy_ssl_storage_port_enabled", "true")
                               .build());
         }).createWithoutStarting())
         {
diff --git a/test/distributed/org/apache/cassandra/distributed/upgrade/CompactStorageUpgradeTest.java b/test/distributed/org/apache/cassandra/distributed/upgrade/CompactStorageUpgradeTest.java
index 9e68934..657e25e 100644
--- a/test/distributed/org/apache/cassandra/distributed/upgrade/CompactStorageUpgradeTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/upgrade/CompactStorageUpgradeTest.java
@@ -146,7 +146,7 @@ public class CompactStorageUpgradeTest extends UpgradeTestBase
         .nodes(2)
         .nodesToUpgrade(1, 2)
         .upgradesFrom(v30)
-        .withConfig(config -> config.with(GOSSIP, NETWORK).set("enable_drop_compact_storage", true))
+        .withConfig(config -> config.with(GOSSIP, NETWORK).set("drop_compact_storage_enabled", true))
         .setup((cluster) -> {
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, PRIMARY KEY (pk, ck)) WITH COMPACT STORAGE");
             cluster.coordinator(1).execute("INSERT INTO " + KEYSPACE + ".tbl (pk, ck) VALUES (1,1)", ConsistencyLevel.ALL);
diff --git a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
index 750939f..18eaded 100644
--- a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
@@ -22,6 +22,8 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
 
 public class LoadOldYAMLBackwardCompatibilityTest
 {
@@ -41,6 +43,7 @@ public class LoadOldYAMLBackwardCompatibilityTest
         /*assertEquals(5, config.internode_socket_send_buffer_size_in_bytes);
         assertEquals(5, config.internode_socket_receive_buffer_size_in_bytes);
         assertEquals(DurationSpec.inMilliseconds(10800000), config.max_hint_window);
+        assertEquals(DurationSpec.inHours(0), config.max_hint_window);
         assertEquals(DurationSpec.inMilliseconds(0), config.native_transport_idle_timeout);
         assertEquals(DurationSpec.inMilliseconds(10000), config.request_timeout);
         assertEquals(DurationSpec.inMilliseconds(5000), config.read_request_timeout);
@@ -99,15 +102,15 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DurationSpec.inMilliseconds(1000), config.gc_warn_threshold);
         assertEquals(DurationSpec.inSeconds(86400), config.trace_type_query_ttl);
         assertEquals(DurationSpec.inSeconds(604800), config.trace_type_repair_ttl);
-        assertNull(config.prepared_statements_cache_size);
-        assertFalse(config.user_defined_functions_enabled);
-        assertFalse(config.scripted_user_defined_functions_enabled);
-        assertFalse(config.materialized_views_enabled);
+        assertNull(config.prepared_statements_cache_size);*/
+        assertTrue(config.user_defined_functions_enabled);
+        assertTrue(config.scripted_user_defined_functions_enabled);
+        assertTrue(config.materialized_views_enabled);
         assertFalse(config.transient_replication_enabled);
-        assertFalse(config.sasi_indexes_enabled);
-        assertFalse(config.drop_compact_storage_enabled);
+        assertTrue(config.sasi_indexes_enabled);
+        assertTrue(config.drop_compact_storage_enabled);
         assertTrue(config.user_defined_functions_threads_enabled);
-        assertEquals(DurationSpec.inMilliseconds(2000), config.permissions_validity);
+        /*assertEquals(DurationSpec.inMilliseconds(2000), config.permissions_validity);
         assertEquals(DurationSpec.inMilliseconds(0), config.permissions_update_interval);
         assertEquals(DurationSpec.inMilliseconds(2000), config.roles_validity);
         assertEquals(DurationSpec.inMilliseconds(0), config.roles_update_interval);
diff --git a/test/unit/org/apache/cassandra/cql3/ViewTest.java b/test/unit/org/apache/cassandra/cql3/ViewTest.java
index 1230eec..75efa57 100644
--- a/test/unit/org/apache/cassandra/cql3/ViewTest.java
+++ b/test/unit/org/apache/cassandra/cql3/ViewTest.java
@@ -508,10 +508,10 @@ public class ViewTest extends ViewAbstractTest
 
         executeNet("USE " + keyspace());
 
-        boolean enableMaterializedViews = DatabaseDescriptor.getEnableMaterializedViews();
+        boolean enableMaterializedViews = DatabaseDescriptor.getMaterializedViewsEnabled();
         try
         {
-            DatabaseDescriptor.setEnableMaterializedViews(false);
+            DatabaseDescriptor.setMaterializedViewsEnabled(false);
             createView("CREATE MATERIALIZED VIEW %s AS SELECT v FROM %s WHERE k IS NOT NULL AND v IS NOT NULL PRIMARY KEY (v, k)");
             Assert.fail("Should not be able to create a materialized view if they are disabled");
         }
@@ -523,7 +523,7 @@ public class ViewTest extends ViewAbstractTest
         }
         finally
         {
-            DatabaseDescriptor.setEnableMaterializedViews(enableMaterializedViews);
+            DatabaseDescriptor.setMaterializedViewsEnabled(enableMaterializedViews);
         }
     }
 
diff --git a/test/unit/org/apache/cassandra/index/sasi/SASICQLTest.java b/test/unit/org/apache/cassandra/index/sasi/SASICQLTest.java
index c786184..e746fab 100644
--- a/test/unit/org/apache/cassandra/index/sasi/SASICQLTest.java
+++ b/test/unit/org/apache/cassandra/index/sasi/SASICQLTest.java
@@ -112,10 +112,10 @@ public class SASICQLTest extends CQLTester
     {
         createTable("CREATE TABLE %s (k int PRIMARY KEY, v int)");
 
-        boolean enableSASIIndexes = DatabaseDescriptor.getEnableSASIIndexes();
+        boolean enableSASIIndexes = DatabaseDescriptor.getSASIIndexesEnabled();
         try
         {
-            DatabaseDescriptor.setEnableSASIIndexes(false);
+            DatabaseDescriptor.setSASIIndexesEnabled(false);
             createIndex("CREATE CUSTOM INDEX ON %s (v) USING 'org.apache.cassandra.index.sasi.SASIIndex'");
             Assert.fail("Should not be able to create a SASI index if they are disabled");
         }
@@ -128,7 +128,7 @@ public class SASICQLTest extends CQLTester
         }
         finally
         {
-            DatabaseDescriptor.setEnableSASIIndexes(enableSASIIndexes);
+            DatabaseDescriptor.setSASIIndexesEnabled(enableSASIIndexes);
         }
     }
 
diff --git a/test/unit/org/apache/cassandra/net/MessagingServiceTest.java b/test/unit/org/apache/cassandra/net/MessagingServiceTest.java
index 871f592..3b5959b 100644
--- a/test/unit/org/apache/cassandra/net/MessagingServiceTest.java
+++ b/test/unit/org/apache/cassandra/net/MessagingServiceTest.java
@@ -347,12 +347,12 @@ public class MessagingServiceTest
 
             Set<InetAddressAndPort> expect = new HashSet<>();
             expect.add(InetAddressAndPort.getByAddressOverrideDefaults(listenAddress, DatabaseDescriptor.getStoragePort()));
-            if (settings.encryption.enable_legacy_ssl_storage_port)
+            if (settings.encryption.legacy_ssl_storage_port_enabled)
                 expect.add(InetAddressAndPort.getByAddressOverrideDefaults(listenAddress, DatabaseDescriptor.getSSLStoragePort()));
             if (listenOnBroadcastAddr)
             {
                 expect.add(InetAddressAndPort.getByAddressOverrideDefaults(FBUtilities.getBroadcastAddressAndPort().getAddress(), DatabaseDescriptor.getStoragePort()));
-                if (settings.encryption.enable_legacy_ssl_storage_port)
+                if (settings.encryption.legacy_ssl_storage_port_enabled)
                     expect.add(InetAddressAndPort.getByAddressOverrideDefaults(FBUtilities.getBroadcastAddressAndPort().getAddress(), DatabaseDescriptor.getSSLStoragePort()));
             }
 

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


[cassandra] 05/13: Extend DurationSpec and DataStorageSpec for smallest unit and transfer denylist parameters to the new framework patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 b9e2ab75f8f6dedd45c6ad7a83b3160149869262
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Wed Feb 2 12:47:41 2022 -0500

    Extend DurationSpec and DataStorageSpec for smallest unit and transfer denylist parameters to the new framework
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                | 14 ++--
 src/java/org/apache/cassandra/config/Config.java   | 12 ++--
 .../org/apache/cassandra/config/Converters.java    | 28 ++++----
 .../apache/cassandra/config/DataStorageSpec.java   | 49 ++++++++++++--
 .../cassandra/config/DatabaseDescriptor.java       | 46 ++++++-------
 .../org/apache/cassandra/config/DurationSpec.java  | 75 +++++++++++++++++-----
 .../config/SmallestDataStorageKibibytes.java       | 55 ++++++++++++++++
 .../config/SmallestDataStorageMebibytes.java       | 55 ++++++++++++++++
 .../config/SmallestDurationMilliseconds.java       | 57 ++++++++++++++++
 .../cassandra/config/SmallestDurationMinutes.java  | 57 ++++++++++++++++
 .../cassandra/config/SmallestDurationSeconds.java  | 57 ++++++++++++++++
 .../apache/cassandra/schema/PartitionDenylist.java |  6 +-
 .../org/apache/cassandra/service/StorageProxy.java | 16 ++---
 .../distributed/test/PartitionDenylistTest.java    |  8 +--
 .../config/DatabaseDescriptorRefTest.java          |  7 +-
 .../cassandra/config/DatabaseDescriptorTest.java   |  4 +-
 .../LoadOldYAMLBackwardCompatibilityTest.java      |  6 +-
 .../config/SmallestDataStorageKibibytesTest.java   | 42 ++++++++++++
 .../config/SmallestDataStorageMebibytesTest.java   | 42 ++++++++++++
 .../config/SmallestDurationMillisecondsTest.java   | 48 ++++++++++++++
 .../config/SmallestDurationMinutesTest.java        | 52 +++++++++++++++
 .../config/SmallestDurationSecondsTest.java        | 50 +++++++++++++++
 .../cassandra/service/PartitionDenylistTest.java   |  8 +--
 23 files changed, 701 insertions(+), 93 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 265bf38..1d7998a 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -841,7 +841,7 @@ rpc_keepalive: true
 # Uncomment to set socket buffer size for internode communication
 # Note that when setting this, the buffer size is limited by net.core.wmem_max
 # and when not setting it it is defined by net.ipv4.tcp_wmem
-# internode_socket_receive_buffer_size_in_bytes:
+# internode_socket_receive_buffer_size:
 
 # Set to true to have Cassandra create a hard link to each sstable
 # flushed or streamed locally in a backups/ subdirectory of the
@@ -1076,19 +1076,19 @@ slow_query_log_timeout_in_ms: 500
 
 # Allows denying configurable access (rw/rr) to operations on configured ks, table, and partitions, intended for use by
 # operators to manage cluster health vs application access. See CASSANDRA-12106 and CEP-13 for more details.
-# enable_partition_denylist: false
+# partition_denylist_enabled: false
 
-# enable_denylist_writes: true
-# enable_denylist_reads: true
-# enable_denylist_range_reads: true
+# denylist_writes_enabled: true
+# denylist_reads_enabled: true
+# denylist_range_reads_enabled: true
 
 # The interval at which keys in the cache for denylisting will "expire" and async refresh from the backing DB.
 # Note: this serves only as a fail-safe, as the usage pattern is expected to be "mutate state, refresh cache" on any
 # changes to the underlying denylist entries. See documentation for details.
-# denylist_refresh_seconds: 600
+# denylist_refresh: 600s
 
 # In the event of errors on attempting to load the denylist cache, retry on this interval.
-# denylist_initial_load_retry_seconds: 5
+# denylist_initial_load_retry: 5s
 
 # We cap the number of denylisted keys allowed per table to keep things from growing unbounded. Nodes will warn above
 # this limit while allowing new denylisted keys to be inserted. Denied keys are loaded in natural query / clustering
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 0485cc1..eb67be1 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -546,17 +546,17 @@ public class Config
     /** This feature allows denying access to operations on certain key partitions, intended for use by operators to
      * provide another tool to manage cluster health vs application access. See CASSANDRA-12106 and CEP-13 for more details.
      */
-    public volatile boolean enable_partition_denylist = false;
+    public volatile boolean partition_denylist_enabled = false;
 
-    public volatile boolean enable_denylist_writes = true;
+    public volatile boolean denylist_writes_enabled = true;
 
-    public volatile boolean enable_denylist_reads = true;
+    public volatile boolean denylist_reads_enabled = true;
 
-    public volatile boolean enable_denylist_range_reads = true;
+    public volatile boolean denylist_range_reads_enabled = true;
 
-    public int denylist_refresh_seconds = 600;
+    public SmallestDurationSeconds denylist_refresh = new SmallestDurationSeconds("600s");
 
-    public int denylist_initial_load_retry_seconds = 5;
+    public SmallestDurationSeconds denylist_initial_load_retry = new SmallestDurationSeconds("5s");
 
     /** We cap the number of denylisted keys allowed per table to keep things from growing unbounded. Operators will
      * receive warnings and only denylist_max_keys_per_table in natural query ordering will be processed on overflow.
diff --git a/src/java/org/apache/cassandra/config/Converters.java b/src/java/org/apache/cassandra/config/Converters.java
index 629e3d3..eb64552 100644
--- a/src/java/org/apache/cassandra/config/Converters.java
+++ b/src/java/org/apache/cassandra/config/Converters.java
@@ -36,30 +36,30 @@ public enum Converters
      */
     IDENTITY(null, o -> o, o-> o),
     MILLIS_DURATION(Long.class,
-                    o -> DurationSpec.inMilliseconds((Long) o),
-                    o -> ((DurationSpec)o).toMilliseconds()),
+                    o -> SmallestDurationMilliseconds.inMilliseconds((Long) o),
+                    o -> ((SmallestDurationMilliseconds)o).toMilliseconds()),
     MILLIS_DOUBLE_DURATION(Double.class,
-                           o ->  DurationSpec.inDoubleMilliseconds((Double) o),
-                           o -> ((DurationSpec)o).toMilliseconds()),
+                           o ->  SmallestDurationMilliseconds.inDoubleMilliseconds((Double) o),
+                           o -> ((SmallestDurationMilliseconds)o).toMilliseconds()),
     /**
      * This converter is used to support backward compatibility for parameters where in the past -1 was used as a value
      * Example: credentials_update_interval_in_ms = -1 and credentials_update_interval = null (quantity of 0ms) are equal.
      */
     MILLIS_CUSTOM_DURATION(Long.class,
-                           o -> (Long)o == -1 ? new DurationSpec("0ms") : DurationSpec.inMilliseconds((Long) o),
-                           o -> ((DurationSpec)o).toMilliseconds() == 0 ? -1 : ((DurationSpec)o).toMilliseconds()),
+                           o -> (Long)o == -1 ? new SmallestDurationMilliseconds("0ms") : SmallestDurationMilliseconds.inMilliseconds((Long) o),
+                           o -> ((SmallestDurationMilliseconds)o).toMilliseconds() == 0 ? -1 : ((SmallestDurationMilliseconds)o).toMilliseconds()),
     SECONDS_DURATION(Long.class,
-                     o -> DurationSpec.inSeconds((Long) o),
-                     o -> ((DurationSpec)o).toSeconds()),
+                     o -> SmallestDurationSeconds.inSeconds((Long) o),
+                     o -> ((SmallestDurationSeconds)o).toSeconds()),
     MINUTES_DURATION(Long.class,
-                     o -> DurationSpec.inMinutes((Long) o),
-                     o -> ((DurationSpec)o).toMinutes()),
+                     o -> SmallestDurationMinutes.inMinutes((Long) o),
+                     o -> ((SmallestDurationMinutes)o).toMinutes()),
     MEBIBYTES_DATA_STORAGE(Long.class,
-                          o -> DataStorageSpec.inMebibytes((Long) o),
-                          o -> ((DataStorageSpec)o).toMebibytes()),
+                          o -> SmallestDataStorageMebibytes.inMebibytes((Long) o),
+                          o -> ((SmallestDataStorageMebibytes)o).toMebibytes()),
     KIBIBYTES_DATASTORAGE(Long.class,
-                          o -> DataStorageSpec.inKibibytes((Long) o),
-                          o -> ((DataStorageSpec)o).toKibibytes()),
+                          o -> SmallestDataStorageKibibytes.inKibibytes((Long) o),
+                          o -> ((SmallestDataStorageKibibytes)o).toKibibytes()),
     BYTES_DATASTORAGE(Long.class,
                       o -> DataStorageSpec.inBytes((Long) o),
                       o -> ((DataStorageSpec)o).toBytes()),
diff --git a/src/java/org/apache/cassandra/config/DataStorageSpec.java b/src/java/org/apache/cassandra/config/DataStorageSpec.java
index 72ed2ba..baa6d4a 100644
--- a/src/java/org/apache/cassandra/config/DataStorageSpec.java
+++ b/src/java/org/apache/cassandra/config/DataStorageSpec.java
@@ -23,18 +23,30 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.primitives.Ints;
 
 import org.apache.cassandra.exceptions.ConfigurationException;
 
+import static org.apache.cassandra.config.DataStorageSpec.DataStorageUnit.GIBIBYTES;
+import static org.apache.cassandra.config.DataStorageSpec.DataStorageUnit.KIBIBYTES;
+import static org.apache.cassandra.config.DataStorageSpec.DataStorageUnit.MEBIBYTES;
+
 /**
  * Represents an amount of data storage. Wrapper class for Cassandra configuration parameters, providing to the
  * users the opportunity to be able to provide config with a unit of their choice in cassandra.yaml as per the available
  * options. (CASSANDRA-15234)
  */
-public final class DataStorageSpec
+public class DataStorageSpec
 {
     /**
+     * Immutable map that matches supported time units according to a provided smallest supported time unit
+     */
+    private static final ImmutableMap<DataStorageUnit, ImmutableSet<DataStorageUnit>> MAP_UNITS_PER_MIN_UNIT =
+    ImmutableMap.of(KIBIBYTES, ImmutableSet.of(KIBIBYTES, MEBIBYTES, GIBIBYTES),
+                    MEBIBYTES, ImmutableSet.of(MEBIBYTES, GIBIBYTES));
+    /**
      * The Regexp used to parse the storage provided as String.
      */
     private static final Pattern STORAGE_UNITS_PATTERN = Pattern.compile("^(\\d+)(GiB|MiB|KiB|B)$");
@@ -48,7 +60,7 @@ public final class DataStorageSpec
         if (value == null || value.equals("null"))
         {
             quantity = 0;
-            unit = DataStorageUnit.MEBIBYTES; // the unit doesn't really matter as 0 is 0 in all units
+            unit = MEBIBYTES; // the unit doesn't really matter as 0 is 0 in all units
             return;
         }
 
@@ -74,6 +86,35 @@ public final class DataStorageSpec
         this.unit = unit;
     }
 
+    public DataStorageSpec (String value, DataStorageUnit minUnit)
+    {
+        if (value == null || value.equals("null"))
+        {
+            quantity = 0;
+            unit = minUnit;
+            return;
+        }
+
+        if (!MAP_UNITS_PER_MIN_UNIT.containsKey(minUnit))
+            throw new ConfigurationException("Invalid smallest unit set for " + value);
+
+        //parse the string field value
+        Matcher matcher = STORAGE_UNITS_PATTERN.matcher(value);
+
+        if (matcher.find())
+        {
+            quantity = Long.parseLong(matcher.group(1));
+            unit = DataStorageUnit.fromSymbol(matcher.group(2));
+
+            if (!MAP_UNITS_PER_MIN_UNIT.get(minUnit).contains(unit))
+                throw new ConfigurationException("Invalid data storage: " + value + " Accepted units:" + MAP_UNITS_PER_MIN_UNIT);
+        }
+        else
+        {
+            throw new ConfigurationException("Invalid data storage: " + value + " Accepted units:" + MAP_UNITS_PER_MIN_UNIT.get(minUnit) +
+                                             " where case matters and only non-negative values are accepted");
+        }
+    }
     /**
      * Creates a {@code DataStorageSpec} of the specified amount of bytes.
      *
@@ -93,7 +134,7 @@ public final class DataStorageSpec
      */
     public static DataStorageSpec inKibibytes(long kibibytes)
     {
-        return new DataStorageSpec(kibibytes, DataStorageUnit.KIBIBYTES);
+        return new DataStorageSpec(kibibytes, KIBIBYTES);
     }
 
     /**
@@ -104,7 +145,7 @@ public final class DataStorageSpec
      */
     public static DataStorageSpec inMebibytes(long mebibytes)
     {
-        return new DataStorageSpec(mebibytes, DataStorageUnit.MEBIBYTES);
+        return new DataStorageSpec(mebibytes, MEBIBYTES);
     }
 
     /**
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 622a825..102a587 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -3609,68 +3609,70 @@ public class DatabaseDescriptor
         conf.consecutive_message_errors_threshold = value;
     }
 
-    public static boolean getEnablePartitionDenylist()
+    public static boolean getPartitionDenylistEnabled()
     {
-        return conf.enable_partition_denylist;
+        return conf.partition_denylist_enabled;
     }
 
-    public static void setEnablePartitionDenylist(boolean enabled)
+    public static void setPartitionDenylistEnabled(boolean enabled)
     {
-        conf.enable_partition_denylist = enabled;
+        conf.partition_denylist_enabled = enabled;
     }
 
-    public static boolean getEnableDenylistWrites()
+    public static boolean getDenylistWritesEnabled()
     {
-        return conf.enable_denylist_writes;
+        return conf.denylist_writes_enabled;
     }
 
-    public static void setEnableDenylistWrites(boolean enabled)
+    public static void setDenylistWritesEnabled(boolean enabled)
     {
-        conf.enable_denylist_writes = enabled;
+        conf.denylist_writes_enabled = enabled;
     }
 
-    public static boolean getEnableDenylistReads()
+    public static boolean getDenylistReadsEnabled()
     {
-        return conf.enable_denylist_reads;
+        return conf.denylist_reads_enabled;
     }
 
-    public static void setEnableDenylistReads(boolean enabled)
+    public static void setDenylistReadsEnabled(boolean enabled)
     {
-        conf.enable_denylist_reads = enabled;
+        conf.denylist_reads_enabled = enabled;
     }
 
-    public static boolean getEnableDenylistRangeReads()
+    public static boolean getDenylistRangeReadsEnabled()
     {
-        return conf.enable_denylist_range_reads;
+        return conf.denylist_range_reads_enabled;
     }
 
-    public static void setEnableDenylistRangeReads(boolean enabled)
+    public static void setDenylistRangeReadsEnabled(boolean enabled)
     {
-        conf.enable_denylist_range_reads = enabled;
+        conf.denylist_range_reads_enabled = enabled;
     }
 
     public static int getDenylistRefreshSeconds()
     {
-        return conf.denylist_refresh_seconds;
+        return conf.denylist_refresh.toSecondsAsInt();
     }
 
     public static void setDenylistRefreshSeconds(int seconds)
     {
         if (seconds <= 0)
-            throw new IllegalArgumentException("denylist_refresh_seconds must be a positive integer.");
-        conf.denylist_refresh_seconds = seconds;
+            throw new IllegalArgumentException("denylist_refresh must be a positive integer.");
+
+        conf.denylist_refresh = SmallestDurationSeconds.inSeconds(seconds);
     }
 
     public static int getDenylistInitialLoadRetrySeconds()
     {
-        return conf.denylist_initial_load_retry_seconds;
+        return conf.denylist_initial_load_retry.toSecondsAsInt();
     }
 
     public static void setDenylistInitialLoadRetrySeconds(int seconds)
     {
         if (seconds <= 0)
-            throw new IllegalArgumentException("denylist_initial_load_retry_seconds must be a positive integer.");
-        conf.denylist_initial_load_retry_seconds = seconds;
+            throw new IllegalArgumentException("denylist_initial_load_retry must be a positive integer.");
+
+        conf.denylist_initial_load_retry = SmallestDurationSeconds.inSeconds(seconds);
     }
 
     public static ConsistencyLevel getDenylistConsistencyLevel()
diff --git a/src/java/org/apache/cassandra/config/DurationSpec.java b/src/java/org/apache/cassandra/config/DurationSpec.java
index 796fde6..f06c247 100644
--- a/src/java/org/apache/cassandra/config/DurationSpec.java
+++ b/src/java/org/apache/cassandra/config/DurationSpec.java
@@ -25,24 +25,40 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.primitives.Ints;
 
 import org.apache.cassandra.exceptions.ConfigurationException;
 
+import static java.util.concurrent.TimeUnit.DAYS;
+import static java.util.concurrent.TimeUnit.HOURS;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.MINUTES;
+import static java.util.concurrent.TimeUnit.SECONDS;
+
 /**
  * Represents a positive time duration. Wrapper class for Cassandra duration configuration parameters, providing to the
  * users the opportunity to be able to provide config with a unit of their choice in cassandra.yaml as per the available
  * options. (CASSANDRA-15234)
  */
-public final class DurationSpec
+public class DurationSpec
 {
     /**
+     * Immutable map that matches supported time units according to a provided smallest supported time unit
+     */
+    private static final ImmutableMap<TimeUnit, ImmutableSet<TimeUnit>> MAP_UNITS_PER_MIN_UNIT =
+    ImmutableMap.of(MILLISECONDS, ImmutableSet.of(MILLISECONDS, SECONDS, MINUTES, HOURS, DAYS),
+                    SECONDS, ImmutableSet.of(SECONDS, MINUTES, HOURS, DAYS),
+                    MINUTES, ImmutableSet.of(MINUTES, HOURS, DAYS));
+    /**
      * The Regexp used to parse the duration provided as String.
      */
-    private static final Pattern TIME_UNITS_PATTERN = Pattern.compile(("^(\\d+)(d|h|s|ms|us|µs|ns|m)"));
+    private static final Pattern TIME_UNITS_PATTERN = Pattern.compile(("^(\\d+)(d|h|s|ms|us|µs|ns|m)$"));
+
     private static final Pattern VALUES_PATTERN = Pattern.compile(("\\d+"));
 
-    public final long quantity;
+    private final long quantity;
 
     private final TimeUnit unit;
 
@@ -51,7 +67,7 @@ public final class DurationSpec
         if (value == null || value.equals("null") || value.toLowerCase(Locale.ROOT).equals("nan"))
         {
             quantity = 0;
-            unit = TimeUnit.MILLISECONDS;
+            unit = MILLISECONDS;
             return;
         }
 
@@ -84,6 +100,35 @@ public final class DurationSpec
         this(Math.round(quantity), unit);
     }
 
+    public DurationSpec(String value, TimeUnit minUnit)
+    {
+        if (value == null || value.equals("null") || value.toLowerCase(Locale.ROOT).equals("nan"))
+        {
+            quantity = 0;
+            unit = minUnit;
+            return;
+        }
+
+        if (!MAP_UNITS_PER_MIN_UNIT.containsKey(minUnit))
+            throw new ConfigurationException("Invalid smallest unit set for " + value);
+
+        Matcher matcher = TIME_UNITS_PATTERN.matcher(value);
+
+        if(matcher.find())
+        {
+            quantity = Long.parseLong(matcher.group(1));
+            unit = fromSymbol(matcher.group(2));
+
+            if (!MAP_UNITS_PER_MIN_UNIT.get(minUnit).contains(unit))
+                throw new ConfigurationException("Invalid duration: " + value + " Accepted units:" + MAP_UNITS_PER_MIN_UNIT.get(minUnit));
+        }
+        else
+        {
+            throw new ConfigurationException("Invalid duration: " + value + " Accepted units:" + MAP_UNITS_PER_MIN_UNIT.get(minUnit) +
+                                             " where case matters and only non-negative values.");
+        }
+    }
+
     /**
      * Creates a {@code DurationSpec} of the specified amount of milliseconds.
      *
@@ -92,12 +137,12 @@ public final class DurationSpec
      */
     public static DurationSpec inMilliseconds(long milliseconds)
     {
-        return new DurationSpec(milliseconds, TimeUnit.MILLISECONDS);
+        return new DurationSpec(milliseconds, MILLISECONDS);
     }
 
     public static DurationSpec inDoubleMilliseconds(double milliseconds)
     {
-        return new DurationSpec(milliseconds, TimeUnit.MILLISECONDS);
+        return new DurationSpec(milliseconds, MILLISECONDS);
     }
 
     /**
@@ -108,7 +153,7 @@ public final class DurationSpec
      */
     public static DurationSpec inSeconds(long seconds)
     {
-        return new DurationSpec(seconds, TimeUnit.SECONDS);
+        return new DurationSpec(seconds, SECONDS);
     }
 
     /**
@@ -119,7 +164,7 @@ public final class DurationSpec
      */
     public static DurationSpec inMinutes(long minutes)
     {
-        return new DurationSpec(minutes, TimeUnit.MINUTES);
+        return new DurationSpec(minutes, MINUTES);
     }
 
     /**
@@ -130,7 +175,7 @@ public final class DurationSpec
      */
     public static DurationSpec inHours(long hours)
     {
-        return new DurationSpec(hours, TimeUnit.HOURS);
+        return new DurationSpec(hours, HOURS);
     }
 
     /**
@@ -151,7 +196,7 @@ public final class DurationSpec
         if (matcher.matches())
         {
             seconds = Long.parseLong(value);
-            return new DurationSpec(seconds, TimeUnit.SECONDS);
+            return new DurationSpec(seconds, SECONDS);
         }
 
         //otherwise we just use the standard constructors
@@ -166,11 +211,11 @@ public final class DurationSpec
     {
         switch (symbol.toLowerCase())
         {
-            case "d": return TimeUnit.DAYS;
-            case "h": return TimeUnit.HOURS;
-            case "m": return TimeUnit.MINUTES;
-            case "s": return TimeUnit.SECONDS;
-            case "ms": return TimeUnit.MILLISECONDS;
+            case "d": return DAYS;
+            case "h": return HOURS;
+            case "m": return MINUTES;
+            case "s": return SECONDS;
+            case "ms": return MILLISECONDS;
             case "us":
             case "µs": return TimeUnit.MICROSECONDS;
             case "ns": return TimeUnit.NANOSECONDS;
diff --git a/src/java/org/apache/cassandra/config/SmallestDataStorageKibibytes.java b/src/java/org/apache/cassandra/config/SmallestDataStorageKibibytes.java
new file mode 100644
index 0000000..e298ba5
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/SmallestDataStorageKibibytes.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+/**
+ * Wrapper class for Cassandra data storage configuration parameters which are internally represented in Kibibytes. In order
+ * 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
+{
+    /**
+     * Creates a {@code SmallestDataStorageKibibytes} of the specified amount of seconds and provides the smallest
+     * required unit of Kibibytes for the respective parameter of type {@code SmallestDurationSeconds}.
+     *
+     * @param value the data storage
+     *
+     */
+    public SmallestDataStorageKibibytes(String value)
+    {
+        super(value, DataStorageSpec.DataStorageUnit.KIBIBYTES);
+    }
+
+    private SmallestDataStorageKibibytes(long quantity, DataStorageSpec.DataStorageUnit unit)
+    {
+        super(quantity, unit);
+    }
+
+    /**
+     * Creates a {@code SmallestDataStorageKibibytes} of the specified amount of kibibytes.
+     *
+     * @param kibibytes the amount of kibibytes
+     * @return a data storage
+     */
+    public static SmallestDataStorageKibibytes inKibibytes(long kibibytes)
+    {
+        return new SmallestDataStorageKibibytes(kibibytes, DataStorageSpec.DataStorageUnit.KIBIBYTES);
+    }
+}
diff --git a/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java b/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
new file mode 100644
index 0000000..effc9a8
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+/**
+ * Wrapper class for Cassandra data storage configuration parameters which are internally represented in mebibytes. In order
+ * 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
+{
+    /**
+     * Creates a {@code SmallestDataStoragemebibytes} of the specified amount of seconds and provides the smallest
+     * required unit of mebibytes for the respective parameter of type {@code SmallestDurationSeconds}.
+     *
+     * @param value the data storage
+     *
+     */
+    public SmallestDataStorageMebibytes(String value)
+    {
+        super(value, DataStorageSpec.DataStorageUnit.MEBIBYTES);
+    }
+
+    private SmallestDataStorageMebibytes(long quantity, DataStorageSpec.DataStorageUnit unit)
+    {
+        super(quantity, unit);
+    }
+
+    /**
+     * Creates a {@code SmallestDataStorageMebibytes} of the specified amount of mebibytes.
+     *
+     * @param mebibytes the amount of mebibytes
+     * @return a data storage
+     */
+    public static SmallestDataStorageMebibytes inMebibytes(long mebibytes)
+    {
+        return new SmallestDataStorageMebibytes(mebibytes, DataStorageSpec.DataStorageUnit.MEBIBYTES);
+    }
+}
diff --git a/src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java b/src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java
new file mode 100644
index 0000000..cf6ef1b
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Wrapper class for Cassandra duration configuration parameters which are internally represented in Milliseconds. In order
+ * 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
+{
+    /**
+     * Creates a {@code SmallestDurationMilliseconds} of the specified amount of milliseconds and provides the smallest
+     * required unit of milliseconds for the respective parameter of type {@code SmallestDurationMilliseconds}.
+     *
+     * @param value the duration
+     *
+     */
+    public SmallestDurationMilliseconds(String value)
+    {
+        super(value, TimeUnit.MILLISECONDS);
+    }
+
+    private SmallestDurationMilliseconds(long quantity, TimeUnit unit)
+    {
+        super(quantity, unit);
+    }
+
+    /**
+     * Creates a {@code SmallestDurationMilliseconds} of the specified amount of milliseconds.
+     *
+     * @param milliseconds the amount of milliseconds
+     * @return a duration
+     */
+    public static SmallestDurationMilliseconds inMilliseconds(long milliseconds)
+    {
+        return new SmallestDurationMilliseconds(milliseconds, TimeUnit.MILLISECONDS);
+    }
+}
diff --git a/src/java/org/apache/cassandra/config/SmallestDurationMinutes.java b/src/java/org/apache/cassandra/config/SmallestDurationMinutes.java
new file mode 100644
index 0000000..d68230f
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/SmallestDurationMinutes.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Wrapper class for Cassandra duration configuration parameters which are internally represented in Minuts. In order
+ * 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
+{
+    /**
+     * Creates a {@code SmallestDurationMinutes} of the specified amount of minutes and provides the smallest
+     * required unit of minutes for the respective parameter of type {@code SmallestDurationMinutes}.
+     *
+     * @param value the duration
+     *
+     */
+    public SmallestDurationMinutes(String value)
+    {
+        super(value, TimeUnit.MINUTES);
+    }
+
+    private SmallestDurationMinutes(long quantity, TimeUnit unit)
+    {
+        super(quantity, unit);
+    }
+
+    /**
+     * Creates a {@code SmallestDurationMinutes} of the specified amount of minutes.
+     *
+     * @param minutes the amount of minutes
+     * @return a duration
+     */
+    public static SmallestDurationMinutes inMinutes(long minutes)
+    {
+        return new SmallestDurationMinutes(minutes, TimeUnit.MINUTES);
+    }
+}
diff --git a/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java b/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
new file mode 100644
index 0000000..6ca8266
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Wrapper class for Cassandra duration configuration parameters which are internally represented in Seconds. In order
+ * 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
+{
+    /**
+     * Creates a {@code SmallestDurationSeconds} of the specified amount of seconds and provides the smallest
+     * required unit of seconds for the respective parameter of type {@code SmallestDurationSeconds}.
+     *
+     * @param value the duration
+     *
+     */
+    public SmallestDurationSeconds(String value)
+    {
+        super(value, TimeUnit.SECONDS);
+    }
+
+    private SmallestDurationSeconds(long quantity, TimeUnit unit)
+    {
+        super(quantity, unit);
+    }
+
+    /**
+     * Creates a {@code SmallestDurationSeconds} of the specified amount of seconds.
+     *
+     * @param seconds the amount of seconds
+     * @return a duration
+     */
+    public static SmallestDurationSeconds inSeconds(long seconds)
+    {
+        return new SmallestDurationSeconds(seconds, TimeUnit.SECONDS);
+    }
+}
diff --git a/src/java/org/apache/cassandra/schema/PartitionDenylist.java b/src/java/org/apache/cassandra/schema/PartitionDenylist.java
index c9aee97..9bd171c 100644
--- a/src/java/org/apache/cassandra/schema/PartitionDenylist.java
+++ b/src/java/org/apache/cassandra/schema/PartitionDenylist.java
@@ -131,7 +131,7 @@ public class PartitionDenylist
      */
     public void initialLoad()
     {
-        if (!DatabaseDescriptor.getEnablePartitionDenylist())
+        if (!DatabaseDescriptor.getPartitionDenylistEnabled())
             return;
 
         synchronized (this)
@@ -309,7 +309,7 @@ public class PartitionDenylist
         final TableMetadata tmd = Schema.instance.getTableMetadata(tid);
 
         // We have a few quick state checks to get out of the way first; this is hot path so we want to do these first if possible.
-        if (!DatabaseDescriptor.getEnablePartitionDenylist() || tid == null || tmd == null || !canDenylistKeyspace(tmd.keyspace))
+        if (!DatabaseDescriptor.getPartitionDenylistEnabled() || tid == null || tmd == null || !canDenylistKeyspace(tmd.keyspace))
             return true;
 
         try
@@ -351,7 +351,7 @@ public class PartitionDenylist
     public int getDeniedKeysInRangeCount(final TableId tid, final AbstractBounds<PartitionPosition> range)
     {
         final TableMetadata tmd = Schema.instance.getTableMetadata(tid);
-        if (!DatabaseDescriptor.getEnablePartitionDenylist() || tid == null || tmd == null || !canDenylistKeyspace(tmd.keyspace))
+        if (!DatabaseDescriptor.getPartitionDenylistEnabled() || tid == null || tmd == null || !canDenylistKeyspace(tmd.keyspace))
             return 0;
 
         try
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index e273348..686192c 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -287,7 +287,7 @@ public class StorageProxy implements StorageProxyMBean
         {
             TableMetadata metadata = Schema.instance.validateTable(keyspaceName, cfName);
 
-            if (DatabaseDescriptor.getEnablePartitionDenylist() && DatabaseDescriptor.getEnableDenylistWrites() && !partitionDenylist.isKeyPermitted(keyspaceName, cfName, key.getKey()))
+            if (DatabaseDescriptor.getPartitionDenylistEnabled() && DatabaseDescriptor.getDenylistWritesEnabled() && !partitionDenylist.isKeyPermitted(keyspaceName, cfName, key.getKey()))
             {
                 denylistMetrics.incrementWritesRejected();
                 throw new InvalidRequestException(String.format("Unable to CAS write to denylisted partition [0x%s] in %s/%s",
@@ -1079,7 +1079,7 @@ public class StorageProxy implements StorageProxyMBean
                                           long queryStartNanoTime)
     throws WriteTimeoutException, WriteFailureException, UnavailableException, OverloadedException, InvalidRequestException
     {
-        if (DatabaseDescriptor.getEnablePartitionDenylist() && DatabaseDescriptor.getEnableDenylistWrites())
+        if (DatabaseDescriptor.getPartitionDenylistEnabled() && DatabaseDescriptor.getDenylistWritesEnabled())
         {
             for (final IMutation mutation : mutations)
             {
@@ -1788,7 +1788,7 @@ public class StorageProxy implements StorageProxyMBean
             throw exception;
         }
 
-        if (DatabaseDescriptor.getEnablePartitionDenylist() && DatabaseDescriptor.getEnableDenylistReads())
+        if (DatabaseDescriptor.getPartitionDenylistEnabled() && DatabaseDescriptor.getDenylistReadsEnabled())
         {
             for (SinglePartitionReadCommand command : group.queries)
             {
@@ -2143,7 +2143,7 @@ public class StorageProxy implements StorageProxyMBean
                                                   ConsistencyLevel consistencyLevel,
                                                   long queryStartNanoTime)
     {
-        if (DatabaseDescriptor.getEnablePartitionDenylist() && DatabaseDescriptor.getEnableDenylistRangeReads())
+        if (DatabaseDescriptor.getPartitionDenylistEnabled() && DatabaseDescriptor.getDenylistRangeReadsEnabled())
         {
             final int denylisted = partitionDenylist.getDeniedKeysInRangeCount(command.metadata().id, command.dataRange().keyRange());
             if (denylisted > 0)
@@ -2877,25 +2877,25 @@ public class StorageProxy implements StorageProxyMBean
     @Override
     public void setEnablePartitionDenylist(boolean enabled)
     {
-        DatabaseDescriptor.setEnablePartitionDenylist(enabled);
+        DatabaseDescriptor.setPartitionDenylistEnabled(enabled);
     }
 
     @Override
     public void setEnableDenylistWrites(boolean enabled)
     {
-        DatabaseDescriptor.setEnableDenylistWrites(enabled);
+        DatabaseDescriptor.setDenylistWritesEnabled(enabled);
     }
 
     @Override
     public void setEnableDenylistReads(boolean enabled)
     {
-        DatabaseDescriptor.setEnableDenylistReads(enabled);
+        DatabaseDescriptor.setDenylistReadsEnabled(enabled);
     }
 
     @Override
     public void setEnableDenylistRangeReads(boolean enabled)
     {
-        DatabaseDescriptor.setEnableDenylistRangeReads(enabled);
+        DatabaseDescriptor.setDenylistRangeReadsEnabled(enabled);
     }
 
     @Override
diff --git a/test/distributed/org/apache/cassandra/distributed/test/PartitionDenylistTest.java b/test/distributed/org/apache/cassandra/distributed/test/PartitionDenylistTest.java
index 43b3ef8..382981f 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/PartitionDenylistTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/PartitionDenylistTest.java
@@ -65,8 +65,8 @@ public class PartitionDenylistTest extends TestBaseImpl
                                       .withConfig(config -> config
                                       .with(NETWORK)
                                       .with(GOSSIP)
-                                      .set("enable_partition_denylist", true)
-                                      .set("denylist_initial_load_retry_seconds", 1))
+                                      .set("partition_denylist_enabled", true)
+                                      .set("denylist_initial_load_retry", "1s"))
                                       .createWithoutStarting())
         {
             cluster.forEach(i -> {
@@ -142,8 +142,8 @@ public class PartitionDenylistTest extends TestBaseImpl
                                       .withConfig(config -> config
                                       .with(NETWORK)
                                       .with(GOSSIP)
-                                      .set("enable_partition_denylist", true)
-                                      .set("denylist_initial_load_retry_seconds", 1))
+                                      .set("partition_denylist_enabled", true)
+                                      .set("denylist_initial_load_retry", "1s"))
                                       .createWithoutStarting())
         {
             // Starting without networking enabled in the hope it doesn't trigger
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
index dd98509..b586245 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
@@ -210,7 +210,12 @@ public class DatabaseDescriptorRefTest
     "org.apache.cassandra.config.DataRateSpec$DataRateUnit",
     "org.apache.cassandra.config.DataRateSpec$DataRateUnit$1",
     "org.apache.cassandra.config.DataRateSpec$DataRateUnit$2",
-    "org.apache.cassandra.config.DataRateSpec$DataRateUnit$3"
+    "org.apache.cassandra.config.DataRateSpec$DataRateUnit$3",
+    "org.apache.cassandra.config.SmallestDurationMinutes",
+    "org.apache.cassandra.config.SmallestDurationSeconds",
+    "org.apache.cassandra.config.SmallestDurationMilliseconds",
+    "org.apache.cassandra.config.SmallestDataStorageKibibytes",
+    "org.apache.cassandra.config.SmallestDataStorageMebibytes"
     };
 
     static final Set<String> checkedClasses = new HashSet<>(Arrays.asList(validClasses));
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
index d389a6c..4af1f8a 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
@@ -599,8 +599,8 @@ public class DatabaseDescriptorTest
     {
         DatabaseDescriptor.loadConfig();
 
-        expectIllegalArgumentException(DatabaseDescriptor::setDenylistRefreshSeconds, 0, "denylist_refresh_seconds must be a positive integer.");
-        expectIllegalArgumentException(DatabaseDescriptor::setDenylistRefreshSeconds, -1, "denylist_refresh_seconds must be a positive integer.");
+        expectIllegalArgumentException(DatabaseDescriptor::setDenylistRefreshSeconds, 0, "denylist_refresh must be a positive integer.");
+        expectIllegalArgumentException(DatabaseDescriptor::setDenylistRefreshSeconds, -1, "denylist_refresh must be a positive integer.");
         expectIllegalArgumentException(DatabaseDescriptor::setDenylistMaxKeysPerTable, 0, "denylist_max_keys_per_table must be a positive integer.");
         expectIllegalArgumentException(DatabaseDescriptor::setDenylistMaxKeysPerTable, -1, "denylist_max_keys_per_table must be a positive integer.");
         expectIllegalArgumentException(DatabaseDescriptor::setDenylistMaxKeysTotal, 0, "denylist_max_keys_total must be a positive integer.");
diff --git a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
index 18eaded..e1169e0 100644
--- a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
@@ -110,16 +110,16 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertTrue(config.sasi_indexes_enabled);
         assertTrue(config.drop_compact_storage_enabled);
         assertTrue(config.user_defined_functions_threads_enabled);
-        /*assertEquals(DurationSpec.inMilliseconds(2000), config.permissions_validity);
+        assertEquals(DurationSpec.inMilliseconds(2000), config.permissions_validity);
         assertEquals(DurationSpec.inMilliseconds(0), config.permissions_update_interval);
         assertEquals(DurationSpec.inMilliseconds(2000), config.roles_validity);
         assertEquals(DurationSpec.inMilliseconds(0), config.roles_update_interval);
         assertEquals(DurationSpec.inMilliseconds(2000), config.credentials_validity);
         assertEquals(DurationSpec.inMilliseconds(0), config.credentials_update_interval);
-        assertEquals(DurationSpec.inMinutes(60), config.index_summary_resize_interval);
+        //assertEquals(DurationSpec.inMinutes(60), config.index_summary_resize_interval);
 
         //parameters which names have not changed with CASSANDRA-15234
-        assertEquals(DurationSpec.inSecondsString("14400"), config.key_cache_save_period);
+        /*assertEquals(DurationSpec.inSecondsString("14400"), config.key_cache_save_period);
         assertEquals(DurationSpec.inHours(4), config.key_cache_save_period);
         assertEquals(DurationSpec.inSecondsString("0"), config.row_cache_save_period);
         assertEquals(DurationSpec.inSeconds(0), config.row_cache_save_period);
diff --git a/test/unit/org/apache/cassandra/config/SmallestDataStorageKibibytesTest.java b/test/unit/org/apache/cassandra/config/SmallestDataStorageKibibytesTest.java
new file mode 100644
index 0000000..c161d12
--- /dev/null
+++ b/test/unit/org/apache/cassandra/config/SmallestDataStorageKibibytesTest.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
+
+public class SmallestDataStorageKibibytesTest
+{
+    @Test
+    public void testInvalidUnits()
+    {
+        assertThatThrownBy(() -> new SmallestDataStorageKibibytes("10B")).isInstanceOf(ConfigurationException.class)
+                                                                          .hasMessageContaining("Invalid data storage: 10B");
+    }
+
+    @Test
+    public void testValidUnits()
+    {
+        assertEquals(10L, new SmallestDataStorageKibibytes("10KiB").toKibibytes());
+    }
+}
diff --git a/test/unit/org/apache/cassandra/config/SmallestDataStorageMebibytesTest.java b/test/unit/org/apache/cassandra/config/SmallestDataStorageMebibytesTest.java
new file mode 100644
index 0000000..a313681
--- /dev/null
+++ b/test/unit/org/apache/cassandra/config/SmallestDataStorageMebibytesTest.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
+
+public class SmallestDataStorageMebibytesTest
+{
+    @Test
+    public void testInvalidUnits()
+    {
+        assertThatThrownBy(() -> new SmallestDataStorageMebibytes("10B")).isInstanceOf(ConfigurationException.class)
+                                                                         .hasMessageContaining("Invalid data storage: 10B");
+    }
+
+    @Test
+    public void testValidUnits()
+    {
+        assertEquals(10L, new SmallestDataStorageMebibytes("10MiB").toMebibytes());
+    }
+}
diff --git a/test/unit/org/apache/cassandra/config/SmallestDurationMillisecondsTest.java b/test/unit/org/apache/cassandra/config/SmallestDurationMillisecondsTest.java
new file mode 100644
index 0000000..6e7597d
--- /dev/null
+++ b/test/unit/org/apache/cassandra/config/SmallestDurationMillisecondsTest.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
+
+public class SmallestDurationMillisecondsTest
+{
+    @Test
+    public void testInvalidUnits()
+    {
+        assertThatThrownBy(() -> new SmallestDurationMilliseconds("10ns")).isInstanceOf(ConfigurationException.class)
+                                                                          .hasMessageContaining("Invalid duration: 10ns");
+        assertThatThrownBy(() -> new SmallestDurationMilliseconds("10us")).isInstanceOf(ConfigurationException.class)
+                                                                          .hasMessageContaining("Invalid duration: 10us");
+        assertThatThrownBy(() -> new SmallestDurationMilliseconds("10µs")).isInstanceOf(ConfigurationException.class)
+                                                                          .hasMessageContaining("Invalid duration: 10µs");
+        assertThatThrownBy(() -> new SmallestDurationMilliseconds("-10s")).isInstanceOf(ConfigurationException.class)
+                                                                          .hasMessageContaining("Invalid duration: -10s");
+    }
+
+    @Test
+    public void testValidUnits()
+    {
+        assertEquals(10L, new SmallestDurationMilliseconds("10ms").toMilliseconds());
+    }
+}
diff --git a/test/unit/org/apache/cassandra/config/SmallestDurationMinutesTest.java b/test/unit/org/apache/cassandra/config/SmallestDurationMinutesTest.java
new file mode 100644
index 0000000..68b44db
--- /dev/null
+++ b/test/unit/org/apache/cassandra/config/SmallestDurationMinutesTest.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
+
+public class SmallestDurationMinutesTest
+{
+    @Test
+    public void testInvalidUnits()
+    {
+        assertThatThrownBy(() -> new SmallestDurationMinutes("10s")).isInstanceOf(ConfigurationException.class)
+                                                                    .hasMessageContaining("Invalid duration: 10s");
+        assertThatThrownBy(() -> new SmallestDurationMinutes("10ms")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: 10ms");
+        assertThatThrownBy(() -> new SmallestDurationMinutes("10ns")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: 10ns");
+        assertThatThrownBy(() -> new SmallestDurationMinutes("10us")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: 10us");
+        assertThatThrownBy(() -> new SmallestDurationMinutes("10µs")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: 10µs");
+        assertThatThrownBy(() -> new SmallestDurationMinutes("-10s")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: -10s");
+    }
+
+    @Test
+    public void testValidUnits()
+    {
+        assertEquals(10L, new SmallestDurationMinutes("10m").toMinutes());
+    }
+}
diff --git a/test/unit/org/apache/cassandra/config/SmallestDurationSecondsTest.java b/test/unit/org/apache/cassandra/config/SmallestDurationSecondsTest.java
new file mode 100644
index 0000000..c563639
--- /dev/null
+++ b/test/unit/org/apache/cassandra/config/SmallestDurationSecondsTest.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.assertEquals;
+
+public class SmallestDurationSecondsTest
+{
+    @Test
+    public void testInvalidUnits()
+    {
+        assertThatThrownBy(() -> new SmallestDurationSeconds("10ms")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: 10ms");
+        assertThatThrownBy(() -> new SmallestDurationSeconds("10ns")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: 10ns");
+        assertThatThrownBy(() -> new SmallestDurationSeconds("10us")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: 10us");
+        assertThatThrownBy(() -> new SmallestDurationSeconds("10µs")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: 10µs");
+        assertThatThrownBy(() -> new SmallestDurationSeconds("-10s")).isInstanceOf(ConfigurationException.class)
+                                                                     .hasMessageContaining("Invalid duration: -10s");
+    }
+
+    @Test
+    public void testValidUnits()
+    {
+        assertEquals(10L, new SmallestDurationSeconds("10s").toSeconds());
+    }
+}
diff --git a/test/unit/org/apache/cassandra/service/PartitionDenylistTest.java b/test/unit/org/apache/cassandra/service/PartitionDenylistTest.java
index 0751036..fd318cc 100644
--- a/test/unit/org/apache/cassandra/service/PartitionDenylistTest.java
+++ b/test/unit/org/apache/cassandra/service/PartitionDenylistTest.java
@@ -70,8 +70,8 @@ public class PartitionDenylistTest
                                        + "PRIMARY KEY((keyone, keytwo), keythree) ) ", ks_cql).build()
         ));
         Schema.instance.load(schema);
-        DatabaseDescriptor.setEnablePartitionDenylist(true);
-        DatabaseDescriptor.setEnableDenylistRangeReads(true);
+        DatabaseDescriptor.setPartitionDenylistEnabled(true);
+        DatabaseDescriptor.setDenylistRangeReadsEnabled(true);
         DatabaseDescriptor.setDenylistConsistencyLevel(ConsistencyLevel.ONE);
         DatabaseDescriptor.setDenylistRefreshSeconds(1);
         StorageService.instance.initServer(0);
@@ -80,7 +80,7 @@ public class PartitionDenylistTest
     @Before
     public void setup()
     {
-        DatabaseDescriptor.setEnablePartitionDenylist(true);
+        DatabaseDescriptor.setPartitionDenylistEnabled(true);
         resetDenylist();
 
         process("INSERT INTO " + ks_cql + ".table1 (keyone, keytwo, qux, quz, foo) VALUES ('aaa', 'bbb', 'ccc', 'ddd', 'v')", ConsistencyLevel.ONE);
@@ -282,7 +282,7 @@ public class PartitionDenylistTest
         process(String.format("TRUNCATE TABLE %s.table2", ks_cql), ConsistencyLevel.ONE);
         process(String.format("TRUNCATE TABLE %s.table3", ks_cql), ConsistencyLevel.ONE);
         denyAllKeys();
-        DatabaseDescriptor.setEnablePartitionDenylist(false);
+        DatabaseDescriptor.setPartitionDenylistEnabled(false);
         process("INSERT INTO " + ks_cql + ".table1 (keyone, keytwo, qux, quz, foo) VALUES ('bbb', 'ccc', 'eee', 'fff', 'w')", ConsistencyLevel.ONE);
         process("SELECT * FROM " + ks_cql + ".table1 WHERE keyone='bbb' and keytwo='ccc'", ConsistencyLevel.ONE);
         process("SELECT * FROM " + ks_cql + ".table1", ConsistencyLevel.ONE);

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


[cassandra] 12/13: Bulk change of units around the code to support the move to the new configuration framework patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 c51a7c66fc21ca2da08b89ae5f9b4817ee4d8c23
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Sat Feb 5 17:15:18 2022 -0500

    Bulk change of units around the code to support the move to the new configuration framework
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                | 206 ++++++++++-----------
 .../apache/cassandra/cache/AutoSavingCache.java    |   2 +-
 .../org/apache/cassandra/cache/CaffeineCache.java  |   2 +-
 .../org/apache/cassandra/cache/ChunkCache.java     |   5 +-
 .../apache/cassandra/cache/SerializingCache.java   |   2 +-
 src/java/org/apache/cassandra/config/Config.java   |  16 +-
 .../org/apache/cassandra/config/Converters.java    |   2 +
 .../org/apache/cassandra/config/DataRateSpec.java  |   2 -
 .../cassandra/config/DatabaseDescriptor.java       | 134 +++++---------
 .../cassandra/config/YamlConfigurationLoader.java  |   3 +-
 .../org/apache/cassandra/cql3/QueryProcessor.java  |  15 +-
 .../org/apache/cassandra/db/RowIndexEntry.java     |   4 +-
 .../cassandra/db/compaction/CompactionTask.java    |   4 +-
 .../db/compaction/LeveledCompactionStrategy.java   |   8 +-
 .../cassandra/db/compaction/SSTableSplitter.java   |   6 +-
 .../SplittingSizeTieredCompactionWriter.java       |   4 +-
 .../db/partitions/AtomicBTreePartition.java        |   2 +-
 .../rows/UnfilteredRowIteratorWithLowerBound.java  |   2 +-
 .../org/apache/cassandra/hadoop/ConfigHelper.java  |  10 +-
 .../cassandra/hadoop/cql3/CqlBulkRecordWriter.java |   2 +-
 .../cassandra/hadoop/cql3/CqlInputFormat.java      |   4 +-
 .../org/apache/cassandra/hints/HintsReader.java    |   2 +-
 .../org/apache/cassandra/hints/HintsWriter.java    |   4 +-
 .../cassandra/index/sasi/conf/IndexMode.java       |   2 +-
 .../cassandra/io/sstable/CQLSSTableWriter.java     |  15 +-
 .../cassandra/io/sstable/IndexSummaryBuilder.java  |   2 +-
 .../cassandra/io/sstable/IndexSummaryManager.java  |   4 +-
 .../io/sstable/IndexSummaryManagerMBean.java       |   2 +-
 .../io/sstable/IndexSummaryRedistribution.java     |   6 +-
 .../org/apache/cassandra/io/sstable/SSTable.java   |   2 +-
 .../cassandra/io/sstable/SSTableRewriter.java      |   4 +-
 .../io/sstable/format/big/BigTableWriter.java      |   2 +-
 .../cassandra/io/util/SequentialWriterOption.java  |   6 +-
 .../cassandra/net/AsyncStreamingOutputPlus.java    |   4 +-
 .../apache/cassandra/schema/CompressionParams.java |   2 +-
 .../org/apache/cassandra/service/CacheService.java |   8 +-
 .../apache/cassandra/service/StorageService.java   |  18 +-
 .../cassandra/service/StorageServiceMBean.java     |   2 +-
 src/java/org/apache/cassandra/tools/NodeProbe.java |   6 +-
 .../apache/cassandra/tools/StandaloneScrubber.java |   4 +-
 .../org/apache/cassandra/tools/nodetool/Info.java  |   4 +-
 .../tools/nodetool/SetBatchlogReplayThrottle.java  |   2 +-
 .../apache/cassandra/utils/memory/BufferPools.java |   4 +-
 .../cassandra/utils/memory/NativeAllocator.java    |   4 +-
 .../cassandra/utils/memory/SlabAllocator.java      |   4 +-
 test/conf/cassandra-seeds.yaml                     |   2 +-
 test/conf/cassandra_encryption.yaml                |  26 +--
 test/conf/unit-test-conf/test-native-port.yaml     |   2 +-
 .../test/HintedHandoffNodetoolTest.java            |   6 +-
 .../distributed/test/MessageFiltersTest.java       |   1 -
 .../distributed/test/ReadRepairQueryTypesTest.java |   1 -
 .../trackwarnings/RowIndexSizeWarningTest.java     |   4 +-
 .../upgrade/MixedModeMessageForwardTest.java       |   2 +-
 .../LongLeveledCompactionStrategyTest.java         |   8 +-
 .../io/sstable/CQLSSTableWriterLongTest.java       |   2 +-
 .../cassandra/config/DatabaseDescriptorTest.java   |  10 +-
 .../LoadOldYAMLBackwardCompatibilityTest.java      |   2 +-
 ...lityTest.java => ParseAndConvertUnitsTest.java} | 105 +++++------
 .../validation/entities/SecondaryIndexTest.java    |  10 +-
 .../unit/org/apache/cassandra/db/KeyCacheTest.java |   8 +-
 .../unit/org/apache/cassandra/db/RowCacheTest.java |  10 +-
 .../commitlog/CommitLogInitWithExceptionTest.java  |   1 -
 .../cassandra/db/commitlog/CommitLogTest.java      |   4 +-
 .../db/compaction/CompactionsCQLTest.java          |   4 +-
 .../compaction/LeveledCompactionStrategyTest.java  |  10 +-
 .../db/streaming/CassandraStreamManagerTest.java   |   4 +-
 .../CompressedSequentialWriterReopenTest.java      |   2 +-
 .../cassandra/io/sstable/CQLSSTableWriterTest.java |  10 +-
 .../cassandra/io/sstable/IndexSummaryTest.java     |   4 +-
 .../cassandra/io/sstable/LargePartitionsTest.java  |  34 ++--
 .../cassandra/io/sstable/SSTableLoaderTest.java    |   4 +-
 .../apache/cassandra/io/util/FileUtilsTest.java    |  20 +-
 .../cassandra/io/util/RandomAccessReaderTest.java  |   4 +-
 .../tools/StandaloneSplitterWithCQLTesterTest.java |   6 +-
 .../tools/nodetool/SetGetColumnIndexSizeTest.java  |   2 +-
 .../org/apache/cassandra/utils/MerkleTreeTest.java |  10 +-
 .../cassandra/utils/memory/BufferPoolTest.java     |   6 +-
 .../io/sstable/StressCQLSSTableWriter.java         |  12 +-
 .../apache/cassandra/stress/CompactionStress.java  |  16 +-
 .../operations/userdefined/SchemaInsert.java       |   2 +-
 80 files changed, 417 insertions(+), 485 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index cf4326a..7e39097 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -514,15 +514,15 @@ commitlog_segment_size: 32MiB
 # any class that implements the SeedProvider interface and has a
 # constructor that takes a Map<String, String> of parameters will do.
 seed_provider:
-    # Addresses of hosts that are deemed contact points. 
-    # Cassandra nodes use this list of hosts to find each other and learn
-    # the topology of the ring.  You must change this if you are running
-    # multiple nodes!
-    - class_name: org.apache.cassandra.locator.SimpleSeedProvider
-      parameters:
-          # seeds is actually a comma-delimited list of addresses.
-          # Ex: "<ip1>,<ip2>,<ip3>"
-          - seeds: "127.0.0.1:7000"
+  # Addresses of hosts that are deemed contact points.
+  # Cassandra nodes use this list of hosts to find each other and learn
+  # the topology of the ring.  You must change this if you are running
+  # multiple nodes!
+  - class_name: org.apache.cassandra.locator.SimpleSeedProvider
+    parameters:
+      # seeds is actually a comma-delimited list of addresses.
+      # Ex: "<ip1>,<ip2>,<ip3>"
+      - seeds: "127.0.0.1:7000"
 
 # For workloads with more data than can fit in memory, Cassandra's
 # bottleneck will be reads that need to fetch data from
@@ -660,7 +660,7 @@ memtable_allocation_type: heap_buffers
 # and flush size and frequency. More is not better you just need enough flush writers
 # to never stall waiting for flushing to free memory.
 #
-#memtable_flush_writers: 2
+# memtable_flush_writers: 2
 
 # Total space to use for change-data-capture logs on disk.
 #
@@ -668,7 +668,7 @@ memtable_allocation_type: heap_buffers
 # on Mutations including tables with CDC enabled. A CDCCompactor is responsible
 # for parsing the raw CDC logs and deleting them when parsing is completed.
 #
-# The default value is the min of 4096 mb and 1/8th of the total space
+# The default value is the min of 4096 MiB and 1/8th of the total space
 # of the drive where cdc_raw_directory resides.
 # cdc_total_space: 4096MiB
 
@@ -769,8 +769,8 @@ native_transport_port: 9042
 # native_transport_max_threads: 128
 #
 # The maximum size of allowed frame. Frame (requests) larger than this will
-# be rejected as invalid. The default is 16MB. If you're changing this parameter,
-# you may want to adjust max_value_size_in_mb accordingly. This should be positive and less than 2048.
+# be rejected as invalid. The default is 16MiB. If you're changing this parameter,
+# you may want to adjust max_value_size accordingly. This should be positive and less than 2048.
 # native_transport_max_frame_size: 16MiB
 
 # The maximum number of concurrent client connections.
@@ -793,7 +793,7 @@ native_transport_allow_older_protocols: true
 # values for heartbeat intervals have to be set on the client side.
 #
 # Idle connection timeouts are disabled by default.
-# native_transport_idle_timeout_in_ms: 60000
+# native_transport_idle_timeout: 60000ms
 
 # The address or interface to bind the native transport server to.
 #
@@ -903,7 +903,7 @@ column_index_cache_size: 2KiB
 # 
 # If your data directories are backed by SSD, you should increase this
 # to the number of cores.
-#concurrent_compactors: 1
+# concurrent_compactors: 1
 
 # Number of simultaneous repair validations to allow. If not set or set to
 # a value less than 1, it defaults to the value of concurrent_compactors.
@@ -1212,39 +1212,39 @@ dynamic_snitch_badness_threshold: 1.0
 # Step 2: Set optional=false (or remove it) and if you generated truststores and want to use mutual
 # auth set require_client_auth=true. Restart all nodes
 server_encryption_options:
-    # On outbound connections, determine which type of peers to securely connect to.
-    #   The available options are :
-    #     none : Do not encrypt outgoing connections
-    #     dc   : Encrypt connections to peers in other datacenters but not within datacenters
-    #     rack : Encrypt connections to peers in other racks but not within racks
-    #     all  : Always use encrypted connections
-    internode_encryption: none
-    # When set to true, encrypted and unencrypted connections are allowed on the storage_port
-    # This should _only be true_ while in unencrypted or transitional operation
-    # optional defaults to true if internode_encryption is none
-    # optional: true
-    # If enabled, will open up an encrypted listening socket on ssl_storage_port. Should only be used
-    # during upgrade to 4.0; otherwise, set to false.
-    legacy_ssl_storage_port_enabled: false
-    # Set to a valid keystore if internode_encryption is dc, rack or all
-    keystore: conf/.keystore
-    keystore_password: cassandra
-    # Verify peer server certificates
-    require_client_auth: false
-    # Set to a valid trustore if require_client_auth is true
-    truststore: conf/.truststore
-    truststore_password: cassandra
-    # Verify that the host name in the certificate matches the connected host
-    require_endpoint_verification: false
-    # More advanced defaults:
-    # protocol: TLS
-    # store_type: JKS
-    # cipher_suites: [
-    #   TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
-    #   TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
-    #   TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA,
-    #   TLS_RSA_WITH_AES_256_CBC_SHA
-    # ]
+  # On outbound connections, determine which type of peers to securely connect to.
+  #   The available options are :
+  #     none : Do not encrypt outgoing connections
+  #     dc   : Encrypt connections to peers in other datacenters but not within datacenters
+  #     rack : Encrypt connections to peers in other racks but not within racks
+  #     all  : Always use encrypted connections
+  internode_encryption: none
+  # When set to true, encrypted and unencrypted connections are allowed on the storage_port
+  # This should _only be true_ while in unencrypted or transitional operation
+  # optional defaults to true if internode_encryption is none
+  # optional: true
+  # If enabled, will open up an encrypted listening socket on ssl_storage_port. Should only be used
+  # during upgrade to 4.0; otherwise, set to false.
+  legacy_ssl_storage_port_enabled: false
+  # Set to a valid keystore if internode_encryption is dc, rack or all
+  keystore: conf/.keystore
+  keystore_password: cassandra
+  # Verify peer server certificates
+  require_client_auth: false
+  # Set to a valid trustore if require_client_auth is true
+  truststore: conf/.truststore
+  truststore_password: cassandra
+  # Verify that the host name in the certificate matches the connected host
+  require_endpoint_verification: false
+  # More advanced defaults:
+  # protocol: TLS
+  # store_type: JKS
+  # cipher_suites: [
+  #   TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+  #   TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
+  #   TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA,
+  #   TLS_RSA_WITH_AES_256_CBC_SHA
+  # ]
 
 # Configure client-to-server encryption.
 #
@@ -1259,29 +1259,29 @@ server_encryption_options:
 # Step 2: Set optional=false (or remove it) and if you generated truststores and want to use mutual
 # auth set require_client_auth=true. Restart all nodes
 client_encryption_options:
-    # Enable client-to-server encryption
-    enabled: false
-    # When set to true, encrypted and unencrypted connections are allowed on the native_transport_port
-    # This should _only be true_ while in unencrypted or transitional operation
-    # optional defaults to true when enabled is false, and false when enabled is true.
-    # optional: true
-    # Set keystore and keystore_password to valid keystores if enabled is true
-    keystore: conf/.keystore
-    keystore_password: cassandra
-    # Verify client certificates
-    require_client_auth: false
-    # Set trustore and truststore_password if require_client_auth is true
-    # truststore: conf/.truststore
-    # truststore_password: cassandra
-    # More advanced defaults:
-    # protocol: TLS
-    # store_type: JKS
-    # cipher_suites: [
-    #   TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
-    #   TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
-    #   TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA,
-    #   TLS_RSA_WITH_AES_256_CBC_SHA
-    # ]
+  # Enable client-to-server encryption
+  enabled: false
+  # When set to true, encrypted and unencrypted connections are allowed on the native_transport_port
+  # This should _only be true_ while in unencrypted or transitional operation
+  # optional defaults to true when enabled is false, and false when enabled is true.
+  # optional: true
+  # Set keystore and keystore_password to valid keystores if enabled is true
+  keystore: conf/.keystore
+  keystore_password: cassandra
+  # Verify client certificates
+  require_client_auth: false
+  # Set trustore and truststore_password if require_client_auth is true
+  # truststore: conf/.truststore
+  # truststore_password: cassandra
+  # More advanced defaults:
+  # protocol: TLS
+  # store_type: JKS
+  # cipher_suites: [
+  #   TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
+  #   TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
+  #   TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA,
+  #   TLS_RSA_WITH_AES_256_CBC_SHA
+  # ]
 
 # internode_compression controls whether traffic between nodes is
 # compressed.
@@ -1332,19 +1332,19 @@ scripted_user_defined_functions_enabled: false
 # Currently, only the following file types are supported for transparent data encryption, although
 # more are coming in future cassandra releases: commitlog, hints
 transparent_data_encryption_options:
-    enabled: false
-    chunk_length_kb: 64
-    cipher: AES/CBC/PKCS5Padding
-    key_alias: testing:1
-    # CBC IV length for AES needs to be 16 bytes (which is also the default size)
-    # iv_length: 16
-    key_provider:
-      - class_name: org.apache.cassandra.security.JKSKeyProvider
-        parameters:
-          - keystore: conf/.keystore
-            keystore_password: cassandra
-            store_type: JCEKS
-            key_password: cassandra
+  enabled: false
+  chunk_length_kb: 64
+  cipher: AES/CBC/PKCS5Padding
+  key_alias: testing:1
+  # CBC IV length for AES needs to be 16 bytes (which is also the default size)
+  # iv_length: 16
+  key_provider:
+    - class_name: org.apache.cassandra.security.JKSKeyProvider
+      parameters:
+        - keystore: conf/.keystore
+          keystore_password: cassandra
+          store_type: JCEKS
+          key_password: cassandra
 
 
 #####################
@@ -1383,11 +1383,11 @@ replica_filtering_protection:
     cached_rows_warn_threshold: 2000
     cached_rows_fail_threshold: 32000
 
-# Log WARN on any multiple-partition batch size exceeding this value. 5kb per batch by default.
+# Log WARN on any multiple-partition batch size exceeding this value. 5KiB per batch by default.
 # Caution should be taken on increasing the size of this threshold as it can lead to node instability.
 batch_size_warn_threshold: 5KiB
 
-# Fail any multiple-partition batch exceeding this value. 50kb (10x warn threshold) by default.
+# Fail any multiple-partition batch exceeding this value. 50KiB (10x warn threshold) by default.
 batch_size_fail_threshold: 50KiB
 
 # Log WARN on any batches not of type LOGGED than span across more partitions than this limit
@@ -1446,23 +1446,23 @@ compaction_tombstone_warning_threshold: 100000
 # Audit logging - Logs every incoming CQL command request, authentication to a node. See the docs
 # on audit_logging for full details about the various configuration options.
 audit_logging_options:
-    enabled: false
-    logger:
-      - class_name: BinAuditLogger
-    # audit_logs_dir:
-    # included_keyspaces:
-    # excluded_keyspaces: system, system_schema, system_virtual_schema
-    # included_categories:
-    # excluded_categories:
-    # included_users:
-    # excluded_users:
-    # roll_cycle: HOURLY
-    # block: true
-    # max_queue_weight: 268435456 # 256 MiB
-    # max_log_size: 17179869184 # 16 GiB
-    ## archive command is "/path/to/script.sh %path" where %path is replaced with the file being rolled:
-    # archive_command:
-    # max_archive_retries: 10
+  enabled: false
+  logger:
+    - class_name: BinAuditLogger
+  # audit_logs_dir:
+  # included_keyspaces:
+  # excluded_keyspaces: system, system_schema, system_virtual_schema
+  # included_categories:
+  # excluded_categories:
+  # included_users:
+  # excluded_users:
+  # roll_cycle: HOURLY
+  # block: true
+  # max_queue_weight: 268435456 # 256 MiB
+  # max_log_size: 17179869184 # 16 GiB
+  ## archive command is "/path/to/script.sh %path" where %path is replaced with the file being rolled:
+  # archive_command:
+  # max_archive_retries: 10
 
 
 # default options for full query logging - these can be overridden from command line when executing
diff --git a/src/java/org/apache/cassandra/cache/AutoSavingCache.java b/src/java/org/apache/cassandra/cache/AutoSavingCache.java
index d0b897e..66736d1 100644
--- a/src/java/org/apache/cassandra/cache/AutoSavingCache.java
+++ b/src/java/org/apache/cassandra/cache/AutoSavingCache.java
@@ -93,7 +93,7 @@ public class AutoSavingCache<K extends CacheKey, V> extends InstrumentingCache<K
     {
         private final SequentialWriterOption writerOption = SequentialWriterOption.newBuilder()
                                                                     .trickleFsync(DatabaseDescriptor.getTrickleFsync())
-                                                                    .trickleFsyncByteInterval(DatabaseDescriptor.getTrickleFsyncIntervalInKb() * 1024)
+                                                                    .trickleFsyncByteInterval(DatabaseDescriptor.getTrickleFsyncIntervalInKiB() * 1024)
                                                                     .finishOnClose(true).build();
 
         public InputStream getInputStream(File dataPath, File crcPath) throws IOException
diff --git a/src/java/org/apache/cassandra/cache/CaffeineCache.java b/src/java/org/apache/cassandra/cache/CaffeineCache.java
index b01093f..124e681 100644
--- a/src/java/org/apache/cassandra/cache/CaffeineCache.java
+++ b/src/java/org/apache/cassandra/cache/CaffeineCache.java
@@ -65,7 +65,7 @@ public class CaffeineCache<K extends IMeasurableMemory, V extends IMeasurableMem
         return create(weightedCapacity, (key, value) -> {
             long size = key.unsharedHeapSize() + value.unsharedHeapSize();
             if (size > Integer.MAX_VALUE) {
-                throw new IllegalArgumentException("Serialized size cannot be more than 2GB/Integer.MAX_VALUE");
+                throw new IllegalArgumentException("Serialized size cannot be more than 2GiB/Integer.MAX_VALUE");
             }
             return (int) size;
         });
diff --git a/src/java/org/apache/cassandra/cache/ChunkCache.java b/src/java/org/apache/cassandra/cache/ChunkCache.java
index 397850a..51dbdc6 100644
--- a/src/java/org/apache/cassandra/cache/ChunkCache.java
+++ b/src/java/org/apache/cassandra/cache/ChunkCache.java
@@ -26,7 +26,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Throwables;
 import com.google.common.collect.Iterables;
-import com.google.common.util.concurrent.MoreExecutors;
 
 import com.github.benmanes.caffeine.cache.*;
 import org.apache.cassandra.concurrent.ImmediateExecutor;
@@ -40,8 +39,8 @@ import org.apache.cassandra.utils.memory.BufferPools;
 public class ChunkCache
         implements CacheLoader<ChunkCache.Key, ChunkCache.Buffer>, RemovalListener<ChunkCache.Key, ChunkCache.Buffer>, CacheSize
 {
-    public static final int RESERVED_POOL_SPACE_IN_MB = 32;
-    public static final long cacheSize = 1024L * 1024L * Math.max(0, DatabaseDescriptor.getFileCacheSizeInMB() - RESERVED_POOL_SPACE_IN_MB);
+    public static final int RESERVED_POOL_SPACE_IN_MiB = 32;
+    public static final long cacheSize = 1024L * 1024L * Math.max(0, DatabaseDescriptor.getFileCacheSizeInMiB() - RESERVED_POOL_SPACE_IN_MiB);
     public static final boolean roundUp = DatabaseDescriptor.getFileCacheRoundUp();
 
     private static boolean enabled = DatabaseDescriptor.getFileCacheEnabled() && cacheSize > 0;
diff --git a/src/java/org/apache/cassandra/cache/SerializingCache.java b/src/java/org/apache/cassandra/cache/SerializingCache.java
index cd028e2..be7c4f5 100644
--- a/src/java/org/apache/cassandra/cache/SerializingCache.java
+++ b/src/java/org/apache/cassandra/cache/SerializingCache.java
@@ -71,7 +71,7 @@ public class SerializingCache<K, V> implements ICache<K, V>
         return create(weightedCapacity, (key, value) -> {
             long size = value.size();
             if (size > Integer.MAX_VALUE) {
-                throw new IllegalArgumentException("Serialized size must not be more than 2GB");
+                throw new IllegalArgumentException("Serialized size must not be more than 2GiB");
             }
             return (int) size;
         }, serializer);
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index a6b0413..369fe04 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -24,7 +24,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
-import java.util.concurrent.TimeUnit;
 import java.util.function.Supplier;
 
 import com.google.common.base.Joiner;
@@ -196,6 +195,7 @@ public class Config
     @Replaces(oldName = "internode_recv_buff_size_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
     public DataStorageSpec internode_socket_receive_buffer_size = new DataStorageSpec("0B");
 
+    // TODO: derive defaults from system memory settings?
     @Replaces(oldName = "internode_application_send_queue_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
     public DataStorageSpec internode_application_send_queue_capacity = new DataStorageSpec("4MiB");
     @Replaces(oldName = "internode_application_send_queue_reserve_endpoint_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
@@ -203,7 +203,6 @@ public class Config
     @Replaces(oldName = "internode_application_send_queue_reserve_global_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
     public DataStorageSpec internode_application_send_queue_reserve_global_capacity = new DataStorageSpec("512MiB");
 
-    // TODO: derive defaults from system memory settings?
     @Replaces(oldName = "internode_application_receive_queue_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
     public DataStorageSpec internode_application_receive_queue_capacity = new DataStorageSpec("4MiB");
     @Replaces(oldName = "internode_application_receive_queue_reserve_endpoint_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
@@ -281,12 +280,6 @@ public class Config
     public volatile int concurrent_materialized_view_builders = 1;
     public volatile int reject_repair_compaction_threshold = Integer.MAX_VALUE;
 
-    /**
-     * @deprecated retry support removed on CASSANDRA-10992
-     */
-    @Deprecated
-    public int max_streaming_retries = 3;
-
     @Replaces(oldName = "stream_throughput_outbound_megabits_per_sec", converter = Converters.MEGABITS_TO_MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
     public volatile DataRateSpec stream_throughput_outbound = new DataRateSpec("24MiB/s");
     @Replaces(oldName = "inter_dc_stream_throughput_outbound_megabits_per_sec", converter = Converters.MEGABITS_TO_MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
@@ -365,7 +358,6 @@ public class Config
     @Replaces(oldName = "batchlog_replay_throttle_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
     public SmallestDataStorageKibibytes batchlog_replay_throttle = new SmallestDataStorageKibibytes("1024KiB");
     public int max_hints_delivery_threads = 2;
-
     @Replaces(oldName = "hints_flush_period_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
     public SmallestDurationMilliseconds hints_flush_period = new SmallestDurationMilliseconds("10s");
     @Replaces(oldName = "max_hints_file_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
@@ -513,16 +505,16 @@ public class Config
      * (Only valid, if user_defined_functions_threads_enabled==true)
      */
     //No need of unit conversion as this parameter is not exposed in the yaml file
-    public long user_defined_function_warn_timeout = 500;
+    public long user_defined_function_warn_timeout_in_ms = 500;
     /**
      * Time in milliseconds after a fatal UDF run-time situation is detected and action according to
      * user_function_timeout_policy will take place.
      * (Only valid, if user_defined_functions_threads_enabled==true)
      */
     //No need of unit conversion as this parameter is not exposed in the yaml file
-    public long user_defined_function_fail_timeout = 1500;
+    public long user_defined_function_fail_timeout_in_ms = 1500;
     /**
-     * Defines what to do when a UDF ran longer than user_defined_function_fail_timeout.
+     * Defines what to do when a UDF ran longer than user_defined_function_fail_timeout_in_ms.
      * Possible options are:
      * - 'die' - i.e. it is able to emit a warning to the client before the Cassandra Daemon will shut down.
      * - 'die_immediate' - shut down C* daemon immediately (effectively prevent the chance that the client will receive a warning).
diff --git a/src/java/org/apache/cassandra/config/Converters.java b/src/java/org/apache/cassandra/config/Converters.java
index f2f7120..447e731 100644
--- a/src/java/org/apache/cassandra/config/Converters.java
+++ b/src/java/org/apache/cassandra/config/Converters.java
@@ -112,6 +112,7 @@ public enum Converters
      *
      * @param value we will use from cassandra.yaml to create a new {@link Config} parameter of type {@link DurationSpec},
      * {@link DataRateSpec} or {@link DataStorageSpec}
+     *
      * @return new object of type {@link DurationSpec}, {@link DataRateSpec} or {@link DataStorageSpec}
      */
     public Object convert(Object value)
@@ -126,6 +127,7 @@ public enum Converters
      * compatibility
      *
      * @param value we will use to calculate the output value
+     *
      * @return the numeric value
      */
     public Object deconvert(Object value)
diff --git a/src/java/org/apache/cassandra/config/DataRateSpec.java b/src/java/org/apache/cassandra/config/DataRateSpec.java
index bbdbecc..3512513 100644
--- a/src/java/org/apache/cassandra/config/DataRateSpec.java
+++ b/src/java/org/apache/cassandra/config/DataRateSpec.java
@@ -300,8 +300,6 @@ public final class DataRateSpec
 
             public double toMegabitsPerSecond(double d)
             {
-
-
                 if (d > MAX / (MEGABITS_PER_MEBIBYTE))
                     return MAX;
                 return Math.round(d * MEGABITS_PER_MEBIBYTE);
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 25e5c8b..ef9dd43 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -32,11 +32,6 @@ import com.google.common.primitives.Ints;
 import com.google.common.primitives.Longs;
 import com.google.common.util.concurrent.RateLimiter;
 
-import org.apache.cassandra.gms.IFailureDetector;
-import org.apache.cassandra.io.util.File;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.cassandra.audit.AuditLogOptions;
 import org.apache.cassandra.fql.FullQueryLoggerOptions;
 import org.apache.cassandra.auth.AllowAllInternodeAuthenticator;
@@ -54,6 +49,8 @@ import org.apache.cassandra.db.commitlog.CommitLogSegmentManagerCDC;
 import org.apache.cassandra.db.commitlog.CommitLogSegmentManagerStandard;
 import org.apache.cassandra.dht.IPartitioner;
 import org.apache.cassandra.exceptions.ConfigurationException;
+import org.apache.cassandra.gms.IFailureDetector;
+import org.apache.cassandra.io.util.File;
 import org.apache.cassandra.io.FSWriteError;
 import org.apache.cassandra.io.util.DiskOptimizationStrategy;
 import org.apache.cassandra.io.util.FileUtils;
@@ -75,6 +72,9 @@ import org.apache.cassandra.utils.FBUtilities;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.commons.lang3.StringUtils;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static org.apache.cassandra.config.CassandraRelevantProperties.OS_ARCH;
 import static org.apache.cassandra.config.CassandraRelevantProperties.SUN_ARCH_DATA_MODEL;
@@ -94,7 +94,7 @@ public class DatabaseDescriptor
     private static final Logger logger = LoggerFactory.getLogger(DatabaseDescriptor.class);
 
     /**
-     * Tokens are serialized in a Gossip VersionedValue String.  VV are restricted to 64KB
+     * Tokens are serialized in a Gossip VersionedValue String.  VV are restricted to 64KiB
      * when we send them over the wire, which works out to about 1700 tokens.
      */
     private static final int MAX_NUM_TOKENS = 1536;
@@ -379,7 +379,7 @@ public class DatabaseDescriptor
             throw new ConfigurationException("Missing required directive CommitLogSync", false);
         }
 
-        if (conf.commitlog_sync == Config.CommitLogSync.batch)
+        if (conf.commitlog_sync == CommitLogSync.batch)
         {
             if (conf.commitlog_sync_period.toMilliseconds() != 0)
             {
@@ -401,7 +401,7 @@ public class DatabaseDescriptor
         }
         else
         {
-            if (conf.commitlog_sync_period.toMilliseconds() <= 0)
+            if (conf.commitlog_sync_period.toMilliseconds() == 0)
             {
                 throw new ConfigurationException("Missing value for commitlog_sync_period.", false);
             }
@@ -495,7 +495,7 @@ public class DatabaseDescriptor
 
         if (conf.repair_session_space.toMebibytes() < 1)
             throw new ConfigurationException("repair_session_space must be > 0, but was " + conf.repair_session_space);
-        else if (conf.repair_session_space.toMebibytesAsInt() > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))
+        else if (conf.repair_session_space.toMebibytes() > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))
             logger.warn("A repair_session_space of " + conf.repair_session_space+ " mebibytes is likely to cause heap pressure");
 
         checkForLowestAcceptedTimeouts(conf);
@@ -682,13 +682,13 @@ public class DatabaseDescriptor
                                               ? Math.max(10, (int) (Runtime.getRuntime().maxMemory() / 1024 / 1024 / 256))
                                               : conf.prepared_statements_cache_size.toMebibytes();
 
-            if (preparedStatementsCacheSizeInMiB <= 0)
+            if (preparedStatementsCacheSizeInMiB == 0)
                 throw new NumberFormatException(); // to escape duplicating error message
         }
         catch (NumberFormatException e)
         {
             throw new ConfigurationException("prepared_statements_cache_size option was set incorrectly to '"
-                                             + conf.prepared_statements_cache_size + "', supported values are <integer> >= 0.", false);
+                                             + (conf.prepared_statements_cache_size != null ? conf.prepared_statements_cache_size.toString() : null) + "', supported values are <integer> >= 0.", false);
         }
 
         try
@@ -720,7 +720,7 @@ public class DatabaseDescriptor
         catch (NumberFormatException e)
         {
             throw new ConfigurationException("counter_cache_size option was set incorrectly to '"
-                                             + conf.counter_cache_size + "', supported values are <integer> >= 0.", false);
+                                             + (conf.counter_cache_size !=null ?conf.counter_cache_size.toString() : null) + "', supported values are <integer> >= 0.", false);
         }
 
         // if set to empty/"auto" then use 5% of Heap size
@@ -732,13 +732,13 @@ public class DatabaseDescriptor
             throw new ConfigurationException("index_summary_capacity option was set incorrectly to '"
                                              + conf.index_summary_capacity.toString() + "', it should be a non-negative integer.", false);
 
-        if (conf.user_defined_function_fail_timeout < 0)
-            throw new ConfigurationException("user_defined_function_fail_timeout must not be negative", false);
-        if (conf.user_defined_function_warn_timeout < 0)
-            throw new ConfigurationException("user_defined_function_warn_timeout must not be negative", false);
+        if (conf.user_defined_function_fail_timeout_in_ms < 0)
+            throw new ConfigurationException("user_defined_function_fail_timeout_in_ms must not be negative", false);
+        if (conf.user_defined_function_warn_timeout_in_ms < 0)
+            throw new ConfigurationException("user_defined_function_warn_timeout_in_ms must not be negative", false);
 
-        if (conf.user_defined_function_fail_timeout < conf.user_defined_function_warn_timeout)
-            throw new ConfigurationException("user_defined_function_warn_timeout must less than user_defined_function_fail_timeout", false);
+        if (conf.user_defined_function_fail_timeout_in_ms < conf.user_defined_function_warn_timeout_in_ms)
+            throw new ConfigurationException("user_defined_function_warn_timeout_in_ms must less than user_defined_function_fail_timeout_in_ms", false);
 
         if (conf.commitlog_segment_size.toMebibytes() == 0)
             throw new ConfigurationException("commitlog_segment_size must be positive, but was "
@@ -768,9 +768,9 @@ public class DatabaseDescriptor
         if (conf.snapshot_links_per_second < 0)
             throw new ConfigurationException("snapshot_links_per_second must be >= 0");
 
-        if (conf.max_value_size.toMebibytesAsInt() == 0)
+        if (conf.max_value_size.toMebibytes() == 0)
             throw new ConfigurationException("max_value_size must be positive", false);
-        else if (conf.max_value_size.toMebibytesAsInt() >= 2048)
+        else if (conf.max_value_size.toMebibytes() >= 2048)
             throw new ConfigurationException("max_value_size must be smaller than 2048, but was "
                     + conf.max_value_size.toString(), false);
 
@@ -1552,7 +1552,7 @@ public class DatabaseDescriptor
         return conf.batch_size_fail_threshold.toBytesAsInt();
     }
 
-    public static int getBatchSizeFailThresholdInKB()
+    public static int getBatchSizeFailThresholdInKiB()
     {
         return conf.batch_size_fail_threshold.toKibibytesAsInt();
     }
@@ -1569,7 +1569,7 @@ public class DatabaseDescriptor
         conf.batch_size_warn_threshold = SmallestDataStorageKibibytes.inKibibytes(threshold);
     }
 
-    public static void setBatchSizeFailThresholdInKB(int threshold)
+    public static void setBatchSizeFailThresholdInKiB(int threshold)
     {
         conf.batch_size_fail_threshold = SmallestDataStorageKibibytes.inKibibytes(threshold);
     }
@@ -1662,7 +1662,7 @@ public class DatabaseDescriptor
 
     public static long getRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.request_timeout.toMilliseconds(), MILLISECONDS);
+        return conf.request_timeout.to(unit);
     }
 
     public static void setRpcTimeout(long timeOutInMillis)
@@ -1672,7 +1672,7 @@ public class DatabaseDescriptor
 
     public static long getReadRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.read_request_timeout.toMilliseconds(), MILLISECONDS);
+        return conf.read_request_timeout.to(unit);
     }
 
     public static void setReadRpcTimeout(long timeOutInMillis)
@@ -1682,7 +1682,7 @@ public class DatabaseDescriptor
 
     public static long getRangeRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.range_request_timeout.toMilliseconds(), MILLISECONDS);
+        return conf.range_request_timeout.to(unit);
     }
 
     public static void setRangeRpcTimeout(long timeOutInMillis)
@@ -1692,7 +1692,7 @@ public class DatabaseDescriptor
 
     public static long getWriteRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.write_request_timeout.toMilliseconds(), MILLISECONDS);
+        return conf.write_request_timeout.to(unit);
     }
 
     public static void setWriteRpcTimeout(long timeOutInMillis)
@@ -1702,7 +1702,7 @@ public class DatabaseDescriptor
 
     public static long getCounterWriteRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.counter_write_request_timeout.toMilliseconds(), MILLISECONDS);
+        return conf.counter_write_request_timeout.to(unit);
     }
 
     public static void setCounterWriteRpcTimeout(long timeOutInMillis)
@@ -1712,7 +1712,7 @@ public class DatabaseDescriptor
 
     public static long getCasContentionTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.cas_contention_timeout.toMilliseconds(), MILLISECONDS);
+        return conf.cas_contention_timeout.to(unit);
     }
 
     public static void setCasContentionTimeout(long timeOutInMillis)
@@ -1722,7 +1722,7 @@ public class DatabaseDescriptor
 
     public static long getTruncateRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.truncate_request_timeout.toMilliseconds(), MILLISECONDS);
+        return conf.truncate_request_timeout.to(unit);
     }
 
     public static void setTruncateRpcTimeout(long timeOutInMillis)
@@ -1740,9 +1740,9 @@ public class DatabaseDescriptor
         conf.internode_timeout = crossNodeTimeout;
     }
 
-    public static long getSlowQueryTimeout(TimeUnit units)
+    public static long getSlowQueryTimeout(TimeUnit unit)
     {
-        return units.convert(conf.slow_query_log_timeout.toMilliseconds(), MILLISECONDS);
+        return conf.slow_query_log_timeout.to(unit);
     }
 
     /**
@@ -2770,7 +2770,7 @@ public class DatabaseDescriptor
         return conf.file_cache_enabled;
     }
 
-    public static int getFileCacheSizeInMB()
+    public static int getFileCacheSizeInMiB()
     {
         if (conf.file_cache_size == null)
         {
@@ -2782,7 +2782,7 @@ public class DatabaseDescriptor
         return conf.file_cache_size.toMebibytesAsInt();
     }
 
-    public static int getNetworkingCacheSizeInMB()
+    public static int getNetworkingCacheSizeInMiB()
     {
         if (conf.networking_cache_size == null)
         {
@@ -2830,13 +2830,14 @@ public class DatabaseDescriptor
         conf.key_cache_migrate_during_compaction = migrateCacheEntry;
     }
 
-    public static int getSSTablePreemptiveOpenIntervalInMB()
+    public static int getSSTablePreemptiveOpenIntervalInMiB()
     {
         return conf.sstable_preemptive_open_interval.toMebibytesAsInt();
     }
-    public static void setSSTablePreemptiveOpenIntervalInMB(int mb)
+
+    public static void setSSTablePreemptiveOpenIntervalInMiB(int mib)
     {
-        conf.sstable_preemptive_open_interval = SmallestDataStorageMebibytes.inMebibytes(mb);
+        conf.sstable_preemptive_open_interval = SmallestDataStorageMebibytes.inMebibytes(mib);
     }
 
     public static boolean getTrickleFsync()
@@ -2844,17 +2845,17 @@ public class DatabaseDescriptor
         return conf.trickle_fsync;
     }
 
-    public static int getTrickleFsyncIntervalInKb()
+    public static int getTrickleFsyncIntervalInKiB()
     {
         return conf.trickle_fsync_interval.toKibibytesAsInt();
     }
 
-    public static long getKeyCacheSizeInMB()
+    public static long getKeyCacheSizeInMiB()
     {
         return keyCacheSizeInMiB;
     }
 
-    public static long getIndexSummaryCapacityInMB()
+    public static long getIndexSummaryCapacityInMiB()
     {
         return indexSummaryCapacityInMiB;
     }
@@ -3075,7 +3076,7 @@ public class DatabaseDescriptor
         return conf.trace_type_query_ttl.toSecondsAsInt();
     }
 
-    public static long getPreparedStatementsCacheSizeMB()
+    public static long getPreparedStatementsCacheSizeMiB()
     {
         return preparedStatementsCacheSizeInMiB;
     }
@@ -3102,12 +3103,12 @@ public class DatabaseDescriptor
 
     public static long getUserDefinedFunctionWarnTimeout()
     {
-        return conf.user_defined_function_warn_timeout;
+        return conf.user_defined_function_warn_timeout_in_ms;
     }
 
     public static void setUserDefinedFunctionWarnTimeout(long userDefinedFunctionWarnTimeout)
     {
-        conf.user_defined_function_warn_timeout = userDefinedFunctionWarnTimeout;
+        conf.user_defined_function_warn_timeout_in_ms = userDefinedFunctionWarnTimeout;
     }
 
     public static boolean getMaterializedViewsEnabled()
@@ -3153,12 +3154,12 @@ public class DatabaseDescriptor
 
     public static long getUserDefinedFunctionFailTimeout()
     {
-        return conf.user_defined_function_fail_timeout;
+        return conf.user_defined_function_fail_timeout_in_ms;
     }
 
     public static void setUserDefinedFunctionFailTimeout(long userDefinedFunctionFailTimeout)
     {
-        conf.user_defined_function_fail_timeout = userDefinedFunctionFailTimeout;
+        conf.user_defined_function_fail_timeout_in_ms = userDefinedFunctionFailTimeout;
     }
 
     public static Config.UserFunctionTimeoutPolicy getUserFunctionTimeoutPolicy()
@@ -3419,43 +3420,6 @@ public class DatabaseDescriptor
     }
 
     /**
-     * Class that primarily tracks overflow thresholds during conversions
-     */
-    private enum ByteUnit {
-        KIBI_BYTES(2048 * 1024, 1024),
-        MEBI_BYTES(2048, 1024 * 1024);
-
-        private final int overflowThreshold;
-        private final int multiplier;
-
-        ByteUnit(int t, int m)
-        {
-            this.overflowThreshold = t;
-            this.multiplier = m;
-        }
-
-        public int overflowThreshold()
-        {
-            return overflowThreshold;
-        }
-
-        public boolean willOverflowInBytes(int val)
-        {
-            return val >= overflowThreshold;
-        }
-
-        public long toBytes(int val)
-        {
-            return val * multiplier;
-        }
-
-        public long fromBytes(int val)
-        {
-            return val / multiplier;
-        }
-    }
-
-    /**
      * Ensures passed in configuration value is positive and will not overflow when converted to Bytes
      */
     private static void checkValidForByteConversion(final SmallestDataStorageKibibytes value, String name)
@@ -3789,22 +3753,22 @@ public class DatabaseDescriptor
         conf.track_warnings.local_read_size.setAbortThresholdKb(value);
     }
 
-    public static int getRowIndexSizeWarnThresholdKb()
+    public static int getRowIndexSizeWarnThresholdKiB()
     {
         return conf.track_warnings.row_index_size.getWarnThresholdKb();
     }
 
-    public static void setRowIndexSizeWarnThresholdKb(int value)
+    public static void setRowIndexSizeWarnThresholdKiB(int value)
     {
         conf.track_warnings.row_index_size.setWarnThresholdKb(value);
     }
 
-    public static int getRowIndexSizeAbortThresholdKb()
+    public static int getRowIndexSizeAbortThresholdKiB()
     {
         return conf.track_warnings.row_index_size.getAbortThresholdKb();
     }
 
-    public static void setRowIndexSizeAbortThresholdKb(int value)
+    public static void setRowIndexSizeAbortThresholdKiB(int value)
     {
         conf.track_warnings.row_index_size.setAbortThresholdKb(value);
     }
diff --git a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
index 4fc82b4..1840054 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -144,8 +144,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
         }
         catch (YAMLException e)
         {
-            throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR
-                                             + " Error: " + e.getMessage(), false);
+            throw new ConfigurationException("Invalid yaml: " + url, e);
         }
     }
 
diff --git a/src/java/org/apache/cassandra/cql3/QueryProcessor.java b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
index 80ba508..0e0c043 100644
--- a/src/java/org/apache/cassandra/cql3/QueryProcessor.java
+++ b/src/java/org/apache/cassandra/cql3/QueryProcessor.java
@@ -30,7 +30,6 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Predicate;
 import com.google.common.collect.*;
 import com.google.common.primitives.Ints;
-import com.google.common.util.concurrent.MoreExecutors;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -99,7 +98,7 @@ public class QueryProcessor implements QueryHandler
     {
         preparedStatements = Caffeine.newBuilder()
                              .executor(ImmediateExecutor.INSTANCE)
-                             .maximumWeight(capacityToBytes(DatabaseDescriptor.getPreparedStatementsCacheSizeMB()))
+                             .maximumWeight(capacityToBytes(DatabaseDescriptor.getPreparedStatementsCacheSizeMiB()))
                              .weigher(QueryProcessor::measure)
                              .removalListener((key, prepared, cause) -> {
                                  MD5Digest md5Digest = (MD5Digest) key;
@@ -114,13 +113,13 @@ public class QueryProcessor implements QueryHandler
         ScheduledExecutors.scheduledTasks.scheduleAtFixedRate(() -> {
             long count = lastMinuteEvictionsCount.getAndSet(0);
             if (count > 0)
-                logger.warn("{} prepared statements discarded in the last minute because cache limit reached ({} MB)",
+                logger.warn("{} prepared statements discarded in the last minute because cache limit reached ({} MiB)",
                             count,
-                            DatabaseDescriptor.getPreparedStatementsCacheSizeMB());
+                            DatabaseDescriptor.getPreparedStatementsCacheSizeMiB());
         }, 1, 1, TimeUnit.MINUTES);
 
-        logger.info("Initialized prepared statement caches with {} MB",
-                    DatabaseDescriptor.getPreparedStatementsCacheSizeMB());
+        logger.info("Initialized prepared statement caches with {} MiB",
+                    DatabaseDescriptor.getPreparedStatementsCacheSizeMiB());
     }
 
     private static long capacityToBytes(long cacheSizeMB)
@@ -564,10 +563,10 @@ public class QueryProcessor implements QueryHandler
         // (if the keyspace is null, queryString has to have a fully-qualified keyspace so it's fine.
         long statementSize = ObjectSizes.measureDeep(prepared.statement);
         // don't execute the statement if it's bigger than the allowed threshold
-        if (statementSize > capacityToBytes(DatabaseDescriptor.getPreparedStatementsCacheSizeMB()))
+        if (statementSize > capacityToBytes(DatabaseDescriptor.getPreparedStatementsCacheSizeMiB()))
             throw new InvalidRequestException(String.format("Prepared statement of size %d bytes is larger than allowed maximum of %d MB: %s...",
                                                             statementSize,
-                                                            DatabaseDescriptor.getPreparedStatementsCacheSizeMB(),
+                                                            DatabaseDescriptor.getPreparedStatementsCacheSizeMiB(),
                                                             queryString.substring(0, 200)));
         MD5Digest statementId = computeId(queryString, keyspace);
         preparedStatements.put(statementId, prepared);
diff --git a/src/java/org/apache/cassandra/db/RowIndexEntry.java b/src/java/org/apache/cassandra/db/RowIndexEntry.java
index 153dbac..f5f632a 100644
--- a/src/java/org/apache/cassandra/db/RowIndexEntry.java
+++ b/src/java/org/apache/cassandra/db/RowIndexEntry.java
@@ -355,8 +355,8 @@ public class RowIndexEntry<T> implements IMeasurableMemory
             if (command == null || SchemaConstants.isSystemKeyspace(command.metadata().keyspace) || !DatabaseDescriptor.getTrackWarningsEnabled())
                 return;
 
-            int warnThreshold = DatabaseDescriptor.getRowIndexSizeWarnThresholdKb() * 1024;
-            int abortThreshold = DatabaseDescriptor.getRowIndexSizeAbortThresholdKb() * 1024;
+            int warnThreshold = DatabaseDescriptor.getRowIndexSizeWarnThresholdKiB() * 1024;
+            int abortThreshold = DatabaseDescriptor.getRowIndexSizeAbortThresholdKiB() * 1024;
             if (warnThreshold == 0 && abortThreshold == 0)
                 return;
 
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
index 17c30d4..b0ec8da 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionTask.java
@@ -87,7 +87,7 @@ public class CompactionTask extends AbstractCompactionTask
         if (partialCompactionsAcceptable() && transaction.originals().size() > 1)
         {
             // Try again w/o the largest one.
-            logger.warn("insufficient space to compact all requested files. {}MB required, {}",
+            logger.warn("insufficient space to compact all requested files. {}MiB required, {}",
                         (float) expectedSize / 1024 / 1024,
                         StringUtils.join(transaction.originals(), ", "));
 
@@ -394,7 +394,7 @@ public class CompactionTask extends AbstractCompactionTask
             }
 
             sstablesRemoved++;
-            logger.warn("Not enough space for compaction, {}MB estimated.  Reducing scope.",
+            logger.warn("Not enough space for compaction, {}MiB estimated.  Reducing scope.",
                         (float) expectedWriteSize / 1024 / 1024);
         }
 
diff --git a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
index 6faca63..54953e4 100644
--- a/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/LeveledCompactionStrategy.java
@@ -54,7 +54,7 @@ public class LeveledCompactionStrategy extends AbstractCompactionStrategy
 
     @VisibleForTesting
     final LeveledManifest manifest;
-    private final int maxSSTableSizeInMB;
+    private final int maxSSTableSizeInMiB;
     private final int levelFanoutSize;
     private final boolean singleSSTableUplevel;
 
@@ -91,11 +91,11 @@ public class LeveledCompactionStrategy extends AbstractCompactionStrategy
                 configuredSingleSSTableUplevel = Boolean.parseBoolean(options.get(SINGLE_SSTABLE_UPLEVEL_OPTION));
             }
         }
-        maxSSTableSizeInMB = configuredMaxSSTableSize;
+        maxSSTableSizeInMiB = configuredMaxSSTableSize;
         levelFanoutSize = configuredLevelFanoutSize;
         singleSSTableUplevel = configuredSingleSSTableUplevel;
 
-        manifest = new LeveledManifest(cfs, this.maxSSTableSizeInMB, this.levelFanoutSize, localOptions);
+        manifest = new LeveledManifest(cfs, this.maxSSTableSizeInMiB, this.levelFanoutSize, localOptions);
         logger.trace("Created {}", manifest);
     }
 
@@ -282,7 +282,7 @@ public class LeveledCompactionStrategy extends AbstractCompactionStrategy
 
     public long getMaxSSTableBytes()
     {
-        return maxSSTableSizeInMB * 1024L * 1024L;
+        return maxSSTableSizeInMiB * 1024L * 1024L;
     }
 
     public int getLevelFanoutSize()
diff --git a/src/java/org/apache/cassandra/db/compaction/SSTableSplitter.java b/src/java/org/apache/cassandra/db/compaction/SSTableSplitter.java
index 1bb1701..6f68c34 100644
--- a/src/java/org/apache/cassandra/db/compaction/SSTableSplitter.java
+++ b/src/java/org/apache/cassandra/db/compaction/SSTableSplitter.java
@@ -42,12 +42,12 @@ public class SSTableSplitter
 
     public static class SplittingCompactionTask extends CompactionTask
     {
-        private final int sstableSizeInMB;
+        private final int sstableSizeInMiB;
 
         public SplittingCompactionTask(ColumnFamilyStore cfs, LifecycleTransaction transaction, int sstableSizeInMB)
         {
             super(cfs, transaction, CompactionManager.NO_GC, false);
-            this.sstableSizeInMB = sstableSizeInMB;
+            this.sstableSizeInMiB = sstableSizeInMB;
 
             if (sstableSizeInMB <= 0)
                 throw new IllegalArgumentException("Invalid target size for SSTables, must be > 0 (got: " + sstableSizeInMB + ")");
@@ -65,7 +65,7 @@ public class SSTableSplitter
                                                               LifecycleTransaction txn,
                                                               Set<SSTableReader> nonExpiredSSTables)
         {
-            return new MaxSSTableSizeWriter(cfs, directories, txn, nonExpiredSSTables, sstableSizeInMB * 1024L * 1024L, 0, false);
+            return new MaxSSTableSizeWriter(cfs, directories, txn, nonExpiredSSTables, sstableSizeInMiB * 1024L * 1024L, 0, false);
         }
 
         @Override
diff --git a/src/java/org/apache/cassandra/db/compaction/writers/SplittingSizeTieredCompactionWriter.java b/src/java/org/apache/cassandra/db/compaction/writers/SplittingSizeTieredCompactionWriter.java
index d29061c..565e614 100644
--- a/src/java/org/apache/cassandra/db/compaction/writers/SplittingSizeTieredCompactionWriter.java
+++ b/src/java/org/apache/cassandra/db/compaction/writers/SplittingSizeTieredCompactionWriter.java
@@ -37,7 +37,7 @@ import org.apache.cassandra.io.sstable.metadata.MetadataCollector;
  * CompactionAwareWriter that splits input in differently sized sstables
  *
  * Biggest sstable will be total_compaction_size / 2, second biggest total_compaction_size / 4 etc until
- * the result would be sub 50MB, all those are put in the same
+ * the result would be sub 50MiB, all those are put in the same
  */
 public class SplittingSizeTieredCompactionWriter extends CompactionAwareWriter
 {
@@ -70,7 +70,7 @@ public class SplittingSizeTieredCompactionWriter extends CompactionAwareWriter
         }
 
         int noPointIndex = 0;
-        // find how many sstables we should create - 50MB min sstable size
+        // find how many sstables we should create - 50MiB min sstable size
         for (double ratio : potentialRatios)
         {
             noPointIndex++;
diff --git a/src/java/org/apache/cassandra/db/partitions/AtomicBTreePartition.java b/src/java/org/apache/cassandra/db/partitions/AtomicBTreePartition.java
index c5e9fe4..92e2f8e 100644
--- a/src/java/org/apache/cassandra/db/partitions/AtomicBTreePartition.java
+++ b/src/java/org/apache/cassandra/db/partitions/AtomicBTreePartition.java
@@ -73,7 +73,7 @@ public final class AtomicBTreePartition extends AbstractBTreePartition
 
     /**
      * (clock + allocation) granularity are combined to give us an acceptable (waste) allocation rate that is defined by
-     * the passage of real time of ALLOCATION_GRANULARITY_BYTES/CLOCK_GRANULARITY, or in this case 7.63Kb/ms, or 7.45Mb/s
+     * the passage of real time of ALLOCATION_GRANULARITY_BYTES/CLOCK_GRANULARITY, or in this case 7.63KiB/ms, or 7.45Mb/s
      *
      * in wasteTracker we maintain within EXCESS_WASTE_OFFSET before the current time; whenever we waste bytes
      * we increment the current value if it is within this window, and set it to the min of the window plus our waste
diff --git a/src/java/org/apache/cassandra/db/rows/UnfilteredRowIteratorWithLowerBound.java b/src/java/org/apache/cassandra/db/rows/UnfilteredRowIteratorWithLowerBound.java
index b6f4254..2842e66 100644
--- a/src/java/org/apache/cassandra/db/rows/UnfilteredRowIteratorWithLowerBound.java
+++ b/src/java/org/apache/cassandra/db/rows/UnfilteredRowIteratorWithLowerBound.java
@@ -185,7 +185,7 @@ public class UnfilteredRowIteratorWithLowerBound extends LazilyInitializedUnfilt
         // CASSANDRA-11369 is there to fix this afterwards.
 
         // Creating the iterator ensures that rowIndexEntry is loaded if available (partitions bigger than
-        // DatabaseDescriptor.column_index_size_in_kb)
+        // DatabaseDescriptor.column_index_size)
         if (!canUseMetadataLowerBound())
             maybeInit();
 
diff --git a/src/java/org/apache/cassandra/hadoop/ConfigHelper.java b/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
index f01197d..cc539b1 100644
--- a/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
+++ b/src/java/org/apache/cassandra/hadoop/ConfigHelper.java
@@ -45,7 +45,7 @@ public class ConfigHelper
     private static final String INPUT_PREDICATE_CONFIG = "cassandra.input.predicate";
     private static final String INPUT_KEYRANGE_CONFIG = "cassandra.input.keyRange";
     private static final String INPUT_SPLIT_SIZE_CONFIG = "cassandra.input.split.size";
-    private static final String INPUT_SPLIT_SIZE_IN_MB_CONFIG = "cassandra.input.split.size_mb";
+    private static final String INPUT_SPLIT_SIZE_IN_MIB_CONFIG = "cassandra.input.split.size_mb";
     private static final String INPUT_WIDEROWS_CONFIG = "cassandra.input.widerows";
     private static final int DEFAULT_SPLIT_SIZE = 64 * 1024;
     private static final String RANGE_BATCH_SIZE_CONFIG = "cassandra.range.batch.size";
@@ -185,21 +185,21 @@ public class ConfigHelper
      * the overhead of each map will take up the bulk of the job time.
      *
      * @param conf          Job configuration you are about to run
-     * @param splitSizeMb   Input split size in MB
+     * @param splitSizeMb   Input split size in MiB
      */
     public static void setInputSplitSizeInMb(Configuration conf, int splitSizeMb)
     {
-        conf.setInt(INPUT_SPLIT_SIZE_IN_MB_CONFIG, splitSizeMb);
+        conf.setInt(INPUT_SPLIT_SIZE_IN_MIB_CONFIG, splitSizeMb);
     }
 
     /**
      * cassandra.input.split.size will be used if the value is undefined or negative.
      * @param conf  Job configuration you are about to run
-     * @return      split size in MB or -1 if it is undefined.
+     * @return      split size in MiB or -1 if it is undefined.
      */
     public static int getInputSplitSizeInMb(Configuration conf)
     {
-        return conf.getInt(INPUT_SPLIT_SIZE_IN_MB_CONFIG, -1);
+        return conf.getInt(INPUT_SPLIT_SIZE_IN_MIB_CONFIG, -1);
     }
 
     /**
diff --git a/src/java/org/apache/cassandra/hadoop/cql3/CqlBulkRecordWriter.java b/src/java/org/apache/cassandra/hadoop/cql3/CqlBulkRecordWriter.java
index b34048d..82d5e8a 100644
--- a/src/java/org/apache/cassandra/hadoop/cql3/CqlBulkRecordWriter.java
+++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlBulkRecordWriter.java
@@ -169,7 +169,7 @@ public class CqlBulkRecordWriter extends RecordWriter<Object, List<ByteBuffer>>
                                      .using(insertStatement)
                                      .withPartitioner(ConfigHelper.getOutputPartitioner(conf))
                                      .inDirectory(outputDir)
-                                     .withBufferSizeInMB(Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64")))
+                                     .withBufferSizeInMiB(Integer.parseInt(conf.get(BUFFER_SIZE_IN_MB, "64")))
                                      .withPartitioner(partitioner)
                                      .build();
         }
diff --git a/src/java/org/apache/cassandra/hadoop/cql3/CqlInputFormat.java b/src/java/org/apache/cassandra/hadoop/cql3/CqlInputFormat.java
index bb6881b..584a80c 100644
--- a/src/java/org/apache/cassandra/hadoop/cql3/CqlInputFormat.java
+++ b/src/java/org/apache/cassandra/hadoop/cql3/CqlInputFormat.java
@@ -330,8 +330,8 @@ public class CqlInputFormat extends org.apache.hadoop.mapreduce.InputFormat<Long
     private Map<TokenRange, Long> getSubSplits(String keyspace, String cfName, TokenRange range, Host host, Configuration conf, Session session)
     {
         int splitSize = ConfigHelper.getInputSplitSize(conf);
-        int splitSizeMb = ConfigHelper.getInputSplitSizeInMb(conf);
-        return describeSplits(keyspace, cfName, range, host, splitSize, splitSizeMb, session);
+        int splitSizeMiB = ConfigHelper.getInputSplitSizeInMb(conf);
+        return describeSplits(keyspace, cfName, range, host, splitSize, splitSizeMiB, session);
     }
 
     private static Map<TokenRange, List<Host>> getRangeMap(String keyspace, Metadata metadata, String targetDC)
diff --git a/src/java/org/apache/cassandra/hints/HintsReader.java b/src/java/org/apache/cassandra/hints/HintsReader.java
index a3944eb..708a916 100644
--- a/src/java/org/apache/cassandra/hints/HintsReader.java
+++ b/src/java/org/apache/cassandra/hints/HintsReader.java
@@ -53,7 +53,7 @@ class HintsReader implements AutoCloseable, Iterable<HintsReader.Page>
 {
     private static final Logger logger = LoggerFactory.getLogger(HintsReader.class);
 
-    // don't read more than 512 KB of hints at a time.
+    // don't read more than 512 KiB of hints at a time.
     private static final int PAGE_SIZE = 512 << 10;
 
     private final HintsDescriptor descriptor;
diff --git a/src/java/org/apache/cassandra/hints/HintsWriter.java b/src/java/org/apache/cassandra/hints/HintsWriter.java
index 8c70893..468eee2 100644
--- a/src/java/org/apache/cassandra/hints/HintsWriter.java
+++ b/src/java/org/apache/cassandra/hints/HintsWriter.java
@@ -284,7 +284,7 @@ class HintsWriter implements AutoCloseable
 
         private void maybeFsync()
         {
-            if (position() >= lastSyncPosition + DatabaseDescriptor.getTrickleFsyncIntervalInKb() * 1024L)
+            if (position() >= lastSyncPosition + DatabaseDescriptor.getTrickleFsyncIntervalInKiB() * 1024L)
                 fsync();
         }
 
@@ -294,7 +294,7 @@ class HintsWriter implements AutoCloseable
 
             // don't skip page cache for tiny files, on the assumption that if they are tiny, the target node is probably
             // alive, and if so, the file will be closed and dispatched shortly (within a minute), and the file will be dropped.
-            if (position >= DatabaseDescriptor.getTrickleFsyncIntervalInKb() * 1024L)
+            if (position >= DatabaseDescriptor.getTrickleFsyncIntervalInKiB() * 1024L)
                 NativeLibrary.trySkipCache(fd, 0, position - (position % PAGE_SIZE), file.path());
         }
     }
diff --git a/src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java b/src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java
index 875d2f7..7d4f5c9 100644
--- a/src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java
+++ b/src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java
@@ -190,7 +190,7 @@ public class IndexMode
 
         if (maxMemBytes > 100L * 1073741824)
         {
-            logger.error("{} configured as {} is above 100GB, reverting to default 1GB", INDEX_MAX_FLUSH_MEMORY_OPTION, maxMemBytes);
+            logger.error("{} configured as {} is above 100GiB, reverting to default 1GB", INDEX_MAX_FLUSH_MEMORY_OPTION, maxMemBytes);
             maxMemBytes = DEFAULT_MAX_MEM_BYTES;
         }
         return new IndexMode(mode, isLiteral, isAnalyzed, analyzerClass, maxMemBytes);
diff --git a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
index 919c199..153f0d5 100644
--- a/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/CQLSSTableWriter.java
@@ -52,7 +52,6 @@ import org.apache.cassandra.io.sstable.format.SSTableFormat;
 import org.apache.cassandra.io.util.File;
 import org.apache.cassandra.schema.*;
 import org.apache.cassandra.service.ClientState;
-import org.apache.cassandra.service.QueryState;
 import org.apache.cassandra.transport.ProtocolVersion;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
@@ -356,7 +355,7 @@ public class CQLSSTableWriter implements Closeable
         private IPartitioner partitioner;
 
         private boolean sorted = false;
-        private long bufferSizeInMB = 128;
+        private long bufferSizeInMiB = 128;
 
         protected Builder() {
             this.typeStatements = new ArrayList<>();
@@ -469,15 +468,15 @@ public class CQLSSTableWriter implements Closeable
          * a new SSTable. This correspond roughly to the data size that will have the created
          * sstable.
          * <p>
-         * The default is 128MB, which should be reasonable for a 1GB heap. If you experience
+         * The default is 128MiB, which should be reasonable for a 1GiB heap. If you experience
          * OOM while using the writer, you should lower this value.
          *
-         * @param size the size to use in MB.
+         * @param size the size to use in MiB.
          * @return this builder.
          */
-        public Builder withBufferSizeInMB(int size)
+        public Builder withBufferSizeInMiB(int size)
         {
-            this.bufferSizeInMB = size;
+            this.bufferSizeInMiB = size;
             return this;
         }
 
@@ -494,7 +493,7 @@ public class CQLSSTableWriter implements Closeable
          * the rows in order, which is rarely the case. If you can provide the
          * rows in order however, using this sorted might be more efficient.
          * <p>
-         * Note that if used, some option like withBufferSizeInMB will be ignored.
+         * Note that if used, some option like withBufferSizeInMiB will be ignored.
          *
          * @return this builder.
          */
@@ -548,7 +547,7 @@ public class CQLSSTableWriter implements Closeable
                 TableMetadataRef ref = TableMetadataRef.forOfflineTools(tableMetadata);
                 AbstractSSTableSimpleWriter writer = sorted
                                                    ? new SSTableSimpleWriter(directory, ref, preparedInsert.updatedColumns())
-                                                   : new SSTableSimpleUnsortedWriter(directory, ref, preparedInsert.updatedColumns(), bufferSizeInMB);
+                                                   : new SSTableSimpleUnsortedWriter(directory, ref, preparedInsert.updatedColumns(), bufferSizeInMiB);
 
                 if (formatType != null)
                     writer.setSSTableFormatType(formatType);
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexSummaryBuilder.java b/src/java/org/apache/cassandra/io/sstable/IndexSummaryBuilder.java
index cb6fcc0..75cca84 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexSummaryBuilder.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexSummaryBuilder.java
@@ -211,7 +211,7 @@ public class IndexSummaryBuilder implements AutoCloseable
             else
             {
                 // we cannot fully sample this sstable due to too much memory in the index summary, so let's tell the user
-                logger.error("Memory capacity of index summary exceeded (2GB), index summary will not cover full sstable, " +
+                logger.error("Memory capacity of index summary exceeded (2GiB), index summary will not cover full sstable, " +
                              "you should increase min_sampling_level");
             }
         }
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java b/src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java
index ee6f349..4e3ae30 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexSummaryManager.java
@@ -82,12 +82,12 @@ public class IndexSummaryManager implements IndexSummaryManagerMBean
     {
         executor = executorFactory().scheduled(false, "IndexSummaryManager", Thread.MIN_PRIORITY);
 
-        long indexSummarySizeInMB = DatabaseDescriptor.getIndexSummaryCapacityInMB();
+        long indexSummarySizeInMB = DatabaseDescriptor.getIndexSummaryCapacityInMiB();
         int interval = DatabaseDescriptor.getIndexSummaryResizeIntervalInMinutes();
         logger.info("Initializing index summary manager with a memory pool size of {} MB and a resize interval of {} minutes",
                     indexSummarySizeInMB, interval);
 
-        setMemoryPoolCapacityInMB(DatabaseDescriptor.getIndexSummaryCapacityInMB());
+        setMemoryPoolCapacityInMB(DatabaseDescriptor.getIndexSummaryCapacityInMiB());
         setResizeIntervalInMinutes(DatabaseDescriptor.getIndexSummaryResizeIntervalInMinutes());
     }
 
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexSummaryManagerMBean.java b/src/java/org/apache/cassandra/io/sstable/IndexSummaryManagerMBean.java
index ad79185..8edba75 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexSummaryManagerMBean.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexSummaryManagerMBean.java
@@ -27,7 +27,7 @@ public interface IndexSummaryManagerMBean
 
     /**
      * Returns the current actual off-heap memory usage of the index summaries for all non-compacting sstables.
-     * @return The amount of memory used in MB.
+     * @return The amount of memory used in MiB.
      */
     public double getMemoryPoolSizeInMB();
 
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexSummaryRedistribution.java b/src/java/org/apache/cassandra/io/sstable/IndexSummaryRedistribution.java
index bac3280..91a3b54 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexSummaryRedistribution.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexSummaryRedistribution.java
@@ -94,7 +94,7 @@ public class IndexSummaryRedistribution extends CompactionInfo.Holder
         for (SSTableReader sstable : redistribute)
             total += sstable.getIndexSummaryOffHeapSize();
 
-        logger.info("Beginning redistribution of index summaries for {} sstables with memory pool size {} MB; current spaced used is {} MB",
+        logger.info("Beginning redistribution of index summaries for {} sstables with memory pool size {} MiB; current spaced used is {} MiB",
                      redistribute.size(), memoryPoolBytes / 1024L / 1024L, total / 1024.0 / 1024.0);
 
         final Map<SSTableReader, Double> readRates = new HashMap<>(redistribute.size());
@@ -119,7 +119,7 @@ public class IndexSummaryRedistribution extends CompactionInfo.Holder
 
         long remainingBytes = memoryPoolBytes - nonRedistributingOffHeapSize;
 
-        logger.trace("Index summaries for compacting SSTables are using {} MB of space",
+        logger.trace("Index summaries for compacting SSTables are using {} MiB of space",
                      (memoryPoolBytes - remainingBytes) / 1024.0 / 1024.0);
         List<SSTableReader> newSSTables;
         try (Refs<SSTableReader> refs = Refs.ref(sstablesByHotness))
@@ -133,7 +133,7 @@ public class IndexSummaryRedistribution extends CompactionInfo.Holder
         for (SSTableReader sstable : newSSTables)
             total += sstable.getIndexSummaryOffHeapSize();
 
-        logger.info("Completed resizing of index summaries; current approximate memory used: {} MB, time spent: {}ms",
+        logger.info("Completed resizing of index summaries; current approximate memory used: {} MiB, time spent: {}ms",
                     total / 1024.0 / 1024.0, TimeUnit.NANOSECONDS.toMillis(nanoTime() - start));
 
         return newSSTables;
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTable.java b/src/java/org/apache/cassandra/io/sstable/SSTable.java
index b56a286..04f22d9 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTable.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTable.java
@@ -273,7 +273,7 @@ public abstract class SSTable
     /** @return An estimate of the number of keys contained in the given index file. */
     public static long estimateRowsFromIndex(RandomAccessReader ifile, Descriptor descriptor) throws IOException
     {
-        // collect sizes for the first 10000 keys, or first 10 megabytes of data
+        // collect sizes for the first 10000 keys, or first 10 mebibytes of data
         final int SAMPLES_CAP = 10000, BYTES_CAP = (int)Math.min(10000000, ifile.length());
         int keys = 0;
         while (ifile.getFilePointer() < BYTES_CAP && keys < SAMPLES_CAP)
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java b/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
index 06b5dcd..e394bbd 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableRewriter.java
@@ -62,7 +62,7 @@ public class SSTableRewriter extends Transactional.AbstractTransactional impleme
     private final ILifecycleTransaction transaction; // the readers we are rewriting (updated as they are replaced)
     private final List<SSTableReader> preparedForCommit = new ArrayList<>();
 
-    private long currentlyOpenedEarlyAt; // the position (in MB) in the target file we last (re)opened at
+    private long currentlyOpenedEarlyAt; // the position (in MiB) in the target file we last (re)opened at
 
     private final List<SSTableWriter> writers = new ArrayList<>();
     private final boolean keepOriginals; // true if we do not want to obsolete the originals
@@ -106,7 +106,7 @@ public class SSTableRewriter extends Transactional.AbstractTransactional impleme
 
     private static long calculateOpenInterval(boolean shouldOpenEarly)
     {
-        long interval = DatabaseDescriptor.getSSTablePreemptiveOpenIntervalInMB() * (1L << 20);
+        long interval = DatabaseDescriptor.getSSTablePreemptiveOpenIntervalInMiB() * (1L << 20);
         if (disableEarlyOpeningForTests || !shouldOpenEarly || interval < 0)
             interval = Long.MAX_VALUE;
         return interval;
diff --git a/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java b/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java
index dc43380..85eb8ed 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/big/BigTableWriter.java
@@ -71,7 +71,7 @@ public class BigTableWriter extends SSTableWriter
 
     private final SequentialWriterOption writerOption = SequentialWriterOption.newBuilder()
                                                         .trickleFsync(DatabaseDescriptor.getTrickleFsync())
-                                                        .trickleFsyncByteInterval(DatabaseDescriptor.getTrickleFsyncIntervalInKb() * 1024)
+                                                        .trickleFsyncByteInterval(DatabaseDescriptor.getTrickleFsyncIntervalInKiB() * 1024)
                                                         .build();
 
     public BigTableWriter(Descriptor descriptor,
diff --git a/src/java/org/apache/cassandra/io/util/SequentialWriterOption.java b/src/java/org/apache/cassandra/io/util/SequentialWriterOption.java
index 61f375b..599c654 100644
--- a/src/java/org/apache/cassandra/io/util/SequentialWriterOption.java
+++ b/src/java/org/apache/cassandra/io/util/SequentialWriterOption.java
@@ -32,10 +32,10 @@ public class SequentialWriterOption
      * Default write option.
      *
      * <ul>
-     *   <li>buffer size: 64 KB
+     *   <li>buffer size: 64 KiB
      *   <li>buffer type: on heap
      *   <li>trickle fsync: false
-     *   <li>trickle fsync byte interval: 10 MB
+     *   <li>trickle fsync byte interval: 10 MiB
      *   <li>finish on close: false
      * </ul>
      */
@@ -108,7 +108,7 @@ public class SequentialWriterOption
         private BufferType bufferType = BufferType.ON_HEAP;
         /* default: no trickle fsync */
         private boolean trickleFsync = false;
-        /* default tricle fsync byte interval: 10MB */
+        /* default tricle fsync byte interval: 10MiB */
         private int trickleFsyncByteInterval = 10 * 1024 * 1024;
         private boolean finishOnClose = false;
 
diff --git a/src/java/org/apache/cassandra/net/AsyncStreamingOutputPlus.java b/src/java/org/apache/cassandra/net/AsyncStreamingOutputPlus.java
index 2a51ae3..915e8a3 100644
--- a/src/java/org/apache/cassandra/net/AsyncStreamingOutputPlus.java
+++ b/src/java/org/apache/cassandra/net/AsyncStreamingOutputPlus.java
@@ -147,7 +147,7 @@ public class AsyncStreamingOutputPlus extends AsyncChannelOutputPlus implements
     /**
      * Writes all data in file channel to stream: <br>
      * * For zero-copy-streaming, 1MiB at a time, with at most 2MiB in flight at once. <br>
-     * * For streaming with SSL, 64kb at a time, with at most 32+64kb (default low water mark + batch size) in flight. <br>
+     * * For streaming with SSL, 64KiB at a time, with at most 32+64KiB (default low water mark + batch size) in flight. <br>
      * <p>
      * This method takes ownership of the provided {@link FileChannel}.
      * <p>
@@ -157,7 +157,7 @@ public class AsyncStreamingOutputPlus extends AsyncChannelOutputPlus implements
     public long writeFileToChannel(FileChannel file, RateLimiter limiter) throws IOException
     {
         if (channel.pipeline().get(SslHandler.class) != null)
-            // each batch is loaded into ByteBuffer, 64kb is more BufferPool friendly.
+            // each batch is loaded into ByteBuffer, 64KiB is more BufferPool friendly.
             return writeFileToChannel(file, limiter, 1 << 16);
         else
             // write files in 1MiB chunks, since there may be blocking work performed to fetch it from disk,
diff --git a/src/java/org/apache/cassandra/schema/CompressionParams.java b/src/java/org/apache/cassandra/schema/CompressionParams.java
index fca7e4c..be79ec6 100644
--- a/src/java/org/apache/cassandra/schema/CompressionParams.java
+++ b/src/java/org/apache/cassandra/schema/CompressionParams.java
@@ -370,7 +370,7 @@ public final class CompressionParams
     }
 
     /**
-     * Parse the chunk length (in KB) and returns it as bytes.
+     * Parse the chunk length (in KiB) and returns it as bytes.
      *
      * @param chLengthKB the length of the chunk to parse
      * @return the chunk length in bytes
diff --git a/src/java/org/apache/cassandra/service/CacheService.java b/src/java/org/apache/cassandra/service/CacheService.java
index 2bacc343..27d3322 100644
--- a/src/java/org/apache/cassandra/service/CacheService.java
+++ b/src/java/org/apache/cassandra/service/CacheService.java
@@ -99,9 +99,9 @@ public class CacheService implements CacheServiceMBean
      */
     private AutoSavingCache<KeyCacheKey, RowIndexEntry> initKeyCache()
     {
-        logger.info("Initializing key cache with capacity of {} MBs.", DatabaseDescriptor.getKeyCacheSizeInMB());
+        logger.info("Initializing key cache with capacity of {} MiBs.", DatabaseDescriptor.getKeyCacheSizeInMiB());
 
-        long keyCacheInMemoryCapacity = DatabaseDescriptor.getKeyCacheSizeInMB() * 1024 * 1024;
+        long keyCacheInMemoryCapacity = DatabaseDescriptor.getKeyCacheSizeInMiB() * 1024 * 1024;
 
         // as values are constant size we can use singleton weigher
         // where 48 = 40 bytes (average size of the key) + 8 bytes (size of value)
@@ -121,7 +121,7 @@ public class CacheService implements CacheServiceMBean
      */
     private AutoSavingCache<RowCacheKey, IRowCacheEntry> initRowCache()
     {
-        logger.info("Initializing row cache with capacity of {} MBs", DatabaseDescriptor.getRowCacheSizeInMiB());
+        logger.info("Initializing row cache with capacity of {} MiBs", DatabaseDescriptor.getRowCacheSizeInMiB());
 
         CacheProvider<RowCacheKey, IRowCacheEntry> cacheProvider;
         String cacheProviderClassName = DatabaseDescriptor.getRowCacheSizeInMiB() > 0
@@ -150,7 +150,7 @@ public class CacheService implements CacheServiceMBean
 
     private AutoSavingCache<CounterCacheKey, ClockAndCount> initCounterCache()
     {
-        logger.info("Initializing counter cache with capacity of {} MBs", DatabaseDescriptor.getCounterCacheSizeInMiB());
+        logger.info("Initializing counter cache with capacity of {} MiBs", DatabaseDescriptor.getCounterCacheSizeInMiB());
 
         long capacity = DatabaseDescriptor.getCounterCacheSizeInMiB() * 1024 * 1024;
 
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 1236279..3f956dd 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -5827,12 +5827,12 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
 
     public void setSSTablePreemptiveOpenIntervalInMB(int intervalInMB)
     {
-        DatabaseDescriptor.setSSTablePreemptiveOpenIntervalInMB(intervalInMB);
+        DatabaseDescriptor.setSSTablePreemptiveOpenIntervalInMiB(intervalInMB);
     }
 
     public int getSSTablePreemptiveOpenIntervalInMB()
     {
-        return DatabaseDescriptor.getSSTablePreemptiveOpenIntervalInMB();
+        return DatabaseDescriptor.getSSTablePreemptiveOpenIntervalInMiB();
     }
 
     public boolean getMigrateKeycacheOnCompaction()
@@ -5889,7 +5889,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
         logger.info("updated replica_filtering_protection.cached_rows_fail_threshold to {}", threshold);
     }
 
-    public int getColumnIndexSizeInKB()
+    public int getColumnIndexSizeInKiB()
     {
         return DatabaseDescriptor.getColumnIndexSizeInKiB();
     }
@@ -5914,12 +5914,12 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
 
     public int getBatchSizeFailureThreshold()
     {
-        return DatabaseDescriptor.getBatchSizeFailThresholdInKB();
+        return DatabaseDescriptor.getBatchSizeFailThresholdInKiB();
     }
 
     public void setBatchSizeFailureThreshold(int threshold)
     {
-        DatabaseDescriptor.setBatchSizeFailThresholdInKB(threshold);
+        DatabaseDescriptor.setBatchSizeFailThresholdInKiB(threshold);
         logger.info("updated batch_size_fail_threshold to {}", threshold);
     }
 
@@ -6318,7 +6318,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
     @Override
     public int getRowIndexSizeWarnThresholdKb()
     {
-        return DatabaseDescriptor.getRowIndexSizeWarnThresholdKb();
+        return DatabaseDescriptor.getRowIndexSizeWarnThresholdKiB();
     }
 
     @Override
@@ -6326,14 +6326,14 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
     {
         if (value < 0)
             throw new IllegalArgumentException("value " + value + " is less than 0; must be positive or zero");
-        DatabaseDescriptor.setRowIndexSizeWarnThresholdKb(value);
+        DatabaseDescriptor.setRowIndexSizeWarnThresholdKiB(value);
         logger.info("updated track_warnings.row_index_size.warn_threshold_kb to {}", value);
     }
 
     @Override
     public int getRowIndexSizeAbortThresholdKb()
     {
-        return DatabaseDescriptor.getRowIndexSizeAbortThresholdKb();
+        return DatabaseDescriptor.getRowIndexSizeAbortThresholdKiB();
     }
 
     @Override
@@ -6341,7 +6341,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
     {
         if (value < 0)
             throw new IllegalArgumentException("value " + value + " is less than 0; must be positive or zero");
-        DatabaseDescriptor.setRowIndexSizeAbortThresholdKb(value);
+        DatabaseDescriptor.setRowIndexSizeAbortThresholdKiB(value);
         logger.info("updated track_warnings.row_index_size.abort_threshold_kb to {}", value);
     }
 
diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
index 103b4dd..213c5a9 100644
--- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
@@ -777,7 +777,7 @@ public interface StorageServiceMBean extends NotificationEmitter
     public void setCachedReplicaRowsFailThreshold(int threshold);
 
     /** Returns the granularity of the collation index of rows within a partition **/
-    public int getColumnIndexSizeInKB();
+    public int getColumnIndexSizeInKiB();
     /** Sets the granularity of the collation index of rows within a partition **/
     public void setColumnIndexSize(int columnIndexSizeInKB);
 
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 90f8bb3..f66566d 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -1227,14 +1227,14 @@ public class NodeProbe implements AutoCloseable
         return ssProxy.isInitialized();
     }
 
-    public void setColumnIndexSize(int columnIndexSizeInKB)
+    public void setColumnIndexSize(int columnIndexSizeInKiB)
     {
-        ssProxy.setColumnIndexSize(columnIndexSizeInKB);
+        ssProxy.setColumnIndexSize(columnIndexSizeInKiB);
     }
 
     public int getColumnIndexSizeInKB()
     {
-        return ssProxy.getColumnIndexSizeInKB();
+        return ssProxy.getColumnIndexSizeInKiB();
     }
 
     public void setCompactionThroughput(int value)
diff --git a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
index 6ee320e..b1f8e6c 100644
--- a/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
+++ b/src/java/org/apache/cassandra/tools/StandaloneScrubber.java
@@ -262,7 +262,7 @@ public class StandaloneScrubber
     {
         if (strategyManager.getCompactionParams().klass().equals(LeveledCompactionStrategy.class))
         {
-            int maxSizeInMB = (int)((cfs.getCompactionStrategyManager().getMaxSSTableBytes()) / (1024L * 1024L));
+            int maxSizeInMiB = (int)((cfs.getCompactionStrategyManager().getMaxSSTableBytes()) / (1024L * 1024L));
             int fanOut = cfs.getCompactionStrategyManager().getLevelFanoutSize();
             for (AbstractStrategyHolder.GroupedSSTableContainer sstableGroup : strategyManager.groupSSTables(sstables))
             {
@@ -270,7 +270,7 @@ public class StandaloneScrubber
                 {
                     List<SSTableReader> groupSSTables = new ArrayList<>(sstableGroup.getGroup(i));
                     // creating the manifest makes sure the leveling is sane:
-                    LeveledManifest.create(cfs, maxSizeInMB, fanOut, groupSSTables);
+                    LeveledManifest.create(cfs, maxSizeInMiB, fanOut, groupSSTables);
                 }
             }
         }
diff --git a/src/java/org/apache/cassandra/tools/nodetool/Info.java b/src/java/org/apache/cassandra/tools/nodetool/Info.java
index 1ee6bac..6966157 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/Info.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/Info.java
@@ -162,8 +162,8 @@ public class Info extends NodeToolCmd
     }
 
     /**
-     * Returns the total off heap memory used in MB.
-     * @return the total off heap memory used in MB.
+     * Returns the total off heap memory used in MiB.
+     * @return the total off heap memory used in MiB.
      */
     private static double getOffHeapMemoryUsed(NodeProbe probe)
     {
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SetBatchlogReplayThrottle.java b/src/java/org/apache/cassandra/tools/nodetool/SetBatchlogReplayThrottle.java
index 3c6370c..b96146c 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/SetBatchlogReplayThrottle.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/SetBatchlogReplayThrottle.java
@@ -26,7 +26,7 @@ import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
                                                            "This will be reduced proportionally to the number of nodes in the cluster.")
 public class SetBatchlogReplayThrottle extends NodeToolCmd
 {
-    @Arguments(title = "batchlog_replay_throttle", usage = "<value_in_kb_per_sec>", description = "Value in KB per second, 0 to disable throttling", required = true)
+    @Arguments(title = "batchlog_replay_throttle", usage = "<value_in_kb_per_sec>", description = "Value in KiB per second, 0 to disable throttling", required = true)
     private Integer batchlogReplayThrottle = null;
 
     @Override
diff --git a/src/java/org/apache/cassandra/utils/memory/BufferPools.java b/src/java/org/apache/cassandra/utils/memory/BufferPools.java
index 736e1cd..5d80881 100644
--- a/src/java/org/apache/cassandra/utils/memory/BufferPools.java
+++ b/src/java/org/apache/cassandra/utils/memory/BufferPools.java
@@ -35,13 +35,13 @@ public class BufferPools
     /**
      * Used by chunk cache to store decompressed data and buffers may be held by chunk cache for arbitrary period.
      */
-    private static final long FILE_MEMORY_USAGE_THRESHOLD = DatabaseDescriptor.getFileCacheSizeInMB() * 1024L * 1024L;
+    private static final long FILE_MEMORY_USAGE_THRESHOLD = DatabaseDescriptor.getFileCacheSizeInMiB() * 1024L * 1024L;
     private static final BufferPool CHUNK_CACHE_POOL = new BufferPool("chunk-cache", FILE_MEMORY_USAGE_THRESHOLD, true);
 
     /**
      * Used by client-server or inter-node requests, buffers should be released immediately after use.
      */
-    private static final long NETWORKING_MEMORY_USAGE_THRESHOLD = DatabaseDescriptor.getNetworkingCacheSizeInMB() * 1024L * 1024L;
+    private static final long NETWORKING_MEMORY_USAGE_THRESHOLD = DatabaseDescriptor.getNetworkingCacheSizeInMiB() * 1024L * 1024L;
     private static final BufferPool NETWORKING_POOL = new BufferPool("networking", NETWORKING_MEMORY_USAGE_THRESHOLD, false);
 
     static
diff --git a/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java b/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java
index cb5c425..29853e4 100644
--- a/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java
+++ b/src/java/org/apache/cassandra/utils/memory/NativeAllocator.java
@@ -32,8 +32,8 @@ import static org.apache.cassandra.utils.concurrent.Semaphore.newSemaphore;
 
 /**
  * This NativeAllocator uses global slab allocation strategy
- * with slab size that scales exponentially from 8kb to 1Mb to
- * serve allocation of up to 128kb.
+ * with slab size that scales exponentially from 8KiB to 1MiB to
+ * serve allocation of up to 128KiB.
  * <p>
  * </p>
  * The slab allocation reduces heap fragmentation from small
diff --git a/src/java/org/apache/cassandra/utils/memory/SlabAllocator.java b/src/java/org/apache/cassandra/utils/memory/SlabAllocator.java
index 538cd3f..17eb29c 100644
--- a/src/java/org/apache/cassandra/utils/memory/SlabAllocator.java
+++ b/src/java/org/apache/cassandra/utils/memory/SlabAllocator.java
@@ -32,8 +32,8 @@ import org.apache.cassandra.utils.concurrent.OpOrder;
 
 /**
 + * The SlabAllocator is a bump-the-pointer allocator that allocates
-+ * large (1MB) global regions and then doles them out to threads that
-+ * request smaller sized (up to 128kb) slices into the array.
++ * large (1MiB) global regions and then doles them out to threads that
++ * request smaller sized (up to 128KiB) slices into the array.
  * <p></p>
  * The purpose of this class is to combat heap fragmentation in long lived
  * objects: by ensuring that all allocations with similar lifetimes
diff --git a/test/conf/cassandra-seeds.yaml b/test/conf/cassandra-seeds.yaml
index 0cfd06b..1c38f8e 100644
--- a/test/conf/cassandra-seeds.yaml
+++ b/test/conf/cassandra-seeds.yaml
@@ -17,7 +17,7 @@ listen_address: 127.0.0.1
 storage_port: 7012
 start_native_transport: true
 native_transport_port: 9042
-column_index_size_in_kb: 4
+column_index_size: 4KiB
 saved_caches_directory: build/test/cassandra/saved_caches
 data_file_directories:
     - build/test/cassandra/data
diff --git a/test/conf/cassandra_encryption.yaml b/test/conf/cassandra_encryption.yaml
index 47e1312..3b8d08d 100644
--- a/test/conf/cassandra_encryption.yaml
+++ b/test/conf/cassandra_encryption.yaml
@@ -1,14 +1,14 @@
 transparent_data_encryption_options:
-    enabled: true
-    chunk_length_kb: 2
-    cipher: AES/CBC/PKCS5Padding
-    key_alias: testing:1
-    # CBC requires iv length to be 16 bytes
-    # iv_length: 16
-    key_provider: 
-      - class_name: org.apache.cassandra.security.JKSKeyProvider
-        parameters: 
-          - keystore: test/conf/cassandra.keystore
-            keystore_password: cassandra
-            store_type: JCEKS
-            key_password: cassandra
+  enabled: true
+  chunk_length_kb: 2
+  cipher: AES/CBC/PKCS5Padding
+  key_alias: testing:1
+  # CBC requires iv length to be 16 bytes
+  # iv_length: 16
+  key_provider:
+    - class_name: org.apache.cassandra.security.JKSKeyProvider
+      parameters:
+        - keystore: test/conf/cassandra.keystore
+          keystore_password: cassandra
+          store_type: JCEKS
+          key_password: cassandra
diff --git a/test/conf/unit-test-conf/test-native-port.yaml b/test/conf/unit-test-conf/test-native-port.yaml
index a234ad5..c8ed929 100644
--- a/test/conf/unit-test-conf/test-native-port.yaml
+++ b/test/conf/unit-test-conf/test-native-port.yaml
@@ -39,7 +39,7 @@ server_encryption_options:
   truststore_password: cassandra
 incremental_backups: true
 concurrent_compactors: 4
-compaction_throughput_mb_per_sec: 0
+compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size: 16MiB
 user_defined_functions_enabled: true
diff --git a/test/distributed/org/apache/cassandra/distributed/test/HintedHandoffNodetoolTest.java b/test/distributed/org/apache/cassandra/distributed/test/HintedHandoffNodetoolTest.java
index 5ab83ba..a401bd0 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/HintedHandoffNodetoolTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/HintedHandoffNodetoolTest.java
@@ -122,10 +122,10 @@ public class HintedHandoffNodetoolTest extends TestBaseImpl
     @Test
     public void testThrottle()
     {
-        Integer throttleInKB = cluster.get(node).callOnInstance(DatabaseDescriptor::getHintedHandoffThrottleInKiB);
-        cluster.get(node).nodetoolResult("sethintedhandoffthrottlekb", String.valueOf(throttleInKB * 2)).asserts().success();
+        Integer throttleInKiB = cluster.get(node).callOnInstance(DatabaseDescriptor::getHintedHandoffThrottleInKiB);
+        cluster.get(node).nodetoolResult("sethintedhandoffthrottlekb", String.valueOf(throttleInKiB * 2)).asserts().success();
         Integer newThrottleInKB = cluster.get(node).callOnInstance(DatabaseDescriptor::getHintedHandoffThrottleInKiB);
-        assertEquals(throttleInKB * 2, newThrottleInKB.intValue());
+        assertEquals(throttleInKiB * 2, newThrottleInKB.intValue());
     }
 
     @SuppressWarnings("Convert2MethodRef")
diff --git a/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java b/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
index 9ecea99..e1a0a91 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
@@ -30,7 +30,6 @@ import com.google.common.collect.Sets;
 import org.junit.Assert;
 import org.junit.Test;
 
-import org.apache.cassandra.config.SmallestDurationMilliseconds;
 import org.apache.cassandra.distributed.Cluster;
 import org.apache.cassandra.distributed.api.ConsistencyLevel;
 import org.apache.cassandra.distributed.api.ICluster;
diff --git a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java
index 221ac86..10a8976 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java
@@ -32,7 +32,6 @@ import org.junit.runners.Parameterized;
 import org.apache.cassandra.distributed.Cluster;
 import org.apache.cassandra.service.reads.repair.ReadRepairStrategy;
 
-import static java.util.concurrent.TimeUnit.MINUTES;
 import static org.apache.cassandra.distributed.shared.AssertUtils.assertEquals;
 import static org.apache.cassandra.distributed.shared.AssertUtils.assertRows;
 import static org.apache.cassandra.distributed.shared.AssertUtils.row;
diff --git a/test/distributed/org/apache/cassandra/distributed/test/trackwarnings/RowIndexSizeWarningTest.java b/test/distributed/org/apache/cassandra/distributed/test/trackwarnings/RowIndexSizeWarningTest.java
index e2158e5..5a2957d 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/trackwarnings/RowIndexSizeWarningTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/trackwarnings/RowIndexSizeWarningTest.java
@@ -36,8 +36,8 @@ public class RowIndexSizeWarningTest extends AbstractClientSizeWarning
         AbstractClientSizeWarning.setupClass();
 
         CLUSTER.stream().forEach(i -> i.runOnInstance(() -> {
-            DatabaseDescriptor.setRowIndexSizeWarnThresholdKb(1);
-            DatabaseDescriptor.setRowIndexSizeAbortThresholdKb(2);
+            DatabaseDescriptor.setRowIndexSizeWarnThresholdKiB(1);
+            DatabaseDescriptor.setRowIndexSizeAbortThresholdKiB(2);
 
             // hack to force multiple index entries
             DatabaseDescriptor.setColumnIndexCacheSize(1 << 20);
diff --git a/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeMessageForwardTest.java b/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeMessageForwardTest.java
index 935cc8e..7da2b79 100644
--- a/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeMessageForwardTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeMessageForwardTest.java
@@ -79,7 +79,7 @@ public class MixedModeMessageForwardTest extends UpgradeTestBase
                                   .collect(Collectors.joining(","));
 
         new TestCase()
-        .withConfig(c -> c.with(Feature.GOSSIP, Feature.NETWORK).set("request_timeout_in_ms", 30000))
+        .withConfig(c -> c.with(Feature.GOSSIP, Feature.NETWORK).set("request_timeout", "30000ms"))
         .withBuilder(b -> b.withRacks(numDCs, 1, nodesPerDc))
         .nodes(numDCs * nodesPerDc)
         .singleUpgrade(v30)
diff --git a/test/long/org/apache/cassandra/db/compaction/LongLeveledCompactionStrategyTest.java b/test/long/org/apache/cassandra/db/compaction/LongLeveledCompactionStrategyTest.java
index 399f3a9..4d692c6 100644
--- a/test/long/org/apache/cassandra/db/compaction/LongLeveledCompactionStrategyTest.java
+++ b/test/long/org/apache/cassandra/db/compaction/LongLeveledCompactionStrategyTest.java
@@ -75,7 +75,7 @@ public class LongLeveledCompactionStrategyTest
         CompactionStrategyManager mgr = store.getCompactionStrategyManager();
         LeveledCompactionStrategy lcs = (LeveledCompactionStrategy) mgr.getStrategies().get(1).get(0);
 
-        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KB value, make it easy to have multiple files
+        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KiB value, make it easy to have multiple files
 
         populateSSTables(store);
 
@@ -138,7 +138,7 @@ public class LongLeveledCompactionStrategyTest
     {
         Keyspace keyspace = Keyspace.open(KEYSPACE1);
         ColumnFamilyStore store = keyspace.getColumnFamilyStore(CF_STANDARDLVL2);
-        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KB value, make it easy to have multiple files
+        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KiB value, make it easy to have multiple files
 
         populateSSTables(store);
 
@@ -147,7 +147,7 @@ public class LongLeveledCompactionStrategyTest
         CompactionStrategyManager mgr = store.getCompactionStrategyManager();
         LeveledCompactionStrategy lcs = (LeveledCompactionStrategy) mgr.getStrategies().get(1).get(0);
 
-        value = ByteBuffer.wrap(new byte[10 * 1024]); // 10 KB value
+        value = ByteBuffer.wrap(new byte[10 * 1024]); // 10 KiB value
 
         // Adds 10 partitions
         for (int r = 0; r < 10; r++)
@@ -245,7 +245,7 @@ public class LongLeveledCompactionStrategyTest
 
     private void populateSSTables(ColumnFamilyStore store)
     {
-        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KB value, make it easy to have multiple files
+        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KiB value, make it easy to have multiple files
 
         // Enough data to have a level 1 and 2
         int rows = 128;
diff --git a/test/long/org/apache/cassandra/io/sstable/CQLSSTableWriterLongTest.java b/test/long/org/apache/cassandra/io/sstable/CQLSSTableWriterLongTest.java
index f2bbfa6..2cdc447 100644
--- a/test/long/org/apache/cassandra/io/sstable/CQLSSTableWriterLongTest.java
+++ b/test/long/org/apache/cassandra/io/sstable/CQLSSTableWriterLongTest.java
@@ -76,7 +76,7 @@ public class CQLSSTableWriterLongTest
                                                   .inDirectory(dataDir)
                                                   .forTable(schema)
                                                   .using(insert)
-                                                  .withBufferSizeInMB(1)
+                                                  .withBufferSizeInMiB(1)
                                                   .build();
 
         long high = 100;
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
index eea55f7..1c7cf0a 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
@@ -442,25 +442,25 @@ public class DatabaseDescriptorTest
     }
 
     @Test
-    public void testCalculateDefaultSpaceInMB()
+    public void testCalculateDefaultSpaceInMiB()
     {
         // check prefered size is used for a small storage volume
-        int preferredInMB = 667;
+        int preferredInMiB = 667;
         int numerator = 2;
         int denominator = 3;
         int spaceInBytes = 999 * 1024 * 1024;
 
         assertEquals(666, // total size is less than preferred, so return lower limit
-                     DatabaseDescriptor.calculateDefaultSpaceInMiB("type", "/path", "setting_name", preferredInMB, spaceInBytes, numerator, denominator));
+                     DatabaseDescriptor.calculateDefaultSpaceInMiB("type", "/path", "setting_name", preferredInMiB, spaceInBytes, numerator, denominator));
 
         // check preferred size is used for a small storage volume
-        preferredInMB = 100;
+        preferredInMiB = 100;
         numerator = 1;
         denominator = 3;
         spaceInBytes = 999 * 1024 * 1024;
 
         assertEquals(100, // total size is more than preferred so keep the configured limit
-                     DatabaseDescriptor.calculateDefaultSpaceInMiB("type", "/path", "setting_name", preferredInMB, spaceInBytes, numerator, denominator));
+                     DatabaseDescriptor.calculateDefaultSpaceInMiB("type", "/path", "setting_name", preferredInMiB, spaceInBytes, numerator, denominator));
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
index da1d094..d57009e 100644
--- a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
@@ -22,9 +22,9 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
 
 public class LoadOldYAMLBackwardCompatibilityTest
 {
diff --git a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java b/test/unit/org/apache/cassandra/config/ParseAndConvertUnitsTest.java
similarity index 51%
copy from test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
copy to test/unit/org/apache/cassandra/config/ParseAndConvertUnitsTest.java
index da1d094..0421e3e 100644
--- a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ b/test/unit/org/apache/cassandra/config/ParseAndConvertUnitsTest.java
@@ -15,7 +15,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.cassandra.config;
 
 import org.junit.BeforeClass;
@@ -23,26 +22,23 @@ import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
 
-public class LoadOldYAMLBackwardCompatibilityTest
+public class ParseAndConvertUnitsTest
 {
     @BeforeClass
     public static void setupDatabaseDescriptor()
     {
-        System.setProperty("cassandra.config", "cassandra-old.yaml");
         DatabaseDescriptor.daemonInitialization();
     }
 
     // CASSANDRA-15234
     @Test
-    public void testConfigurationLoaderBackwardCompatibility()
+    public void testConfigurationLoaderParser()
     {
         Config config = DatabaseDescriptor.loadConfig();
 
+        //Confirm duration parameters were successfully parsed with the default values in cassandra.yaml
         assertEquals(DurationSpec.inMilliseconds(10800000), config.max_hint_window);
-        assertEquals(DurationSpec.inHours(3), config.max_hint_window);
         assertEquals(DurationSpec.inMilliseconds(0), config.native_transport_idle_timeout);
         assertEquals(DurationSpec.inMilliseconds(10000), config.request_timeout);
         assertEquals(DurationSpec.inMilliseconds(5000), config.read_request_timeout);
@@ -53,62 +49,19 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DurationSpec.inMilliseconds(60000), config.truncate_request_timeout);
         assertEquals(DurationSpec.inSeconds(300), config.streaming_keep_alive_period);
         assertEquals(DurationSpec.inMilliseconds(500), config.slow_query_log_timeout);
-        assertNull(config.memtable_heap_space);
-        assertNull(config.memtable_offheap_space);
-        assertNull( config.repair_session_space);
-        assertEquals(DataStorageSpec.inBytes(4194304), config.internode_application_send_queue_capacity);
-        assertEquals(DataStorageSpec.inBytes(134217728), config.internode_application_send_queue_reserve_endpoint_capacity);
-        assertEquals(DataStorageSpec.inBytes(536870912), config.internode_application_send_queue_reserve_global_capacity);
-        assertEquals(DataStorageSpec.inBytes(4194304), config.internode_application_receive_queue_capacity);
-        assertEquals(DataStorageSpec.inBytes(134217728), config.internode_application_receive_queue_reserve_endpoint_capacity);
-        assertEquals(DataStorageSpec.inBytes(536870912), config.internode_application_receive_queue_reserve_global_capacity);
         assertEquals(DurationSpec.inMilliseconds(2000), config.internode_tcp_connect_timeout);
         assertEquals(DurationSpec.inMilliseconds(30000), config.internode_tcp_user_timeout);
-        assertEquals(DurationSpec.inMilliseconds(300000), config.internode_streaming_tcp_user_timeout);
-        assertEquals(DataStorageSpec.inMebibytes(16), config.native_transport_max_frame_size);
-        assertEquals(DataStorageSpec.inMebibytes(256), config.max_value_size);
-        assertEquals(DataStorageSpec.inKibibytes(4), config.column_index_size);
-        assertEquals(DataStorageSpec.inKibibytes(2), config.column_index_cache_size);
-        assertEquals(DataStorageSpec.inKibibytes(5), config.batch_size_warn_threshold);
-        assertEquals(DataRateSpec.inMebibytesPerSecond(64), config.compaction_throughput);
-        assertEquals(DataStorageSpec.inMebibytes(50), config.min_free_space_per_drive);
-        assertEquals(DataRateSpec.inMebibytesPerSecond(23841858).toString(), config.stream_throughput_outbound.toString());
-        assertEquals(DataRateSpec.megabitsPerSecondInMebibytesPerSecond(200000000).toString(), config.stream_throughput_outbound.toString());
-        assertEquals(DataRateSpec.inMebibytesPerSecond(24), config.inter_dc_stream_throughput_outbound);
-        assertNull(config.commitlog_total_space);
-        assertEquals(DurationSpec.inDoubleMilliseconds(0), config.commitlog_sync_group_window);
+        assertEquals(DurationSpec.inMilliseconds(0), config.commitlog_sync_group_window);
         assertEquals(DurationSpec.inMilliseconds(0), config.commitlog_sync_period);
-        assertEquals(DataStorageSpec.inMebibytes(5), config.commitlog_segment_size);
-        assertNull(config.periodic_commitlog_sync_lag_block);  //Integer
-        assertNull(config.max_mutation_size);
-        assertEquals(DataStorageSpec.inMebibytes(0), config.cdc_total_space);
+        assertNull(config.periodic_commitlog_sync_lag_block);
         assertEquals(DurationSpec.inMilliseconds(250), config.cdc_free_space_check_interval);
         assertEquals(DurationSpec.inMilliseconds(100), config.dynamic_snitch_update_interval);
         assertEquals(DurationSpec.inMilliseconds(600000), config.dynamic_snitch_reset_interval);
-        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.inKibibytes(10240), config.trickle_fsync_interval);
-        assertEquals(DataStorageSpec.inMebibytes(50), config.sstable_preemptive_open_interval);
-        assertNull( config.key_cache_size);
-        assertEquals(DataStorageSpec.inMebibytes(16), config.row_cache_size);
-        assertNull(config.counter_cache_size);
-        assertNull(config.networking_cache_size);
-        assertNull(config.file_cache_size);
-        assertNull(config.index_summary_capacity);
         assertEquals(DurationSpec.inMilliseconds(200), config.gc_log_threshold);
+        assertEquals(DurationSpec.inMilliseconds(10000), config.hints_flush_period);
         assertEquals(DurationSpec.inMilliseconds(1000), config.gc_warn_threshold);
         assertEquals(DurationSpec.inSeconds(86400), config.trace_type_query_ttl);
         assertEquals(DurationSpec.inSeconds(604800), config.trace_type_repair_ttl);
-        assertNull(config.prepared_statements_cache_size);
-        assertTrue(config.user_defined_functions_enabled);
-        assertTrue(config.scripted_user_defined_functions_enabled);
-        assertTrue(config.materialized_views_enabled);
-        assertFalse(config.transient_replication_enabled);
-        assertTrue(config.sasi_indexes_enabled);
-        assertTrue(config.drop_compact_storage_enabled);
-        assertTrue(config.user_defined_functions_threads_enabled);
         assertEquals(DurationSpec.inMilliseconds(2000), config.permissions_validity);
         assertEquals(DurationSpec.inMilliseconds(0), config.permissions_update_interval);
         assertEquals(DurationSpec.inMilliseconds(2000), config.roles_validity);
@@ -116,13 +69,43 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DurationSpec.inMilliseconds(2000), config.credentials_validity);
         assertEquals(DurationSpec.inMilliseconds(0), config.credentials_update_interval);
         assertEquals(DurationSpec.inMinutes(60), config.index_summary_resize_interval);
-
-        //parameters which names have not changed with CASSANDRA-15234
-        assertEquals(DurationSpec.inSecondsString("14400"), config.key_cache_save_period);
-        assertEquals(DurationSpec.inSecondsString("14400s"), config.key_cache_save_period);
         assertEquals(DurationSpec.inHours(4), config.key_cache_save_period);
-        assertEquals(DurationSpec.inSecondsString("0"), config.row_cache_save_period);
-        assertEquals(DurationSpec.inSeconds(0), config.row_cache_save_period);
-        assertEquals(DurationSpec.inHours(2), config.counter_cache_save_period);
+
+        //Confirm space parameters were successfully parsed with the default values in cassandra.yaml
+        assertNull(config.memtable_heap_space);
+        assertNull(config.memtable_offheap_space);
+        assertNull(config.repair_session_space); //null everywhere so should be correct, let's check whether it will bomb
+        assertEquals(new DataStorageSpec("4194304B"), config.internode_application_send_queue_capacity);
+        assertEquals(new DataStorageSpec("134217728B"), config.internode_application_send_queue_reserve_endpoint_capacity);
+        assertEquals(new DataStorageSpec("536870912B"), config.internode_application_send_queue_reserve_global_capacity);
+        assertEquals(new DataStorageSpec("4194304B"), config.internode_application_receive_queue_capacity);
+        assertEquals(new DataStorageSpec("134217728B"), config.internode_application_receive_queue_reserve_endpoint_capacity);
+        assertEquals(new DataStorageSpec("536870912B"), config.internode_application_receive_queue_reserve_global_capacity);
+        assertEquals(new DataStorageSpec("16MiB"), config.native_transport_max_frame_size);
+        assertEquals(new DataStorageSpec("256MiB"), config.max_value_size);
+        assertEquals(new DataStorageSpec("4KiB"), config.column_index_size);
+        assertEquals(new DataStorageSpec("2KiB"), config.column_index_cache_size);
+        assertEquals(new DataStorageSpec("5KiB"), config.batch_size_warn_threshold);
+        assertEquals(new DataStorageSpec("50KiB"), config.batch_size_fail_threshold);
+        assertEquals(new DataStorageSpec("100MiB"), config.compaction_large_partition_warning_threshold);
+        assertNull(config.commitlog_total_space);
+        assertEquals(new DataStorageSpec("5MiB"), config.commitlog_segment_size);
+        assertNull(config.max_mutation_size); //not set explicitly in the default yaml, check the config; not set there too
+        assertEquals(new DataStorageSpec("0MiB"), config.cdc_total_space);
+        assertEquals(new DataStorageSpec("1024KiB"), config.hinted_handoff_throttle);
+        assertEquals(new DataStorageSpec("1024KiB"), config.batchlog_replay_throttle);
+        assertEquals(new DataStorageSpec("10240KiB"), config.trickle_fsync_interval);
+        assertEquals(new DataStorageSpec("50MiB"), config.sstable_preemptive_open_interval);
+        assertNull(config.counter_cache_size);
+        assertNull(config.file_cache_size);
+        assertNull(config.index_summary_capacity);
+        assertEquals(new DataStorageSpec("1MiB"), config.prepared_statements_cache_size);
+        assertNull(config.key_cache_size);
+        assertEquals(new DataStorageSpec("16MiB"), config.row_cache_size);
+
+        //Confirm rate parameters were successfully parsed with the default values in cassandra.yaml
+        assertEquals(DataRateSpec.inMebibytesPerSecond(0), config.compaction_throughput);
+        assertEquals(DataRateSpec.inMebibytesPerSecond(23841858), config.stream_throughput_outbound);
+        assertEquals(DataRateSpec.inMebibytesPerSecond(24), config.inter_dc_stream_throughput_outbound);
     }
-}
+}
\ No newline at end of file
diff --git a/test/unit/org/apache/cassandra/cql3/validation/entities/SecondaryIndexTest.java b/test/unit/org/apache/cassandra/cql3/validation/entities/SecondaryIndexTest.java
index bfe4815..e5fda16 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/entities/SecondaryIndexTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/entities/SecondaryIndexTest.java
@@ -612,7 +612,7 @@ public class SecondaryIndexTest extends CQLTester
     /**
      * Test for CASSANDRA-5732, Can not query secondary index
      * migrated from cql_tests.py:TestCQL.bug_5732_test(),
-     * which was executing with a row cache size of 100 MB
+     * which was executing with a row cache size of 100 MiB
      * and restarting the node, here we just cleanup the cache.
      */
     @Test
@@ -672,14 +672,14 @@ public class SecondaryIndexTest extends CQLTester
         long batchSizeThreshold = DatabaseDescriptor.getBatchSizeFailThreshold();
         try
         {
-            DatabaseDescriptor.setBatchSizeFailThresholdInKB( (TOO_BIG / 1024) * 2);
+            DatabaseDescriptor.setBatchSizeFailThresholdInKiB((TOO_BIG / 1024) * 2);
             succeedInsert("BEGIN BATCH\n" +
                           "INSERT INTO %s (a, b, c) VALUES (1, 1, ?) IF NOT EXISTS;\n" +
                           "APPLY BATCH", ByteBuffer.allocate(TOO_BIG));
         }
         finally
         {
-            DatabaseDescriptor.setBatchSizeFailThresholdInKB((int) (batchSizeThreshold / 1024));
+            DatabaseDescriptor.setBatchSizeFailThresholdInKiB((int) (batchSizeThreshold / 1024));
         }
     }
 
@@ -725,14 +725,14 @@ public class SecondaryIndexTest extends CQLTester
         long batchSizeThreshold = DatabaseDescriptor.getBatchSizeFailThreshold();
         try
         {
-            DatabaseDescriptor.setBatchSizeFailThresholdInKB( (TOO_BIG / 1024) * 2);
+            DatabaseDescriptor.setBatchSizeFailThresholdInKiB((TOO_BIG / 1024) * 2);
             succeedInsert("BEGIN BATCH\n" +
                           "INSERT INTO %s (a, b, c) VALUES (1, 1, ?) IF NOT EXISTS;\n" +
                           "APPLY BATCH", ByteBuffer.allocate(TOO_BIG));
         }
         finally
         {
-            DatabaseDescriptor.setBatchSizeFailThresholdInKB((int)(batchSizeThreshold / 1024));
+            DatabaseDescriptor.setBatchSizeFailThresholdInKiB((int)(batchSizeThreshold / 1024));
         }
     }
 
diff --git a/test/unit/org/apache/cassandra/db/KeyCacheTest.java b/test/unit/org/apache/cassandra/db/KeyCacheTest.java
index ee56d6e..23a94f5 100644
--- a/test/unit/org/apache/cassandra/db/KeyCacheTest.java
+++ b/test/unit/org/apache/cassandra/db/KeyCacheTest.java
@@ -317,7 +317,7 @@ public class KeyCacheTest
             throw new IllegalStateException();
 
         Util.compactAll(cfs, Integer.MAX_VALUE).get();
-        boolean noEarlyOpen = DatabaseDescriptor.getSSTablePreemptiveOpenIntervalInMB() < 0;
+        boolean noEarlyOpen = DatabaseDescriptor.getSSTablePreemptiveOpenIntervalInMiB() < 0;
 
         // after compaction cache should have entries for new SSTables,
         // but since we have kept a reference to the old sstables,
@@ -339,16 +339,16 @@ public class KeyCacheTest
     }
 
     @Test
-    public void testKeyCacheLoadNegativeCacheLoadTime() throws Exception
+    public void testKeyCacheLoadZeroCacheLoadTime() throws Exception
     {
-        DatabaseDescriptor.setCacheLoadTimeout(-1);
+        DatabaseDescriptor.setCacheLoadTimeout(0);
         String cf = COLUMN_FAMILY7;
 
         createAndInvalidateCache(Collections.singletonList(Pair.create(KEYSPACE1, cf)), 100);
 
         CacheService.instance.keyCache.loadSaved();
 
-        // Here max time to load cache is negative which means no time left to load cache. So the keyCache size should
+        // Here max time to load cache is zero which means no time left to load cache. So the keyCache size should
         // be zero after loadSaved().
         assertKeyCacheSize(0, KEYSPACE1, cf);
         assertEquals(0, CacheService.instance.keyCache.size());
diff --git a/test/unit/org/apache/cassandra/db/RowCacheTest.java b/test/unit/org/apache/cassandra/db/RowCacheTest.java
index e6585a4..a015788 100644
--- a/test/unit/org/apache/cassandra/db/RowCacheTest.java
+++ b/test/unit/org/apache/cassandra/db/RowCacheTest.java
@@ -94,7 +94,7 @@ public class RowCacheTest
         // empty the row cache
         CacheService.instance.invalidateRowCache();
 
-        // set global row cache size to 1 MB
+        // set global row cache size to 1 MiB
         CacheService.instance.setRowCacheCapacityInMB(1);
 
         ByteBuffer key = ByteBufferUtil.bytes("rowcachekey");
@@ -139,7 +139,7 @@ public class RowCacheTest
         // empty the row cache
         CacheService.instance.invalidateRowCache();
 
-        // set global row cache size to 1 MB
+        // set global row cache size to 1 MiB
         CacheService.instance.setRowCacheCapacityInMB(1);
 
         // inserting 100 rows into both column families
@@ -221,7 +221,7 @@ public class RowCacheTest
         // empty the row cache
         CacheService.instance.invalidateRowCache();
 
-        // set global row cache size to 1 MB
+        // set global row cache size to 1 MiB
         CacheService.instance.setRowCacheCapacityInMB(1);
 
         // inserting 100 rows into column family
@@ -409,7 +409,7 @@ public class RowCacheTest
         // empty the row cache
         CacheService.instance.invalidateRowCache();
 
-        // set global row cache size to 1 MB
+        // set global row cache size to 1 MiB
         CacheService.instance.setRowCacheCapacityInMB(1);
 
         ByteBuffer key = ByteBufferUtil.bytes("rowcachekey");
@@ -484,7 +484,7 @@ public class RowCacheTest
         // empty the row cache
         CacheService.instance.invalidateRowCache();
 
-        // set global row cache size to 1 MB
+        // set global row cache size to 1 MiB
         CacheService.instance.setRowCacheCapacityInMB(1);
 
         // inserting 100 rows into both column families
diff --git a/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java b/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
index 7cd1445..fbad0b4 100644
--- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
+++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
@@ -90,7 +90,6 @@ public class CommitLogInitWithExceptionTest
             Assert.fail();
         }
 
-
         Assert.assertTrue(CommitLog.instance.segmentManager.executor.isTerminated()); // exit successfully
     }
 
diff --git a/test/unit/org/apache/cassandra/db/commitlog/CommitLogTest.java b/test/unit/org/apache/cassandra/db/commitlog/CommitLogTest.java
index 31b44cd..a70d06c 100644
--- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogTest.java
+++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogTest.java
@@ -338,7 +338,7 @@ public abstract class CommitLogTest
         ColumnFamilyStore cfs1 = ks.getColumnFamilyStore(STANDARD1);
         ColumnFamilyStore cfs2 = ks.getColumnFamilyStore(STANDARD2);
 
-        // Roughly 32 MB mutation
+        // Roughly 32 MiB mutation
         Mutation m = new RowUpdateBuilder(cfs1.metadata(), 0, "k")
                      .clustering("bytes")
                      .add("val", ByteBuffer.allocate(DatabaseDescriptor.getCommitLogSegmentSize() / 4))
@@ -374,7 +374,7 @@ public abstract class CommitLogTest
         ColumnFamilyStore cfs1 = ks.getColumnFamilyStore(STANDARD1);
         ColumnFamilyStore cfs2 = ks.getColumnFamilyStore(STANDARD2);
 
-        // Roughly 32 MB mutation
+        // Roughly 32 MiB mutation
          Mutation rm = new RowUpdateBuilder(cfs1.metadata(), 0, "k")
                   .clustering("bytes")
                   .add("val", ByteBuffer.allocate((DatabaseDescriptor.getCommitLogSegmentSize()/4) - 1))
diff --git a/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java b/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
index 25ec662..0af6be3 100644
--- a/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
@@ -385,7 +385,7 @@ public class CompactionsCQLTest extends CQLTester
     {
         // write enough data to make sure we use an IndexedReader when doing a read, and make sure it fails when reading a corrupt range tombstone
         DatabaseDescriptor.setCorruptedTombstoneStrategy(Config.CorruptedTombstoneStrategy.exception);
-        final int maxSizePreKB = DatabaseDescriptor.getColumnIndexSizeInKiB();
+        final int maxSizePreKiB = DatabaseDescriptor.getColumnIndexSizeInKiB();
         DatabaseDescriptor.setColumnIndexSize(1024);
         prepareWide();
         RangeTombstone rt = new RangeTombstone(Slice.ALL, new DeletionTime(System.currentTimeMillis(), -1));
@@ -394,7 +394,7 @@ public class CompactionsCQLTest extends CQLTester
         getCurrentColumnFamilyStore().forceBlockingFlush();
         readAndValidate(true);
         readAndValidate(false);
-        DatabaseDescriptor.setColumnIndexSize(maxSizePreKB);
+        DatabaseDescriptor.setColumnIndexSize(maxSizePreKiB);
     }
 
 
diff --git a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
index 8dc75f5..40402df 100644
--- a/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java
@@ -115,7 +115,7 @@ public class LeveledCompactionStrategyTest
      */
     @Test
     public void testGrouperLevels() throws Exception{
-        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KB value, make it easy to have multiple files
+        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KiB value, make it easy to have multiple files
 
         //Need entropy to prevent compression so size is predictable with compression enabled/disabled
         new Random().nextBytes(value.array());
@@ -173,7 +173,7 @@ public class LeveledCompactionStrategyTest
     {
         byte [] b = new byte[100 * 1024];
         new Random().nextBytes(b);
-        ByteBuffer value = ByteBuffer.wrap(b); // 100 KB value, make it easy to have multiple files
+        ByteBuffer value = ByteBuffer.wrap(b); // 100 KiB value, make it easy to have multiple files
 
         // Enough data to have a level 1 and 2
         int rows = 40;
@@ -284,7 +284,7 @@ public class LeveledCompactionStrategyTest
     public void testMutateLevel() throws Exception
     {
         cfs.disableAutoCompaction();
-        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KB value, make it easy to have multiple files
+        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KiB value, make it easy to have multiple files
 
         // Enough data to have a level 1 and 2
         int rows = 40;
@@ -325,7 +325,7 @@ public class LeveledCompactionStrategyTest
     {
         byte [] b = new byte[100 * 1024];
         new Random().nextBytes(b);
-        ByteBuffer value = ByteBuffer.wrap(b); // 100 KB value, make it easy to have multiple files
+        ByteBuffer value = ByteBuffer.wrap(b); // 100 KiB value, make it easy to have multiple files
 
         // Enough data to have a level 1 and 2
         int rows = 40;
@@ -395,7 +395,7 @@ public class LeveledCompactionStrategyTest
         // Disable auto compaction so cassandra does not compact
         CompactionManager.instance.disableAutoCompaction();
 
-        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KB value, make it easy to have multiple files
+        ByteBuffer value = ByteBuffer.wrap(new byte[100 * 1024]); // 100 KiB value, make it easy to have multiple files
 
         DecoratedKey key1 = Util.dk(String.valueOf(1));
         DecoratedKey key2 = Util.dk(String.valueOf(2));
diff --git a/test/unit/org/apache/cassandra/db/streaming/CassandraStreamManagerTest.java b/test/unit/org/apache/cassandra/db/streaming/CassandraStreamManagerTest.java
index 7c59628..30c77a7 100644
--- a/test/unit/org/apache/cassandra/db/streaming/CassandraStreamManagerTest.java
+++ b/test/unit/org/apache/cassandra/db/streaming/CassandraStreamManagerTest.java
@@ -202,7 +202,7 @@ public class CassandraStreamManagerTest
         Collection<SSTableReader> allSSTables = cfs.getLiveSSTables();
         Assert.assertEquals(1, allSSTables.size());
         final Token firstToken = allSSTables.iterator().next().first.getToken();
-        DatabaseDescriptor.setSSTablePreemptiveOpenIntervalInMB(1);
+        DatabaseDescriptor.setSSTablePreemptiveOpenIntervalInMiB(1);
 
         Set<SSTableReader> sstablesBeforeRewrite = getReadersForRange(new Range<>(firstToken, firstToken));
         Assert.assertEquals(1, sstablesBeforeRewrite.size());
@@ -234,7 +234,7 @@ public class CassandraStreamManagerTest
         }
         finally
         {
-            DatabaseDescriptor.setSSTablePreemptiveOpenIntervalInMB(50);
+            DatabaseDescriptor.setSSTablePreemptiveOpenIntervalInMiB(50);
             done.set(true);
             t.join(20);
         }
diff --git a/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterReopenTest.java b/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterReopenTest.java
index 461c13c..a751984 100644
--- a/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterReopenTest.java
+++ b/test/unit/org/apache/cassandra/io/compress/CompressedSequentialWriterReopenTest.java
@@ -84,7 +84,7 @@ public class CompressedSequentialWriterReopenTest extends CQLTester
             execute("insert into %s (id, t) values (?, ?)", i, ByteBuffer.wrap(blob));
         }
         getCurrentColumnFamilyStore().forceBlockingFlush();
-        DatabaseDescriptor.setSSTablePreemptiveOpenIntervalInMB(1);
+        DatabaseDescriptor.setSSTablePreemptiveOpenIntervalInMiB(1);
         getCurrentColumnFamilyStore().forceMajorCompaction();
     }
 
diff --git a/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java b/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
index ad476fd..92b627a 100644
--- a/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/CQLSSTableWriterTest.java
@@ -173,8 +173,8 @@ public class CQLSSTableWriterTest
     public void testSyncWithinPartition() throws Exception
     {
         // Check that the write respect the buffer size even if we only insert rows withing the same partition (#7360)
-        // To do that simply, we use a writer with a buffer of 1MB, and write 2 rows in the same partition with a value
-        // > 1MB and validate that this created more than 1 sstable.
+        // To do that simply, we use a writer with a buffer of 1MiB, and write 2 rows in the same partition with a value
+        // > 1MiB and validate that this created more than 1 sstable.
         String schema = "CREATE TABLE " + qualifiedTable + " ("
                       + "  k int PRIMARY KEY,"
                       + "  v blob"
@@ -184,7 +184,7 @@ public class CQLSSTableWriterTest
                                                   .inDirectory(dataDir)
                                                   .using(insert)
                                                   .forTable(schema)
-                                                  .withBufferSizeInMB(1)
+                                                  .withBufferSizeInMiB(1)
                                                   .build();
 
         ByteBuffer val = ByteBuffer.allocate(1024 * 1050);
@@ -212,7 +212,7 @@ public class CQLSSTableWriterTest
                                                   .inDirectory(dataDir)
                                                   .forTable(schema)
                                                   .using(insert)
-                                                  .withBufferSizeInMB(1)
+                                                  .withBufferSizeInMiB(1)
                                                   .build();
 
         for (int i = 0 ; i < 50000 ; i++) {
@@ -644,7 +644,7 @@ public class CQLSSTableWriterTest
                                                   .inDirectory(dataDir)
                                                   .forTable(schema)
                                                   .using(insert)
-                                                  .withBufferSizeInMB(1)
+                                                  .withBufferSizeInMiB(1)
                                                   .build();
 
         final int ID_OFFSET = 1000;
diff --git a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
index 1318227..d0680f8 100644
--- a/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/IndexSummaryTest.java
@@ -112,7 +112,7 @@ public class IndexSummaryTest
     }
 
     /**
-     * Test an index summary whose total size is bigger than 2GB,
+     * Test an index summary whose total size is bigger than 2GiB,
      * the index summary builder should log an error but it should still
      * create an index summary, albeit one that does not cover the entire sstable.
      */
@@ -146,7 +146,7 @@ public class IndexSummaryTest
     }
 
     /**
-     * Test an index summary whose total size is bigger than 2GB,
+     * Test an index summary whose total size is bigger than 2GiB,
      * having updated IndexSummaryBuilder.defaultExpectedKeySize to match the size,
      * the index summary should be downsampled automatically.
      */
diff --git a/test/unit/org/apache/cassandra/io/sstable/LargePartitionsTest.java b/test/unit/org/apache/cassandra/io/sstable/LargePartitionsTest.java
index 7ff7845..17fb0f2 100644
--- a/test/unit/org/apache/cassandra/io/sstable/LargePartitionsTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/LargePartitionsTest.java
@@ -59,24 +59,24 @@ public class LargePartitionsTest extends CQLTester
         return new String(ch);
     }
 
-    private static final int rowKBytes = 8;
+    private static final int rowKibibytes = 8;
 
-    private void withPartitionSize(long partitionKBytes, long totalMBytes) throws Throwable
+    private void withPartitionSize(long partitionKibibytes, long totalMBytes) throws Throwable
     {
-        long totalKBytes = totalMBytes * 1024L;
+        long totalKibibytes = totalMBytes * 1024L;
 
         createTable("CREATE TABLE %s (pk text, ck text, val text, PRIMARY KEY (pk, ck))");
 
-        String name = "part=" + partitionKBytes + "k total=" + totalMBytes + 'M';
+        String name = "part=" + partitionKibibytes + "k total=" + totalMBytes + 'M';
 
         measured("INSERTs for " + name, () -> {
-            for (long writtenKBytes = 0L; writtenKBytes < totalKBytes; writtenKBytes += partitionKBytes)
+            for (long writtenKibibytes = 0L; writtenKibibytes < totalKibibytes; writtenKibibytes += partitionKibibytes)
             {
-                String pk = Long.toBinaryString(writtenKBytes);
-                for (long kbytes = 0L; kbytes < partitionKBytes; kbytes += rowKBytes)
+                String pk = Long.toBinaryString(writtenKibibytes);
+                for (long kibibytes = 0L; kibibytes < partitionKibibytes; kibibytes += rowKibibytes)
                 {
-                    String ck = Long.toBinaryString(kbytes);
-                    execute("INSERT INTO %s (pk, ck, val) VALUES (?,?,?)", pk, ck, randomText(rowKBytes * 1024));
+                    String ck = Long.toBinaryString(kibibytes);
+                    execute("INSERT INTO %s (pk, ck, val) VALUES (?,?,?)", pk, ck, randomText(rowKibibytes * 1024));
                 }
             }
         });
@@ -91,20 +91,20 @@ public class LargePartitionsTest extends CQLTester
             keyCacheMetrics("after compaction");
         });
 
-        measured("SELECTs 1 for " + name, () -> selects(partitionKBytes, totalKBytes));
+        measured("SELECTs 1 for " + name, () -> selects(partitionKibibytes, totalKibibytes));
 
-        measured("SELECTs 2 for " + name, () -> selects(partitionKBytes, totalKBytes));
+        measured("SELECTs 2 for " + name, () -> selects(partitionKibibytes, totalKibibytes));
 
         CacheService.instance.keyCache.clear();
-        measured("Scan for " + name, () -> scan(partitionKBytes, totalKBytes));
+        measured("Scan for " + name, () -> scan(partitionKibibytes, totalKibibytes));
     }
 
-    private void selects(long partitionKBytes, long totalKBytes) throws Throwable
+    private void selects(long partitionKibibytes, long totalKibibytes) throws Throwable
     {
         for (int i = 0; i < 50000; i++)
         {
-            long pk = ThreadLocalRandom.current().nextLong(totalKBytes / partitionKBytes) * partitionKBytes;
-            long ck = ThreadLocalRandom.current().nextLong(partitionKBytes / rowKBytes) * rowKBytes;
+            long pk = ThreadLocalRandom.current().nextLong(totalKibibytes / partitionKibibytes) * partitionKibibytes;
+            long ck = ThreadLocalRandom.current().nextLong(partitionKibibytes / rowKibibytes) * rowKibibytes;
             execute("SELECT val FROM %s WHERE pk=? AND ck=?",
                     Long.toBinaryString(pk),
                     Long.toBinaryString(ck)).one();
@@ -114,9 +114,9 @@ public class LargePartitionsTest extends CQLTester
         keyCacheMetrics("after all selects");
     }
 
-    private void scan(long partitionKBytes, long totalKBytes) throws Throwable
+    private void scan(long partitionKibibytes, long totalKibibytes) throws Throwable
     {
-        long pk = ThreadLocalRandom.current().nextLong(totalKBytes / partitionKBytes) * partitionKBytes;
+        long pk = ThreadLocalRandom.current().nextLong(totalKibibytes / partitionKibibytes) * partitionKibibytes;
         Iterator<UntypedResultSet.Row> iter = execute("SELECT val FROM %s WHERE pk=?", Long.toBinaryString(pk)).iterator();
         int i = 0;
         while (iter.hasNext())
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableLoaderTest.java b/test/unit/org/apache/cassandra/io/sstable/SSTableLoaderTest.java
index b67cc8b..3dc6151 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableLoaderTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableLoaderTest.java
@@ -168,10 +168,10 @@ public class SSTableLoaderTest
                                                   .inDirectory(dataDir)
                                                   .forTable(String.format(schema, KEYSPACE1, CF_STANDARD2))
                                                   .using(String.format(query, KEYSPACE1, CF_STANDARD2))
-                                                  .withBufferSizeInMB(1)
+                                                  .withBufferSizeInMiB(1)
                                                   .build();
 
-        int NB_PARTITIONS = 5000; // Enough to write >1MB and get at least one completed sstable before we've closed the writer
+        int NB_PARTITIONS = 5000; // Enough to write >1MiB and get at least one completed sstable before we've closed the writer
 
         for (int i = 0; i < NB_PARTITIONS; i++)
         {
diff --git a/test/unit/org/apache/cassandra/io/util/FileUtilsTest.java b/test/unit/org/apache/cassandra/io/util/FileUtilsTest.java
index 46bdded..6f25b2e 100644
--- a/test/unit/org/apache/cassandra/io/util/FileUtilsTest.java
+++ b/test/unit/org/apache/cassandra/io/util/FileUtilsTest.java
@@ -52,26 +52,26 @@ public class FileUtilsTest
         // test straightforward conversions for each unit
         assertEquals("FileUtils.parseFileSize() failed to parse a whole number of bytes",
             256L, FileUtils.parseFileSize("256 bytes"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a whole number of kilobytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a whole number of kibibytes",
             2048L, FileUtils.parseFileSize("2 KiB"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a whole number of megabytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a whole number of mebibytes",
             4194304L, FileUtils.parseFileSize("4 MiB"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a whole number of gigabytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a whole number of gibibytes",
             3221225472L, FileUtils.parseFileSize("3 GiB"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a whole number of terabytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a whole number of tebibytes",
             5497558138880L, FileUtils.parseFileSize("5 TiB"));
         // test conversions of fractional units
-        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of kilobytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of kibibytes",
             1536L, FileUtils.parseFileSize("1.5 KiB"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of kilobytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of kibibytes",
             4434L, FileUtils.parseFileSize("4.33 KiB"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of megabytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of mebibytes",
             2359296L, FileUtils.parseFileSize("2.25 MiB"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of megabytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of mebibytes",
             3292529L, FileUtils.parseFileSize("3.14 MiB"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of gigabytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of gibibytes",
             1299227607L, FileUtils.parseFileSize("1.21 GiB"));
-        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of terabytes",
+        assertEquals("FileUtils.parseFileSize() failed to parse a rational number of tebibytes",
             6621259022467L, FileUtils.parseFileSize("6.022 TiB"));
     }
 
diff --git a/test/unit/org/apache/cassandra/io/util/RandomAccessReaderTest.java b/test/unit/org/apache/cassandra/io/util/RandomAccessReaderTest.java
index 967ddac..f933cf1 100644
--- a/test/unit/org/apache/cassandra/io/util/RandomAccessReaderTest.java
+++ b/test/unit/org/apache/cassandra/io/util/RandomAccessReaderTest.java
@@ -138,8 +138,8 @@ public class RandomAccessReaderTest
     @Test
     public void testVeryLarge() throws IOException
     {
-        final long SIZE = 1L << 32; // 2GB
-        Parameters params = new Parameters(SIZE, 1 << 20); // 1MB
+        final long SIZE = 1L << 32; // 2GiB
+        Parameters params = new Parameters(SIZE, 1 << 20); // 1MiB
 
 
         try (ChannelProxy channel = new ChannelProxy("abc", new FakeFileChannel(SIZE));
diff --git a/test/unit/org/apache/cassandra/tools/StandaloneSplitterWithCQLTesterTest.java b/test/unit/org/apache/cassandra/tools/StandaloneSplitterWithCQLTesterTest.java
index b9269cd..5b02ccf 100644
--- a/test/unit/org/apache/cassandra/tools/StandaloneSplitterWithCQLTesterTest.java
+++ b/test/unit/org/apache/cassandra/tools/StandaloneSplitterWithCQLTesterTest.java
@@ -70,7 +70,7 @@ public class StandaloneSplitterWithCQLTesterTest extends CQLTester
         List<File> splitFiles = Arrays.asList(sstablesDir.tryList());
         splitFiles.stream().forEach(f -> {
             if (f.name().endsWith("Data.db") && !origSstables.contains(f))
-                assertTrue(f.name() + " is way bigger than 1MB: [" + f.length() + "] bytes",
+                assertTrue(f.name() + " is way bigger than 1MiB: [" + f.length() + "] bytes",
                            f.length() <= 1024 * 1024 * 1.2); //give a 20% margin on size check
         });
         assertTrue(origSstables.size() < splitFiles.size());
@@ -93,7 +93,7 @@ public class StandaloneSplitterWithCQLTesterTest extends CQLTester
         List<File> splitFiles = Arrays.asList(sstablesDir.tryList());
         splitFiles.stream().forEach(f -> {
             if (f.name().endsWith("Data.db") && !origSstables.contains(f))
-                assertTrue(f.name() + " is way bigger than 1MB: [" + f.length() + "] bytes",
+                assertTrue(f.name() + " is way bigger than 1MiB: [" + f.length() + "] bytes",
                            f.length() <= 1024 * 1024 * 1.2); //give a 20% margin on size check
         });
         assertTrue(origSstables.size() < splitFiles.size());
@@ -123,7 +123,7 @@ public class StandaloneSplitterWithCQLTesterTest extends CQLTester
 
         Set<SSTableReader> sstables = cfs.getLiveSSTables();
         sstableFileName = sstables.iterator().next().getFilename();
-        assertTrue("Generated sstable must be at least 1MB", (new File(sstableFileName)).length() > 1024*1024);
+        assertTrue("Generated sstable must be at least 1MiB", (new File(sstableFileName)).length() > 1024*1024);
         sstablesDir = new File(sstableFileName).parent();
         origSstables = Arrays.asList(sstablesDir.tryList());
         System.setProperty(Util.ALLOW_TOOL_REINIT_FOR_TEST, "true"); // Necessary for testing
diff --git a/test/unit/org/apache/cassandra/tools/nodetool/SetGetColumnIndexSizeTest.java b/test/unit/org/apache/cassandra/tools/nodetool/SetGetColumnIndexSizeTest.java
index b30cf06..45736c9 100644
--- a/test/unit/org/apache/cassandra/tools/nodetool/SetGetColumnIndexSizeTest.java
+++ b/test/unit/org/apache/cassandra/tools/nodetool/SetGetColumnIndexSizeTest.java
@@ -90,7 +90,7 @@ public class SetGetColumnIndexSizeTest extends CQLTester
 
         assertGetThroughput(columnIndexSizeInKB);
 
-        assertThat(StorageService.instance.getColumnIndexSizeInKB()).isEqualTo(columnIndexSizeInKB);
+        assertThat(StorageService.instance.getColumnIndexSizeInKiB()).isEqualTo(columnIndexSizeInKB);
     }
 
     private static void assertSetInvalidColumnIndexSize(String columnIndexSizeInKB, String expectedErrorMessage, int expectedErrorCode)
diff --git a/test/unit/org/apache/cassandra/utils/MerkleTreeTest.java b/test/unit/org/apache/cassandra/utils/MerkleTreeTest.java
index 1cdcc22..ae70fd4 100644
--- a/test/unit/org/apache/cassandra/utils/MerkleTreeTest.java
+++ b/test/unit/org/apache/cassandra/utils/MerkleTreeTest.java
@@ -600,19 +600,19 @@ public class MerkleTreeTest
         Assert.assertEquals(1, MerkleTree.estimatedMaxDepthForBytes(Murmur3Partitioner.instance, 0, 32));
         Assert.assertEquals(1, MerkleTree.estimatedMaxDepthForBytes(Murmur3Partitioner.instance, 1, 32));
 
-        // The minimum of 1 megabyte split between RF=3 should yield trees of around 10
+        // The minimum of 1 mebibyte split between RF=3 should yield trees of around 10
         Assert.assertEquals(10, MerkleTree.estimatedMaxDepthForBytes(Murmur3Partitioner.instance,
                                                                      1048576 / 3, 32));
 
-        // With a single megabyte of space we should get 12
+        // With a single mebibyte of space we should get 12
         Assert.assertEquals(12, MerkleTree.estimatedMaxDepthForBytes(Murmur3Partitioner.instance,
                                                                      1048576, 32));
 
-        // With 100 megabytes we should get a limit of 19
+        // With 100 mebibytes we should get a limit of 19
         Assert.assertEquals(19, MerkleTree.estimatedMaxDepthForBytes(Murmur3Partitioner.instance,
                                                                      100 * 1048576, 32));
 
-        // With 300 megabytes we should get the old limit of 20
+        // With 300 mebibytes we should get the old limit of 20
         Assert.assertEquals(20, MerkleTree.estimatedMaxDepthForBytes(Murmur3Partitioner.instance,
                                                                      300 * 1048576, 32));
         Assert.assertEquals(20, MerkleTree.estimatedMaxDepthForBytes(RandomPartitioner.instance,
@@ -635,7 +635,7 @@ public class MerkleTreeTest
         Range<Token> fullRange = new Range<>(partitioner.getMinimumToken(), partitioner.getMinimumToken());
         MerkleTree tree = new MerkleTree(partitioner, fullRange, RECOMMENDED_DEPTH, 0);
 
-        // Test 16 kilobyte -> 16 megabytes
+        // Test 16 kibibyte -> 16 mebibytes
         for (int i = 14; i < 24; i ++)
         {
             long numBytes = 1 << i;
diff --git a/test/unit/org/apache/cassandra/utils/memory/BufferPoolTest.java b/test/unit/org/apache/cassandra/utils/memory/BufferPoolTest.java
index eb3cc1b..4e68d8b 100644
--- a/test/unit/org/apache/cassandra/utils/memory/BufferPoolTest.java
+++ b/test/unit/org/apache/cassandra/utils/memory/BufferPoolTest.java
@@ -353,7 +353,7 @@ public class BufferPoolTest
     @Test
     public void testChunkExhausted()
     {
-        final int size = BufferPool.NORMAL_CHUNK_SIZE / 64; // 1kbit
+        final int size = BufferPool.NORMAL_CHUNK_SIZE / 64; // 1kibibit
         int[] sizes = new int[128];
         Arrays.fill(sizes, size);
 
@@ -852,8 +852,8 @@ public class BufferPoolTest
     @Test
     public void testRecyclePartialFreeChunk()
     {
-        // normal chunk size is 128kb
-        int halfNormalChunk = BufferPool.NORMAL_CHUNK_SIZE / 2; // 64kb, half of normal chunk
+        // normal chunk size is 128KiB
+        int halfNormalChunk = BufferPool.NORMAL_CHUNK_SIZE / 2; // 64KiB, half of normal chunk
         List<ByteBuffer> toRelease = new ArrayList<>();
 
         // allocate three buffers on different chunks
diff --git a/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java b/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java
index 84ac5f1..c4ecb07 100644
--- a/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java
+++ b/tools/stress/src/org/apache/cassandra/io/sstable/StressCQLSSTableWriter.java
@@ -353,7 +353,7 @@ public class StressCQLSSTableWriter implements Closeable
         private IPartitioner partitioner;
 
         private boolean sorted = false;
-        private long bufferSizeInMB = 128;
+        private long bufferSizeInMiB = 128;
 
         protected Builder()
         {
@@ -502,15 +502,15 @@ public class StressCQLSSTableWriter implements Closeable
          * a new SSTable. This correspond roughly to the data size that will have the created
          * sstable.
          * <p>
-         * The default is 128MB, which should be reasonable for a 1GB heap. If you experience
+         * The default is 128MiB, which should be reasonable for a 1GB heap. If you experience
          * OOM while using the writer, you should lower this value.
          *
          * @param size the size to use in MB.
          * @return this builder.
          */
-        public Builder withBufferSizeInMB(int size)
+        public Builder withBufferSizeInMiB(int size)
         {
-            this.bufferSizeInMB = size;
+            this.bufferSizeInMiB = size;
             return this;
         }
 
@@ -527,7 +527,7 @@ public class StressCQLSSTableWriter implements Closeable
          * the rows in order, which is rarely the case. If you can provide the
          * rows in order however, using this sorted might be more efficient.
          * <p>
-         * Note that if used, some option like withBufferSizeInMB will be ignored.
+         * Note that if used, some option like withBufferSizeInMiB will be ignored.
          *
          * @return this builder.
          */
@@ -558,7 +558,7 @@ public class StressCQLSSTableWriter implements Closeable
                 UpdateStatement preparedInsert = prepareInsert();
                 AbstractSSTableSimpleWriter writer = sorted
                                                      ? new SSTableSimpleWriter(cfs.getDirectories().getDirectoryForNewSSTables(), cfs.metadata, preparedInsert.updatedColumns())
-                                                     : new SSTableSimpleUnsortedWriter(cfs.getDirectories().getDirectoryForNewSSTables(), cfs.metadata, preparedInsert.updatedColumns(), bufferSizeInMB);
+                                                     : new SSTableSimpleUnsortedWriter(cfs.getDirectories().getDirectoryForNewSSTables(), cfs.metadata, preparedInsert.updatedColumns(), bufferSizeInMiB);
 
                 if (formatType != null)
                     writer.setSSTableFormatType(formatType);
diff --git a/tools/stress/src/org/apache/cassandra/stress/CompactionStress.java b/tools/stress/src/org/apache/cassandra/stress/CompactionStress.java
index a42829a..25ad29a 100644
--- a/tools/stress/src/org/apache/cassandra/stress/CompactionStress.java
+++ b/tools/stress/src/org/apache/cassandra/stress/CompactionStress.java
@@ -273,10 +273,10 @@ public abstract class CompactionStress implements Runnable
     @Command(name = "write", description = "write data directly to disk")
     public static class DataWriter extends CompactionStress
     {
-        private static double BYTES_IN_GB = 1024 * 1014 * 1024;
+        private static double BYTES_IN_GIB = 1024 * 1014 * 1024;
 
         @Option(name = { "-g", "--gbsize"}, description = "Total GB size on disk you wish to write", required = true)
-        Integer totalSizeGb;
+        Integer totalSizeGiB;
 
         @Option(name = { "-t", "--threads" }, description = "Number of sstable writer threads (default 2)")
         Integer threads = 2;
@@ -284,7 +284,7 @@ public abstract class CompactionStress implements Runnable
         @Option(name = { "-c", "--partition-count"}, description = "Number of partitions to loop over (default 1000000)")
         Integer partitions = 1000000;
 
-        @Option(name = { "-b", "--buffer-size-mb"}, description = "Buffer in MB writes before writing new sstable (default 128)")
+        @Option(name = { "-b", "--buffer-size-mb"}, description = "Buffer in MiB writes before writing new sstable (default 128)")
         Integer bufferSize = 128;
 
         @Option(name = { "-r", "--range-aware"}, description = "Splits the local ranges in number of data directories and makes sure we never write the same token in two different directories (default true)")
@@ -326,13 +326,13 @@ public abstract class CompactionStress implements Runnable
                 });
             }
 
-            double currentSizeGB;
-            while ((currentSizeGB = directories.getRawDiretoriesSize() / BYTES_IN_GB) < totalSizeGb)
+            double currentSizeGiB;
+            while ((currentSizeGiB = directories.getRawDiretoriesSize() / BYTES_IN_GIB) < totalSizeGiB)
             {
                 if (finished.getCount() == 0)
                     break;
 
-                System.out.println(String.format("Written %.2fGB of %dGB", currentSizeGB, totalSizeGb));
+                System.out.println(String.format("Written %.2fGB of %dGB", currentSizeGiB, totalSizeGiB));
 
                 Uninterruptibles.sleepUninterruptibly(3, TimeUnit.SECONDS);
             }
@@ -340,8 +340,8 @@ public abstract class CompactionStress implements Runnable
             workManager.stop();
             Uninterruptibles.awaitUninterruptibly(finished);
 
-            currentSizeGB = directories.getRawDiretoriesSize() / BYTES_IN_GB;
-            System.out.println(String.format("Finished writing %.2fGB", currentSizeGB));
+            currentSizeGiB = directories.getRawDiretoriesSize() / BYTES_IN_GIB;
+            System.out.println(String.format("Finished writing %.2fGB", currentSizeGiB));
         }
     }
 
diff --git a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaInsert.java b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaInsert.java
index 4cfea82..258e688 100644
--- a/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaInsert.java
+++ b/tools/stress/src/org/apache/cassandra/stress/operations/userdefined/SchemaInsert.java
@@ -151,7 +151,7 @@ public class SchemaInsert extends SchemaStatement
     {
         return StressCQLSSTableWriter.builder()
                                .withCfs(cfs)
-                               .withBufferSizeInMB(bufferSize)
+                               .withBufferSizeInMiB(bufferSize)
                                .forTable(tableSchema)
                                .using(insertStatement)
                                .rangeAware(makeRangeAware)

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


[cassandra] 01/13: Add new custom types and unit tests for configuration patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 db9f7a67ec4b03413c10034956e2cf18739ca4b1
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Tue Dec 14 23:00:56 2021 -0500

    Add new custom types and unit  tests for configuration
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 CHANGES.txt                                        |   1 +
 NEWS.txt                                           |   6 +
 .../org/apache/cassandra/config/DataRateSpec.java  | 378 ++++++++++++++++++++
 .../apache/cassandra/config/DataStorageSpec.java   | 397 +++++++++++++++++++++
 .../org/apache/cassandra/config/DurationSpec.java  | 342 ++++++++++++++++++
 .../apache/cassandra/config/DataRateSpecTest.java  | 136 +++++++
 .../cassandra/config/DataStorageSpecTest.java      | 141 ++++++++
 .../apache/cassandra/config/DurationSpecTest.java  | 160 +++++++++
 8 files changed, 1561 insertions(+)

diff --git a/CHANGES.txt b/CHANGES.txt
index 4304aa7..66aae18 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.1
+ * Standardize storage configuration parameters' names. Support unit suffixes. (CASSANDRA-15234)
  * Remove support for Windows (CASSANDRA-16956)
  * Runtime-configurable YAML option to prohibit USE statements (CASSANDRA-17318)
  * When streaming sees a ClosedChannelException this triggers the disk failure policy (CASSANDRA-17116)
diff --git a/NEWS.txt b/NEWS.txt
index ff166df..966a729 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -81,6 +81,12 @@ New features
 
 Upgrading
 ---------
+    - There is a new cassandra.yaml version 2. Units suffixes should be provided for all rates(B/s|MiB/s|KiB/s|MiB/s),
+      memory (KiB|MiB|GiB|B) and duration(d|h|s|ms|us|µs|ns|m)
+      parameters. (CASSANDRA-15234)
+      Backward compatibility with the old cassandra.yaml file will be in place until at least the next major version.
+    - Many cassandra.yaml parameters' names have been changed. Full list can be found on ...... (ADD LINK LATER WHEN PAGE
+      IS CREATED) (CASSANDRA-15234)
     - Before you upgrade, if you are using `cassandra.auth_bcrypt_gensalt_log2_rounds` property,
       confirm it is set to value lower than 31 otherwise Cassandra will fail to start. See CASSANDRA-9384
       for further details. You also need to regenerate passwords for users for who the password
diff --git a/src/java/org/apache/cassandra/config/DataRateSpec.java b/src/java/org/apache/cassandra/config/DataRateSpec.java
new file mode 100644
index 0000000..3512513
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/DataRateSpec.java
@@ -0,0 +1,378 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.config;
+
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import com.google.common.primitives.Ints;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+
+/**
+ * Represents a data rate type used for cassandra configuration. It supports the opportunity for the users to be able to
+ * add units to the confiuration parameter value. (CASSANDRA-15234)
+ */
+public final class DataRateSpec
+{
+    /**
+     * The Regexp used to parse the rate provided as String in cassandra.yaml.
+     */
+    private static final Pattern BIT_RATE_UNITS_PATTERN = Pattern.compile("^(\\d+)(MiB/s|KiB/s|B/s)$");
+
+    private final double quantity;
+
+    private final DataRateUnit unit;
+
+    public DataRateSpec(String value)
+    {
+        //parse the string field value
+        Matcher matcher = BIT_RATE_UNITS_PATTERN.matcher(value);
+
+        if (!matcher.find())
+            throw new ConfigurationException("Invalid bit rate: " + value + " Accepted units: MiB/s, KiB/s, B/s where " +
+                                             "case matters and " + "only non-negative values are valid");
+
+        quantity = Long.parseLong(matcher.group(1));
+        unit = DataRateUnit.fromSymbol(matcher.group(2));
+    }
+
+    DataRateSpec(double quantity, DataRateUnit unit)
+    {
+        if (quantity < 0)
+            throw new ConfigurationException("Invalid bit rare: value must be non-negative");
+
+        if (quantity > Long.MAX_VALUE)
+            throw new NumberFormatException("Invalid bit rate: value must be between 0 and Long.MAX_VALUE = 9223372036854775807");
+
+        this.quantity = quantity;
+        this.unit = unit;
+    }
+
+    /**
+     * Creates a {@code DataRateSpec} of the specified amount of bits per second.
+     *
+     * @param bytesPerSecond the amount of bytes per second
+     * @return a {@code DataRateSpec}
+     */
+    public static DataRateSpec inBytesPerSecond(long bytesPerSecond)
+    {
+        return new DataRateSpec(bytesPerSecond, DataRateUnit.BYTES_PER_SECOND);
+    }
+
+    /**
+     * Creates a {@code DataRateSpec} of the specified amount of kibibytes per second.
+     *
+     * @param kibibytesPerSecond the amount of kibibytes per second
+     * @return a {@code DataRateSpec}
+     */
+    public static DataRateSpec inKibibytesPerSecond(long kibibytesPerSecond)
+    {
+        return new DataRateSpec(kibibytesPerSecond, DataRateUnit.KIBIBYTES_PER_SECOND);
+    }
+
+    /**
+     * Creates a {@code DataRateSpec} of the specified amount of mebibytes per second.
+     *
+     * @param mebibytesPerSecond the amount of mebibytes per second
+     * @return a {@code DataRateSpec}
+     */
+    public static DataRateSpec inMebibytesPerSecond(long mebibytesPerSecond)
+    {
+        return new DataRateSpec(mebibytesPerSecond, DataRateUnit.MEBIBYTES_PER_SECOND);
+    }
+
+    /**
+     * Creates a {@code DataRateSpec} of the specified amount of mebibytes per second.
+     *
+     * @param megabitsPerSecond the amount of megabits per second
+     * @return a {@code DataRateSpec}
+     */
+    public static DataRateSpec megabitsPerSecondInMebibytesPerSecond(long megabitsPerSecond)
+    {
+        final double MEBIBYTES_PER_MEGABIT = 0.119209289550781;
+        double mebibytesPerSecond = (double)megabitsPerSecond * MEBIBYTES_PER_MEGABIT;
+
+        return new DataRateSpec(mebibytesPerSecond, DataRateUnit.MEBIBYTES_PER_SECOND);
+    }
+
+    /**
+     * @return the data rate unit assigned.
+     */
+    public DataRateUnit getUnit()
+    {
+        return unit;
+    }
+
+    /**
+     * @return the data rate in bytes per second
+     */
+    public double toBytesPerSecond()
+    {
+        return unit.toBytesPerSecond(quantity);
+    }
+
+    /**
+     * Returns the data rate in bytes per second as an {@code int}
+     *
+     * @return the data rate in bytes per second or {@code Integer.MAX_VALUE} if the rate is too large.
+     */
+    public int toBytesPerSecondAsInt()
+    {
+        return Ints.saturatedCast(Math.round(toBytesPerSecond()));
+    }
+
+    /**
+     * @return the data rate in kibibytes per second
+     */
+    public double toKibibytesPerSecond()
+    {
+        return unit.toKibibytesPerSecond(quantity);
+    }
+
+    /**
+     * Returns the data rate in kibibytes per second as an {@code int}
+     *
+     * @return the data rate in kibibytes per second or {@code Integer.MAX_VALUE} if the number of kibibytes is too large.
+     */
+    public int toKibibytesPerSecondAsInt()
+    {
+        return Ints.saturatedCast(Math.round(toKibibytesPerSecond()));
+    }
+
+    /**
+     * @return the data rate in mebibytes per second
+     */
+    public double toMebibytesPerSecond()
+    {
+        return unit.toMebibytesPerSecond(quantity);
+    }
+
+    /**
+     * Returns the data rate in mebibytes per second as an {@code int}
+     *
+     * @return the data rate in mebibytes per second or {@code Integer.MAX_VALUE} if the number of mebibytes is too large.
+     */
+    public int toMebibytesPerSecondAsInt()
+    {
+        return Ints.saturatedCast(Math.round(toMebibytesPerSecond()));
+    }
+
+    /**
+     * This method is required in order to support backward compatibility with the old unit used for a few Data Rate
+     * parameters before CASSANDRA-15234
+     *
+     * @return the data rate in megabits per second.
+     */
+    public double toMegabitsPerSecond()
+    {
+        return unit.toMegabitsPerSecond(quantity);
+    }
+
+    /**
+     * Returns the data rate in megabits per second as an {@code int}. This method is required in order to support
+     * backward compatibility with the old unit used for a few Data Rate parameters before CASSANDRA-15234
+     *
+     * @return the data rate in mebibytes per second or {@code Integer.MAX_VALUE} if the number of mebibytes is too large.
+     */
+    public int toMegabitsPerSecondAsInt()
+    {
+        return Ints.saturatedCast(Math.round(toMegabitsPerSecond()));
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return Objects.hash(unit.toKibibytesPerSecond(quantity));
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+            return true;
+
+        if (!(obj instanceof DataRateSpec))
+            return false;
+
+        DataRateSpec other = (DataRateSpec) obj;
+        if (unit == other.unit)
+            return quantity == other.quantity;
+
+        // Due to overflows we can only guarantee that the 2 data rates are equal if we get the same results
+        // doing the conversion in both directions.
+        return unit.convert(other.quantity, other.unit) == quantity && other.unit.convert(quantity, unit) == other.quantity;
+    }
+
+    @Override
+    public String toString()
+    {
+        return Math.round(quantity) + unit.symbol;
+    }
+
+    public enum DataRateUnit
+    {
+        BYTES_PER_SECOND("B/s")
+        {
+            public double toBytesPerSecond(double d)
+            {
+                return d;
+            }
+
+            public double toKibibytesPerSecond(double d)
+            {
+                return d / 1024.0;
+            }
+
+            public double toMebibytesPerSecond(double d)
+            {
+                return d / (1024.0 * 1024.0);
+            }
+
+            public double toMegabitsPerSecond(double d) { return (d / 125000.0); }
+
+            public double convert(double source, DataRateUnit sourceUnit)
+            {
+                return sourceUnit.toBytesPerSecond(source);
+            }
+        },
+        KIBIBYTES_PER_SECOND("KiB/s")
+        {
+            public double toBytesPerSecond(double d)
+            {
+                return x(d, 1024.0, (MAX / 1024.0));
+            }
+
+            public double toKibibytesPerSecond(double d)
+            {
+                return d;
+            }
+
+            public double toMebibytesPerSecond(double d)
+            {
+                return d / 1024.0;
+            }
+
+            public double toMegabitsPerSecond(double d)
+            {
+                return d / 122.0;
+            }
+
+            public double convert(double source, DataRateUnit sourceUnit)
+            {
+                return sourceUnit.toKibibytesPerSecond(source);
+            }
+        },
+        MEBIBYTES_PER_SECOND("MiB/s")
+        {
+            public double toBytesPerSecond(double d)
+            {
+                return x(d, (1024.0 * 1024.0), (MAX / (1024.0 * 1024.0)));
+            }
+
+            public double toKibibytesPerSecond(double d)
+            {
+                return x(d, 1024.0, (MAX / 1024.0));
+            }
+
+            public double toMebibytesPerSecond(double d)
+            {
+                return d;
+            }
+
+            public double toMegabitsPerSecond(double d)
+            {
+                if (d > MAX / (MEGABITS_PER_MEBIBYTE))
+                    return MAX;
+                return Math.round(d * MEGABITS_PER_MEBIBYTE);
+            }
+
+            public double convert(double source, DataRateUnit sourceUnit)
+            {
+                return sourceUnit.toMebibytesPerSecond(source);
+            }
+        };
+
+        static final double MAX = Long.MAX_VALUE;
+        static final double MEGABITS_PER_MEBIBYTE = 8.388608;
+
+        /**
+         * Scale d by m, checking for overflow. This has a short name to make above code more readable.
+         */
+        static double x(double d, double m, double over)
+        {
+            assert (over > 0.0) && (over < (MAX - 1)) && (over == (MAX / m));
+
+            if (d > over)
+                return MAX;
+            return d * m;
+        }
+
+        /**
+         * @param symbol the unit symbol
+         * @return the rate unit corresponding to the given symbol
+         */
+        public static DataRateUnit fromSymbol(String symbol)
+        {
+            for (DataRateUnit value : values())
+            {
+                if (value.symbol.equalsIgnoreCase(symbol))
+                    return value;
+            }
+            throw new ConfigurationException(String.format("Unsupported data rate unit: %s. Supported units are: %s",
+                                                             symbol, Arrays.stream(values())
+                                                                           .map(u -> u.symbol)
+                                                                           .collect(Collectors.joining(", "))));
+        }
+
+        /**
+         * The unit symbol
+         */
+        private final String symbol;
+
+        DataRateUnit(String symbol)
+        {
+            this.symbol = symbol;
+        }
+
+        public double toBytesPerSecond(double d)
+        {
+            throw new AbstractMethodError();
+        }
+
+        public double toKibibytesPerSecond(double d)
+        {
+            throw new AbstractMethodError();
+        }
+
+        public double toMebibytesPerSecond(double d)
+        {
+            throw new AbstractMethodError();
+        }
+
+        public double toMegabitsPerSecond(double d) { throw new AbstractMethodError(); }
+
+        public double convert(double source, DataRateUnit sourceUnit)
+        {
+            throw new AbstractMethodError();
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/java/org/apache/cassandra/config/DataStorageSpec.java b/src/java/org/apache/cassandra/config/DataStorageSpec.java
new file mode 100644
index 0000000..72ed2ba
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/DataStorageSpec.java
@@ -0,0 +1,397 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.config;
+
+import java.util.Arrays;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import com.google.common.primitives.Ints;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+
+/**
+ * Represents an amount of data storage. Wrapper class for Cassandra configuration parameters, providing to the
+ * users the opportunity to be able to provide config with a unit of their choice in cassandra.yaml as per the available
+ * options. (CASSANDRA-15234)
+ */
+public final class DataStorageSpec
+{
+    /**
+     * The Regexp used to parse the storage provided as String.
+     */
+    private static final Pattern STORAGE_UNITS_PATTERN = Pattern.compile("^(\\d+)(GiB|MiB|KiB|B)$");
+
+    private final long quantity;
+
+    private final DataStorageUnit unit;
+
+    public DataStorageSpec(String value)
+    {
+        if (value == null || value.equals("null"))
+        {
+            quantity = 0;
+            unit = DataStorageUnit.MEBIBYTES; // the unit doesn't really matter as 0 is 0 in all units
+            return;
+        }
+
+        //parse the string field value
+        Matcher matcher = STORAGE_UNITS_PATTERN.matcher(value);
+
+        if (!matcher.find())
+        {
+            throw new ConfigurationException("Invalid data storage: " + value + " Accepted units: B, KiB, MiB, GiB" +
+                                             " where case matters and only non-negative values are accepted");
+        }
+
+        quantity = Long.parseLong(matcher.group(1));
+        unit = DataStorageUnit.fromSymbol(matcher.group(2));
+    }
+
+    DataStorageSpec(long quantity, DataStorageUnit unit)
+    {
+        if (quantity < 0)
+            throw new ConfigurationException("Invalid data storage: value must be positive, but was " + quantity);
+
+        this.quantity = quantity;
+        this.unit = unit;
+    }
+
+    /**
+     * Creates a {@code DataStorageSpec} of the specified amount of bytes.
+     *
+     * @param bytes the amount of bytes
+     * @return a {@code DataStorageSpec}
+     */
+    public static DataStorageSpec inBytes(long bytes)
+    {
+        return new DataStorageSpec(bytes, DataStorageUnit.BYTES);
+    }
+
+    /**
+     * Creates a {@code DataStorageSpec} of the specified amount of kibibytes.
+     *
+     * @param kibibytes the amount of kibibytes
+     * @return a {@code DataStorageSpec}
+     */
+    public static DataStorageSpec inKibibytes(long kibibytes)
+    {
+        return new DataStorageSpec(kibibytes, DataStorageUnit.KIBIBYTES);
+    }
+
+    /**
+     * Creates a {@code DataStorageSpec} of the specified amount of mebibytes.
+     *
+     * @param mebibytes the amount of mebibytes
+     * @return a {@code DataStorageSpec}
+     */
+    public static DataStorageSpec inMebibytes(long mebibytes)
+    {
+        return new DataStorageSpec(mebibytes, DataStorageUnit.MEBIBYTES);
+    }
+
+    /**
+     * @return the data storage unit.
+     */
+    public DataStorageUnit getUnit()
+    {
+        return unit;
+    }
+
+    /**
+     * @return the amount of data storage in bytes
+     */
+    public long toBytes()
+    {
+        return unit.toBytes(quantity);
+    }
+
+    /**
+     * Returns the amount of data storage in bytes as an {@code int}
+     *
+     * @return the amount of data storage in bytes or {@code Integer.MAX_VALUE} if the number of bytes is too large.
+     */
+    public int toBytesAsInt()
+    {
+        return Ints.saturatedCast(toBytes());
+    }
+
+    /**
+     * @return the amount of data storage in kibibytes
+     */
+    public long toKibibytes()
+    {
+        return unit.toKibibytes(quantity);
+    }
+
+    /**
+     * Returns the amount of data storage in kibibytes as an {@code int}
+     *
+     * @return the amount of data storage in kibibytes or {@code Integer.MAX_VALUE} if the number of kibibytes is too large.
+     */
+    public int toKibibytesAsInt()
+    {
+        return Ints.saturatedCast(toKibibytes());
+    }
+
+    /**
+     * @return the amount of data storage in mebibytes
+     */
+    public long toMebibytes()
+    {
+        return unit.toMebibytes(quantity);
+    }
+
+    /**
+     * Returns the amount of data storage in mebibytes as an {@code int}
+     *
+     * @return the amount of data storage in mebibytes or {@code Integer.MAX_VALUE} if the number of mebibytes is too large.
+     */
+    public int toMebibytesAsInt()
+    {
+        return Ints.saturatedCast(toMebibytes());
+    }
+
+    /**
+     * @return the amount of data storage in gibibytes
+     */
+    public long toGibibytes()
+    {
+        return unit.toGibibytes(quantity);
+    }
+
+    /**
+     * Returns the amount of data storage in gibibytes as an {@code int}
+     *
+     * @return the amount of data storage in gibibytes or {@code Integer.MAX_VALUE} if the number of gibibytes is too large.
+     */
+    public int toGibibytesAsInt()
+    {
+        return Ints.saturatedCast(toGibibytes());
+    }
+
+    @Override
+    public int hashCode()
+    {
+        return Objects.hash(unit.toKibibytes(quantity));
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+            return true;
+
+        if (!(obj instanceof DataStorageSpec))
+            return false;
+
+        DataStorageSpec other = (DataStorageSpec) obj;
+        if (unit == other.unit)
+            return quantity == other.quantity;
+
+        // Due to overflows we can only guarantee that the 2 storages are equal if we get the same results
+        // doing the convertion in both directions.
+        return unit.convert(other.quantity, other.unit) == quantity && other.unit.convert(quantity, unit) == other.quantity;
+    }
+
+    @Override
+    public String toString()
+    {
+        return quantity + unit.symbol;
+    }
+
+    public enum DataStorageUnit
+    {
+        BYTES("B")
+        {
+            public long toBytes(long d)
+            {
+                return d;
+            }
+
+            public long toKibibytes(long d)
+            {
+                return (d / 1024L);
+            }
+
+            public long toMebibytes(long d)
+            {
+                return (d / (1024L * 1024));
+            }
+
+            public long toGibibytes(long d)
+            {
+                return (d / (1024L * 1024 * 1024));
+            }
+
+            public long convert(long source, DataStorageUnit sourceUnit)
+            {
+                return sourceUnit.toBytes(source);
+            }
+        },
+        KIBIBYTES("KiB")
+        {
+            public long toBytes(long d)
+            {
+                return x(d, 1024L, (MAX / 1024L));
+            }
+
+            public long toKibibytes(long d)
+            {
+                return d;
+            }
+
+            public long toMebibytes(long d)
+            {
+                return (d / 1024L);
+            }
+
+            public long toGibibytes(long d)
+            {
+                return (d / (1024L * 1024));
+            }
+
+            public long convert(long source, DataStorageUnit sourceUnit)
+            {
+                return sourceUnit.toKibibytes(source);
+            }
+        },
+        MEBIBYTES("MiB")
+        {
+            public long toBytes(long d)
+            {
+                return x(d, (1024L * 1024), MAX / (1024L * 1024));
+            }
+
+            public long toKibibytes(long d)
+            {
+                return x(d, 1024L, (MAX / 1024L));
+            }
+
+            public long toMebibytes(long d)
+            {
+                return d;
+            }
+
+            public long toGibibytes(long d)
+            {
+                return (d / 1024L);
+            }
+
+            public long convert(long source, DataStorageUnit sourceUnit)
+            {
+                return sourceUnit.toMebibytes(source);
+            }
+        },
+        GIBIBYTES("GiB")
+        {
+            public long toBytes(long d)
+            {
+                return x(d, (1024L * 1024 * 1024), MAX / (1024L * 1024 * 1024));
+            }
+
+            public long toKibibytes(long d)
+            {
+                return x(d, (1024L * 1024), MAX / (1024L * 1024));
+            }
+
+            public long toMebibytes(long d)
+            {
+                return x(d, 1024L, (MAX / 1024L));
+            }
+
+            public long toGibibytes(long d)
+            {
+                return d;
+            }
+
+            public long convert(long source, DataStorageUnit sourceUnit)
+            {
+                return sourceUnit.toGibibytes(source);
+            }
+        };
+
+        /**
+         * Scale d by m, checking for overflow. This has a short name to make above code more readable.
+         */
+        static long x(long d, long m, long over)
+        {
+            assert (over > 0) && (over < (MAX-1L)) && (over == (MAX / m));
+
+            if (d > over)
+                return Long.MAX_VALUE;
+            return Math.multiplyExact(d, m);
+        }
+
+        /**
+         * @param symbol the unit symbol
+         * @return the memory unit corresponding to the given symbol
+         */
+        public static DataStorageUnit fromSymbol(String symbol)
+        {
+            for (DataStorageUnit value : values())
+            {
+                if (value.symbol.equalsIgnoreCase(symbol))
+                    return value;
+            }
+            throw new ConfigurationException(String.format("Unsupported data storage unit: %s. Supported units are: %s",
+                                                           symbol, Arrays.stream(values())
+                                                                         .map(u -> u.symbol)
+                                                                         .collect(Collectors.joining(", "))));
+        }
+
+        static final long MAX = Long.MAX_VALUE;
+
+        /**
+         * The unit symbol
+         */
+        private final String symbol;
+
+        DataStorageUnit(String symbol)
+        {
+            this.symbol = symbol;
+        }
+
+        public long toBytes(long d)
+        {
+            throw new AbstractMethodError();
+        }
+
+        public long toKibibytes(long d)
+        {
+            throw new AbstractMethodError();
+        }
+
+        public long toMebibytes(long d)
+        {
+            throw new AbstractMethodError();
+        }
+
+        public long toGibibytes(long d)
+        {
+            throw new AbstractMethodError();
+        }
+
+        public long convert(long source, DataStorageUnit sourceUnit)
+        {
+            throw new AbstractMethodError();
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/java/org/apache/cassandra/config/DurationSpec.java b/src/java/org/apache/cassandra/config/DurationSpec.java
new file mode 100644
index 0000000..796fde6
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/DurationSpec.java
@@ -0,0 +1,342 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.config;
+
+import java.util.Arrays;
+import java.util.Locale;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+import com.google.common.primitives.Ints;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+
+/**
+ * Represents a positive time duration. Wrapper class for Cassandra duration configuration parameters, providing to the
+ * users the opportunity to be able to provide config with a unit of their choice in cassandra.yaml as per the available
+ * options. (CASSANDRA-15234)
+ */
+public final class DurationSpec
+{
+    /**
+     * The Regexp used to parse the duration provided as String.
+     */
+    private static final Pattern TIME_UNITS_PATTERN = Pattern.compile(("^(\\d+)(d|h|s|ms|us|µs|ns|m)"));
+    private static final Pattern VALUES_PATTERN = Pattern.compile(("\\d+"));
+
+    public final long quantity;
+
+    private final TimeUnit unit;
+
+    public DurationSpec(String value)
+    {
+        if (value == null || value.equals("null") || value.toLowerCase(Locale.ROOT).equals("nan"))
+        {
+            quantity = 0;
+            unit = TimeUnit.MILLISECONDS;
+            return;
+        }
+
+        //parse the string field value
+        Matcher matcher = TIME_UNITS_PATTERN.matcher(value);
+
+        if(matcher.find())
+        {
+            quantity = Long.parseLong(matcher.group(1));
+            unit = fromSymbol(matcher.group(2));
+        }
+        else
+        {
+            throw new ConfigurationException("Invalid duration: " + value + " Accepted units: d, h, m, s, ms, us, µs," +
+                                             " ns where case matters and " + "only non-negative values");
+        }
+    }
+
+    DurationSpec(long quantity, TimeUnit unit)
+    {
+        if (quantity < 0)
+            throw new ConfigurationException("Invalid duration: value must be positive");
+
+        this.quantity = quantity;
+        this.unit = unit;
+    }
+
+    private DurationSpec(double quantity, TimeUnit unit)
+    {
+        this(Math.round(quantity), unit);
+    }
+
+    /**
+     * Creates a {@code DurationSpec} of the specified amount of milliseconds.
+     *
+     * @param milliseconds the amount of milliseconds
+     * @return a duration
+     */
+    public static DurationSpec inMilliseconds(long milliseconds)
+    {
+        return new DurationSpec(milliseconds, TimeUnit.MILLISECONDS);
+    }
+
+    public static DurationSpec inDoubleMilliseconds(double milliseconds)
+    {
+        return new DurationSpec(milliseconds, TimeUnit.MILLISECONDS);
+    }
+
+    /**
+     * Creates a {@code DurationSpec} of the specified amount of seconds.
+     *
+     * @param seconds the amount of seconds
+     * @return a duration
+     */
+    public static DurationSpec inSeconds(long seconds)
+    {
+        return new DurationSpec(seconds, TimeUnit.SECONDS);
+    }
+
+    /**
+     * Creates a {@code DurationSpec} of the specified amount of minutes.
+     *
+     * @param minutes the amount of minutes
+     * @return a duration
+     */
+    public static DurationSpec inMinutes(long minutes)
+    {
+        return new DurationSpec(minutes, TimeUnit.MINUTES);
+    }
+
+    /**
+     * Creates a {@code DurationSpec} of the specified amount of hours.
+     *
+     * @param hours the amount of hours
+     * @return a duration
+     */
+    public static DurationSpec inHours(long hours)
+    {
+        return new DurationSpec(hours, TimeUnit.HOURS);
+    }
+
+    /**
+     * Creates a {@code DurationSpec} of the specified amount of seconds. Custom method for special cases.
+     *
+     * @param value which can be in the old form only presenting the quantity or the post CASSANDRA-15234 form - a
+     * value consisting of quantity and unit. This method is necessary for three parameters which didn't change their
+     * names but only their value format. (key_cache_save_period, row_cache_save_period, counter_cache_save_period)
+     * @return a duration
+     */
+    public static DurationSpec inSecondsString(String value)
+    {
+        //parse the string field value
+        Matcher matcher = VALUES_PATTERN.matcher(value);
+
+        long seconds;
+        //if the provided string value is just a number, then we create a Duration Spec value in seconds
+        if (matcher.matches())
+        {
+            seconds = Long.parseLong(value);
+            return new DurationSpec(seconds, TimeUnit.SECONDS);
+        }
+
+        //otherwise we just use the standard constructors
+        return new DurationSpec(value);
+    }
+
+    /**
+     * @param symbol the time unit symbol
+     * @return the time unit associated to the specified symbol
+     */
+    static TimeUnit fromSymbol(String symbol)
+    {
+        switch (symbol.toLowerCase())
+        {
+            case "d": return TimeUnit.DAYS;
+            case "h": return TimeUnit.HOURS;
+            case "m": return TimeUnit.MINUTES;
+            case "s": return TimeUnit.SECONDS;
+            case "ms": return TimeUnit.MILLISECONDS;
+            case "us":
+            case "µs": return TimeUnit.MICROSECONDS;
+            case "ns": return TimeUnit.NANOSECONDS;
+        }
+        throw new ConfigurationException(String.format("Unsupported time unit: %s. Supported units are: %s",
+                                                       symbol, Arrays.stream(TimeUnit.values())
+                                                                     .map(DurationSpec::getSymbol)
+                                                                     .collect(Collectors.joining(", "))));
+    }
+
+    /**
+     * @param targetUnit the time unit
+     * @return this duration in the specified time unit
+     */
+    public long to(TimeUnit targetUnit)
+    {
+        return targetUnit.convert(quantity, unit);
+    }
+
+    /**
+     * @return this duration in number of hours
+     */
+    public long toHours()
+    {
+        return unit.toHours(quantity);
+    }
+
+    /**
+     * Returns this duration in number of minutes as an {@code int}
+     *
+     * @return this duration in number of minutes or {@code Integer.MAX_VALUE} if the number of minutes is too large.
+     */
+    public int toHoursAsInt()
+    {
+        return Ints.saturatedCast(toHours());
+    }
+
+    /**
+     * @return this duration in number of minutes
+     */
+    public long toMinutes()
+    {
+        return unit.toMinutes(quantity);
+    }
+
+    /**
+     * Returns this duration in number of minutes as an {@code int}
+     *
+     * @return this duration in number of minutes or {@code Integer.MAX_VALUE} if the number of minutes is too large.
+     */
+    public int toMinutesAsInt()
+    {
+        return Ints.saturatedCast(toMinutes());
+    }
+
+    /**
+     * @return this duration in number of seconds
+     */
+    public long toSeconds()
+    {
+        return unit.toSeconds(quantity);
+    }
+
+    /**
+     * Returns this duration in number of seconds as an {@code int}
+     *
+     * @return this duration in number of seconds or {@code Integer.MAX_VALUE} if the number of seconds is too large.
+     */
+    public int toSecondsAsInt()
+    {
+        return Ints.saturatedCast(toSeconds());
+    }
+
+    /**
+     * @return this duration in number of nanoseconds
+     */
+    public long toNanoseconds()
+    {
+        return unit.toNanos(quantity);
+    }
+
+    /**
+     * Returns this duration in number of nanoseconds as an {@code int}
+     *
+     * @return this duration in number of nanoseconds or {@code Integer.MAX_VALUE} if the number of nanoseconds is too large.
+     */
+    public int toNanosecondsAsInt()
+    {
+        return Ints.saturatedCast(toNanoseconds());
+    }
+
+    /**
+     * @return this duration in number of milliseconds
+     */
+    public long toMilliseconds()
+    {
+        return unit.toMillis(quantity);
+    }
+
+    /**
+     * @return the duration value in milliseconds
+     */
+    public static long toMilliseconds(DurationSpec quantity)
+    {
+        return quantity.toMilliseconds();
+    }
+
+    /**
+     * Returns this duration in number of milliseconds as an {@code int}
+     *
+     * @return this duration in number of milliseconds or {@code Integer.MAX_VALUE} if the number of milliseconds is too large.
+     */
+    public int toMillisecondsAsInt()
+    {
+        return Ints.saturatedCast(toMilliseconds());
+    }
+
+    @Override
+    public int hashCode()
+    {
+        // Milliseconds seems to be a reasonable tradeoff
+        return Objects.hash(unit.toMillis(quantity));
+    }
+
+    @Override
+    public boolean equals(Object obj)
+    {
+        if (this == obj)
+            return true;
+
+        if (!(obj instanceof DurationSpec))
+            return false;
+
+        DurationSpec other = (DurationSpec) obj;
+        if (unit == other.unit)
+            return quantity == other.quantity;
+
+        // Due to overflows we can only guarantee that the 2 durations are equal if we get the same results
+        // doing the conversion in both directions.
+        return unit.convert(other.quantity, other.unit) == quantity && other.unit.convert(quantity, unit) == other.quantity;
+    }
+
+    @Override
+    public String toString()
+    {
+        return quantity + getSymbol(unit);
+    }
+
+    /**
+     * Returns the symbol associated to the specified unit
+     *
+     * @param unit the time unit
+     * @return the time unit symbol
+     */
+    static String getSymbol(TimeUnit unit)
+    {
+        switch (unit)
+        {
+            case DAYS: return "d";
+            case HOURS: return "h";
+            case MINUTES: return "m";
+            case SECONDS: return "s";
+            case MILLISECONDS: return "ms";
+            case MICROSECONDS: return "us";
+            case NANOSECONDS: return "ns";
+        }
+        throw new AssertionError();
+    }
+}
diff --git a/test/unit/org/apache/cassandra/config/DataRateSpecTest.java b/test/unit/org/apache/cassandra/config/DataRateSpecTest.java
new file mode 100644
index 0000000..73625fb
--- /dev/null
+++ b/test/unit/org/apache/cassandra/config/DataRateSpecTest.java
@@ -0,0 +1,136 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.config;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+import org.quicktheories.core.Gen;
+import org.quicktheories.generators.SourceDSL;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.*;
+import static org.quicktheories.QuickTheory.qt;
+
+public class DataRateSpecTest
+{
+    @Test
+    public void testConversions()
+    {
+        assertEquals(10, new DataRateSpec("10B/s").toBytesPerSecond(), 0);
+        assertEquals(10240, new DataRateSpec("10KiB/s").toBytesPerSecond(), 0);
+        assertEquals(0, new DataRateSpec("10KiB/s").toMebibytesPerSecond(), 0.1);
+        assertEquals(10240, new DataRateSpec("10MiB/s").toKibibytesPerSecond(), 0);
+        assertEquals(10485760, new DataRateSpec("10MiB/s").toBytesPerSecond(), 0);
+        assertEquals(10485760, new DataRateSpec("10MiB/s").toBytesPerSecond(), 0);
+        assertEquals(new DataRateSpec("24MiB/s").toString(), DataRateSpec.megabitsPerSecondInMebibytesPerSecond(200L).toString());
+    }
+
+    @Test
+    public void testOverflowingDuringConversion()
+    {
+        assertEquals(Long.MAX_VALUE, new DataRateSpec("9223372036854775807B/s").toBytesPerSecond(), 0);
+        assertEquals(Integer.MAX_VALUE, new DataRateSpec("9223372036854775807B/s").toBytesPerSecondAsInt(), 0);
+        assertEquals(Long.MAX_VALUE, new DataRateSpec("9223372036854775807KiB/s").toBytesPerSecond(), 0);
+        assertEquals(Integer.MAX_VALUE, new DataRateSpec("9223372036854775807KiB/s").toBytesPerSecondAsInt(), 0);
+        assertEquals(Long.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toBytesPerSecond(), 0);
+        assertEquals(Integer.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toBytesPerSecondAsInt(), 0);
+        assertEquals(Long.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toBytesPerSecond(), 0);
+        assertEquals(Integer.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toBytesPerSecondAsInt(), 0);
+
+        assertEquals(Long.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toMegabitsPerSecond(), 0);
+        assertEquals(Integer.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toMegabitsPerSecondAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DataRateSpec("9223372036854775807KiB/s").toKibibytesPerSecond(), 0);
+        assertEquals(Integer.MAX_VALUE, new DataRateSpec("9223372036854775807KiB/s").toKibibytesPerSecondAsInt());
+        assertEquals(Long.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toKibibytesPerSecond(), 0);
+        assertEquals(Integer.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toKibibytesPerSecondAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toMebibytesPerSecond(), 0);
+        assertEquals(Integer.MAX_VALUE, new DataRateSpec("9223372036854775807MiB/s").toMebibytesPerSecondAsInt());
+    }
+
+    @Test
+    public void testFromSymbol()
+    {
+        assertEquals(DataRateSpec.DataRateUnit.fromSymbol("B/s"), DataRateSpec.DataRateUnit.BYTES_PER_SECOND);
+        assertEquals(DataRateSpec.DataRateUnit.fromSymbol("KiB/s"), DataRateSpec.DataRateUnit.KIBIBYTES_PER_SECOND);
+        assertEquals(DataRateSpec.DataRateUnit.fromSymbol("MiB/s"), DataRateSpec.DataRateUnit.MEBIBYTES_PER_SECOND);
+        assertThatThrownBy(() -> DataRateSpec.DataRateUnit.fromSymbol("n"))
+        .isInstanceOf(ConfigurationException.class)
+        .hasMessageContaining("Unsupported data rate unit: n");
+    }
+
+    @Test
+    public void testInvalidInputs()
+    {
+        assertThatThrownBy(() -> new DataRateSpec("10")).isInstanceOf(ConfigurationException.class)
+                                                        .hasMessageContaining("Invalid bit rate: 10");
+        assertThatThrownBy(() -> new DataRateSpec("-10b/s")).isInstanceOf(ConfigurationException.class)
+                                                            .hasMessageContaining("Invalid bit rate: -10b/s");
+        assertThatThrownBy(() -> new DataRateSpec("10xb/s")).isInstanceOf(ConfigurationException.class)
+                                                            .hasMessageContaining("Invalid bit rate: 10xb/s");
+        assertThatThrownBy(() -> new DataRateSpec("9223372036854775809B/s")
+                                 .toBytesPerSecond()).isInstanceOf(NumberFormatException.class)
+                                                     .hasMessageContaining("For input string: \"9223372036854775809\"");
+    }
+
+    @Test
+    public void testEquals()
+    {
+        assertEquals(new DataRateSpec("10B/s"), new DataRateSpec("10B/s"));
+        assertEquals(new DataRateSpec("10KiB/s"), new DataRateSpec("10240B/s"));
+        assertEquals(new DataRateSpec("10240B/s"), new DataRateSpec("10KiB/s"));
+        assertEquals(DataRateSpec.inMebibytesPerSecond(Long.MAX_VALUE), DataRateSpec.inMebibytesPerSecond(Long.MAX_VALUE));
+        assertNotEquals(DataRateSpec.inMebibytesPerSecond(Long.MAX_VALUE), DataRateSpec.inBytesPerSecond(Long.MAX_VALUE));
+        assertNotEquals(new DataRateSpec("0KiB/s"), new DataRateSpec("10MiB/s"));
+    }
+
+    @Test
+    public void thereAndBack()
+    {
+        Gen<DataRateSpec.DataRateUnit> unitGen = SourceDSL.arbitrary().enumValues(DataRateSpec.DataRateUnit.class);
+        Gen<Long> valueGen = SourceDSL.longs().between(0, Long.MAX_VALUE);
+        qt().forAll(valueGen, unitGen).check((value, unit) -> {
+            DataRateSpec there = new DataRateSpec(value, unit);
+            DataRateSpec back = new DataRateSpec(there.toString());
+            DataRateSpec BACK = new DataRateSpec(there.toString());
+            return there.equals(back) && there.equals(BACK);
+        });
+    }
+
+    @Test
+    public void eq()
+    {
+        qt().forAll(gen(), gen()).check((a, b) -> a.equals(b) == b.equals(a));
+    }
+
+    @Test
+    public void eqAndHash()
+    {
+        qt().forAll(gen(), gen()).check((a, b) -> !a.equals(b) || a.hashCode() == b.hashCode());
+    }
+
+    private static Gen<DataRateSpec> gen()
+    {
+        Gen<DataRateSpec.DataRateUnit> unitGen = SourceDSL.arbitrary().enumValues(DataRateSpec.DataRateUnit.class);
+        Gen<Long> valueGen = SourceDSL.longs().between(0, Long.MAX_VALUE);
+        Gen<DataRateSpec> gen = rs -> new DataRateSpec(valueGen.generate(rs), unitGen.generate(rs));
+        return gen.describedAs(DataRateSpec::toString);
+    }
+}
\ No newline at end of file
diff --git a/test/unit/org/apache/cassandra/config/DataStorageSpecTest.java b/test/unit/org/apache/cassandra/config/DataStorageSpecTest.java
new file mode 100644
index 0000000..66c6444
--- /dev/null
+++ b/test/unit/org/apache/cassandra/config/DataStorageSpecTest.java
@@ -0,0 +1,141 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.config;
+
+import java.util.Locale;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+import org.quicktheories.core.Gen;
+import org.quicktheories.generators.SourceDSL;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.*;
+import static org.quicktheories.QuickTheory.qt;
+
+public class DataStorageSpecTest
+{
+    @Test
+    public void testConversions()
+    {
+        assertEquals(10, new DataStorageSpec("10B").toBytes());
+        assertEquals(10240, new DataStorageSpec("10KiB").toBytes());
+        assertEquals(0, new DataStorageSpec("10KiB").toMebibytes());
+        assertEquals(10240, new DataStorageSpec("10MiB").toKibibytes());
+        assertEquals(10485760, new DataStorageSpec("10MiB").toBytes());
+    }
+
+    @Test
+    public void testOverflowingDuringConversion()
+    {
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807B").toBytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807B").toBytesAsInt());
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807KiB").toBytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807KiB").toBytesAsInt());
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807MiB").toBytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807MiB").toBytesAsInt());
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807GiB").toBytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807GiB").toBytesAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807KiB").toKibibytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807KiB").toKibibytesAsInt());
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807MiB").toKibibytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807MiB").toKibibytesAsInt());
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807GiB").toKibibytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807GiB").toKibibytesAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807MiB").toMebibytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807MiB").toMebibytesAsInt());
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807GiB").toMebibytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807GiB").toMebibytesAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DataStorageSpec("9223372036854775807GiB").toGibibytes());
+        assertEquals(Integer.MAX_VALUE, new DataStorageSpec("9223372036854775807GiB").toGibibytesAsInt());
+    }
+
+    @Test
+    public void testFromSymbol()
+    {
+        assertEquals(DataStorageSpec.DataStorageUnit.fromSymbol("B"), DataStorageSpec.DataStorageUnit.BYTES);
+        assertEquals(DataStorageSpec.DataStorageUnit.fromSymbol("KiB"), DataStorageSpec.DataStorageUnit.KIBIBYTES);
+        assertEquals(DataStorageSpec.DataStorageUnit.fromSymbol("MiB"), DataStorageSpec.DataStorageUnit.MEBIBYTES);
+        assertEquals(DataStorageSpec.DataStorageUnit.fromSymbol("GiB"), DataStorageSpec.DataStorageUnit.GIBIBYTES);
+        assertThatThrownBy(() -> DataStorageSpec.DataStorageUnit.fromSymbol("n"))
+        .isInstanceOf(ConfigurationException.class)
+        .hasMessageContaining("Unsupported data storage unit: n");
+    }
+
+    @Test
+    public void testInvalidInputs()
+    {
+        assertThatThrownBy(() -> new DataStorageSpec("10")).isInstanceOf(ConfigurationException.class)
+                                                           .hasMessageContaining("Invalid data storage: 10");
+        assertThatThrownBy(() -> new DataStorageSpec("-10bps")).isInstanceOf(ConfigurationException.class)
+                                                               .hasMessageContaining("Invalid data storage: -10bps");
+        assertThatThrownBy(() -> new DataStorageSpec("-10b")).isInstanceOf(ConfigurationException.class)
+                                                             .hasMessageContaining("Invalid data storage: -10b");
+        assertThatThrownBy(() -> new DataStorageSpec("10HG")).isInstanceOf(ConfigurationException.class)
+                                                             .hasMessageContaining("Invalid data storage: 10HG");
+        assertThatThrownBy(() -> new DataStorageSpec("9223372036854775809B")
+                                 .toBytes()).isInstanceOf(NumberFormatException.class)
+                                            .hasMessageContaining("For input string: \"9223372036854775809\"");
+    }
+
+    @Test
+    public void testEquals()
+    {
+        assertEquals(new DataStorageSpec("10B"), new DataStorageSpec("10B"));
+        assertEquals(new DataStorageSpec("10KiB"), new DataStorageSpec("10240B"));
+        assertEquals(new DataStorageSpec("10240B"), new DataStorageSpec("10KiB"));
+        assertEquals(DataStorageSpec.inMebibytes(Long.MAX_VALUE), DataStorageSpec.inMebibytes(Long.MAX_VALUE));
+        assertNotEquals(DataStorageSpec.inMebibytes(Long.MAX_VALUE), DataStorageSpec.inKibibytes(Long.MAX_VALUE));
+        assertNotEquals(DataStorageSpec.inMebibytes(Long.MAX_VALUE), DataStorageSpec.inBytes(Long.MAX_VALUE));
+        assertNotEquals(new DataStorageSpec("0MiB"), new DataStorageSpec("10KiB"));
+    }
+
+    @Test
+    public void thereAndBack()
+    {
+        qt().forAll(gen()).check(there -> {
+            DataStorageSpec back = new DataStorageSpec(there.toString());
+            DataStorageSpec BACK = new DataStorageSpec(there.toString().toUpperCase(Locale.ROOT).replace("I", "i"));
+            return there.equals(back) && there.equals(BACK);
+        });
+    }
+
+    @Test
+    public void eq()
+    {
+        qt().forAll(gen(), gen()).check((a, b) -> a.equals(b) == b.equals(a));
+    }
+
+    @Test
+    public void eqAndHash()
+    {
+        qt().forAll(gen(), gen()).check((a, b) -> !a.equals(b) || a.hashCode() == b.hashCode());
+    }
+
+    private static Gen<DataStorageSpec> gen()
+    {
+        Gen<DataStorageSpec.DataStorageUnit> unitGen = SourceDSL.arbitrary().enumValues(DataStorageSpec.DataStorageUnit.class);
+        Gen<Long> valueGen = SourceDSL.longs().between(0, Long.MAX_VALUE);
+        Gen<DataStorageSpec> gen = rs -> new DataStorageSpec(valueGen.generate(rs), unitGen.generate(rs));
+        return gen.describedAs(DataStorageSpec::toString);
+    }
+}
\ No newline at end of file
diff --git a/test/unit/org/apache/cassandra/config/DurationSpecTest.java b/test/unit/org/apache/cassandra/config/DurationSpecTest.java
new file mode 100644
index 0000000..84733d8
--- /dev/null
+++ b/test/unit/org/apache/cassandra/config/DurationSpecTest.java
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cassandra.config;
+
+import java.util.concurrent.TimeUnit;
+
+import org.junit.Test;
+
+import org.apache.cassandra.exceptions.ConfigurationException;
+import org.quicktheories.core.Gen;
+import org.quicktheories.generators.SourceDSL;
+
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.junit.Assert.*;
+import static org.quicktheories.QuickTheory.qt;
+
+public class DurationSpecTest
+{
+    @Test
+    public void testConversions()
+    {
+        assertEquals(10L, new DurationSpec("10s").toSeconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807s").toSecondsAsInt());
+        assertEquals(10000, new DurationSpec("10s").toMilliseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807s").toMillisecondsAsInt());
+        assertEquals(0, new DurationSpec("10s").toMinutes());
+        assertEquals(10, new DurationSpec("10m").toMinutes());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807s").toMinutesAsInt());
+        assertEquals(600000, new DurationSpec("10m").toMilliseconds());
+        assertEquals(600, new DurationSpec("10m").toSeconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807s").toSecondsAsInt());
+        assertEquals(DurationSpec.inDoubleMilliseconds(0.7), new DurationSpec("1ms"));
+        assertEquals(DurationSpec.inDoubleMilliseconds(0.33), new DurationSpec("0ms"));
+        assertEquals(DurationSpec.inDoubleMilliseconds(0.333), new DurationSpec("0ms"));
+    }
+
+    @Test
+    public void testFromSymbol()
+    {
+        assertEquals(DurationSpec.fromSymbol("ms"), TimeUnit.MILLISECONDS);
+        assertEquals(DurationSpec.fromSymbol("d"), TimeUnit.DAYS);
+        assertEquals(DurationSpec.fromSymbol("h"), TimeUnit.HOURS);
+        assertEquals(DurationSpec.fromSymbol("m"), TimeUnit.MINUTES);
+        assertEquals(DurationSpec.fromSymbol("s"), TimeUnit.SECONDS);
+        assertEquals(DurationSpec.fromSymbol("us"), TimeUnit.MICROSECONDS);
+        assertEquals(DurationSpec.fromSymbol("µs"), TimeUnit.MICROSECONDS);
+        assertEquals(DurationSpec.fromSymbol("ns"), TimeUnit.NANOSECONDS);
+        assertThatThrownBy(() -> DurationSpec.fromSymbol("n")).isInstanceOf(ConfigurationException.class)
+                                                              .hasMessageContaining("Unsupported time unit: n");
+    }
+
+    @Test
+    public void testGetSymbol()
+    {
+        assertEquals(DurationSpec.getSymbol(TimeUnit.MILLISECONDS), "ms");
+        assertEquals(DurationSpec.getSymbol(TimeUnit.DAYS), "d");
+        assertEquals(DurationSpec.getSymbol(TimeUnit.HOURS), "h");
+        assertEquals(DurationSpec.getSymbol(TimeUnit.MINUTES), "m");
+        assertEquals(DurationSpec.getSymbol(TimeUnit.SECONDS), "s");
+        assertEquals(DurationSpec.getSymbol(TimeUnit.MICROSECONDS), "us");
+        assertEquals(DurationSpec.getSymbol(TimeUnit.NANOSECONDS), "ns");
+    }
+
+    @Test
+    public void testInvalidInputs()
+    {
+        assertThatThrownBy(() -> new DurationSpec("10")).isInstanceOf(ConfigurationException.class)
+                                                        .hasMessageContaining("Invalid duration: 10");
+        assertThatThrownBy(() -> new DurationSpec("-10s")).isInstanceOf(ConfigurationException.class)
+                                                          .hasMessageContaining("Invalid duration: -10s");
+        assertThatThrownBy(() -> new DurationSpec("10xd")).isInstanceOf(ConfigurationException.class)
+                                                          .hasMessageContaining("Invalid duration: 10xd");
+        assertThatThrownBy(() -> new DurationSpec("0.333555555ms")).isInstanceOf(ConfigurationException.class)
+                                                                   .hasMessageContaining("Invalid duration: 0.333555555ms");
+    }
+
+    @Test
+    public void testEquals()
+    {
+        assertEquals(new DurationSpec("10s"), new DurationSpec("10s"));
+        assertEquals(new DurationSpec("10s"), new DurationSpec("10000ms"));
+        assertEquals(new DurationSpec("10000ms"), new DurationSpec("10s"));
+        assertEquals(DurationSpec.inMinutes(Long.MAX_VALUE), DurationSpec.inMinutes(Long.MAX_VALUE));
+        assertEquals(new DurationSpec("4h"), new DurationSpec("14400s"));
+        assertEquals(DurationSpec.inSecondsString("14400"), new DurationSpec("14400s"));
+        assertEquals(DurationSpec.inSecondsString("4h"), new DurationSpec("14400s"));
+        assertEquals(DurationSpec.inSecondsString("14400s"), new DurationSpec("14400s"));
+        assertEquals(DurationSpec.inHours(Long.MAX_VALUE),DurationSpec.inHours(Long.MAX_VALUE));
+        assertNotEquals(DurationSpec.inMinutes(Long.MAX_VALUE), DurationSpec.inMilliseconds(Long.MAX_VALUE));
+        assertNotEquals(new DurationSpec("0m"), new DurationSpec("10ms"));
+    }
+
+    @Test
+    public void thereAndBack()
+    {
+        Gen<TimeUnit> unitGen = SourceDSL.arbitrary().enumValues(TimeUnit.class);
+        Gen<Long> valueGen = SourceDSL.longs().between(0, Long.MAX_VALUE);
+        qt().forAll(valueGen, unitGen).check((value, unit) -> {
+            DurationSpec there = new DurationSpec(value, unit);
+            DurationSpec back = new DurationSpec(there.toString());
+            return there.equals(back);
+        });
+    }
+
+    @Test
+    public void testOverflowingDuringConversion()
+    {
+        // we are heavily dependent on the Java TimeUnit for our configuration of type duration. We want to be sure
+        // that any regression in handlining overflow will be caught quickly on our end
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807ns").toNanoseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807ns").toNanosecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807ms").toNanoseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807ms").toNanosecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807s").toNanoseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807s").toNanosecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807m").toNanoseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807m").toNanosecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807h").toNanoseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807h").toNanosecondsAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807ms").toMilliseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807ms").toMillisecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807s").toMilliseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807s").toMillisecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807m").toMilliseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807m").toMillisecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807h").toMilliseconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807h").toMillisecondsAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807s").toSeconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807s").toSecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807m").toSeconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807m").toSecondsAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807h").toSeconds());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807h").toSecondsAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807m").toMinutes());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807m").toMinutesAsInt());
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807h").toMinutes());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807h").toMinutesAsInt());
+
+        assertEquals(Long.MAX_VALUE, new DurationSpec("9223372036854775807h").toHours());
+        assertEquals(Integer.MAX_VALUE, new DurationSpec("9223372036854775807h").toHoursAsInt());
+    }
+}
\ No newline at end of file

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


[cassandra] 13/13: Remove old Duration class in favor of DurationSpec class patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 9f56bf4ca7fdb61ad09e5f2ad09b87cd01e0716b
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Sat Feb 5 17:51:32 2022 -0500

    Remove old Duration class in favor of DurationSpec class
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                |  20 +-
 src/java/org/apache/cassandra/config/Duration.java | 276 ---------------------
 .../org/apache/cassandra/db/ColumnFamilyStore.java |   9 +-
 src/java/org/apache/cassandra/db/Keyspace.java     |   4 +-
 .../apache/cassandra/service/StorageService.java   |   8 +-
 .../service/snapshot/SnapshotManifest.java         |   4 +-
 .../apache/cassandra/tools/nodetool/Snapshot.java  |   4 +-
 .../org/apache/cassandra/config/DurationTest.java  |  60 -----
 .../org/apache/cassandra/db/DirectoriesTest.java   |   7 +-
 .../service/snapshot/SnapshotManifestTest.java     |   4 +-
 10 files changed, 30 insertions(+), 366 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 7e39097..71fb562 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -441,7 +441,7 @@ counter_cache_save_period: 7200s
 # saved_caches_directory: /var/lib/cassandra/saved_caches
 
 # Number of seconds the server will wait for each cache (row, key, etc ...) to load while starting
-# the Cassandra process. Setting this to a negative value is equivalent to disabling all cache loading on startup
+# the Cassandra process. Setting this to zero is equivalent to disabling all cache loading on startup
 # while still having the cache during runtime.
 # cache_load_timeout: 30s
 
@@ -1467,15 +1467,15 @@ audit_logging_options:
 
 # default options for full query logging - these can be overridden from command line when executing
 # nodetool enablefullquerylog
-#full_query_logging_options:
-    # log_dir:
-    # roll_cycle: HOURLY
-    # block: true
-    # max_queue_weight: 268435456 # 256 MiB
-    # max_log_size: 17179869184 # 16 GiB
-    ## archive command is "/path/to/script.sh %path" where %path is replaced with the file being rolled:
-    # archive_command:
-    # max_archive_retries: 10
+# full_query_logging_options:
+  # log_dir:
+  # roll_cycle: HOURLY
+  # block: true
+  # max_queue_weight: 268435456 # 256 MiB
+  # max_log_size: 17179869184 # 16 GiB
+  ## archive command is "/path/to/script.sh %path" where %path is replaced with the file being rolled:
+  # archive_command:
+  # max_archive_retries: 10
 
 # validate tombstones on reads and compaction
 # can be either "disabled", "warn" or "exception"
diff --git a/src/java/org/apache/cassandra/config/Duration.java b/src/java/org/apache/cassandra/config/Duration.java
deleted file mode 100644
index 89de354..0000000
--- a/src/java/org/apache/cassandra/config/Duration.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.config;
-
-import java.util.Arrays;
-import java.util.Objects;
-import java.util.concurrent.TimeUnit;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-
-import com.google.common.primitives.Ints;
-
-/**
- * Represents a positive time duration.
- */
-public final class Duration
-{
-    /**
-     * The Regexp used to parse the duration provided as String.
-     */
-    private static final Pattern TIME_UNITS_PATTERN = Pattern.compile(("^(\\d+)([a-zA-Z]{1,2}|µs|µS)$"));
-    private static final Pattern DOUBLE_TIME_UNITS_PATTERN = Pattern.compile(("^(\\d+\\.\\d+)([a-zA-Z]{1,2}|µs|µS)$"));
-    
-    private final long quantity;
-
-    private final TimeUnit unit;
-
-
-    public Duration(String value)
-    {
-        if (value == null || value.equals("null"))
-        {
-            quantity = 0;
-            unit = TimeUnit.MILLISECONDS;
-            return;
-        }
-
-        //parse the string field value
-        Matcher matcher = TIME_UNITS_PATTERN.matcher(value);
-        Matcher matcherDouble = DOUBLE_TIME_UNITS_PATTERN.matcher(value);
-
-        if(matcher.find())
-        {
-            quantity = Long.parseLong(matcher.group(1));
-            unit = fromSymbol(matcher.group(2));
-        }
-        else if(matcherDouble.find())
-        {
-            quantity =(long) Double.parseDouble(matcherDouble.group(1));
-            unit = fromSymbol(matcherDouble.group(2));
-        }
-        else {
-            throw new IllegalArgumentException("Invalid duration: " + value);
-        }
-    }
-
-    private Duration(long quantity, TimeUnit unit)
-    {
-        if (quantity < 0)
-            throw new IllegalArgumentException("Duration must be positive");
-
-        this.quantity = quantity;
-        this.unit = unit;
-    }
-
-    private Duration(double quantity, TimeUnit unit)
-    {
-        if (quantity < 0)
-            throw new IllegalArgumentException("Duration must be positive");
-
-        this.quantity = (long) quantity;
-        this.unit = unit;
-    }
-
-    /**
-     * Creates a {@code Duration} of the specified amount of milliseconds.
-     *
-     * @param milliseconds the amount of milliseconds
-     * @return a duration
-     */
-    public static Duration inMilliseconds(long milliseconds)
-    {
-        return new Duration(milliseconds, TimeUnit.MILLISECONDS);
-    }
-
-    public static Duration inDoubleMilliseconds(double milliseconds)
-    {
-        return new Duration(milliseconds, TimeUnit.MILLISECONDS);
-    }
-
-    /**
-     * Creates a {@code Duration} of the specified amount of seconds.
-     *
-     * @param seconds the amount of seconds
-     * @return a duration
-     */
-    public static Duration inSeconds(long seconds)
-    {
-        return new Duration(seconds, TimeUnit.SECONDS);
-    }
-
-    /**
-     * Creates a {@code Duration} of the specified amount of minutes.
-     *
-     * @param minutes the amount of minutes
-     * @return a duration
-     */
-    public static Duration inMinutes(long minutes)
-    {
-        return new Duration(minutes, TimeUnit.MINUTES);
-    }
-
-    /**
-     * Returns the time unit associated to the specified symbol
-     *
-     * @param symbol the time unit symbol
-     * @return the time unit associated to the specified symbol
-     */
-    private TimeUnit fromSymbol(String symbol)
-    {
-        switch (symbol.toLowerCase())
-        {
-            case "d": return TimeUnit.DAYS;
-            case "h": return TimeUnit.HOURS;
-            case "m": return TimeUnit.MINUTES;
-            case "s": return TimeUnit.SECONDS;
-            case "ms": return TimeUnit.MILLISECONDS;
-            case "us":
-            case "µs": return TimeUnit.MICROSECONDS;
-            case "ns": return TimeUnit.NANOSECONDS;
-        }
-        throw new IllegalArgumentException(String.format("Unsupported time unit: %s. Supported units are: %s",
-                                                         symbol, Arrays.stream(TimeUnit.values())
-                                                                       .map(Duration::getSymbol)
-                                                                       .collect(Collectors.joining(", "))));
-    }
-
-    /**
-     * Returns this duration in the specified time unit
-     *
-     * @param targetUnit the time unit
-     * @return this duration in the specified time unit
-     */
-    public long to(TimeUnit targetUnit)
-    {
-        return targetUnit.convert(quantity, unit);
-    }
-
-    /**
-     * Returns this duration in number of minutes
-     *
-     * @return this duration in number of minutes
-     */
-    public long toMinutes()
-    {
-        return unit.toMinutes(quantity);
-    }
-
-    /**
-     * Returns this duration in number of minutes as an {@code int}
-     *
-     * @return this duration in number of minutes or {@code Integer.MAX_VALUE} if the number of minutes is too large.
-     */
-    public int toMinutesAsInt()
-    {
-        return Ints.saturatedCast(toMinutes());
-    }
-
-    /**
-     * Returns this duration in number of seconds
-     *
-     * @return this duration in number of seconds
-     */
-    public long toSeconds()
-    {
-        return unit.toSeconds(quantity);
-    }
-
-    /**
-     * Returns this duration in number of seconds as an {@code int}
-     *
-     * @return this duration in number of seconds or {@code Integer.MAX_VALUE} if the number of seconds is too large.
-     */
-    public int toSecondsAsInt()
-    {
-        return Ints.saturatedCast(toSeconds());
-    }
-
-    /**
-     * Returns this duration in number of milliseconds
-     *
-     * @return this duration in number of milliseconds
-     */
-    public long toMilliseconds()
-    {
-        return unit.toMillis(quantity);
-    }
-
-    /**
-     * Returns this duration in number of milliseconds as an {@code int}
-     *
-     * @return this duration in number of milliseconds or {@code Integer.MAX_VALUE} if the number of milliseconds is too large.
-     */
-    public int toMillisecondsAsInt()
-    {
-        return Ints.saturatedCast(toMilliseconds());
-    }
-
-    @Override
-    public int hashCode()
-    {
-        // Milliseconds seems to be a reasonable tradeoff
-        return Objects.hash(unit.toMillis(quantity));
-    }
-
-    @Override
-    public boolean equals(Object obj)
-    {
-        if (this == obj)
-            return true;
-
-        if (!(obj instanceof Duration))
-            return false;
-
-        Duration other = (Duration) obj;
-        if (unit == other.unit)
-            return quantity == other.quantity;
-
-        // Due to overflows we can only guarantee that the 2 durations are equal if we get the same results
-        // doing the convertion in both directions.
-        return unit.convert(other.quantity, other.unit) == quantity && other.unit.convert(quantity, unit) == other.quantity;
-    }
-
-    @Override
-    public String toString()
-    {
-        return quantity + getSymbol(unit);
-    }
-
-    /**
-     * Returns the symbol associated to the specified unit
-     *
-     * @param unit the time unit
-     * @return the time unit symbol
-     */
-    private static String getSymbol(TimeUnit unit)
-    {
-        switch (unit)
-        {
-            case DAYS: return "d";
-            case HOURS: return "h";
-            case MINUTES: return "m";
-            case SECONDS: return "s";
-            case MILLISECONDS: return "ms";
-            case MICROSECONDS: return "us";
-            case NANOSECONDS: return "ns";
-        }
-        throw new AssertionError();
-    }
-}
\ No newline at end of file
diff --git a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index ce16ab6..aa2b165 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@ -52,7 +52,6 @@ import org.apache.cassandra.utils.concurrent.Future;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.config.Duration;
 import org.apache.cassandra.cache.*;
 import org.apache.cassandra.concurrent.*;
 import org.apache.cassandra.config.*;
@@ -1870,7 +1869,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
     /**
      * @param ephemeral If this flag is set to true, the snapshot will be cleaned during next startup
      */
-    public TableSnapshot snapshotWithoutFlush(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral, Duration ttl, RateLimiter rateLimiter, Instant creationTime)
+    public TableSnapshot snapshotWithoutFlush(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral, DurationSpec ttl, RateLimiter rateLimiter, Instant creationTime)
     {
         if (ephemeral && ttl != null)
         {
@@ -1900,7 +1899,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
         return createSnapshot(snapshotName, ephemeral, ttl, snapshottedSSTables, creationTime);
     }
 
-    protected TableSnapshot createSnapshot(String tag, boolean ephemeral, Duration ttl, Set<SSTableReader> sstables, Instant creationTime) {
+    protected TableSnapshot createSnapshot(String tag, boolean ephemeral, DurationSpec ttl, Set<SSTableReader> sstables, Instant creationTime) {
         Set<File> snapshotDirs = sstables.stream()
                                          .map(s -> Directories.getSnapshotDirectory(s.descriptor, tag).toAbsolute())
                                          .filter(dir -> !Directories.isSecondaryIndexFolder(dir)) // Remove secondary index subdirectory
@@ -2064,7 +2063,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
      * @param rateLimiter Rate limiter for hardlinks-per-second
      * @param creationTime time when this snapshot was taken
      */
-    public TableSnapshot snapshot(String snapshotName, boolean skipFlush, Duration ttl, RateLimiter rateLimiter, Instant creationTime)
+    public TableSnapshot snapshot(String snapshotName, boolean skipFlush, DurationSpec ttl, RateLimiter rateLimiter, Instant creationTime)
     {
         return snapshot(snapshotName, null, false, skipFlush, ttl, rateLimiter, creationTime);
     }
@@ -2086,7 +2085,7 @@ public class ColumnFamilyStore implements ColumnFamilyStoreMBean
      * @param rateLimiter Rate limiter for hardlinks-per-second
      * @param creationTime time when this snapshot was taken
      */
-    public TableSnapshot snapshot(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral, boolean skipFlush, Duration ttl, RateLimiter rateLimiter, Instant creationTime)
+    public TableSnapshot snapshot(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral, boolean skipFlush, DurationSpec ttl, RateLimiter rateLimiter, Instant creationTime)
     {
         if (!skipFlush)
         {
diff --git a/src/java/org/apache/cassandra/db/Keyspace.java b/src/java/org/apache/cassandra/db/Keyspace.java
index 459f926..606e7e8 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -39,9 +39,9 @@ import com.google.common.util.concurrent.RateLimiter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.cassandra.config.Duration;
 import org.apache.cassandra.concurrent.Stage;
 import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.config.DurationSpec;
 import org.apache.cassandra.db.lifecycle.SSTableSet;
 import org.apache.cassandra.db.partitions.PartitionUpdate;
 import org.apache.cassandra.db.repair.CassandraKeyspaceRepairManager;
@@ -214,7 +214,7 @@ public class Keyspace
      * @param rateLimiter Rate limiter for hardlinks-per-second
      * @throws IOException if the column family doesn't exist
      */
-    public void snapshot(String snapshotName, String columnFamilyName, boolean skipFlush, Duration ttl, RateLimiter rateLimiter, Instant creationTime) throws IOException
+    public void snapshot(String snapshotName, String columnFamilyName, boolean skipFlush, DurationSpec ttl, RateLimiter rateLimiter, Instant creationTime) throws IOException
     {
         assert snapshotName != null;
         boolean tookSnapShot = false;
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 3f956dd..e5ca6c8 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -72,8 +72,8 @@ import org.apache.cassandra.batchlog.BatchlogManager;
 import org.apache.cassandra.config.CassandraRelevantProperties;
 import org.apache.cassandra.config.Config;
 import org.apache.cassandra.config.DatabaseDescriptor;
-import org.apache.cassandra.config.Duration;
 import org.apache.cassandra.concurrent.*;
+import org.apache.cassandra.config.DurationSpec;
 import org.apache.cassandra.cql3.QueryProcessor;
 import org.apache.cassandra.db.*;
 import org.apache.cassandra.db.commitlog.CommitLog;
@@ -3847,7 +3847,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
     @Override
     public void takeSnapshot(String tag, Map<String, String> options, String... entities) throws IOException
     {
-        Duration ttl = options.containsKey("ttl") ? new Duration(options.get("ttl")) : null;
+        DurationSpec ttl = options.containsKey("ttl") ? new DurationSpec(options.get("ttl")) : null;
         if (ttl != null)
         {
             int minAllowedTtlSecs = CassandraRelevantProperties.SNAPSHOT_MIN_ALLOWED_TTL_SECONDS.getInt();
@@ -3925,7 +3925,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
      * @param skipFlush Skip blocking flush of memtable
      * @param keyspaceNames the names of the keyspaces to snapshot; empty means "all."
      */
-    private void takeSnapshot(String tag, boolean skipFlush, Duration ttl, String... keyspaceNames) throws IOException
+    private void takeSnapshot(String tag, boolean skipFlush, DurationSpec ttl, String... keyspaceNames) throws IOException
     {
         if (operationMode == Mode.JOINING)
             throw new IOException("Cannot snapshot until bootstrap completes");
@@ -3971,7 +3971,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
      * @param tableList
      *            list of tables from different keyspace in the form of ks1.cf1 ks2.cf2
      */
-    private void takeMultipleTableSnapshot(String tag, boolean skipFlush, Duration ttl, String... tableList)
+    private void takeMultipleTableSnapshot(String tag, boolean skipFlush, DurationSpec ttl, String... tableList)
             throws IOException
     {
         Map<Keyspace, List<String>> keyspaceColumnfamily = new HashMap<Keyspace, List<String>>();
diff --git a/src/java/org/apache/cassandra/service/snapshot/SnapshotManifest.java b/src/java/org/apache/cassandra/service/snapshot/SnapshotManifest.java
index e1bd4df..0a301fa 100644
--- a/src/java/org/apache/cassandra/service/snapshot/SnapshotManifest.java
+++ b/src/java/org/apache/cassandra/service/snapshot/SnapshotManifest.java
@@ -26,9 +26,9 @@ import java.util.Objects;
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.cassandra.config.Duration;
 import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 import com.fasterxml.jackson.databind.DeserializationFeature;
+import org.apache.cassandra.config.DurationSpec;
 import org.apache.cassandra.io.util.File;
 import org.apache.cassandra.io.util.FileInputStreamPlus;
 import org.apache.cassandra.io.util.FileOutputStreamPlus;
@@ -64,7 +64,7 @@ public class SnapshotManifest
         this.expiresAt = null;
     }
 
-    public SnapshotManifest(List<String> files, Duration ttl, Instant creationTime)
+    public SnapshotManifest(List<String> files, DurationSpec ttl, Instant creationTime)
     {
         this.files = files;
         this.createdAt = creationTime;
diff --git a/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java b/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java
index ef308f7..1d899d3 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/Snapshot.java
@@ -31,9 +31,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.cassandra.config.DurationSpec;
 import org.apache.cassandra.tools.NodeProbe;
 import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
-import org.apache.cassandra.config.Duration;
 
 @Command(name = "snapshot", description = "Take a snapshot of specified keyspaces or a snapshot of the specified table")
 public class Snapshot extends NodeToolCmd
@@ -69,7 +69,7 @@ public class Snapshot extends NodeToolCmd
             Map<String, String> options = new HashMap<String,String>();
             options.put("skipFlush", Boolean.toString(skipFlush));
             if (null != ttl) {
-                Duration d = new Duration(ttl);
+                DurationSpec d = new DurationSpec(ttl);
                 options.put("ttl", d.toString());
             }
 
diff --git a/test/unit/org/apache/cassandra/config/DurationTest.java b/test/unit/org/apache/cassandra/config/DurationTest.java
deleted file mode 100644
index c89792f..0000000
--- a/test/unit/org/apache/cassandra/config/DurationTest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cassandra.config;
-
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.junit.Assert.*;
-
-public class DurationTest
-{
-    @Test
-    public void testConversions()
-    {
-        assertEquals(10, new Duration("10s").toSeconds());
-        assertEquals(10000, new Duration("10s").toMilliseconds());
-        assertEquals(0, new Duration("10s").toMinutes());
-        assertEquals(10, new Duration("10m").toMinutes());
-        assertEquals(600000, new Duration("10m").toMilliseconds());
-        assertEquals(600, new Duration("10m").toSeconds());
-    }
-
-    @Test
-    public void testInvalidInputs()
-    {
-        assertThatThrownBy(() -> new Duration("10")).isInstanceOf(IllegalArgumentException.class)
-                                                    .hasMessageContaining("Invalid duration: 10");
-        assertThatThrownBy(() -> new Duration("-10s")).isInstanceOf(IllegalArgumentException.class)
-                                                      .hasMessageContaining("Invalid duration: -10s");
-        assertThatThrownBy(() -> new Duration("10xd")).isInstanceOf(IllegalArgumentException.class)
-                                                      .hasMessageContaining("Unsupported time unit: xd. Supported units are: ns, us, ms, s, m, h, d");
-    }
-
-    @Test
-    public void testEquals()
-    {
-        assertEquals(new Duration("10s"), new Duration("10s"));
-        assertEquals(new Duration("10s"), new Duration("10000ms"));
-        assertEquals(new Duration("10000ms"), new Duration("10s"));
-        assertEquals(Duration.inMinutes(Long.MAX_VALUE), Duration.inMinutes(Long.MAX_VALUE));
-        assertNotEquals(Duration.inMinutes(Long.MAX_VALUE), Duration.inMilliseconds(Long.MAX_VALUE));
-        assertNotEquals(new Duration("0m"), new Duration("10ms"));
-    }
-
-}
diff --git a/test/unit/org/apache/cassandra/db/DirectoriesTest.java b/test/unit/org/apache/cassandra/db/DirectoriesTest.java
index 5988c04..d21c06c 100644
--- a/test/unit/org/apache/cassandra/db/DirectoriesTest.java
+++ b/test/unit/org/apache/cassandra/db/DirectoriesTest.java
@@ -27,6 +27,8 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 
 import com.google.common.collect.Sets;
+
+import org.apache.cassandra.config.DurationSpec;
 import org.apache.cassandra.io.util.File;
 import org.apache.cassandra.io.util.FileOutputStreamPlus;
 import org.apache.commons.lang3.StringUtils;
@@ -36,7 +38,6 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import org.apache.cassandra.config.Duration;
 import org.apache.cassandra.cql3.ColumnIdentifier;
 import org.apache.cassandra.schema.Indexes;
 import org.apache.cassandra.schema.SchemaConstants;
@@ -186,7 +187,7 @@ public class DirectoriesTest
         if (createManifest)
         {
             File manifestFile = Directories.getSnapshotManifestFile(snapshotDir);
-            manifest = new SnapshotManifest(Collections.singletonList(sstableDesc.filenameFor(Component.DATA)), new Duration("1m"), Instant.now());
+            manifest = new SnapshotManifest(Collections.singletonList(sstableDesc.filenameFor(Component.DATA)), new DurationSpec("1m"), Instant.now());
             manifest.serializeToJsonFile(manifestFile);
         }
 
@@ -311,7 +312,7 @@ public class DirectoriesTest
 
             File manifestFile = directories.getSnapshotManifestFile(tag);
 
-            SnapshotManifest manifest = new SnapshotManifest(files, new Duration("1m"), Instant.now());
+            SnapshotManifest manifest = new SnapshotManifest(files, new DurationSpec("1m"), Instant.now());
             manifest.serializeToJsonFile(manifestFile);
 
             Set<File> dirs = new HashSet<>();
diff --git a/test/unit/org/apache/cassandra/service/snapshot/SnapshotManifestTest.java b/test/unit/org/apache/cassandra/service/snapshot/SnapshotManifestTest.java
index 41cb1e7..4239d50 100644
--- a/test/unit/org/apache/cassandra/service/snapshot/SnapshotManifestTest.java
+++ b/test/unit/org/apache/cassandra/service/snapshot/SnapshotManifestTest.java
@@ -33,8 +33,8 @@ import static org.apache.cassandra.utils.Clock.Global.currentTimeMillis;
 import static org.assertj.core.api.Assertions.assertThatIOException;
 import static org.assertj.core.api.Assertions.assertThat;
 
-import org.apache.cassandra.config.Duration;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.cassandra.config.DurationSpec;
 import org.apache.cassandra.io.util.File;
 import org.apache.cassandra.io.util.FileOutputStreamPlus;
 
@@ -108,7 +108,7 @@ public class SnapshotManifestTest
 
     @Test
     public void testSerializeAndDeserialize() throws Exception {
-        SnapshotManifest manifest = new SnapshotManifest(Arrays.asList("db1", "db2", "db3"), new Duration("2m"), Instant.ofEpochMilli(currentTimeMillis()));
+        SnapshotManifest manifest = new SnapshotManifest(Arrays.asList("db1", "db2", "db3"), new DurationSpec("2m"), Instant.ofEpochMilli(currentTimeMillis()));
         File manifestFile = new File(tempFolder.newFile("manifest.json"));
 
         manifest.serializeToJsonFile(manifestFile);

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


[cassandra] 03/13: DataRate parameters transition to the new framework Fix the DB descriptorRefTest which failed on the previous commit patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 5bb4bab12f8edfef95ed13cbabf8c0f377986065
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Mon Jan 31 21:51:49 2022 -0500

    DataRate parameters transition to the new framework
    Fix the DB descriptorRefTest which failed on the previous commit
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 .build/build-rat.xml                               |  2 +-
 conf/cassandra.yaml                                | 24 +++---
 src/java/org/apache/cassandra/config/Config.java   | 13 +--
 .../org/apache/cassandra/config/Converters.java    |  4 +-
 .../org/apache/cassandra/config/DataRateSpec.java  |  2 +
 .../cassandra/config/DatabaseDescriptor.java       | 57 ++++++++++----
 .../cassandra/db/compaction/CompactionManager.java | 10 +--
 .../apache/cassandra/service/StorageService.java   | 61 ++++++++++----
 .../cassandra/service/StorageServiceMBean.java     | 17 +++-
 .../apache/cassandra/streaming/StreamManager.java  | 36 ++++-----
 .../streaming/StreamingDataOutputPlus.java         |  2 +-
 .../org/apache/cassandra/tools/LoaderOptions.java  | 12 +--
 src/java/org/apache/cassandra/tools/NodeProbe.java | 16 ++--
 .../tools/nodetool/GetCompactionThroughput.java    |  4 +-
 .../tools/nodetool/GetInterDCStreamThroughput.java |  6 +-
 .../tools/nodetool/GetStreamThroughput.java        |  6 +-
 .../tools/nodetool/SetCompactionThroughput.java    |  4 +-
 .../tools/nodetool/SetInterDCStreamThroughput.java |  4 +-
 .../tools/nodetool/SetStreamThroughput.java        |  4 +-
 test/conf/cassandra-murmur.yaml                    |  2 +-
 ...ed_parameters_names.yaml => cassandra-old.yaml} |  2 +-
 test/conf/cassandra-seeds.yaml                     |  2 +-
 ...dra-sslcontextfactory-invalidconfiguration.yaml |  4 +-
 test/conf/cassandra-sslcontextfactory.yaml         |  4 +-
 test/conf/cassandra.yaml                           |  4 +-
 test/conf/unit-test-conf/test-native-port.yaml     |  2 +-
 .../test/AbstractNetstatsBootstrapStreaming.java   |  8 +-
 ...WithEntireSSTablesCompressionStreamingTest.java |  2 +-
 .../test/NetstatsRepairStreamingTest.java          |  4 +-
 .../cassandra/streaming/LongStreamingTest.java     | 20 ++---
 .../microbench/ZeroCopyStreamingBenchmark.java     |  2 +-
 .../config/DatabaseDescriptorRefTest.java          | 14 +++-
 .../LoadOldYAMLBackwardCompatibilityTest.java      | 89 ++++++++++++++++++++-
 .../miscellaneous/CrcCheckChanceTest.java          |  2 +-
 .../net/AsyncStreamingOutputPlusTest.java          |  8 +-
 .../cassandra/streaming/StreamManagerTest.java     | 92 ++++++++++------------
 .../cassandra/streaming/StreamRateLimiterTest.java | 32 ++++----
 ...st.java => SetGetCompactionThroughputTest.java} | 41 ++++------
 ...etEntireSSTableInterDCStreamThroughputTest.java | 12 +--
 .../SetGetEntireSSTableStreamThroughputTest.java   | 12 +--
 .../SetGetInterDCStreamThroughputTest.java         | 26 +++---
 .../tools/nodetool/SetGetStreamThroughputTest.java | 26 +++---
 42 files changed, 422 insertions(+), 272 deletions(-)

diff --git a/.build/build-rat.xml b/.build/build-rat.xml
index a1a17cd..599d5ea 100644
--- a/.build/build-rat.xml
+++ b/.build/build-rat.xml
@@ -55,7 +55,7 @@
                  <exclude name="**/cassandra-seeds.yaml"/>
                  <exclude NAME="**/doc/antora.yml"/>
                  <exclude name="**/test/conf/cassandra.yaml"/>
-                 <exclude name="**/test/conf/cassandra_deprecated_parameters_names.yaml"/>
+                 <exclude name="**/test/conf/cassandra-old.yaml"/>
                  <exclude name="**/test/conf/cassandra_encryption.yaml"/>
                  <exclude name="**/test/conf/cdc.yaml"/>
                  <exclude name="**/test/conf/commitlog_compression_LZ4.yaml"/>
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index a18a5b0..8741b9b 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -896,7 +896,7 @@ column_index_cache_size_in_kb: 2
 # during a single long running compactions. The default is usually
 # fine and if you experience problems with compaction running too
 # slowly or too fast, you should look at
-# compaction_throughput_mb_per_sec first.
+# compaction_throughput first.
 #
 # concurrent_compactors defaults to the smaller of (number of disks,
 # number of cores), with a minimum of 2 and a maximum of 8.
@@ -924,7 +924,7 @@ concurrent_materialized_view_builders: 1
 # Setting this to 0 disables throttling. Note that this accounts for all types
 # of compaction, including validation compaction (building Merkle trees
 # for repairs).
-compaction_throughput_mb_per_sec: 64
+compaction_throughput: 64MiB/s
 
 # When compacting, the replacement sstable(s) can be opened before they
 # are completely written, and used in place of the prior sstables for
@@ -935,8 +935,8 @@ sstable_preemptive_open_interval_in_mb: 50
 # When enabled, permits Cassandra to zero-copy stream entire eligible
 # SSTables between nodes, including every component.
 # This speeds up the network transfer significantly subject to
-# throttling specified by entire_sstable_stream_throughput_outbound_megabits_per_sec,
-# and entire_sstable_inter_dc_stream_throughput_outbound_megabits_per_sec
+# throttling specified by entire_sstable_stream_throughput_outbound,
+# and entire_sstable_inter_dc_stream_throughput_outbound
 # for inter-DC transfers.
 # Enabling this will reduce the GC pressure on sending and receiving node.
 # When unset, the default is enabled. While this feature tries to keep the
@@ -947,27 +947,27 @@ sstable_preemptive_open_interval_in_mb: 50
 # Throttles entire SSTable outbound streaming file transfers on
 # this node to the given total throughput in Mbps.
 # Setting this value to 0 it disables throttling.
-# When unset, the default is 200 Mbps or 25 MB/s.
-# entire_sstable_stream_throughput_outbound_megabits_per_sec: 200
+# When unset, the default is 200 Mbps or 24 MiB/s.
+# entire_sstable_stream_throughput_outbound: 24MiB/s
 
 # Throttles entire SSTable file streaming between datacenters.
 # Setting this value to 0 disables throttling for entire SSTable inter-DC file streaming.
-# When unset, the default is 200 Mbps or 25 MB/s.
-# entire_sstable_inter_dc_stream_throughput_outbound_megabits_per_sec: 200
+# When unset, the default is 200 Mbps or 24 MiB/s.
+# entire_sstable_inter_dc_stream_throughput_outbound: 24MiB/s
 
 # Throttles all outbound streaming file transfers on this node to the
 # given total throughput in Mbps. This is necessary because Cassandra does
 # mostly sequential IO when streaming data during bootstrap or repair, which
 # can lead to saturating the network connection and degrading rpc performance.
-# When unset, the default is 200 Mbps or 25 MB/s.
-# stream_throughput_outbound_megabits_per_sec: 200
+# When unset, the default is 200 Mbps or 24 MiB/s.
+# stream_throughput_outbound: 24MiB/s
 
 # Throttles all streaming file transfer between the datacenters,
 # this setting allows users to throttle inter dc stream throughput in addition
 # to throttling all network stream traffic as configured with
 # stream_throughput_outbound_megabits_per_sec
-# When unset, the default is 200 Mbps or 25 MB/s.
-# inter_dc_stream_throughput_outbound_megabits_per_sec: 200
+# When unset, the default is 200 Mbps or 24 MiB/s.
+# inter_dc_stream_throughput_outbound: 24MiB/s
 
 # Server side timeouts for requests. The server will return a timeout exception
 # to the client if it can't complete an operation within the corresponding
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 25f015a..4f6e27e 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -229,7 +229,8 @@ public class Config
     public volatile int batch_size_fail_threshold_in_kb = 50;
     public Integer unlogged_batch_across_partitions_warn_threshold = 10;
     public volatile Integer concurrent_compactors;
-    public volatile int compaction_throughput_mb_per_sec = 16;
+    @Replaces(oldName = "compaction_throughput_mb_per_sec", converter = Converters.MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
+    public volatile DataRateSpec compaction_throughput = new DataRateSpec("16MiB/s");
     public volatile int compaction_large_partition_warning_threshold_mb = 100;
     public int min_free_space_per_drive_in_mb = 50;
     public volatile Integer compaction_tombstone_warning_threshold = 100000;
@@ -243,11 +244,13 @@ public class Config
     @Deprecated
     public int max_streaming_retries = 3;
 
-    public volatile int stream_throughput_outbound_megabits_per_sec = 200;
-    public volatile int inter_dc_stream_throughput_outbound_megabits_per_sec = 200;
+    @Replaces(oldName = "stream_throughput_outbound_megabits_per_sec", converter = Converters.MEGABITS_TO_MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
+    public volatile DataRateSpec stream_throughput_outbound = new DataRateSpec("24MiB/s");
+    @Replaces(oldName = "inter_dc_stream_throughput_outbound_megabits_per_sec", converter = Converters.MEGABITS_TO_MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
+    public volatile DataRateSpec inter_dc_stream_throughput_outbound = new DataRateSpec("24MiB/s");
 
-    public volatile int entire_sstable_stream_throughput_outbound_megabits_per_sec = 200;
-    public volatile int entire_sstable_inter_dc_stream_throughput_outbound_megabits_per_sec = 200;
+    public volatile DataRateSpec entire_sstable_stream_throughput_outbound = new DataRateSpec("24MiB/s");
+    public volatile DataRateSpec entire_sstable_inter_dc_stream_throughput_outbound = new DataRateSpec("24MiB/s");
 
     public String[] data_file_directories = new String[0];
 
diff --git a/src/java/org/apache/cassandra/config/Converters.java b/src/java/org/apache/cassandra/config/Converters.java
index 9a832cc..629e3d3 100644
--- a/src/java/org/apache/cassandra/config/Converters.java
+++ b/src/java/org/apache/cassandra/config/Converters.java
@@ -65,14 +65,14 @@ public enum Converters
                       o -> ((DataStorageSpec)o).toBytes()),
     MEBIBYTES_PER_SECOND_DATA_RATE(Long.class,
                                    o -> DataRateSpec.inMebibytesPerSecond((Long) o),
-                                   o -> ((DataRateSpec)o).toMebibytesPerSecond()),
+                                   o -> ((DataRateSpec)o).toMebibytesPerSecondAsInt()),
     /**
      * This converter is a custom one to support backward compatibility for stream_throughput_outbound and
      * inter_dc_stream_throughput_outbound which were provided in megatibs per second prior CASSANDRA-15234.
      */
     MEGABITS_TO_MEBIBYTES_PER_SECOND_DATA_RATE(Long.class,
                                                o -> DataRateSpec.megabitsPerSecondInMebibytesPerSecond((Long)o),
-                                               o -> ((DataRateSpec)o).toMegabitsPerSecond());
+                                               o -> ((DataRateSpec)o).toMegabitsPerSecondAsInt());
 
     private final Class<?> inputType;
     private final Function<Object, Object> convert;
diff --git a/src/java/org/apache/cassandra/config/DataRateSpec.java b/src/java/org/apache/cassandra/config/DataRateSpec.java
index 3512513..bbdbecc 100644
--- a/src/java/org/apache/cassandra/config/DataRateSpec.java
+++ b/src/java/org/apache/cassandra/config/DataRateSpec.java
@@ -300,6 +300,8 @@ public final class DataRateSpec
 
             public double toMegabitsPerSecond(double d)
             {
+
+
                 if (d > MAX / (MEGABITS_PER_MEBIBYTE))
                     return MAX;
                 return Math.round(d * MEGABITS_PER_MEBIBYTE);
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 530482e..021b0c6 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -1841,14 +1841,19 @@ public class DatabaseDescriptor
         conf.concurrent_compactors = value;
     }
 
-    public static int getCompactionThroughputMbPerSec()
+    public static int getCompactionThroughputMebibytesPerSecAsInt()
     {
-        return conf.compaction_throughput_mb_per_sec;
+        return conf.compaction_throughput.toMebibytesPerSecondAsInt();
     }
 
-    public static void setCompactionThroughputMbPerSec(int value)
+    public static double getCompactionThroughputMebibytesPerSec()
     {
-        conf.compaction_throughput_mb_per_sec = value;
+        return conf.compaction_throughput.toMebibytesPerSecond();
+    }
+
+    public static void setCompactionThroughputMebibytesPerSec(int value)
+    {
+        conf.compaction_throughput = DataRateSpec.inMebibytesPerSecond(value);
     }
 
     public static long getCompactionLargePartitionWarningThreshold() { return ByteUnit.MEBI_BYTES.toBytes(conf.compaction_large_partition_warning_threshold_mb); }
@@ -1901,42 +1906,62 @@ public class DatabaseDescriptor
 
     public static int getStreamThroughputOutboundMegabitsPerSec()
     {
-        return conf.stream_throughput_outbound_megabits_per_sec;
+        return conf.stream_throughput_outbound.toMegabitsPerSecondAsInt();
+    }
+
+    public static double getStreamThroughputOutboundMebibytesPerSec()
+    {
+        return conf.stream_throughput_outbound.toMebibytesPerSecond();
     }
 
     public static void setStreamThroughputOutboundMegabitsPerSec(int value)
     {
-        conf.stream_throughput_outbound_megabits_per_sec = value;
+        conf.stream_throughput_outbound = DataRateSpec.megabitsPerSecondInMebibytesPerSecond(value);
     }
 
-    public static int getEntireSSTableStreamThroughputOutboundMegabitsPerSec()
+    public static int getEntireSSTableStreamThroughputOutboundMebibytesPerSecAsInt()
     {
-        return conf.entire_sstable_stream_throughput_outbound_megabits_per_sec;
+        return conf.entire_sstable_stream_throughput_outbound.toMebibytesPerSecondAsInt();
     }
 
-    public static void setEntireSSTableStreamThroughputOutboundMegabitsPerSec(int value)
+    public static double getEntireSSTableStreamThroughputOutboundMebibytesPerSec()
     {
-        conf.entire_sstable_stream_throughput_outbound_megabits_per_sec = value;
+        return conf.entire_sstable_stream_throughput_outbound.toMebibytesPerSecond();
+    }
+
+    public static void setEntireSSTableStreamThroughputOutboundMebibytesPerSec(int value)
+    {
+        conf.entire_sstable_stream_throughput_outbound = DataRateSpec.inMebibytesPerSecond(value);
     }
 
     public static int getInterDCStreamThroughputOutboundMegabitsPerSec()
     {
-        return conf.inter_dc_stream_throughput_outbound_megabits_per_sec;
+        return conf.inter_dc_stream_throughput_outbound.toMegabitsPerSecondAsInt();
+    }
+
+    public static double getInterDCStreamThroughputOutboundMebibytesPerSec()
+    {
+        return conf.inter_dc_stream_throughput_outbound.toMebibytesPerSecond();
     }
 
     public static void setInterDCStreamThroughputOutboundMegabitsPerSec(int value)
     {
-        conf.inter_dc_stream_throughput_outbound_megabits_per_sec = value;
+        conf.inter_dc_stream_throughput_outbound = DataRateSpec.megabitsPerSecondInMebibytesPerSecond(value);
+    }
+
+    public static double getEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSec()
+    {
+        return conf.entire_sstable_inter_dc_stream_throughput_outbound.toMebibytesPerSecond();
     }
 
-    public static int getEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec()
+    public static int getEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSecAsInt()
     {
-        return conf.entire_sstable_inter_dc_stream_throughput_outbound_megabits_per_sec;
+        return conf.entire_sstable_inter_dc_stream_throughput_outbound.toMebibytesPerSecondAsInt();
     }
 
-    public static void setEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec(int value)
+    public static void setEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSec(int value)
     {
-        conf.entire_sstable_inter_dc_stream_throughput_outbound_megabits_per_sec = value;
+        conf.entire_sstable_inter_dc_stream_throughput_outbound = DataRateSpec.inMebibytesPerSecond(value);
     }
 
     /**
diff --git a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
index f1e8af5..6b82321 100644
--- a/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
+++ b/src/java/org/apache/cassandra/db/compaction/CompactionManager.java
@@ -151,18 +151,18 @@ public class CompactionManager implements CompactionManagerMBean
      */
     public RateLimiter getRateLimiter()
     {
-        setRate(DatabaseDescriptor.getCompactionThroughputMbPerSec());
+        setRate(DatabaseDescriptor.getCompactionThroughputMebibytesPerSec());
         return compactionRateLimiter;
     }
 
     /**
-     * Sets the rate for the rate limiter. When compaction_throughput_mb_per_sec is 0 or node is bootstrapping,
+     * Sets the rate for the rate limiter. When compaction_throughput is 0 or node is bootstrapping,
      * this sets the rate to Double.MAX_VALUE bytes per second.
-     * @param throughPutMbPerSec throughput to set in mb per second
+     * @param throughPutMiBPerSec throughput to set in MiB/s
      */
-    public void setRate(final double throughPutMbPerSec)
+    public void setRate(final double throughPutMiBPerSec)
     {
-        double throughput = throughPutMbPerSec * 1024.0 * 1024.0;
+        double throughput = throughPutMiBPerSec * 1024.0 * 1024.0;
         // if throughput is set to 0, throttling is disabled
         if (throughput == 0 || StorageService.instance.isBootstrapMode())
             throughput = Double.MAX_VALUE;
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 4c0562a..9d6a295 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1497,67 +1497,96 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
         return DatabaseDescriptor.getTruncateRpcTimeout(MILLISECONDS);
     }
 
+    @Deprecated
     public void setStreamThroughputMbPerSec(int value)
     {
+        setStreamThroughputMbitPerSec(value);
+    }
+
+    public void setStreamThroughputMbitPerSec(int value)
+    {
         int oldValue = DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec();
         DatabaseDescriptor.setStreamThroughputOutboundMegabitsPerSec(value);
         StreamManager.StreamRateLimiter.updateThroughput();
-        logger.info("setstreamthroughput: throttle set to {}{} Mb/s (was {} Mb/s)", value, value <= 0 ? " (unlimited)" : "", oldValue);
+        logger.info("setstreamthroughput: throttle set to {}{} megabits per second (was {} megabits per second)",
+                    value, value <= 0 ? " (unlimited)" : "", oldValue);
     }
 
+    @Deprecated
     public int getStreamThroughputMbPerSec()
     {
+        return getStreamThroughputMbitPerSec();
+    }
+
+    public int getStreamThroughputMbitPerSec()
+    {
         return DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec();
     }
 
-    public void setEntireSSTableStreamThroughputMbPerSec(int value)
+    public void setEntireSSTableStreamThroughputMebibytesPerSec(int value)
     {
-        int oldValue = DatabaseDescriptor.getEntireSSTableStreamThroughputOutboundMegabitsPerSec();
-        DatabaseDescriptor.setEntireSSTableStreamThroughputOutboundMegabitsPerSec(value);
+        int oldValue = DatabaseDescriptor.getEntireSSTableStreamThroughputOutboundMebibytesPerSecAsInt();
+        DatabaseDescriptor.setEntireSSTableStreamThroughputOutboundMebibytesPerSec(value);
         StreamManager.StreamRateLimiter.updateEntireSSTableThroughput();
-        logger.info("setstreamthroughput (entire SSTable): throttle set to {}{} Mb/s (was {} Mb/s)", value, value <= 0 ? " (unlimited)" : "", oldValue);
+        logger.info("setstreamthroughput (entire SSTable): throttle set to {}{} MiB/s (was {} MiB/s)",
+                    value, value <= 0 ? " (unlimited)" : "", oldValue);
     }
 
-    public int getEntireSSTableStreamThroughputMbPerSec()
+    public int getEntireSSTableStreamThroughputMebibytesPerSec()
     {
-        return DatabaseDescriptor.getEntireSSTableStreamThroughputOutboundMegabitsPerSec();
+        return DatabaseDescriptor.getEntireSSTableStreamThroughputOutboundMebibytesPerSecAsInt();
     }
 
+    @Deprecated
     public void setInterDCStreamThroughputMbPerSec(int value)
     {
+        setInterDCStreamThroughputMbitPerSec(value);
+    }
+
+    public void setInterDCStreamThroughputMbitPerSec(int value)
+    {
         int oldValue = DatabaseDescriptor.getInterDCStreamThroughputOutboundMegabitsPerSec();
         DatabaseDescriptor.setInterDCStreamThroughputOutboundMegabitsPerSec(value);
         StreamManager.StreamRateLimiter.updateInterDCThroughput();
-        logger.info("setinterdcstreamthroughput: throttle set to {}{} Mb/s (was {} Mb/s)", value, value <= 0 ? " (unlimited)" : "", oldValue);
+        logger.info("setinterdcstreamthroughput: throttle set to {}{} megabits per second (was {} megabits per second)", value, value <= 0 ? " (unlimited)" : "", oldValue);
     }
 
+    @Deprecated
     public int getInterDCStreamThroughputMbPerSec()
     {
+        return getInterDCStreamThroughputMbitPerSec();
+    }
+
+    public int getInterDCStreamThroughputMbitPerSec()
+    {
         return DatabaseDescriptor.getInterDCStreamThroughputOutboundMegabitsPerSec();
     }
 
-    public void setEntireSSTableInterDCStreamThroughputMbPerSec(int value)
+    public void setEntireSSTableInterDCStreamThroughputMebibytesPerSec(int value)
     {
-        int oldValue = DatabaseDescriptor.getEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec();
-        DatabaseDescriptor.setEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec(value);
+        int oldValue = DatabaseDescriptor.getEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSecAsInt();
+        DatabaseDescriptor.setEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSec(value);
         StreamManager.StreamRateLimiter.updateEntireSSTableInterDCThroughput();
-        logger.info("setinterdcstreamthroughput (entire SSTable): throttle set to {}{} Mb/s (was {} Mb/s)", value, value <= 0 ? " (unlimited)" : "", oldValue);
+        logger.info("setinterdcstreamthroughput (entire SSTable): throttle set to {}{} MiB/s (was {} MiB/s)", value, value <= 0 ? " (unlimited)" : "", oldValue);
     }
 
-    public int getEntireSSTableInterDCStreamThroughputMbPerSec()
+    public int getEntireSSTableInterDCStreamThroughputMebibytesPerSec()
     {
-        return DatabaseDescriptor.getEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec();
+        return DatabaseDescriptor.getEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSecAsInt();
     }
 
     public int getCompactionThroughputMbPerSec()
     {
-        return DatabaseDescriptor.getCompactionThroughputMbPerSec();
+        return DatabaseDescriptor.getCompactionThroughputMebibytesPerSecAsInt();
     }
 
     public void setCompactionThroughputMbPerSec(int value)
     {
-        DatabaseDescriptor.setCompactionThroughputMbPerSec(value);
+        int oldValue = DatabaseDescriptor.getCompactionThroughputMebibytesPerSecAsInt();
+        DatabaseDescriptor.setCompactionThroughputMebibytesPerSec(value);
         CompactionManager.instance.setRate(value);
+        logger.info("compactionthroughput: throttle set to {} mebibytes per second (was {} mebibytes per second)",
+                    value, oldValue);
     }
 
     public int getBatchlogReplayThrottleInKB()
diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
index 0f3ac51..8e386ec 100644
--- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
@@ -618,17 +618,26 @@ public interface StorageServiceMBean extends NotificationEmitter
     public void setTruncateRpcTimeout(long value);
     public long getTruncateRpcTimeout();
 
+    public void setStreamThroughputMbitPerSec(int value);
+    public int getStreamThroughputMbitPerSec();
+
+    @Deprecated
     public void setStreamThroughputMbPerSec(int value);
+    @Deprecated
     public int getStreamThroughputMbPerSec();
 
+    public void setInterDCStreamThroughputMbitPerSec(int value);
+    public int getInterDCStreamThroughputMbitPerSec();
+    @Deprecated
     public void setInterDCStreamThroughputMbPerSec(int value);
+    @Deprecated
     public int getInterDCStreamThroughputMbPerSec();
 
-    public void setEntireSSTableStreamThroughputMbPerSec(int value);
-    public int getEntireSSTableStreamThroughputMbPerSec();
+    public void setEntireSSTableStreamThroughputMebibytesPerSec(int value);
+    public int getEntireSSTableStreamThroughputMebibytesPerSec();
 
-    public void setEntireSSTableInterDCStreamThroughputMbPerSec(int value);
-    public int getEntireSSTableInterDCStreamThroughputMbPerSec();
+    public void setEntireSSTableInterDCStreamThroughputMebibytesPerSec(int value);
+    public int getEntireSSTableInterDCStreamThroughputMebibytesPerSec();
 
     public int getCompactionThroughputMbPerSec();
     public void setCompactionThroughputMbPerSec(int value);
diff --git a/src/java/org/apache/cassandra/streaming/StreamManager.java b/src/java/org/apache/cassandra/streaming/StreamManager.java
index 59f8821..bec112b 100644
--- a/src/java/org/apache/cassandra/streaming/StreamManager.java
+++ b/src/java/org/apache/cassandra/streaming/StreamManager.java
@@ -41,7 +41,7 @@ import org.apache.cassandra.streaming.management.StreamStateCompositeData;
 /**
  * StreamManager manages currently running {@link StreamResultFuture}s and provides status of all operation invoked.
  *
- * All stream operation should be created through this class to track streaming status and progress.
+ * All stream operations should be created through this class to track streaming status and progress.
  */
 public class StreamManager implements StreamManagerMBean
 {
@@ -49,7 +49,7 @@ public class StreamManager implements StreamManagerMBean
 
     /**
      * Gets streaming rate limiter.
-     * When stream_throughput_outbound_megabits_per_sec is 0, this returns rate limiter
+     * When stream_throughput_outbound is 0, this returns rate limiter
      * with the rate of Double.MAX_VALUE bytes per second.
      * Rate unit is bytes per sec.
      *
@@ -60,13 +60,13 @@ public class StreamManager implements StreamManagerMBean
         return new StreamRateLimiter(peer,
                                      StreamRateLimiter.LIMITER,
                                      StreamRateLimiter.INTER_DC_LIMITER,
-                                     DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec(),
-                                     DatabaseDescriptor.getInterDCStreamThroughputOutboundMegabitsPerSec());
+                                     DatabaseDescriptor.getStreamThroughputOutboundMebibytesPerSec(),
+                                     DatabaseDescriptor.getInterDCStreamThroughputOutboundMebibytesPerSec());
     }
 
     /**
      * Get streaming rate limiter for entire SSTable operations.
-     * When {@code entire_sstable_stream_throughput_outbound_megabits_per_sec}
+     * When {@code entire_sstable_stream_throughput_outbound}
      * is less than or equal ot {@code 0}, this returns rate limiter with the
      * rate of {@link Double.MAX_VALUE} bytes per second.
      * Rate unit is bytes per sec.
@@ -79,13 +79,13 @@ public class StreamManager implements StreamManagerMBean
         return new StreamRateLimiter(peer,
                                      StreamRateLimiter.ENTIRE_SSTABLE_LIMITER,
                                      StreamRateLimiter.ENTIRE_SSTABLE_INTER_DC_LIMITER,
-                                     DatabaseDescriptor.getEntireSSTableStreamThroughputOutboundMegabitsPerSec(),
-                                     DatabaseDescriptor.getEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec());
+                                     DatabaseDescriptor.getEntireSSTableStreamThroughputOutboundMebibytesPerSec(),
+                                     DatabaseDescriptor.getEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSec());
     }
 
     public static class StreamRateLimiter implements StreamingDataOutputPlus.RateLimiter
     {
-        public static final double BYTES_PER_MEGABIT = (1000 * 1000) / 8.0;
+        public static final double BYTES_PER_MEBIBYTE = 1024.0 * 1024.0;
         private static final RateLimiter LIMITER = RateLimiter.create(calculateRateInBytes());
         private static final RateLimiter INTER_DC_LIMITER = RateLimiter.create(calculateInterDCRateInBytes());
         private static final RateLimiter ENTIRE_SSTABLE_LIMITER = RateLimiter.create(calculateEntireSSTableRateInBytes());
@@ -94,10 +94,10 @@ public class StreamManager implements StreamManagerMBean
         private final RateLimiter limiter;
         private final RateLimiter interDCLimiter;
         private final boolean isLocalDC;
-        private final int throughput;
-        private final int interDCThroughput;
+        private final double throughput;
+        private final double interDCThroughput;
 
-        private StreamRateLimiter(InetAddressAndPort peer, RateLimiter limiter, RateLimiter interDCLimiter, int throughput, int interDCThroughput)
+        private StreamRateLimiter(InetAddressAndPort peer, RateLimiter limiter, RateLimiter interDCLimiter, double throughput, double interDCThroughput)
         {
             this.limiter = limiter;
             this.interDCLimiter = interDCLimiter;
@@ -148,25 +148,25 @@ public class StreamManager implements StreamManagerMBean
 
         private static double calculateRateInBytes()
         {
-            int throughput = DatabaseDescriptor.getStreamThroughputOutboundMegabitsPerSec();
+            double throughput = DatabaseDescriptor.getStreamThroughputOutboundMebibytesPerSec();
             return calculateEffectiveRateInBytes(throughput);
         }
 
         private static double calculateInterDCRateInBytes()
         {
-            int throughput = DatabaseDescriptor.getInterDCStreamThroughputOutboundMegabitsPerSec();
+            double throughput = DatabaseDescriptor.getInterDCStreamThroughputOutboundMebibytesPerSec();
             return calculateEffectiveRateInBytes(throughput);
         }
 
         private static double calculateEntireSSTableRateInBytes()
         {
-            int throughput = DatabaseDescriptor.getEntireSSTableStreamThroughputOutboundMegabitsPerSec();
+            double throughput = DatabaseDescriptor.getEntireSSTableStreamThroughputOutboundMebibytesPerSec();
             return calculateEffectiveRateInBytes(throughput);
         }
 
         private static double calculateEntireSSTableInterDCRateInBytes()
         {
-            int throughput = DatabaseDescriptor.getEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec();
+            double throughput = DatabaseDescriptor.getEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSec();
             return calculateEffectiveRateInBytes(throughput);
         }
 
@@ -194,11 +194,11 @@ public class StreamManager implements StreamManagerMBean
             return ENTIRE_SSTABLE_INTER_DC_LIMITER.getRate();
         }
 
-        private static double calculateEffectiveRateInBytes(int throughput)
+        private static double calculateEffectiveRateInBytes(double throughput)
         {
-            // if throughput is set to 0 or negative value, throttling is disabled
+            // if throughput is set to 0, throttling is disabled
             return throughput > 0
-                   ? throughput * BYTES_PER_MEGABIT
+                   ? throughput * BYTES_PER_MEBIBYTE
                    : Double.MAX_VALUE;
         }
     }
diff --git a/src/java/org/apache/cassandra/streaming/StreamingDataOutputPlus.java b/src/java/org/apache/cassandra/streaming/StreamingDataOutputPlus.java
index ab147c6..d845497 100644
--- a/src/java/org/apache/cassandra/streaming/StreamingDataOutputPlus.java
+++ b/src/java/org/apache/cassandra/streaming/StreamingDataOutputPlus.java
@@ -74,7 +74,7 @@ public interface StreamingDataOutputPlus extends DataOutputPlus, Closeable
     /**
      * Writes all data in file channel to stream: <br>
      * * For zero-copy-streaming, 1MiB at a time, with at most 2MiB in flight at once. <br>
-     * * For streaming with SSL, 64kb at a time, with at most 32+64kb (default low water mark + batch size) in flight. <br>
+     * * For streaming with SSL, 64KiB at a time, with at most 32+64KiB (default low water mark + batch size) in flight. <br>
      * <p>
      * This method takes ownership of the provided {@link FileChannel}.
      * <p>
diff --git a/src/java/org/apache/cassandra/tools/LoaderOptions.java b/src/java/org/apache/cassandra/tools/LoaderOptions.java
index 5334eab..bd680b6 100644
--- a/src/java/org/apache/cassandra/tools/LoaderOptions.java
+++ b/src/java/org/apache/cassandra/tools/LoaderOptions.java
@@ -402,10 +402,10 @@ public class LoaderOptions
                 {
                     config = new Config();
                     // unthrottle stream by default
-                    config.stream_throughput_outbound_megabits_per_sec = 0;
-                    config.inter_dc_stream_throughput_outbound_megabits_per_sec = 0;
-                    config.entire_sstable_stream_throughput_outbound_megabits_per_sec = 0;
-                    config.entire_sstable_inter_dc_stream_throughput_outbound_megabits_per_sec = 0;
+                    config.stream_throughput_outbound = DataRateSpec.inMebibytesPerSecond(0);
+                    config.inter_dc_stream_throughput_outbound = DataRateSpec.inMebibytesPerSecond(0);
+                    config.entire_sstable_stream_throughput_outbound = DataRateSpec.inMebibytesPerSecond(0);
+                    config.entire_sstable_inter_dc_stream_throughput_outbound = DataRateSpec.inMebibytesPerSecond(0);
                 }
 
 
@@ -460,7 +460,7 @@ public class LoaderOptions
                     sslStoragePort = Integer.parseInt(cmd.getOptionValue(SSL_STORAGE_PORT_OPTION));
                 else
                     sslStoragePort = config.ssl_storage_port;
-                throttle = config.stream_throughput_outbound_megabits_per_sec;
+                throttle = config.stream_throughput_outbound.toMebibytesPerSecondAsInt();
                 // Copy the encryption options and apply the config so that argument parsing can accesss isEnabled.
                 clientEncOptions = config.client_encryption_options.applyConfig();
                 serverEncOptions = config.server_encryption_options;
@@ -675,7 +675,7 @@ public class LoaderOptions
                 "you will need to have the files Standard1-g-1-Data.db and Standard1-g-1-Index.db into a directory /path/to/Keyspace1/Standard1/.";
         String footer = System.lineSeparator() +
                 "You can provide cassandra.yaml file with -f command line option to set up streaming throughput, client and server encryption options. " +
-                "Only stream_throughput_outbound_megabits_per_sec, server_encryption_options and client_encryption_options are read from yaml. " +
+                "Only stream_throughput_outbound, server_encryption_options and client_encryption_options are read from yaml. " +
                 "You can override options read from cassandra.yaml with corresponding command line options.";
         new HelpFormatter().printHelp(usage, header, options, footer);
     }
diff --git a/src/java/org/apache/cassandra/tools/NodeProbe.java b/src/java/org/apache/cassandra/tools/NodeProbe.java
index 73d2cbf..90f8bb3 100644
--- a/src/java/org/apache/cassandra/tools/NodeProbe.java
+++ b/src/java/org/apache/cassandra/tools/NodeProbe.java
@@ -1318,22 +1318,22 @@ public class NodeProbe implements AutoCloseable
 
     public int getStreamThroughput()
     {
-        return ssProxy.getStreamThroughputMbPerSec();
+        return ssProxy.getStreamThroughputMbitPerSec();
     }
 
     public int getInterDCStreamThroughput()
     {
-        return ssProxy.getInterDCStreamThroughputMbPerSec();
+        return ssProxy.getInterDCStreamThroughputMbitPerSec();
     }
 
     public int getEntireSSTableStreamThroughput()
     {
-        return ssProxy.getEntireSSTableStreamThroughputMbPerSec();
+        return ssProxy.getEntireSSTableStreamThroughputMebibytesPerSec();
     }
 
     public int getEntireSSTableInterDCStreamThroughput()
     {
-        return ssProxy.getEntireSSTableInterDCStreamThroughputMbPerSec();
+        return ssProxy.getEntireSSTableInterDCStreamThroughputMebibytesPerSec();
     }
 
     public double getTraceProbability()
@@ -1431,22 +1431,22 @@ public class NodeProbe implements AutoCloseable
 
     public void setStreamThroughput(int value)
     {
-        ssProxy.setStreamThroughputMbPerSec(value);
+        ssProxy.setStreamThroughputMbitPerSec(value);
     }
 
     public void setInterDCStreamThroughput(int value)
     {
-        ssProxy.setInterDCStreamThroughputMbPerSec(value);
+        ssProxy.setInterDCStreamThroughputMbitPerSec(value);
     }
 
     public void setEntireSSTableStreamThroughput(int value)
     {
-        ssProxy.setEntireSSTableStreamThroughputMbPerSec(value);
+        ssProxy.setEntireSSTableStreamThroughputMebibytesPerSec(value);
     }
 
     public void setEntireSSTableInterDCStreamThroughput(int value)
     {
-        ssProxy.setEntireSSTableInterDCStreamThroughputMbPerSec(value);
+        ssProxy.setEntireSSTableInterDCStreamThroughputMebibytesPerSec(value);
     }
 
     public void setTraceProbability(double value)
diff --git a/src/java/org/apache/cassandra/tools/nodetool/GetCompactionThroughput.java b/src/java/org/apache/cassandra/tools/nodetool/GetCompactionThroughput.java
index 839c78d..79ccd2e 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/GetCompactionThroughput.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/GetCompactionThroughput.java
@@ -22,12 +22,12 @@ import io.airlift.airline.Command;
 import org.apache.cassandra.tools.NodeProbe;
 import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 
-@Command(name = "getcompactionthroughput", description = "Print the MB/s throughput cap for compaction in the system")
+@Command(name = "getcompactionthroughput", description = "Print the MiB/s throughput cap for compaction in the system")
 public class GetCompactionThroughput extends NodeToolCmd
 {
     @Override
     public void execute(NodeProbe probe)
     {
-        probe.output().out.println("Current compaction throughput: " + probe.getCompactionThroughput() + " MB/s");
+        probe.output().out.println("Current compaction throughput: " + probe.getCompactionThroughput() + " MiB/s");
     }
 }
diff --git a/src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java b/src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java
index 25abb3f..72e5dc1 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/GetInterDCStreamThroughput.java
@@ -22,7 +22,7 @@ import io.airlift.airline.Option;
 import org.apache.cassandra.tools.NodeProbe;
 import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 
-@Command(name = "getinterdcstreamthroughput", description = "Print the Mb/s throughput cap for inter-datacenter streaming and entire SSTable inter-datacenter streaming in the system")
+@Command(name = "getinterdcstreamthroughput", description = "Print the throughput cap for inter-datacenter streaming and entire SSTable inter-datacenter streaming in the system")
 public class GetInterDCStreamThroughput extends NodeToolCmd
 {
     @SuppressWarnings("UnusedDeclaration")
@@ -36,6 +36,8 @@ public class GetInterDCStreamThroughput extends NodeToolCmd
 
         probe.output().out.printf("Current %sinter-datacenter stream throughput: %s%n",
                                   entireSSTableThroughput ? "entire SSTable " : "",
-                                  throughput > 0 ? throughput + " Mb/s" : "unlimited");
+                                  throughput > 0 ? throughput +
+                                                   (entireSSTableThroughput ? " MiB/s" : " megabits per second")
+                                                 : "unlimited");
     }
 }
diff --git a/src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java b/src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java
index 4c849a9..b5b8cad 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/GetStreamThroughput.java
@@ -22,7 +22,7 @@ import io.airlift.airline.Option;
 import org.apache.cassandra.tools.NodeProbe;
 import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 
-@Command(name = "getstreamthroughput", description = "Print the Mb/s throughput cap for streaming and entire SSTable streaming in the system")
+@Command(name = "getstreamthroughput", description = "Print the throughput cap for streaming and entire SSTable streaming in the system")
 public class GetStreamThroughput extends NodeToolCmd
 {
     @SuppressWarnings("UnusedDeclaration")
@@ -36,6 +36,8 @@ public class GetStreamThroughput extends NodeToolCmd
 
         probe.output().out.printf("Current %sstream throughput: %s%n",
                                   entireSSTableThroughput ? "entire SSTable " : "",
-                                  throughput > 0 ? throughput + " Mb/s" : "unlimited");
+                                  throughput > 0 ? throughput +
+                                                   (entireSSTableThroughput ? " MiB/s" : " megabits per second")
+                                                 : "unlimited");
     }
 }
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SetCompactionThroughput.java b/src/java/org/apache/cassandra/tools/nodetool/SetCompactionThroughput.java
index 4d01f61..a75aa13 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/SetCompactionThroughput.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/SetCompactionThroughput.java
@@ -23,10 +23,10 @@ import io.airlift.airline.Command;
 import org.apache.cassandra.tools.NodeProbe;
 import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 
-@Command(name = "setcompactionthroughput", description = "Set the MB/s throughput cap for compaction in the system, or 0 to disable throttling")
+@Command(name = "setcompactionthroughput", description = "Set the MiB/s throughput cap for compaction in the system, or 0 to disable throttling")
 public class SetCompactionThroughput extends NodeToolCmd
 {
-    @Arguments(title = "compaction_throughput", usage = "<value_in_mb>", description = "Value in MB, 0 to disable throttling", required = true)
+    @Arguments(title = "compaction_throughput", usage = "<value_in_mb>", description = "Value in MiB, 0 to disable throttling", required = true)
     private Integer compactionThroughput = null;
 
     @Override
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SetInterDCStreamThroughput.java b/src/java/org/apache/cassandra/tools/nodetool/SetInterDCStreamThroughput.java
index f454c1b..6ef167e 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/SetInterDCStreamThroughput.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/SetInterDCStreamThroughput.java
@@ -23,11 +23,11 @@ import io.airlift.airline.Option;
 import org.apache.cassandra.tools.NodeProbe;
 import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 
-@Command(name = "setinterdcstreamthroughput", description = "Set the Mb/s throughput cap for inter-datacenter streaming and entire SSTable inter-datacenter streaming in the system, or 0 to disable throttling")
+@Command(name = "setinterdcstreamthroughput", description = "Set the throughput cap for inter-datacenter streaming and entire SSTable inter-datacenter streaming in the system, or 0 to disable throttling")
 public class SetInterDCStreamThroughput extends NodeToolCmd
 {
     @SuppressWarnings("UnusedDeclaration")
-    @Arguments(title = "inter_dc_stream_throughput", usage = "<value_in_mb>", description = "Value in Mb, 0 to disable throttling", required = true)
+    @Arguments(title = "inter_dc_stream_throughput", usage = "<value_in_mb>", description = "Value in megabits, 0 to disable throttling", required = true)
     private int interDCStreamThroughput;
 
     @SuppressWarnings("UnusedDeclaration")
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SetStreamThroughput.java b/src/java/org/apache/cassandra/tools/nodetool/SetStreamThroughput.java
index 5c96a07..e618c78 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/SetStreamThroughput.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/SetStreamThroughput.java
@@ -23,11 +23,11 @@ import io.airlift.airline.Option;
 import org.apache.cassandra.tools.NodeProbe;
 import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 
-@Command(name = "setstreamthroughput", description = "Set the Mb/s throughput cap for streaming and entire SSTable streaming in the system, or 0 to disable throttling")
+@Command(name = "setstreamthroughput", description = "Set throughput cap for streaming and entire SSTable streaming in the system, or 0 to disable throttling")
 public class SetStreamThroughput extends NodeToolCmd
 {
     @SuppressWarnings("UnusedDeclaration")
-    @Arguments(title = "stream_throughput", usage = "<value_in_mb>", description = "Value in Mb, 0 to disable throttling", required = true)
+    @Arguments(title = "stream_throughput", usage = "<value_in_mb>", description = "Value in megabits, 0 to disable throttling", required = true)
     private int streamThroughput;
 
     @SuppressWarnings("UnusedDeclaration")
diff --git a/test/conf/cassandra-murmur.yaml b/test/conf/cassandra-murmur.yaml
index 3c263a5..75c1917 100644
--- a/test/conf/cassandra-murmur.yaml
+++ b/test/conf/cassandra-murmur.yaml
@@ -35,7 +35,7 @@ server_encryption_options:
     truststore_password: cassandra
 incremental_backups: true
 concurrent_compactors: 4
-compaction_throughput_mb_per_sec: 0
+compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
 enable_user_defined_functions: true
diff --git a/test/conf/cassandra_deprecated_parameters_names.yaml b/test/conf/cassandra-old.yaml
similarity index 98%
rename from test/conf/cassandra_deprecated_parameters_names.yaml
rename to test/conf/cassandra-old.yaml
index 3258b7f..aa5572c 100644
--- a/test/conf/cassandra_deprecated_parameters_names.yaml
+++ b/test/conf/cassandra-old.yaml
@@ -39,7 +39,7 @@ server_encryption_options:
     truststore_password: cassandra
 incremental_backups: true
 concurrent_compactors: 4
-compaction_throughput_mb_per_sec: 0
+compaction_throughput_mb_per_sec: 64
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
 enable_user_defined_functions: true
diff --git a/test/conf/cassandra-seeds.yaml b/test/conf/cassandra-seeds.yaml
index f3279ae..2673461 100644
--- a/test/conf/cassandra-seeds.yaml
+++ b/test/conf/cassandra-seeds.yaml
@@ -36,7 +36,7 @@ server_encryption_options:
     truststore_password: cassandra
 incremental_backups: true
 concurrent_compactors: 4
-compaction_throughput_mb_per_sec: 0
+compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
 enable_user_defined_functions: true
diff --git a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
index c05bf75..15a4c92 100644
--- a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
+++ b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
@@ -68,7 +68,7 @@ server_encryption_options:
     truststore_password: cassandra
 incremental_backups: true
 concurrent_compactors: 4
-compaction_throughput_mb_per_sec: 0
+compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
 enable_user_defined_functions: true
@@ -76,7 +76,7 @@ enable_scripted_user_defined_functions: true
 prepared_statements_cache_size_mb: 1
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
-stream_throughput_outbound_megabits_per_sec: 200000000
+stream_throughput_outbound: 23841823841858MiB/s
 enable_sasi_indexes: true
 enable_materialized_views: true
 file_cache_enabled: true
diff --git a/test/conf/cassandra-sslcontextfactory.yaml b/test/conf/cassandra-sslcontextfactory.yaml
index fd17226..3fcb536 100644
--- a/test/conf/cassandra-sslcontextfactory.yaml
+++ b/test/conf/cassandra-sslcontextfactory.yaml
@@ -71,7 +71,7 @@ server_encryption_options:
     truststore_password: cassandra
 incremental_backups: true
 concurrent_compactors: 4
-compaction_throughput_mb_per_sec: 0
+compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
 enable_user_defined_functions: true
@@ -79,7 +79,7 @@ enable_scripted_user_defined_functions: true
 prepared_statements_cache_size_mb: 1
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
-stream_throughput_outbound_megabits_per_sec: 200000000
+stream_throughput_outbound: 23841858MiB/s
 enable_sasi_indexes: true
 enable_materialized_views: true
 file_cache_enabled: true
diff --git a/test/conf/cassandra.yaml b/test/conf/cassandra.yaml
index d556852..3ed919d 100644
--- a/test/conf/cassandra.yaml
+++ b/test/conf/cassandra.yaml
@@ -39,7 +39,7 @@ server_encryption_options:
     truststore_password: cassandra
 incremental_backups: true
 concurrent_compactors: 4
-compaction_throughput_mb_per_sec: 0
+compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
 enable_user_defined_functions: true
@@ -47,7 +47,7 @@ enable_scripted_user_defined_functions: true
 prepared_statements_cache_size_mb: 1
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
-stream_throughput_outbound_megabits_per_sec: 200000000
+stream_throughput_outbound: 23841858MiB/s
 enable_sasi_indexes: true
 enable_materialized_views: true
 enable_drop_compact_storage: true
diff --git a/test/conf/unit-test-conf/test-native-port.yaml b/test/conf/unit-test-conf/test-native-port.yaml
index b46525f..58cd383 100644
--- a/test/conf/unit-test-conf/test-native-port.yaml
+++ b/test/conf/unit-test-conf/test-native-port.yaml
@@ -47,7 +47,7 @@ enable_scripted_user_defined_functions: true
 prepared_statements_cache_size_mb: 1
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
-stream_throughput_outbound_megabits_per_sec: 200000000
+stream_throughput_outbound: 23841858MiB/s
 
 client_encryption_options:
   enabled: true
diff --git a/test/distributed/org/apache/cassandra/distributed/test/AbstractNetstatsBootstrapStreaming.java b/test/distributed/org/apache/cassandra/distributed/test/AbstractNetstatsBootstrapStreaming.java
index 0bf9b9f..d327fd7 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/AbstractNetstatsBootstrapStreaming.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/AbstractNetstatsBootstrapStreaming.java
@@ -48,10 +48,10 @@ public abstract class AbstractNetstatsBootstrapStreaming extends AbstractNetstat
                                                  .withNodeIdTopology(NetworkTopology.singleDcNetworkTopology(2, "dc0", "rack0"))
                                                  .withConfig(config -> config.with(NETWORK, GOSSIP, NATIVE_PROTOCOL)
                                                                              .set(streamEntireSSTables
-                                                                                  ? "entire_sstable_stream_throughput_outbound_megabits_per_sec"
-                                                                                  : "stream_throughput_outbound_megabits_per_sec",
-                                                                                  throughput)
-                                                                             .set("compaction_throughput_mb_per_sec", 1)
+                                                                                  ? "entire_sstable_stream_throughput_outbound"
+                                                                                  : "stream_throughput_outbound",
+                                                                                  throughput+"MiB/s")
+                                                                             .set("compaction_throughput", "1MiB/s")
                                                                              .set("stream_entire_sstables", streamEntireSSTables));
 
         try (final Cluster cluster = builder.withNodes(1).start())
diff --git a/test/distributed/org/apache/cassandra/distributed/test/NetstatsBootstrapWithEntireSSTablesCompressionStreamingTest.java b/test/distributed/org/apache/cassandra/distributed/test/NetstatsBootstrapWithEntireSSTablesCompressionStreamingTest.java
index 545461e..8cc8a44 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/NetstatsBootstrapWithEntireSSTablesCompressionStreamingTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/NetstatsBootstrapWithEntireSSTablesCompressionStreamingTest.java
@@ -37,6 +37,6 @@ public class NetstatsBootstrapWithEntireSSTablesCompressionStreamingTest extends
     @Test
     public void testWithStreamingEntireSSTablesWithoutCompressionWithoutThrottling() throws Exception
     {
-        executeTest(true, false, -1);
+        executeTest(true, false, 0);
     }
 }
diff --git a/test/distributed/org/apache/cassandra/distributed/test/NetstatsRepairStreamingTest.java b/test/distributed/org/apache/cassandra/distributed/test/NetstatsRepairStreamingTest.java
index 36bde63..8e280a3 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/NetstatsRepairStreamingTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/NetstatsRepairStreamingTest.java
@@ -54,8 +54,8 @@ public class NetstatsRepairStreamingTest extends AbstractNetstatsStreaming
         try (final Cluster cluster = Cluster.build()
                                             .withNodeIdTopology(NetworkTopology.singleDcNetworkTopology(2, "dc0", "rack0"))
                                             .withConfig(config -> config.with(NETWORK, GOSSIP, NATIVE_PROTOCOL)
-                                                                        .set("stream_throughput_outbound_megabits_per_sec", 1)
-                                                                        .set("compaction_throughput_mb_per_sec", 1)
+                                                                        .set("stream_throughput_outbound", "122KiB/s")
+                                                                        .set("compaction_throughput", "1MiB/s")
                                                                         .set("stream_entire_sstables", false)).start())
         {
             final IInvokableInstance node1 = cluster.get(1);
diff --git a/test/long/org/apache/cassandra/streaming/LongStreamingTest.java b/test/long/org/apache/cassandra/streaming/LongStreamingTest.java
index c4259fb..19d7709 100644
--- a/test/long/org/apache/cassandra/streaming/LongStreamingTest.java
+++ b/test/long/org/apache/cassandra/streaming/LongStreamingTest.java
@@ -59,8 +59,8 @@ public class LongStreamingTest
         StorageService.instance.initServer();
 
         StorageService.instance.setCompactionThroughputMbPerSec(0);
-        StorageService.instance.setStreamThroughputMbPerSec(0);
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(0);
+        StorageService.instance.setStreamThroughputMbitPerSec(0);
+        StorageService.instance.setInterDCStreamThroughputMbitPerSec(0);
     }
 
     @Test
@@ -109,11 +109,11 @@ public class LongStreamingTest
         System.err.println(String.format("Writer finished after %d seconds....", TimeUnit.NANOSECONDS.toSeconds(nanoTime() - start)));
 
         File[] dataFiles = dataDir.tryList((dir, name) -> name.endsWith("-Data.db"));
-        long dataSize = 0l;
+        long dataSizeInBytes = 0l;
         for (File file : dataFiles)
         {
             System.err.println("File : "+file.absolutePath());
-            dataSize += file.length();
+            dataSizeInBytes += file.length();
         }
 
         SSTableLoader loader = new SSTableLoader(dataDir, new SSTableLoader.Client()
@@ -137,9 +137,9 @@ public class LongStreamingTest
         loader.stream().get();
 
         long millis = TimeUnit.NANOSECONDS.toMillis(nanoTime() - start);
-        System.err.println(String.format("Finished Streaming in %.2f seconds: %.2f Mb/sec",
+        System.err.println(String.format("Finished Streaming in %.2f seconds: %.2f MiBsec",
                                          millis/1000d,
-                                         (dataSize / (1 << 20) / (millis / 1000d)) * 8));
+                                         (dataSizeInBytes / (1 << 20) / (millis / 1000d)) * 8));
 
 
         //Stream again
@@ -164,9 +164,9 @@ public class LongStreamingTest
         loader.stream().get();
 
         millis = TimeUnit.NANOSECONDS.toMillis(nanoTime() - start);
-        System.err.println(String.format("Finished Streaming in %.2f seconds: %.2f Mb/sec",
+        System.err.println(String.format("Finished Streaming in %.2f seconds: %.2f MiBsec",
                                          millis/1000d,
-                                         (dataSize / (1 << 20) / (millis / 1000d)) * 8));
+                                         (dataSizeInBytes / (1 << 20) / (millis / 1000d)) * 8));
 
 
         //Compact them both
@@ -174,9 +174,9 @@ public class LongStreamingTest
         Keyspace.open(KS).getColumnFamilyStore(TABLE).forceMajorCompaction();
         millis = TimeUnit.NANOSECONDS.toMillis(nanoTime() - start);
 
-        System.err.println(String.format("Finished Compacting in %.2f seconds: %.2f Mb/sec",
+        System.err.println(String.format("Finished Compacting in %.2f seconds: %.2f MiBsec",
                                          millis / 1000d,
-                                         (dataSize * 2 / (1 << 20) / (millis / 1000d)) * 8));
+                                         (dataSizeInBytes * 2 / (1 << 20) / (millis / 1000d)) * 8));
 
         UntypedResultSet rs = QueryProcessor.executeInternal("SELECT * FROM " + KS + '.'  + TABLE + " limit 100;");
         assertEquals(100, rs.size());
diff --git a/test/microbench/org/apache/cassandra/test/microbench/ZeroCopyStreamingBenchmark.java b/test/microbench/org/apache/cassandra/test/microbench/ZeroCopyStreamingBenchmark.java
index 84c6415..d721298 100644
--- a/test/microbench/org/apache/cassandra/test/microbench/ZeroCopyStreamingBenchmark.java
+++ b/test/microbench/org/apache/cassandra/test/microbench/ZeroCopyStreamingBenchmark.java
@@ -80,7 +80,7 @@ import org.openjdk.jmh.annotations.Threads;
 import org.openjdk.jmh.annotations.Warmup;
 
 /**
- * Please ensure that this benchmark is run with entire_sstable_stream_throughput_outbound_megabits_per_sec
+ * Please ensure that this benchmark is run with entire_sstable_stream_throughput_outbound
  * set to a really high value otherwise, throttling will kick in and the results will not be meaningful.
  */
 @Warmup(iterations = 1, time = 1, timeUnit = TimeUnit.SECONDS)
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
index 7eb9ed8..dd98509 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorRefTest.java
@@ -198,7 +198,19 @@ public class DatabaseDescriptorRefTest
     "org.apache.cassandra.ConsoleAppenderCustomizer",
     "org.apache.cassandra.locator.InetAddressAndPort",
     "org.apache.cassandra.cql3.statements.schema.AlterKeyspaceStatement",
-    "org.apache.cassandra.cql3.statements.schema.CreateKeyspaceStatement"
+    "org.apache.cassandra.cql3.statements.schema.CreateKeyspaceStatement",
+    "org.apache.cassandra.config.DurationSpec",
+    "org.apache.cassandra.config.DataStorageSpec",
+    "org.apache.cassandra.config.DataStorageSpec$DataStorageUnit",
+    "org.apache.cassandra.config.DataStorageSpec$DataStorageUnit$1",
+    "org.apache.cassandra.config.DataStorageSpec$DataStorageUnit$2",
+    "org.apache.cassandra.config.DataStorageSpec$DataStorageUnit$3",
+    "org.apache.cassandra.config.DataStorageSpec$DataStorageUnit$4",
+    "org.apache.cassandra.config.DataRateSpec",
+    "org.apache.cassandra.config.DataRateSpec$DataRateUnit",
+    "org.apache.cassandra.config.DataRateSpec$DataRateUnit$1",
+    "org.apache.cassandra.config.DataRateSpec$DataRateUnit$2",
+    "org.apache.cassandra.config.DataRateSpec$DataRateUnit$3"
     };
 
     static final Set<String> checkedClasses = new HashSet<>(Arrays.asList(validClasses));
diff --git a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
index 575f04d..750939f 100644
--- a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
@@ -28,17 +28,98 @@ public class LoadOldYAMLBackwardCompatibilityTest
     @BeforeClass
     public static void setupDatabaseDescriptor()
     {
-        System.setProperty("cassandra.config", "cassandra_deprecated_parameters_names.yaml");
+        System.setProperty("cassandra.config", "cassandra-old.yaml");
         DatabaseDescriptor.daemonInitialization();
     }
 
-    // CASSANDRA-17141
+    // CASSANDRA-15234
     @Test
     public void testConfigurationLoaderBackwardCompatibility()
     {
         Config config = DatabaseDescriptor.loadConfig();
-        //Confirm parameters were successfully read with the old names from cassandra-old.yaml
-        assertEquals(5, config.internode_socket_send_buffer_size_in_bytes);
+        //Confirm parameters were successfully read with their old names and the default values in cassandra-old.yaml
+        /*assertEquals(5, config.internode_socket_send_buffer_size_in_bytes);
         assertEquals(5, config.internode_socket_receive_buffer_size_in_bytes);
+        assertEquals(DurationSpec.inMilliseconds(10800000), config.max_hint_window);
+        assertEquals(DurationSpec.inMilliseconds(0), config.native_transport_idle_timeout);
+        assertEquals(DurationSpec.inMilliseconds(10000), config.request_timeout);
+        assertEquals(DurationSpec.inMilliseconds(5000), config.read_request_timeout);
+        assertEquals(DurationSpec.inMilliseconds(10000), config.range_request_timeout);
+        assertEquals(DurationSpec.inMilliseconds(2000), config.write_request_timeout);
+        assertEquals(DurationSpec.inMilliseconds(5000), config.counter_write_request_timeout);
+        assertEquals(DurationSpec.inMilliseconds(1000), config.cas_contention_timeout);
+        assertEquals(DurationSpec.inMilliseconds(60000), config.truncate_request_timeout);
+        assertEquals(DurationSpec.inSeconds(300), config.streaming_keep_alive_period);
+        assertEquals(DurationSpec.inMilliseconds(500), config.slow_query_log_timeout);
+        assertNull(config.memtable_heap_space);
+        assertNull(config.memtable_offheap_space);
+        assertNull( config.repair_session_space);
+        assertEquals(DataStorageSpec.inBytes(4194304), config.internode_application_send_queue_capacity);
+        assertEquals(DataStorageSpec.inBytes(134217728), config.internode_application_send_queue_reserve_endpoint_capacity);
+        assertEquals(DataStorageSpec.inBytes(536870912), config.internode_application_send_queue_reserve_global_capacity);
+        assertEquals(DataStorageSpec.inBytes(4194304), config.internode_application_receive_queue_capacity);
+        assertEquals(DataStorageSpec.inBytes(134217728), config.internode_application_receive_queue_reserve_endpoint_capacity);
+        assertEquals(DataStorageSpec.inBytes(536870912), config.internode_application_receive_queue_reserve_global_capacity);
+        assertEquals(DurationSpec.inMilliseconds(2000), config.internode_tcp_connect_timeout);
+        assertEquals(DurationSpec.inMilliseconds(30000), config.internode_tcp_user_timeout);
+        assertEquals(DurationSpec.inMilliseconds(300000), config.internode_streaming_tcp_user_timeout);
+        assertEquals(DataStorageSpec.inMebibytes(16), config.native_transport_max_frame_size);
+        assertEquals(DataStorageSpec.inMebibytes(256), config.max_value_size);
+        assertEquals(DataStorageSpec.inKibibytes(64), config.column_index_size);
+        assertEquals(DataStorageSpec.inKibibytes(2), config.column_index_cache_size);
+        assertEquals(DataStorageSpec.inKibibytes(5), config.batch_size_warn_threshold);*/
+        assertEquals(DataRateSpec.inMebibytesPerSecond(64), config.compaction_throughput);
+        //assertEquals(DataStorageSpec.inMebibytes(50), config.min_free_space_per_drive);
+        assertEquals(DataRateSpec.inMebibytesPerSecond(23841858).toString(), config.stream_throughput_outbound.toString());
+        assertEquals(DataRateSpec.megabitsPerSecondInMebibytesPerSecond(200000000).toString(), config.stream_throughput_outbound.toString());
+        assertEquals(DataRateSpec.inMebibytesPerSecond(24), config.inter_dc_stream_throughput_outbound);
+        /*assertNull(config.commitlog_total_space);
+        assertEquals(DurationSpec.inDoubleMilliseconds(0), config.commitlog_sync_group_window);
+        assertEquals(DurationSpec.inMilliseconds(0), config.commitlog_sync_period);
+        assertEquals(DataStorageSpec.inMebibytes(32), config.commitlog_segment_size);
+        assertNull(config.periodic_commitlog_sync_lag_block);  //Integer
+        assertNull(config.max_mutation_size);
+        assertEquals(DataStorageSpec.inMebibytes(0), config.cdc_total_space);
+        assertEquals(DurationSpec.inMilliseconds(250), config.cdc_free_space_check_interval);
+        assertEquals(DurationSpec.inMilliseconds(100), config.dynamic_snitch_update_interval);
+        assertEquals(DurationSpec.inMilliseconds(600000), config.dynamic_snitch_reset_interval);
+        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.inKibibytes(10240), config.trickle_fsync_interval);
+        assertEquals(DataStorageSpec.inMebibytes(50), config.sstable_preemptive_open_interval);
+        assertNull( config.key_cache_size);
+        assertEquals(DataStorageSpec.inMebibytes(0), config.row_cache_size);
+        assertNull(config.counter_cache_size);
+        assertNull(config.networking_cache_size);
+        assertNull(config.file_cache_size);
+        assertNull(config.index_summary_capacity);
+        assertEquals(DurationSpec.inMilliseconds(200), config.gc_log_threshold);
+        assertEquals(DurationSpec.inMilliseconds(1000), config.gc_warn_threshold);
+        assertEquals(DurationSpec.inSeconds(86400), config.trace_type_query_ttl);
+        assertEquals(DurationSpec.inSeconds(604800), config.trace_type_repair_ttl);
+        assertNull(config.prepared_statements_cache_size);
+        assertFalse(config.user_defined_functions_enabled);
+        assertFalse(config.scripted_user_defined_functions_enabled);
+        assertFalse(config.materialized_views_enabled);
+        assertFalse(config.transient_replication_enabled);
+        assertFalse(config.sasi_indexes_enabled);
+        assertFalse(config.drop_compact_storage_enabled);
+        assertTrue(config.user_defined_functions_threads_enabled);
+        assertEquals(DurationSpec.inMilliseconds(2000), config.permissions_validity);
+        assertEquals(DurationSpec.inMilliseconds(0), config.permissions_update_interval);
+        assertEquals(DurationSpec.inMilliseconds(2000), config.roles_validity);
+        assertEquals(DurationSpec.inMilliseconds(0), config.roles_update_interval);
+        assertEquals(DurationSpec.inMilliseconds(2000), config.credentials_validity);
+        assertEquals(DurationSpec.inMilliseconds(0), config.credentials_update_interval);
+        assertEquals(DurationSpec.inMinutes(60), config.index_summary_resize_interval);
+
+        //parameters which names have not changed with CASSANDRA-15234
+        assertEquals(DurationSpec.inSecondsString("14400"), config.key_cache_save_period);
+        assertEquals(DurationSpec.inHours(4), config.key_cache_save_period);
+        assertEquals(DurationSpec.inSecondsString("0"), config.row_cache_save_period);
+        assertEquals(DurationSpec.inSeconds(0), config.row_cache_save_period);
+        assertEquals(DurationSpec.inHours(2), config.counter_cache_save_period);*/
     }
 }
diff --git a/test/unit/org/apache/cassandra/cql3/validation/miscellaneous/CrcCheckChanceTest.java b/test/unit/org/apache/cassandra/cql3/validation/miscellaneous/CrcCheckChanceTest.java
index 8f1ef69..c6d6390 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/miscellaneous/CrcCheckChanceTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/miscellaneous/CrcCheckChanceTest.java
@@ -185,7 +185,7 @@ public class CrcCheckChanceTest extends CQLTester
             cfs.forceBlockingFlush();
         }
 
-        DatabaseDescriptor.setCompactionThroughputMbPerSec(1);
+        DatabaseDescriptor.setCompactionThroughputMebibytesPerSec(1);
         List<? extends Future<?>> futures = CompactionManager.instance.submitMaximal(cfs, CompactionManager.getDefaultGcBefore(cfs, FBUtilities.nowInSeconds()), false);
         execute("DROP TABLE %s");
 
diff --git a/test/unit/org/apache/cassandra/net/AsyncStreamingOutputPlusTest.java b/test/unit/org/apache/cassandra/net/AsyncStreamingOutputPlusTest.java
index 249850c..4775fd1 100644
--- a/test/unit/org/apache/cassandra/net/AsyncStreamingOutputPlusTest.java
+++ b/test/unit/org/apache/cassandra/net/AsyncStreamingOutputPlusTest.java
@@ -121,8 +121,8 @@ public class AsyncStreamingOutputPlusTest
     public void testWriteFileToChannelEntireSSTableNoThrottling() throws IOException
     {
         // Disable throttling by setting entire SSTable throughput and entire SSTable inter-DC throughput to 0
-        DatabaseDescriptor.setEntireSSTableStreamThroughputOutboundMegabitsPerSec(0);
-        DatabaseDescriptor.setEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec(0);
+        DatabaseDescriptor.setEntireSSTableStreamThroughputOutboundMebibytesPerSec(0);
+        DatabaseDescriptor.setEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSec(0);
         StreamManager.StreamRateLimiter.updateEntireSSTableThroughput();
         StreamManager.StreamRateLimiter.updateEntireSSTableInterDCThroughput();
 
@@ -133,8 +133,8 @@ public class AsyncStreamingOutputPlusTest
     public void testWriteFileToChannelEntireSSTable() throws IOException
     {
         // Enable entire SSTable throttling by setting it to 200 Mbps
-        DatabaseDescriptor.setEntireSSTableStreamThroughputOutboundMegabitsPerSec(200);
-        DatabaseDescriptor.setEntireSSTableInterDCStreamThroughputOutboundMegabitsPerSec(200);
+        DatabaseDescriptor.setEntireSSTableStreamThroughputOutboundMebibytesPerSec(200);
+        DatabaseDescriptor.setEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSec(200);
         StreamManager.StreamRateLimiter.updateEntireSSTableThroughput();
         StreamManager.StreamRateLimiter.updateEntireSSTableInterDCThroughput();
 
diff --git a/test/unit/org/apache/cassandra/streaming/StreamManagerTest.java b/test/unit/org/apache/cassandra/streaming/StreamManagerTest.java
index 9d669ba..b1168d6 100644
--- a/test/unit/org/apache/cassandra/streaming/StreamManagerTest.java
+++ b/test/unit/org/apache/cassandra/streaming/StreamManagerTest.java
@@ -22,29 +22,37 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 import org.apache.cassandra.config.Config;
+import org.apache.cassandra.config.DataRateSpec;
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.service.StorageService;
 
 import static org.apache.cassandra.streaming.StreamManager.StreamRateLimiter;
-import static org.apache.cassandra.streaming.StreamManager.StreamRateLimiter.BYTES_PER_MEGABIT;
+import static org.apache.cassandra.streaming.StreamManager.StreamRateLimiter.BYTES_PER_MEBIBYTE;
 import static org.junit.Assert.assertEquals;
 
 public class StreamManagerTest
 {
-    private static int defaultStreamThroughputMbPerSec;
-    private static int defaultInterDCStreamThroughputMbPerSec;
+    private static double defaultStreamThroughputMebibytesPerSec;
+    private static double defaultInterDCStreamThroughputMebibytesPerSec;
+    private static final double INTEGER_MAX_VALUE_MEGABITS_IN_MEBIBYTES = DataRateSpec
+                                                                       .megabitsPerSecondInMebibytesPerSecond(Integer.MAX_VALUE)
+                                                                       .toMebibytesPerSecond();
 
-    private static int defaultEntireSSTableStreamThroughputMbPerSec;
-    private static int defaultEntireSSTableInterDCStreamThroughputMbPerSec;
+    private static double defaultEntireSSTableStreamThroughputMebibytesPerSec;
+    private static double defaultEntireSSTableInterDCStreamThroughputMebibytesPerSec;
+
+    final double MEBIBYTES_PER_MEGABIT = 0.119209289550781;
 
     @BeforeClass
     public static void setupClass()
     {
         Config c = DatabaseDescriptor.loadConfig();
-        defaultStreamThroughputMbPerSec = c.stream_throughput_outbound_megabits_per_sec;
-        defaultInterDCStreamThroughputMbPerSec = c.inter_dc_stream_throughput_outbound_megabits_per_sec;
-        defaultEntireSSTableStreamThroughputMbPerSec = c.entire_sstable_stream_throughput_outbound_megabits_per_sec;
-        defaultEntireSSTableInterDCStreamThroughputMbPerSec = c.entire_sstable_inter_dc_stream_throughput_outbound_megabits_per_sec;
+
+        defaultStreamThroughputMebibytesPerSec = c.stream_throughput_outbound.toMebibytesPerSecond();
+        defaultInterDCStreamThroughputMebibytesPerSec = c.inter_dc_stream_throughput_outbound.toMebibytesPerSecond();
+        defaultEntireSSTableStreamThroughputMebibytesPerSec = c.entire_sstable_stream_throughput_outbound.toMebibytesPerSecond();
+        defaultEntireSSTableInterDCStreamThroughputMebibytesPerSec = c.entire_sstable_inter_dc_stream_throughput_outbound.toMebibytesPerSecond();
+
         DatabaseDescriptor.daemonInitialization(() -> c);
     }
 
@@ -52,22 +60,18 @@ public class StreamManagerTest
     public void testUpdateStreamThroughput()
     {
         // Initialized value check
-        assertEquals(defaultStreamThroughputMbPerSec * BYTES_PER_MEGABIT, StreamRateLimiter.getRateLimiterRateInBytes(), 0);
+        assertEquals(defaultStreamThroughputMebibytesPerSec * BYTES_PER_MEBIBYTE, StreamRateLimiter.getRateLimiterRateInBytes(), 0);
 
         // Positive value check
-        StorageService.instance.setStreamThroughputMbPerSec(500);
-        assertEquals(500.0d * BYTES_PER_MEGABIT, StreamRateLimiter.getRateLimiterRateInBytes(), 0);
+        StorageService.instance.setStreamThroughputMbitPerSec(500); //60MiB/s
+        assertEquals(500 * MEBIBYTES_PER_MEGABIT * BYTES_PER_MEBIBYTE, StreamRateLimiter.getRateLimiterRateInBytes(), 0);
 
         // Max positive value check
-        StorageService.instance.setStreamThroughputMbPerSec(Integer.MAX_VALUE);
-        assertEquals(Integer.MAX_VALUE * BYTES_PER_MEGABIT, StreamRateLimiter.getRateLimiterRateInBytes(), 0);
+        StorageService.instance.setStreamThroughputMbitPerSec(Integer.MAX_VALUE);
+        assertEquals(INTEGER_MAX_VALUE_MEGABITS_IN_MEBIBYTES * BYTES_PER_MEBIBYTE, StreamRateLimiter.getRateLimiterRateInBytes(), 0.04);
 
         // Zero value check
-        StorageService.instance.setStreamThroughputMbPerSec(0);
-        assertEquals(Double.MAX_VALUE, StreamRateLimiter.getRateLimiterRateInBytes(), 0);
-
-        // Negative value check
-        StorageService.instance.setStreamThroughputMbPerSec(-200);
+        StorageService.instance.setStreamThroughputMbitPerSec(0);
         assertEquals(Double.MAX_VALUE, StreamRateLimiter.getRateLimiterRateInBytes(), 0);
     }
 
@@ -75,22 +79,18 @@ public class StreamManagerTest
     public void testUpdateEntireSSTableStreamThroughput()
     {
         // Initialized value check (defaults to StreamRateLimiter.getRateLimiterRateInBytes())
-        assertEquals(defaultEntireSSTableStreamThroughputMbPerSec * BYTES_PER_MEGABIT, StreamRateLimiter.getEntireSSTableRateLimiterRateInBytes(), 0);
+        assertEquals(defaultEntireSSTableStreamThroughputMebibytesPerSec * BYTES_PER_MEBIBYTE, StreamRateLimiter.getEntireSSTableRateLimiterRateInBytes(), 0);
 
         // Positive value check
-        StorageService.instance.setEntireSSTableStreamThroughputMbPerSec(1500);
-        assertEquals(1500.0d * BYTES_PER_MEGABIT, StreamRateLimiter.getEntireSSTableRateLimiterRateInBytes(), 0);
+        StorageService.instance.setEntireSSTableStreamThroughputMebibytesPerSec(1500);
+        assertEquals(1500d * BYTES_PER_MEBIBYTE, Math.round(StreamRateLimiter.getEntireSSTableRateLimiterRateInBytes()), 0);
 
         // Max positive value check
-        StorageService.instance.setEntireSSTableStreamThroughputMbPerSec(Integer.MAX_VALUE);
-        assertEquals(Integer.MAX_VALUE * BYTES_PER_MEGABIT, StreamRateLimiter.getEntireSSTableRateLimiterRateInBytes(), 0);
+        StorageService.instance.setEntireSSTableStreamThroughputMebibytesPerSec(Integer.MAX_VALUE);
+        assertEquals(Integer.MAX_VALUE * BYTES_PER_MEBIBYTE, StreamRateLimiter.getEntireSSTableRateLimiterRateInBytes(), 0);
 
         // Zero value check
-        StorageService.instance.setEntireSSTableStreamThroughputMbPerSec(0);
-        assertEquals(Double.MAX_VALUE, StreamRateLimiter.getEntireSSTableRateLimiterRateInBytes(), 0);
-
-        // Negative value check
-        StorageService.instance.setEntireSSTableStreamThroughputMbPerSec(-200);
+        StorageService.instance.setEntireSSTableStreamThroughputMebibytesPerSec(0);
         assertEquals(Double.MAX_VALUE, StreamRateLimiter.getEntireSSTableRateLimiterRateInBytes(), 0);
     }
 
@@ -98,22 +98,18 @@ public class StreamManagerTest
     public void testUpdateInterDCStreamThroughput()
     {
         // Initialized value check
-        assertEquals(defaultInterDCStreamThroughputMbPerSec * BYTES_PER_MEGABIT, StreamRateLimiter.getInterDCRateLimiterRateInBytes(), 0);
+        assertEquals(defaultInterDCStreamThroughputMebibytesPerSec * BYTES_PER_MEBIBYTE, StreamRateLimiter.getInterDCRateLimiterRateInBytes(), 0);
 
         // Positive value check
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(200);
-        assertEquals(200.0d * BYTES_PER_MEGABIT, StreamRateLimiter.getInterDCRateLimiterRateInBytes(), 0);
+        StorageService.instance.setInterDCStreamThroughputMbitPerSec(200); //approximately 24MiB/s
+        assertEquals(200 * MEBIBYTES_PER_MEGABIT * BYTES_PER_MEBIBYTE, StreamRateLimiter.getInterDCRateLimiterRateInBytes(), 0);
 
         // Max positive value check
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(Integer.MAX_VALUE);
-        assertEquals(Integer.MAX_VALUE * BYTES_PER_MEGABIT, StreamRateLimiter.getInterDCRateLimiterRateInBytes(), 0);
+        StorageService.instance.setInterDCStreamThroughputMbitPerSec(Integer.MAX_VALUE);
+        assertEquals(INTEGER_MAX_VALUE_MEGABITS_IN_MEBIBYTES * BYTES_PER_MEBIBYTE, StreamRateLimiter.getInterDCRateLimiterRateInBytes(), 0.04);
 
         // Zero value check
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(0);
-        assertEquals(Double.MAX_VALUE, StreamRateLimiter.getInterDCRateLimiterRateInBytes(), 0);
-
-        // Negative value check
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(-200);
+        StorageService.instance.setInterDCStreamThroughputMbitPerSec(0);
         assertEquals(Double.MAX_VALUE, StreamRateLimiter.getInterDCRateLimiterRateInBytes(), 0);
     }
 
@@ -121,22 +117,18 @@ public class StreamManagerTest
     public void testUpdateEntireSSTableInterDCStreamThroughput()
     {
         // Initialized value check (Defaults to StreamRateLimiter.getInterDCRateLimiterRateInBytes())
-        assertEquals(defaultEntireSSTableInterDCStreamThroughputMbPerSec * BYTES_PER_MEGABIT, StreamRateLimiter.getEntireSSTableInterDCRateLimiterRateInBytes(), 0);
+        assertEquals(defaultEntireSSTableInterDCStreamThroughputMebibytesPerSec * BYTES_PER_MEBIBYTE, StreamRateLimiter.getEntireSSTableInterDCRateLimiterRateInBytes(), 0);
 
         // Positive value check
-        StorageService.instance.setEntireSSTableInterDCStreamThroughputMbPerSec(1200);
-        assertEquals(1200.0d * BYTES_PER_MEGABIT, StreamRateLimiter.getEntireSSTableInterDCRateLimiterRateInBytes(), 0);
+        StorageService.instance.setEntireSSTableInterDCStreamThroughputMebibytesPerSec(1200);
+        assertEquals(1200.0d * BYTES_PER_MEBIBYTE, StreamRateLimiter.getEntireSSTableInterDCRateLimiterRateInBytes(), 0);
 
         // Max positive value check
-        StorageService.instance.setEntireSSTableInterDCStreamThroughputMbPerSec(Integer.MAX_VALUE);
-        assertEquals(Integer.MAX_VALUE * BYTES_PER_MEGABIT, StreamRateLimiter.getEntireSSTableInterDCRateLimiterRateInBytes(), 0);
+        StorageService.instance.setEntireSSTableInterDCStreamThroughputMebibytesPerSec(Integer.MAX_VALUE);
+        assertEquals(Integer.MAX_VALUE * BYTES_PER_MEBIBYTE, StreamRateLimiter.getEntireSSTableInterDCRateLimiterRateInBytes(), 0);
 
         // Zero value check
-        StorageService.instance.setEntireSSTableInterDCStreamThroughputMbPerSec(0);
-        assertEquals(Double.MAX_VALUE, StreamRateLimiter.getEntireSSTableInterDCRateLimiterRateInBytes(), 0);
-
-        // Negative value check
-        StorageService.instance.setEntireSSTableInterDCStreamThroughputMbPerSec(-200);
+        StorageService.instance.setEntireSSTableInterDCStreamThroughputMebibytesPerSec(0);
         assertEquals(Double.MAX_VALUE, StreamRateLimiter.getEntireSSTableInterDCRateLimiterRateInBytes(), 0);
     }
-}
+}
\ No newline at end of file
diff --git a/test/unit/org/apache/cassandra/streaming/StreamRateLimiterTest.java b/test/unit/org/apache/cassandra/streaming/StreamRateLimiterTest.java
index a518a66..3b72c4d 100644
--- a/test/unit/org/apache/cassandra/streaming/StreamRateLimiterTest.java
+++ b/test/unit/org/apache/cassandra/streaming/StreamRateLimiterTest.java
@@ -47,8 +47,8 @@ public class StreamRateLimiterTest
     public void testIsRateLimited()
     {
         // Enable rate limiting for local traffic and inter-DC traffic
-        StorageService.instance.setStreamThroughputMbPerSec(200);
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(200);
+        StorageService.instance.setStreamThroughputMbitPerSec(200);
+        StorageService.instance.setInterDCStreamThroughputMbitPerSec(200);
 
         // Rate-limiter enabled for a local peer
         assertTrue(StreamManager.getRateLimiter(FBUtilities.getBroadcastAddressAndPort()).isRateLimited());
@@ -57,8 +57,8 @@ public class StreamRateLimiterTest
         assertTrue(StreamManager.getRateLimiter(REMOTE_PEER_ADDRESS).isRateLimited());
 
         // Disable rate limiting for local traffic, but enable it for inter-DC traffic
-        StorageService.instance.setStreamThroughputMbPerSec(0);
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(200);
+        StorageService.instance.setStreamThroughputMbitPerSec(0);
+        StorageService.instance.setInterDCStreamThroughputMbitPerSec(200);
 
         // Rate-limiter disabled for a local peer
         assertFalse(StreamManager.getRateLimiter(FBUtilities.getBroadcastAddressAndPort()).isRateLimited());
@@ -67,8 +67,8 @@ public class StreamRateLimiterTest
         assertTrue(StreamManager.getRateLimiter(REMOTE_PEER_ADDRESS).isRateLimited());
 
         // Enable rate limiting for local traffic, but disable it for inter-DC traffic
-        StorageService.instance.setStreamThroughputMbPerSec(200);
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(0);
+        StorageService.instance.setStreamThroughputMbitPerSec(200);
+        StorageService.instance.setInterDCStreamThroughputMbitPerSec(0);
 
         // Rate-limiter enabled for a local peer
         assertTrue(StreamManager.getRateLimiter(FBUtilities.getBroadcastAddressAndPort()).isRateLimited());
@@ -77,8 +77,8 @@ public class StreamRateLimiterTest
         assertTrue(StreamManager.getRateLimiter(REMOTE_PEER_ADDRESS).isRateLimited());
 
         // Disable rate liming for local and inter-DC traffic
-        StorageService.instance.setStreamThroughputMbPerSec(0);
-        StorageService.instance.setInterDCStreamThroughputMbPerSec(-1);
+        StorageService.instance.setStreamThroughputMbitPerSec(0);
+        StorageService.instance.setInterDCStreamThroughputMbitPerSec(0);
 
         // Rate-limiter enabled for a local and remote peers
         assertFalse(StreamManager.getRateLimiter(FBUtilities.getBroadcastAddressAndPort()).isRateLimited());
@@ -89,8 +89,8 @@ public class StreamRateLimiterTest
     public void testEntireSSTableStreamingIsRateLimited()
     {
         // Enable rate limiting for local traffic and inter-DC traffic
-        StorageService.instance.setEntireSSTableStreamThroughputMbPerSec(200);
-        StorageService.instance.setEntireSSTableInterDCStreamThroughputMbPerSec(200);
+        StorageService.instance.setEntireSSTableStreamThroughputMebibytesPerSec(200);
+        StorageService.instance.setEntireSSTableInterDCStreamThroughputMebibytesPerSec(200);
 
         // Rate-limiter enabled for a local peer
         assertTrue(StreamManager.getEntireSSTableRateLimiter(FBUtilities.getBroadcastAddressAndPort()).isRateLimited());
@@ -99,8 +99,8 @@ public class StreamRateLimiterTest
         assertTrue(StreamManager.getEntireSSTableRateLimiter(REMOTE_PEER_ADDRESS).isRateLimited());
 
         // Disable rate limiting for local traffic, but enable it for inter-DC traffic
-        StorageService.instance.setEntireSSTableStreamThroughputMbPerSec(0);
-        StorageService.instance.setEntireSSTableInterDCStreamThroughputMbPerSec(200);
+        StorageService.instance.setEntireSSTableStreamThroughputMebibytesPerSec(0);
+        StorageService.instance.setEntireSSTableInterDCStreamThroughputMebibytesPerSec(200);
 
         // Rate-limiter disabled for a local peer
         assertFalse(StreamManager.getEntireSSTableRateLimiter(FBUtilities.getBroadcastAddressAndPort()).isRateLimited());
@@ -109,8 +109,8 @@ public class StreamRateLimiterTest
         assertTrue(StreamManager.getEntireSSTableRateLimiter(REMOTE_PEER_ADDRESS).isRateLimited());
 
         // Enable rate limiting for local traffic, but disable it for inter-DC traffic
-        StorageService.instance.setEntireSSTableStreamThroughputMbPerSec(200);
-        StorageService.instance.setEntireSSTableInterDCStreamThroughputMbPerSec(0);
+        StorageService.instance.setEntireSSTableStreamThroughputMebibytesPerSec(200);
+        StorageService.instance.setEntireSSTableInterDCStreamThroughputMebibytesPerSec(0);
 
         // Rate-limiter enabled for a local peer
         assertTrue(StreamManager.getEntireSSTableRateLimiter(FBUtilities.getBroadcastAddressAndPort()).isRateLimited());
@@ -119,8 +119,8 @@ public class StreamRateLimiterTest
         assertTrue(StreamManager.getEntireSSTableRateLimiter(REMOTE_PEER_ADDRESS).isRateLimited());
 
         // Disable rate liming for local and inter-DC traffic
-        StorageService.instance.setEntireSSTableStreamThroughputMbPerSec(0);
-        StorageService.instance.setEntireSSTableInterDCStreamThroughputMbPerSec(-1);
+        StorageService.instance.setEntireSSTableStreamThroughputMebibytesPerSec(0);
+        StorageService.instance.setEntireSSTableInterDCStreamThroughputMebibytesPerSec(0);
 
         // Rate-limiter enabled for a local and remote peers
         assertFalse(StreamManager.getEntireSSTableRateLimiter(FBUtilities.getBroadcastAddressAndPort()).isRateLimited());
diff --git a/test/unit/org/apache/cassandra/tools/nodetool/SetGetStreamThroughputTest.java b/test/unit/org/apache/cassandra/tools/nodetool/SetGetCompactionThroughputTest.java
similarity index 61%
copy from test/unit/org/apache/cassandra/tools/nodetool/SetGetStreamThroughputTest.java
copy to test/unit/org/apache/cassandra/tools/nodetool/SetGetCompactionThroughputTest.java
index ecf01b1..604cd7b 100644
--- a/test/unit/org/apache/cassandra/tools/nodetool/SetGetStreamThroughputTest.java
+++ b/test/unit/org/apache/cassandra/tools/nodetool/SetGetCompactionThroughputTest.java
@@ -23,17 +23,14 @@ import org.junit.Test;
 
 import org.apache.cassandra.cql3.CQLTester;
 
-import static org.assertj.core.api.Assertions.withPrecision;
-
-import static org.apache.cassandra.streaming.StreamManager.StreamRateLimiter;
 import static org.apache.cassandra.tools.ToolRunner.ToolResult;
 import static org.apache.cassandra.tools.ToolRunner.invokeNodetool;
 import static org.assertj.core.api.Assertions.assertThat;
 
 /**
- * Tests for {@code nodetool setstreamthroughput} and {@code nodetool getstreamthroughput}.
+ * Tests for {@code nodetool setcompactionthroughput} and {@code nodetool getcompactionthroughput}.
  */
-public class SetGetStreamThroughputTest extends CQLTester
+public class SetGetCompactionThroughputTest extends CQLTester
 {
     @BeforeClass
     public static void setup() throws Exception
@@ -44,67 +41,59 @@ public class SetGetStreamThroughputTest extends CQLTester
     @Test
     public void testNull()
     {
-        assertSetInvalidThroughput(null, "Required parameters are missing: stream_throughput");
+        assertSetInvalidThroughput(null, "Required parameters are missing: compaction_throughput");
     }
 
     @Test
     public void testPositive()
     {
-        assertSetGetValidThroughput(7, 7 * StreamRateLimiter.BYTES_PER_MEGABIT);
+        assertSetGetValidThroughput(7);
     }
 
     @Test
     public void testMaxValue()
     {
-        assertSetGetValidThroughput(Integer.MAX_VALUE, Integer.MAX_VALUE * StreamRateLimiter.BYTES_PER_MEGABIT);
+        assertSetGetValidThroughput(Integer.MAX_VALUE);
     }
 
     @Test
     public void testZero()
     {
-        assertSetGetValidThroughput(0, Double.MAX_VALUE);
-    }
-
-    @Test
-    public void testNegative()
-    {
-        assertSetGetValidThroughput(-7, Double.MAX_VALUE);
+        assertSetGetValidThroughput(0);
     }
 
     @Test
     public void testUnparseable()
     {
-        assertSetInvalidThroughput("1.2", "stream_throughput: can not convert \"1.2\" to a int");
-        assertSetInvalidThroughput("value", "stream_throughput: can not convert \"value\" to a int");
+        assertSetInvalidThroughput("1.2", "compaction_throughput: can not convert \"1.2\" to a Integer");
+        assertSetInvalidThroughput("value", "compaction_throughput: can not convert \"value\" to a Integer");
     }
 
-    private static void assertSetGetValidThroughput(int throughput, double rateInBytes)
+    private static void assertSetGetValidThroughput(int throughput)
     {
-        ToolResult tool = invokeNodetool("setstreamthroughput", String.valueOf(throughput));
+        ToolResult tool = invokeNodetool("setcompactionthroughput", String.valueOf(throughput));
         tool.assertOnCleanExit();
         assertThat(tool.getStdout()).isEmpty();
 
         assertGetThroughput(throughput);
-
-        assertThat(StreamRateLimiter.getRateLimiterRateInBytes()).isEqualTo(rateInBytes, withPrecision(0.01));
     }
 
     private static void assertSetInvalidThroughput(String throughput, String expectedErrorMessage)
     {
-        ToolResult tool = throughput == null ? invokeNodetool("setstreamthroughput")
-                                             : invokeNodetool("setstreamthroughput", throughput);
+        ToolResult tool = throughput == null ? invokeNodetool("setcompactionthroughput")
+                                             : invokeNodetool("setcompactionthroughput", throughput);
         assertThat(tool.getExitCode()).isEqualTo(1);
         assertThat(tool.getStdout()).contains(expectedErrorMessage);
     }
 
     private static void assertGetThroughput(int expected)
     {
-        ToolResult tool = invokeNodetool("getstreamthroughput");
+        ToolResult tool = invokeNodetool("getcompactionthroughput");
         tool.assertOnCleanExit();
 
         if (expected > 0)
-            assertThat(tool.getStdout()).contains("Current stream throughput: " + expected + " Mb/s");
+            assertThat(tool.getStdout()).contains("Current compaction throughput: " + expected + " MiB/s");
         else
-            assertThat(tool.getStdout()).contains("Current stream throughput: unlimited");
+            assertThat(tool.getStdout()).contains("Current compaction throughput: 0 MiB/s");
     }
 }
diff --git a/test/unit/org/apache/cassandra/tools/nodetool/SetGetEntireSSTableInterDCStreamThroughputTest.java b/test/unit/org/apache/cassandra/tools/nodetool/SetGetEntireSSTableInterDCStreamThroughputTest.java
index 3f32ac0..d412ab7 100644
--- a/test/unit/org/apache/cassandra/tools/nodetool/SetGetEntireSSTableInterDCStreamThroughputTest.java
+++ b/test/unit/org/apache/cassandra/tools/nodetool/SetGetEntireSSTableInterDCStreamThroughputTest.java
@@ -49,13 +49,13 @@ public class SetGetEntireSSTableInterDCStreamThroughputTest extends CQLTester
     @Test
     public void testPositive()
     {
-        assertSetGetValidThroughput(7, 7 * StreamRateLimiter.BYTES_PER_MEGABIT);
+        assertSetGetValidThroughput(7, 7 * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
     public void testMaxValue()
     {
-        assertSetGetValidThroughput(Integer.MAX_VALUE, Integer.MAX_VALUE * StreamRateLimiter.BYTES_PER_MEGABIT);
+        assertSetGetValidThroughput(Integer.MAX_VALUE, Integer.MAX_VALUE * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
@@ -65,12 +65,6 @@ public class SetGetEntireSSTableInterDCStreamThroughputTest extends CQLTester
     }
 
     @Test
-    public void testNegative()
-    {
-        assertSetGetValidThroughput(-7, Double.MAX_VALUE);
-    }
-
-    @Test
     public void testUnparseable()
     {
         assertSetInvalidThroughput("1.2", "inter_dc_stream_throughput: can not convert \"1.2\" to a int");
@@ -102,7 +96,7 @@ public class SetGetEntireSSTableInterDCStreamThroughputTest extends CQLTester
         tool.assertOnCleanExit();
 
         if (expected > 0)
-            assertThat(tool.getStdout()).contains("Current entire SSTable inter-datacenter stream throughput: " + expected + " Mb/s");
+            assertThat(tool.getStdout()).contains("Current entire SSTable inter-datacenter stream throughput: " + expected + " MiB/s");
         else
             assertThat(tool.getStdout()).contains("Current entire SSTable inter-datacenter stream throughput: unlimited");
     }
diff --git a/test/unit/org/apache/cassandra/tools/nodetool/SetGetEntireSSTableStreamThroughputTest.java b/test/unit/org/apache/cassandra/tools/nodetool/SetGetEntireSSTableStreamThroughputTest.java
index 7250b5f..10426b0 100644
--- a/test/unit/org/apache/cassandra/tools/nodetool/SetGetEntireSSTableStreamThroughputTest.java
+++ b/test/unit/org/apache/cassandra/tools/nodetool/SetGetEntireSSTableStreamThroughputTest.java
@@ -49,13 +49,13 @@ public class SetGetEntireSSTableStreamThroughputTest extends CQLTester
     @Test
     public void testPositive()
     {
-        assertSetGetValidThroughput(7, 7 * StreamRateLimiter.BYTES_PER_MEGABIT);
+        assertSetGetValidThroughput(7, 7 * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
     public void testMaxValue()
     {
-        assertSetGetValidThroughput(Integer.MAX_VALUE, Integer.MAX_VALUE * StreamRateLimiter.BYTES_PER_MEGABIT);
+        assertSetGetValidThroughput(Integer.MAX_VALUE, Integer.MAX_VALUE * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
@@ -65,12 +65,6 @@ public class SetGetEntireSSTableStreamThroughputTest extends CQLTester
     }
 
     @Test
-    public void testNegative()
-    {
-        assertSetGetValidThroughput(-7, Double.MAX_VALUE);
-    }
-
-    @Test
     public void testUnparseable()
     {
         assertSetInvalidThroughput("1.2", "stream_throughput: can not convert \"1.2\" to a int");
@@ -107,7 +101,7 @@ public class SetGetEntireSSTableStreamThroughputTest extends CQLTester
         tool.assertOnCleanExit();
 
         if (expected > 0)
-            assertThat(tool.getStdout()).contains("Current entire SSTable stream throughput: " + expected + " Mb/s");
+            assertThat(tool.getStdout()).contains("Current entire SSTable stream throughput: " + expected + " MiB/s");
         else
             assertThat(tool.getStdout()).contains("Current entire SSTable stream throughput: unlimited");
     }
diff --git a/test/unit/org/apache/cassandra/tools/nodetool/SetGetInterDCStreamThroughputTest.java b/test/unit/org/apache/cassandra/tools/nodetool/SetGetInterDCStreamThroughputTest.java
index b786e5d..6b06c69 100644
--- a/test/unit/org/apache/cassandra/tools/nodetool/SetGetInterDCStreamThroughputTest.java
+++ b/test/unit/org/apache/cassandra/tools/nodetool/SetGetInterDCStreamThroughputTest.java
@@ -21,6 +21,7 @@ package org.apache.cassandra.tools.nodetool;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import org.apache.cassandra.config.DataRateSpec;
 import org.apache.cassandra.cql3.CQLTester;
 
 import static org.apache.cassandra.streaming.StreamManager.StreamRateLimiter;
@@ -34,6 +35,10 @@ import static org.assertj.core.api.Assertions.withPrecision;
  */
 public class SetGetInterDCStreamThroughputTest extends CQLTester
 {
+    private static final double INTEGER_MAX_VALUE_MEGABITS_IN_MEBIBYTES = DataRateSpec
+                                                                       .megabitsPerSecondInMebibytesPerSecond(Integer.MAX_VALUE)
+                                                                       .toMebibytesPerSecond();
+
     @BeforeClass
     public static void setup() throws Exception
     {
@@ -49,25 +54,28 @@ public class SetGetInterDCStreamThroughputTest extends CQLTester
     @Test
     public void testPositive()
     {
-        assertSetGetValidThroughput(7, 7 * StreamRateLimiter.BYTES_PER_MEGABIT);
+        assertSetGetValidThroughput(7, 0.834465026855467 * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
-    public void testMaxValue()
+    public void testSmallPositive()
     {
-        assertSetGetValidThroughput(Integer.MAX_VALUE, Integer.MAX_VALUE * StreamRateLimiter.BYTES_PER_MEGABIT);
+        // As part of CASSANDRA-15234 we had to do some tweaks with precision. This test has to ensure no regressions
+        // happen, hopefully. Internally data rate parameters values and rate limitter are set in double. Users can set
+        // and get only integers
+        assertSetGetValidThroughput(1, 0.119209289550781 * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
-    public void testZero()
+    public void testMaxValue()
     {
-        assertSetGetValidThroughput(0, Double.MAX_VALUE);
+        assertSetGetValidThroughput(Integer.MAX_VALUE, INTEGER_MAX_VALUE_MEGABITS_IN_MEBIBYTES * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
-    public void testNegative()
+    public void testZero()
     {
-        assertSetGetValidThroughput(-7, Double.MAX_VALUE);
+        assertSetGetValidThroughput(0, Double.MAX_VALUE);
     }
 
     @Test
@@ -85,7 +93,7 @@ public class SetGetInterDCStreamThroughputTest extends CQLTester
 
         assertGetThroughput(throughput);
 
-        assertThat(StreamRateLimiter.getInterDCRateLimiterRateInBytes()).isEqualTo(rateInBytes, withPrecision(0.01));
+        assertThat(StreamRateLimiter.getInterDCRateLimiterRateInBytes()).isEqualTo(rateInBytes, withPrecision(0.04));
     }
 
     private static void assertSetInvalidThroughput(String throughput, String expectedErrorMessage)
@@ -102,7 +110,7 @@ public class SetGetInterDCStreamThroughputTest extends CQLTester
         tool.assertOnCleanExit();
 
         if (expected > 0)
-            assertThat(tool.getStdout()).contains("Current inter-datacenter stream throughput: " + expected + " Mb/s");
+            assertThat(tool.getStdout()).contains("Current inter-datacenter stream throughput: " + expected + " megabits per second");
         else
             assertThat(tool.getStdout()).contains("Current inter-datacenter stream throughput: unlimited");
     }
diff --git a/test/unit/org/apache/cassandra/tools/nodetool/SetGetStreamThroughputTest.java b/test/unit/org/apache/cassandra/tools/nodetool/SetGetStreamThroughputTest.java
index ecf01b1..7000387 100644
--- a/test/unit/org/apache/cassandra/tools/nodetool/SetGetStreamThroughputTest.java
+++ b/test/unit/org/apache/cassandra/tools/nodetool/SetGetStreamThroughputTest.java
@@ -21,6 +21,7 @@ package org.apache.cassandra.tools.nodetool;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import org.apache.cassandra.config.DataRateSpec;
 import org.apache.cassandra.cql3.CQLTester;
 
 import static org.assertj.core.api.Assertions.withPrecision;
@@ -35,6 +36,10 @@ import static org.assertj.core.api.Assertions.assertThat;
  */
 public class SetGetStreamThroughputTest extends CQLTester
 {
+    private static final double INTEGER_MAX_VALUE_MEGABITS_IN_MEBIBYTES = DataRateSpec
+                                                                       .megabitsPerSecondInMebibytesPerSecond(Integer.MAX_VALUE)
+                                                                       .toMebibytesPerSecond();
+
     @BeforeClass
     public static void setup() throws Exception
     {
@@ -50,25 +55,28 @@ public class SetGetStreamThroughputTest extends CQLTester
     @Test
     public void testPositive()
     {
-        assertSetGetValidThroughput(7, 7 * StreamRateLimiter.BYTES_PER_MEGABIT);
+        assertSetGetValidThroughput(7, 0.834465026855467 * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
-    public void testMaxValue()
+    public void testSmallPositive()
     {
-        assertSetGetValidThroughput(Integer.MAX_VALUE, Integer.MAX_VALUE * StreamRateLimiter.BYTES_PER_MEGABIT);
+        // As part of CASSANDRA-15234 we had to do some tweaks with precision. This test has to ensure no regressions
+        // happen, hopefully. Internally data rate parameters values and rate limitter are set in double. Users can set
+        // and get only integers
+        assertSetGetValidThroughput(1, 0.119209289550781 * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
-    public void testZero()
+    public void testMaxValue()
     {
-        assertSetGetValidThroughput(0, Double.MAX_VALUE);
+        assertSetGetValidThroughput(Integer.MAX_VALUE, INTEGER_MAX_VALUE_MEGABITS_IN_MEBIBYTES * StreamRateLimiter.BYTES_PER_MEBIBYTE);
     }
 
     @Test
-    public void testNegative()
+    public void testZero()
     {
-        assertSetGetValidThroughput(-7, Double.MAX_VALUE);
+        assertSetGetValidThroughput(0, Double.MAX_VALUE);
     }
 
     @Test
@@ -86,7 +94,7 @@ public class SetGetStreamThroughputTest extends CQLTester
 
         assertGetThroughput(throughput);
 
-        assertThat(StreamRateLimiter.getRateLimiterRateInBytes()).isEqualTo(rateInBytes, withPrecision(0.01));
+        assertThat(StreamRateLimiter.getRateLimiterRateInBytes()).isEqualTo(rateInBytes, withPrecision(0.04));
     }
 
     private static void assertSetInvalidThroughput(String throughput, String expectedErrorMessage)
@@ -103,7 +111,7 @@ public class SetGetStreamThroughputTest extends CQLTester
         tool.assertOnCleanExit();
 
         if (expected > 0)
-            assertThat(tool.getStdout()).contains("Current stream throughput: " + expected + " Mb/s");
+            assertThat(tool.getStdout()).contains("Current stream throughput: " + expected + " megabits per second");
         else
             assertThat(tool.getStdout()).contains("Current stream throughput: unlimited");
     }

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


[cassandra] 02/13: Backward compatibility framework for configuration parameters patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 9c6b382058578ac75b88055a13aa83944901fb88
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Tue Dec 14 23:04:43 2021 -0500

    Backward compatibility framework for configuration parameters
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 .../org/apache/cassandra/config/Converters.java    | 125 +++++++++++++++++++
 src/java/org/apache/cassandra/config/Replaces.java |   9 +-
 .../org/apache/cassandra/config/ReplacesList.java  |   2 +-
 .../cassandra/config/YamlConfigurationLoader.java  | 134 ++++++++++++++++++---
 .../apache/cassandra/db/virtual/SettingsTable.java |  16 +++
 5 files changed, 263 insertions(+), 23 deletions(-)

diff --git a/src/java/org/apache/cassandra/config/Converters.java b/src/java/org/apache/cassandra/config/Converters.java
new file mode 100644
index 0000000..9a832cc
--- /dev/null
+++ b/src/java/org/apache/cassandra/config/Converters.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.cassandra.config;
+
+import java.util.function.Function;
+
+/**
+ * Converters for backward compatibility with the old cassandra.yaml where duration, data rate and
+ * data storage configuration parameters were provided only by value and the expected unit was part of the configuration
+ * parameter name(suffix). (CASSANDRA-15234)
+ * It is important to be noted that this converter is not intended to be used when we don't change name of a configuration
+ * parameter but we want to add unit. This would always default to the old value provided without a unit at the moment.
+ * In case this functionality is needed at some point, please, raise a Jira ticket.
+ */
+public enum Converters
+{
+    /**
+     * This converter is used when we change the name of a cassandra.yaml configuration parameter but we want to be
+     * able to still use the old name too. No units involved.
+     */
+    IDENTITY(null, o -> o, o-> o),
+    MILLIS_DURATION(Long.class,
+                    o -> DurationSpec.inMilliseconds((Long) o),
+                    o -> ((DurationSpec)o).toMilliseconds()),
+    MILLIS_DOUBLE_DURATION(Double.class,
+                           o ->  DurationSpec.inDoubleMilliseconds((Double) o),
+                           o -> ((DurationSpec)o).toMilliseconds()),
+    /**
+     * This converter is used to support backward compatibility for parameters where in the past -1 was used as a value
+     * Example: credentials_update_interval_in_ms = -1 and credentials_update_interval = null (quantity of 0ms) are equal.
+     */
+    MILLIS_CUSTOM_DURATION(Long.class,
+                           o -> (Long)o == -1 ? new DurationSpec("0ms") : DurationSpec.inMilliseconds((Long) o),
+                           o -> ((DurationSpec)o).toMilliseconds() == 0 ? -1 : ((DurationSpec)o).toMilliseconds()),
+    SECONDS_DURATION(Long.class,
+                     o -> DurationSpec.inSeconds((Long) o),
+                     o -> ((DurationSpec)o).toSeconds()),
+    MINUTES_DURATION(Long.class,
+                     o -> DurationSpec.inMinutes((Long) o),
+                     o -> ((DurationSpec)o).toMinutes()),
+    MEBIBYTES_DATA_STORAGE(Long.class,
+                          o -> DataStorageSpec.inMebibytes((Long) o),
+                          o -> ((DataStorageSpec)o).toMebibytes()),
+    KIBIBYTES_DATASTORAGE(Long.class,
+                          o -> DataStorageSpec.inKibibytes((Long) o),
+                          o -> ((DataStorageSpec)o).toKibibytes()),
+    BYTES_DATASTORAGE(Long.class,
+                      o -> DataStorageSpec.inBytes((Long) o),
+                      o -> ((DataStorageSpec)o).toBytes()),
+    MEBIBYTES_PER_SECOND_DATA_RATE(Long.class,
+                                   o -> DataRateSpec.inMebibytesPerSecond((Long) o),
+                                   o -> ((DataRateSpec)o).toMebibytesPerSecond()),
+    /**
+     * This converter is a custom one to support backward compatibility for stream_throughput_outbound and
+     * inter_dc_stream_throughput_outbound which were provided in megatibs per second prior CASSANDRA-15234.
+     */
+    MEGABITS_TO_MEBIBYTES_PER_SECOND_DATA_RATE(Long.class,
+                                               o -> DataRateSpec.megabitsPerSecondInMebibytesPerSecond((Long)o),
+                                               o -> ((DataRateSpec)o).toMegabitsPerSecond());
+
+    private final Class<?> inputType;
+    private final Function<Object, Object> convert;
+    private final Function<Object, Object> reverseConvert;
+
+    Converters(Class<?> inputType, Function<Object, Object> convert, Function<Object, Object> reverseConvert)
+    {
+        this.inputType = inputType;
+        this.convert = convert;
+        this.reverseConvert = reverseConvert;
+    }
+
+    /**
+     * A method to identify what type is needed to be returned by the converter used for a configuration parameter
+     * in {@link Replaces} annotation in {@link Config}
+     *
+     * @return class type
+     */
+    public Class<?> getInputType()
+    {
+        return inputType;
+    }
+
+    /**
+     * Apply the converter specified as part of the {@link Replaces} annotation in {@link Config}
+     *
+     * @param value we will use from cassandra.yaml to create a new {@link Config} parameter of type {@link DurationSpec},
+     * {@link DataRateSpec} or {@link DataStorageSpec}
+     * @return new object of type {@link DurationSpec}, {@link DataRateSpec} or {@link DataStorageSpec}
+     */
+    public Object convert(Object value)
+    {
+        if (value == null) return null;
+        return convert.apply(value);
+    }
+
+    /**
+     * Apply the converter specified as part of the {@link Replaces} annotation in {@link Config} to get config parameters'
+     * values in the old format pre-CASSANDRA-15234 and in the right units, used in the Virtual Tables to ensure backward
+     * compatibility
+     *
+     * @param value we will use to calculate the output value
+     * @return the numeric value
+     */
+    public Object deconvert(Object value)
+    {
+        if (value == null) return 0;
+        return reverseConvert.apply(value);
+    }
+}
diff --git a/src/java/org/apache/cassandra/config/Replaces.java b/src/java/org/apache/cassandra/config/Replaces.java
index 93bdcb5..e1354b9 100644
--- a/src/java/org/apache/cassandra/config/Replaces.java
+++ b/src/java/org/apache/cassandra/config/Replaces.java
@@ -25,8 +25,8 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Repeatable annotation for providing old name and whether the
- * config parameters we annotate are deprecated and we need to warn the users. (CASSANDRA-17141)
+ * Repeatable annotation for providing old name, converter from old to new type and whether the
+ * config parameters we annotate are deprecated and we need to warn the users. (CASSANDRA-17141, CASSANDRA-15234)
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.FIELD})
@@ -39,6 +39,11 @@ public @interface Replaces
     String oldName();
 
     /**
+     * @return which converter we need depending on the old default unit that was used
+     */
+    Converters converter() default Converters.IDENTITY;
+
+    /**
      * @return whether the parameter should be marked as deprecated or not and warning sent to the user
      */
     boolean deprecated() default false;
diff --git a/src/java/org/apache/cassandra/config/ReplacesList.java b/src/java/org/apache/cassandra/config/ReplacesList.java
index a2b0c96..eec4e4c 100644
--- a/src/java/org/apache/cassandra/config/ReplacesList.java
+++ b/src/java/org/apache/cassandra/config/ReplacesList.java
@@ -24,7 +24,7 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Contatining annotation type for the repeatable annotation {@link Replaces}
+ * Concatenating annotation type for the repeatable annotation {@link Replaces}
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.FIELD})
diff --git a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
index dc9b7fb..4fc82b4 100644
--- a/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
+++ b/src/java/org/apache/cassandra/config/YamlConfigurationLoader.java
@@ -25,12 +25,16 @@ import java.lang.reflect.Field;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.nio.file.Files;
+import java.nio.file.Paths;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.collect.Lists;
@@ -38,9 +42,10 @@ import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 import com.google.common.io.ByteStreams;
 
-import org.apache.cassandra.io.util.File;
 import org.apache.commons.lang3.SystemUtils;
 
+import org.apache.cassandra.io.util.File;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -65,6 +70,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
     /**
      * Inspect the classpath to find storage configuration file
      */
+    @VisibleForTesting
     private static URL getStorageConfigURL() throws ConfigurationException
     {
         String configUrl = System.getProperty("cassandra.config");
@@ -106,6 +112,8 @@ public class YamlConfigurationLoader implements ConfigurationLoader
     {
         if (storageConfigURL == null)
             storageConfigURL = getStorageConfigURL();
+
+        validateConfigFile();
         return loadConfig(storageConfigURL);
     }
 
@@ -125,7 +133,6 @@ public class YamlConfigurationLoader implements ConfigurationLoader
                 throw new AssertionError(e);
             }
 
-
             Constructor constructor = new CustomConstructor(Config.class, Yaml.class.getClassLoader());
             Map<Class<?>, Map<String, Replacement>> replacements = getNameReplacements(Config.class);
             PropertiesChecker propertiesChecker = new PropertiesChecker(replacements);
@@ -138,8 +145,48 @@ public class YamlConfigurationLoader implements ConfigurationLoader
         catch (YAMLException e)
         {
             throw new ConfigurationException("Invalid yaml: " + url + SystemUtils.LINE_SEPARATOR
-                                             +  " Error: " + e.getMessage(), false);
+                                             + " Error: " + e.getMessage(), false);
+        }
+    }
+
+    private static String readStorageConfig(URL url)
+    {
+        String content;
+
+        try
+        {
+            content = new String (Files.readAllBytes(Paths.get(String.valueOf(url).substring(5))));
         }
+        catch (IOException e)
+        {
+            throw new ConfigurationException("Invalid yaml: " + url, e);
+        }
+
+        return content;
+    }
+
+    private static void validateConfigFile()
+    {
+        String content = YamlConfigurationLoader.readStorageConfig(storageConfigURL);
+
+        if (isBlank("commitlog_sync_period", content))
+            throw new IllegalArgumentException("You should provide a value for commitlog_sync_period or comment it in " +
+                                               "order to get a default one");
+
+        if (isBlank("commitlog_sync_group_window", content))
+            throw new IllegalArgumentException("You should provide a value for commitlog_sync_group_window or comment it in " +
+                                               "order to get a default one");
+    }
+
+    /**
+     * This method helps to preserve the behavior of parameters which were originally of primitive type and
+     * without default value in Config.java (CASSANDRA-15234)
+     */
+    private static boolean isBlank(String property, String content)
+    {
+        Pattern p = Pattern.compile(String.format("%s%s *: *$", '^', property), Pattern.MULTILINE);
+        Matcher m = p.matcher(content);
+        return m.find();
     }
 
     @VisibleForTesting
@@ -171,6 +218,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
         return value;
     }
 
+    @VisibleForTesting
     static class CustomConstructor extends CustomClassLoaderConstructor
     {
         CustomConstructor(Class<?> theRoot, ClassLoader classLoader)
@@ -213,6 +261,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
      * Utility class to check that there are no extra properties and that properties that are not null by default
      * are not set to null.
      */
+    @VisibleForTesting
     private static class PropertiesChecker extends PropertyUtils
     {
         private final Set<String> missingProperties = new HashSet<>();
@@ -223,22 +272,23 @@ public class YamlConfigurationLoader implements ConfigurationLoader
 
         private final Map<Class<?>, Map<String, Replacement>> replacements;
 
-        public PropertiesChecker(Map<Class<?>, Map<String, Replacement>> replacements)
+        PropertiesChecker(Map<Class<?>, Map<String, Replacement>> replacements)
         {
             this.replacements = Objects.requireNonNull(replacements, "Replacements should not be null");
             setSkipMissingProperties(true);
         }
 
         @Override
-        public Property getProperty(Class<? extends Object> type, String name)
+        public Property getProperty(Class<?> type, String name)
         {
             final Property result;
             Map<String, Replacement> typeReplacements = replacements.getOrDefault(type, Collections.emptyMap());
             if (typeReplacements.containsKey(name))
             {
                 Replacement replacement = typeReplacements.get(name);
+
                 final Property newProperty = super.getProperty(type, replacement.newName);
-                result = new Property(replacement.oldName, newProperty.getType())
+                result = new Property(replacement.oldName, replacement.oldType)
                 {
                     @Override
                     public Class<?>[] getActualTypeArguments()
@@ -249,7 +299,8 @@ public class YamlConfigurationLoader implements ConfigurationLoader
                     @Override
                     public void set(Object o, Object o1) throws Exception
                     {
-                        newProperty.set(o, o1);
+                        Object migratedValue = replacement.converter.convert(o1);
+                        newProperty.set(o, migratedValue);
                     }
 
                     @Override
@@ -270,7 +321,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
                         return null;
                     }
                 };
-
+                
                 if (replacement.deprecated)
                     deprecationWarnings.add(replacement.oldName);
             }
@@ -293,6 +344,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
                     {
                         nullProperties.add(getName());
                     }
+
                     result.set(object, value);
                 }
 
@@ -331,7 +383,7 @@ public class YamlConfigurationLoader implements ConfigurationLoader
                 throw new ConfigurationException("Invalid yaml. Please remove properties " + missingProperties + " from your cassandra.yaml", false);
 
             if (!deprecationWarnings.isEmpty())
-                logger.warn("{} parameters have been deprecated. They have new names; For more information, please refer to NEWS.txt", deprecationWarnings);
+                logger.warn("{} parameters have been deprecated. They have new names and/or value format; For more information, please refer to NEWS.txt", deprecationWarnings);
         }
     }
 
@@ -339,9 +391,9 @@ public class YamlConfigurationLoader implements ConfigurationLoader
      * @param klass to get replacements for
      * @return map of old names and replacements needed.
      */
-    private static Map<Class<?>, Map<String, Replacement>> getNameReplacements(Class<?> klass)
+    private static Map<Class<? extends Object>, Map<String, Replacement>> getNameReplacements(Class<? extends Object> klass)
     {
-        List<Replacement> replacements = getReplacements(klass);
+        List<Replacement> replacements = getReplacementsRecursive(klass);
         Map<Class<?>, Map<String, Replacement>> objectOldNames = new HashMap<>();
         for (Replacement r : replacements)
         {
@@ -357,24 +409,52 @@ public class YamlConfigurationLoader implements ConfigurationLoader
         return objectOldNames;
     }
 
+    /**
+     * @param klass to get replacements for
+     * @return map of old names and replacements needed.
+     */
+    private static List<Replacement> getReplacementsRecursive(Class<?> klass)
+    {
+        Set<Class<?>> seen = new HashSet<>(); // to make sure not to process the same type twice
+        List<Replacement> accum = new ArrayList<>();
+        getReplacementsRecursive(seen, accum, klass);
+        return accum.isEmpty() ? Collections.emptyList() : accum;
+    }
+
+    private static void getReplacementsRecursive(Set<Class<?>> seen,
+                                                 List<Replacement> accum,
+                                                 Class<?> klass)
+    {
+        accum.addAll(getReplacements(klass));
+        for (Field field : klass.getDeclaredFields())
+        {
+            if (seen.add(field.getType()))
+            {
+                // first time looking at this type, walk it
+                getReplacementsRecursive(seen, accum, field.getType());
+            }
+        }
+    }
+
     private static List<Replacement> getReplacements(Class<?> klass)
     {
         List<Replacement> replacements = new ArrayList<>();
         for (Field field : klass.getDeclaredFields())
         {
             String newName = field.getName();
+            Class<?> newType = field.getType();
             final ReplacesList[] byType = field.getAnnotationsByType(ReplacesList.class);
             if (byType == null || byType.length == 0)
             {
                 Replaces r = field.getAnnotation(Replaces.class);
                 if (r != null)
-                    addReplacement(klass, replacements, newName, r);
+                    addReplacement(klass, replacements, newName, newType, r);
             }
             else
             {
                 for (ReplacesList replacesList : byType)
                     for (Replaces r : replacesList.value())
-                        addReplacement(klass, replacements, newName, r);
+                        addReplacement(klass, replacements, newName, newType, r);
             }
         }
         return replacements.isEmpty() ? Collections.emptyList() : replacements;
@@ -382,24 +462,28 @@ public class YamlConfigurationLoader implements ConfigurationLoader
 
     private static void addReplacement(Class<?> klass,
                                        List<Replacement> replacements,
-                                       String newName,
+                                       String newName, Class<?> newType,
                                        Replaces r)
     {
         String oldName = r.oldName();
+
         boolean deprecated = r.deprecated();
 
-        replacements.add(new Replacement(klass, oldName, newName, deprecated));
+        Class<?> oldType = r.converter().getInputType();
+        if (oldType == null)
+            oldType = newType;
+
+        replacements.add(new Replacement(klass, oldName, oldType, newName, r.converter(), deprecated));
     }
 
     /**
-     * Holder for replacements to support backward compatibility between old and new names for configuration parameters
-     * backported partially from trunk(CASSANDRA-15234) to support a bug fix/improvement in Cassadra 4.0
-     * (CASSANDRA-17141)
+     * Holder for replacements to support backward compatibility between old and new names and types
+     * of configuration parameters (CASSANDRA-15234)
      */
     static final class Replacement
     {
         /**
-         * Currently we use for Config class
+         * Currently we use Config class
          */
         final Class<?> parent;
         /**
@@ -407,22 +491,32 @@ public class YamlConfigurationLoader implements ConfigurationLoader
          */
         final String oldName;
         /**
+         * Old type of the configuration parameter
+         */
+        final Class<?> oldType;
+        /**
          * New name used for the configuration parameter
          */
         final String newName;
         /**
-         * A flag to mark whether the old name is deprecated and fire a warning to the user. By default we set it to false.
+         * Converter to be used according to the old default unit which was provided as a suffix of the configuration
+         * parameter
          */
+        final Converters converter;
         final boolean deprecated;
 
         Replacement(Class<?> parent,
                     String oldName,
+                    Class<?> oldType,
                     String newName,
+                    Converters converter,
                     boolean deprecated)
         {
             this.parent = Objects.requireNonNull(parent);
             this.oldName = Objects.requireNonNull(oldName);
+            this.oldType = Objects.requireNonNull(oldType);
             this.newName = Objects.requireNonNull(newName);
+            this.converter = Objects.requireNonNull(converter);
             // by default deprecated is false
             this.deprecated = deprecated;
         }
diff --git a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
index b0ae018..cc91152 100644
--- a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
+++ b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
@@ -50,6 +50,13 @@ final class SettingsTable extends AbstractVirtualTable
               .collect(Collectors.toMap(Field::getName, Functions.identity()));
 
     @VisibleForTesting
+    static final Map<String, Field> ANNOTATED_FIELDS =
+        Arrays.stream(Config.class.getFields())
+              .filter(f -> !Modifier.isStatic(f.getModifiers()))
+              .filter(f -> f.isAnnotationPresent(Replaces.class))
+              .collect(Collectors.toMap(Field::getName, Functions.identity()));
+
+    @VisibleForTesting
     final Map<String, BiConsumer<SimpleDataSet, Field>> overrides =
         ImmutableMap.<String, BiConsumer<SimpleDataSet, Field>>builder()
                     .put("audit_logging_options", this::addAuditLoggingOptions)
@@ -108,6 +115,15 @@ final class SettingsTable extends AbstractVirtualTable
             if (value.getClass().isArray())
                 value = Arrays.toString((Object[]) value);
             result.row(f.getName()).column(VALUE, value.toString());
+
+            if (ANNOTATED_FIELDS.containsKey(f.getName()))
+            {
+                Replaces annotation = f.getAnnotation(Replaces.class);
+                result.row(annotation.oldName())
+                      .column(VALUE, annotation.converter()
+                                               .deconvert(value)
+                                               .toString());
+            }
         }
     }
 

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


[cassandra] 09/13: Transfer parameters to the newly introduced configuration framework (5) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 1315d0c96f4625a76296f58d431f97669e5178c2
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Thu Feb 3 22:28:41 2022 -0500

    Transfer parameters to the newly introduced configuration framework (5)
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                |  40 +--
 src/java/org/apache/cassandra/config/Config.java   |  79 +++---
 .../cassandra/config/DatabaseDescriptor.java       | 272 ++++++++++++---------
 .../config/SmallestDataStorageMebibytes.java       |  11 +
 .../cassandra/cql3/statements/BatchStatement.java  |   4 +-
 src/java/org/apache/cassandra/db/ColumnIndex.java  |  12 +-
 src/java/org/apache/cassandra/db/Memtable.java     |   4 +-
 .../org/apache/cassandra/db/RowIndexEntry.java     |  16 +-
 .../apache/cassandra/db/marshal/AbstractType.java  |   2 +-
 .../org/apache/cassandra/io/sstable/IndexInfo.java |   2 +-
 .../org/apache/cassandra/io/util/FileUtils.java    |  10 +-
 .../apache/cassandra/repair/ValidationManager.java |   2 +-
 .../cassandra/service/ActiveRepairService.java     |  20 +-
 .../service/ActiveRepairServiceMBean.java          |   5 +
 .../apache/cassandra/service/StorageService.java   |  18 +-
 .../apache/cassandra/streaming/StreamSession.java  |   2 +-
 .../tools/nodetool/GetColumnIndexSize.java         |   2 +-
 .../tools/nodetool/SetColumnIndexSize.java         |   6 +-
 test/conf/cassandra-murmur.yaml                    |   2 +-
 test/conf/cassandra-old.yaml                       |   3 +-
 ...dra-sslcontextfactory-invalidconfiguration.yaml |   2 +-
 test/conf/cassandra-sslcontextfactory.yaml         |   2 +-
 test/conf/unit-test-conf/test-native-port.yaml     |   2 +-
 .../cassandra/distributed/impl/InstanceConfig.java |   2 +-
 .../distributed/test/LargeColumnTest.java          |   8 +-
 .../cassandra/simulator/ClusterSimulation.java     |   2 +-
 .../cassandra/config/DatabaseDescriptorTest.java   |  39 +--
 .../LoadOldYAMLBackwardCompatibilityTest.java      |  13 +-
 .../config/YamlConfigurationLoaderTest.java        |   8 +-
 .../db/compaction/CompactionsCQLTest.java          |   6 +-
 .../io/sstable/SSTableWriterTestBase.java          |   2 +-
 .../org/apache/cassandra/repair/ValidatorTest.java |  16 +-
 .../cassandra/service/ClientWarningsTest.java      |   2 +-
 .../cassandra/service/ProtocolBetaVersionTest.java |   2 +-
 .../tools/nodetool/SetGetColumnIndexSizeTest.java  |  12 +-
 .../cassandra/transport/CQLConnectionTest.java     |   4 +-
 36 files changed, 365 insertions(+), 269 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 3d8168b..0c4acb8 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -582,8 +582,8 @@ concurrent_materialized_view_writes: 32
 # accepting writes when the limit is exceeded until a flush completes,
 # and will trigger a flush based on memtable_cleanup_threshold
 # If omitted, Cassandra will set both to 1/4 the size of the heap.
-# memtable_heap_space_in_mb: 2048
-# memtable_offheap_space_in_mb: 2048
+# memtable_heap_space: 2048MiB
+# memtable_offheap_space: 2048MiB
 
 # memtable_cleanup_threshold is deprecated. The default calculation
 # is the only reasonable choice. See the comments on  memtable_flush_writers
@@ -620,7 +620,7 @@ memtable_allocation_type: heap_buffers
 #
 # For more details see https://issues.apache.org/jira/browse/CASSANDRA-14096.
 #
-# repair_session_space_in_mb:
+# repair_session_space:
 
 # Total space to use for commit logs on disk.
 #
@@ -771,7 +771,7 @@ native_transport_port: 9042
 # The maximum size of allowed frame. Frame (requests) larger than this will
 # be rejected as invalid. The default is 16MB. If you're changing this parameter,
 # you may want to adjust max_value_size_in_mb accordingly. This should be positive and less than 2048.
-# native_transport_max_frame_size_in_mb: 16
+# native_transport_max_frame_size: 16MiB
 
 # The maximum number of concurrent client connections.
 # The default is -1, which means unlimited.
@@ -836,7 +836,7 @@ rpc_keepalive: true
 # /proc/sys/net/ipv4/tcp_wmem
 # /proc/sys/net/ipv4/tcp_wmem
 # and 'man tcp'
-# internode_socket_send_buffer_size_in_bytes:
+# internode_socket_send_buffer_size:
 
 # Uncomment to set socket buffer size for internode communication
 # Note that when setting this, the buffer size is limited by net.core.wmem_max
@@ -878,7 +878,7 @@ snapshot_links_per_second: 0
 # - but, Cassandra will keep the collation index in memory for hot
 #   rows (as part of the key cache), so a larger granularity means
 #   you can cache more hot rows
-column_index_size_in_kb: 64
+column_index_size: 64KiB
 
 # Per sstable indexed key cache entries (the collation index in memory
 # mentioned above) exceeding this size will not be held on heap.
@@ -887,7 +887,7 @@ column_index_size_in_kb: 64
 #
 # Note that this size refers to the size of the
 # serialized index information and not the size of the partition.
-column_index_cache_size_in_kb: 2
+column_index_cache_size: 2KiB
 
 # Number of simultaneous compactions to allow, NOT including
 # validation "compactions" for anti-entropy repair.  Simultaneous
@@ -1011,17 +1011,17 @@ request_timeout: 10000ms
 # See (CASSANDRA-14358) for details.
 #
 # The amount of time to wait for internode tcp connections to establish.
-# internode_tcp_connect_timeout_in_ms: 2000
+# internode_tcp_connect_timeout: 2000ms
 #
 # The amount of time unacknowledged data is allowed on a connection before we throw out the connection
 # Note this is only supported on Linux + epoll, and it appears to behave oddly above a setting of 30000
 # (it takes much longer than 30s) as of Linux 4.12. If you want something that high set this to 0
 # which picks up the OS default and configure the net.ipv4.tcp_retries2 sysctl to be ~8.
-# internode_tcp_user_timeout_in_ms: 30000
+# internode_tcp_user_timeout: 30000ms
 
 # The amount of time unacknowledged data is allowed on a streaming connection.
 # The default is 5 minutes. Increase it or set it to 0 in order to increase the timeout.
-# internode_streaming_tcp_user_timeout_in_ms: 300000
+# internode_streaming_tcp_user_timeout: 300000ms
 
 # Global, per-endpoint and per-connection limits imposed on messages queued for delivery to other nodes
 # and waiting to be processed on arrival from other nodes in the cluster.  These limits are applied to the on-wire
@@ -1029,7 +1029,7 @@ request_timeout: 10000ms
 #
 # The basic per-link limit is consumed in isolation before any endpoint or global limit is imposed.
 # Each node-pair has three links: urgent, small and large.  So any given node may have a maximum of
-# N*3*(internode_application_send_queue_capacity_in_bytes+internode_application_receive_queue_capacity_in_bytes)
+# N*3*(internode_application_send_queue_capacity+internode_application_receive_queue_capacity)
 # messages queued without any coordination between them although in practice, with token-aware routing, only RF*tokens
 # nodes should need to communicate with significant bandwidth.
 #
@@ -1038,12 +1038,12 @@ request_timeout: 10000ms
 # The global limit is imposed on all messages exceeding the per-link limit, simultaneously with the per-endpoint limit,
 # on all links to or from any node in the cluster.
 #
-# internode_application_send_queue_capacity_in_bytes: 4194304                       #4MiB
-# internode_application_send_queue_reserve_endpoint_capacity_in_bytes: 134217728    #128MiB
-# internode_application_send_queue_reserve_global_capacity_in_bytes: 536870912      #512MiB
-# internode_application_receive_queue_capacity_in_bytes: 4194304                    #4MiB
-# internode_application_receive_queue_reserve_endpoint_capacity_in_bytes: 134217728 #128MiB
-# internode_application_receive_queue_reserve_global_capacity_in_bytes: 536870912   #512MiB
+# internode_application_send_queue_capacity: 4MiB
+# internode_application_send_queue_reserve_endpoint_capacity: 128MiB
+# internode_application_send_queue_reserve_global_capacity: 512MiB
+# internode_application_receive_queue_capacity: 4MiB
+# internode_application_receive_queue_reserve_endpoint_capacity: 128MiB
+# internode_application_receive_queue_reserve_global_capacity: 512MiB
 
 
 # How long before a node logs slow queries. Select queries that take longer than
@@ -1385,10 +1385,10 @@ replica_filtering_protection:
 
 # Log WARN on any multiple-partition batch size exceeding this value. 5kb per batch by default.
 # Caution should be taken on increasing the size of this threshold as it can lead to node instability.
-batch_size_warn_threshold_in_kb: 5
+batch_size_warn_threshold: 5KiB
 
 # Fail any multiple-partition batch exceeding this value. 50kb (10x warn threshold) by default.
-batch_size_fail_threshold_in_kb: 50
+batch_size_fail_threshold: 50KiB
 
 # Log WARN on any batches not of type LOGGED than span across more partitions than this limit
 unlogged_batch_across_partitions_warn_threshold: 10
@@ -1411,7 +1411,7 @@ compaction_tombstone_warning_threshold: 100000
 # Maximum size of any value in SSTables. Safety measure to detect SSTable corruption
 # early. Any value size larger than this threshold will result into marking an SSTable
 # as corrupted. This should be positive and less than 2048.
-# max_value_size_in_mb: 256
+# max_value_size: 256MiB
 
 # ** Impact on keyspace creation **
 # If replication factor is not mentioned as part of keyspace creation, default_keyspace_rf would apply.
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 6c22d5f..7ee8c42 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -148,14 +148,17 @@ public class Config
     public Integer concurrent_replicates = null;
 
     public int memtable_flush_writers = 0;
-    public Integer memtable_heap_space_in_mb;
-    public Integer memtable_offheap_space_in_mb;
+    @Replaces(oldName = "memtable_heap_space_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes memtable_heap_space;
+    @Replaces(oldName = "memtable_offheap_space_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes memtable_offheap_space;
     public Float memtable_cleanup_threshold = null;
 
     // Limit the maximum depth of repair session merkle trees
     @Deprecated
     public volatile Integer repair_session_max_tree_depth = null;
-    public volatile Integer repair_session_space_in_mb = null;
+    @Replaces(oldName = "repair_session_space_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public volatile SmallestDataStorageMebibytes repair_session_space = null;
 
     public volatile boolean use_offheap_merkle_trees = true;
 
@@ -183,39 +186,52 @@ public class Config
     public String broadcast_rpc_address;
     public boolean rpc_keepalive = true;
 
-    public Integer internode_max_message_size_in_bytes;
+    @Replaces(oldName = "internode_max_message_size_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated=true)
+    public DataStorageSpec internode_max_message_size;
 
-    @Replaces(oldName = "internode_send_buff_size_in_bytes", deprecated = true)
-    public int internode_socket_send_buffer_size_in_bytes = 0;
-    @Replaces(oldName = "internode_recv_buff_size_in_bytes", deprecated = true)
-    public int internode_socket_receive_buffer_size_in_bytes = 0;
+    @Replaces(oldName = "internode_socket_send_buffer_size_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    @Replaces(oldName = "internode_send_buff_size_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    public DataStorageSpec internode_socket_send_buffer_size = new DataStorageSpec("0B");
+    @Replaces(oldName = "internode_socket_receive_buffer_size_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    @Replaces(oldName = "internode_recv_buff_size_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    public DataStorageSpec internode_socket_receive_buffer_size = new DataStorageSpec("0B");
 
-    // TODO: derive defaults from system memory settings?
-    public int internode_application_send_queue_capacity_in_bytes = 1 << 22; // 4MiB
-    public int internode_application_send_queue_reserve_endpoint_capacity_in_bytes = 1 << 27; // 128MiB
-    public int internode_application_send_queue_reserve_global_capacity_in_bytes = 1 << 29; // 512MiB
+    @Replaces(oldName = "internode_application_send_queue_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    public DataStorageSpec internode_application_send_queue_capacity = new DataStorageSpec("4MiB");
+    @Replaces(oldName = "internode_application_send_queue_reserve_endpoint_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    public DataStorageSpec internode_application_send_queue_reserve_endpoint_capacity = new DataStorageSpec("128MiB");
+    @Replaces(oldName = "internode_application_send_queue_reserve_global_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    public DataStorageSpec internode_application_send_queue_reserve_global_capacity = new DataStorageSpec("512MiB");
 
-    public int internode_application_receive_queue_capacity_in_bytes = 1 << 22; // 4MiB
-    public int internode_application_receive_queue_reserve_endpoint_capacity_in_bytes = 1 << 27; // 128MiB
-    public int internode_application_receive_queue_reserve_global_capacity_in_bytes = 1 << 29; // 512MiB
+    // TODO: derive defaults from system memory settings?
+    @Replaces(oldName = "internode_application_receive_queue_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    public DataStorageSpec internode_application_receive_queue_capacity = new DataStorageSpec("4MiB");
+    @Replaces(oldName = "internode_application_receive_queue_reserve_endpoint_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    public DataStorageSpec internode_application_receive_queue_reserve_endpoint_capacity = new DataStorageSpec("128MiB");
+    @Replaces(oldName = "internode_application_receive_queue_reserve_global_capacity_in_bytes", converter = Converters.BYTES_DATASTORAGE, deprecated = true)
+    public DataStorageSpec internode_application_receive_queue_reserve_global_capacity = new DataStorageSpec("512MiB");
 
     // Defensive settings for protecting Cassandra from true network partitions. See (CASSANDRA-14358) for details.
     // The amount of time to wait for internode tcp connections to establish.
-    public volatile int internode_tcp_connect_timeout_in_ms = 2000;
+    @Replaces(oldName = "internode_tcp_connect_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds internode_tcp_connect_timeout = new SmallestDurationMilliseconds("2s");
     // The amount of time unacknowledged data is allowed on a connection before we throw out the connection
     // Note this is only supported on Linux + epoll, and it appears to behave oddly above a setting of 30000
     // (it takes much longer than 30s) as of Linux 4.12. If you want something that high set this to 0
     // (which picks up the OS default) and configure the net.ipv4.tcp_retries2 sysctl to be ~8.
-    public volatile int internode_tcp_user_timeout_in_ms = 30000;
-    // Similar to internode_tcp_user_timeout_in_ms but used specifically for streaming connection.
+    @Replaces(oldName = "internode_tcp_user_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds internode_tcp_user_timeout = new SmallestDurationMilliseconds("30s");
+    // Similar to internode_tcp_user_timeout but used specifically for streaming connection.
     // The default is 5 minutes. Increase it or set it to 0 in order to increase the timeout.
-    public volatile int internode_streaming_tcp_user_timeout_in_ms = 300_000; // 5 minutes
+    @Replaces(oldName = "internode_streaming_tcp_user_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds internode_streaming_tcp_user_timeout = new SmallestDurationMilliseconds("300s"); // 5 minutes
 
     public boolean start_native_transport = true;
     public int native_transport_port = 9042;
     public Integer native_transport_port_ssl = null;
     public int native_transport_max_threads = 128;
-    public int native_transport_max_frame_size_in_mb = 16;
+    @Replaces(oldName = "native_transport_max_frame_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes native_transport_max_frame_size = new SmallestDataStorageMebibytes("16MiB");
     public volatile long native_transport_max_concurrent_connections = -1L;
     public volatile long native_transport_max_concurrent_connections_per_ip = -1L;
     public boolean native_transport_flush_in_batches_legacy = false;
@@ -224,27 +240,34 @@ public class Config
     public volatile long native_transport_max_concurrent_requests_in_bytes = -1L;
     public volatile boolean native_transport_rate_limiting_enabled = false;
     public volatile int native_transport_max_requests_per_second = 1000000;
+    // not exposed in the yaml
     public int native_transport_receive_queue_capacity_in_bytes = 1 << 20; // 1MiB
 
     @Deprecated
     public Integer native_transport_max_negotiable_protocol_version = null;
 
     /**
-     * Max size of values in SSTables, in MegaBytes.
-     * Default is the same as the native protocol frame limit: 256Mb.
+     * Max size of values in SSTables, in MebiBytes.
+     * Default is the same as the native protocol frame limit: 256MiB.
      * See AbstractType for how it is used.
      */
-    public int max_value_size_in_mb = 256;
+    @Replaces(oldName = "max_value_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes max_value_size = new SmallestDataStorageMebibytes("256MiB");
 
     public boolean snapshot_before_compaction = false;
     public boolean auto_snapshot = true;
     public volatile long snapshot_links_per_second = 0;
 
     /* if the size of columns or super-columns are more than this, indexing will kick in */
-    public volatile int column_index_size_in_kb = 64;
-    public volatile int column_index_cache_size_in_kb = 2;
-    public volatile int batch_size_warn_threshold_in_kb = 5;
-    public volatile int batch_size_fail_threshold_in_kb = 50;
+    @Replaces(oldName = "column_index_size_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
+    public volatile SmallestDataStorageKibibytes column_index_size = new SmallestDataStorageKibibytes("64KiB");
+    @Replaces(oldName = "column_index_cache_size_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
+    public volatile SmallestDataStorageKibibytes column_index_cache_size = new SmallestDataStorageKibibytes("2KiB");
+    @Replaces(oldName = "batch_size_warn_threshold_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
+    public volatile SmallestDataStorageKibibytes batch_size_warn_threshold = new SmallestDataStorageKibibytes("5KiB");
+    @Replaces(oldName = "batch_size_fail_threshold_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
+    public volatile SmallestDataStorageKibibytes batch_size_fail_threshold = new SmallestDataStorageKibibytes("50KiB");
+
     public Integer unlogged_batch_across_partitions_warn_threshold = 10;
     public volatile Integer concurrent_compactors;
     @Replaces(oldName = "compaction_throughput_mb_per_sec", converter = Converters.MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
@@ -355,8 +378,6 @@ public class Config
 
     public int cache_load_timeout_seconds = 30;
 
-    public Long paxos_cache_size_in_mb = null;
-
     private static boolean isClientMode = false;
     private static Supplier<Config> overrideLoadConfig = null;
 
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index d573def..3b1ef66 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -79,7 +79,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static org.apache.cassandra.config.CassandraRelevantProperties.OS_ARCH;
 import static org.apache.cassandra.config.CassandraRelevantProperties.SUN_ARCH_DATA_MODEL;
 import static org.apache.cassandra.io.util.FileUtils.ONE_GB;
-import static org.apache.cassandra.io.util.FileUtils.ONE_MB;
+import static org.apache.cassandra.io.util.FileUtils.ONE_MIB;
 import static org.apache.cassandra.utils.Clock.Global.logInitializationOutcome;
 
 public class DatabaseDescriptor
@@ -469,24 +469,22 @@ public class DatabaseDescriptor
         if (conf.file_cache_round_up == null)
             conf.file_cache_round_up = conf.disk_optimization_strategy == Config.DiskOptimizationStrategy.spinning;
 
-        if (conf.memtable_offheap_space_in_mb == null)
-            conf.memtable_offheap_space_in_mb = (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576));
-        if (conf.memtable_offheap_space_in_mb < 0)
-            throw new ConfigurationException("memtable_offheap_space_in_mb must be positive, but was " + conf.memtable_offheap_space_in_mb, false);
+        if (conf.memtable_offheap_space == null)
+            conf.memtable_offheap_space = SmallestDataStorageMebibytes.inMebibytes( (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)));
         // for the moment, we default to twice as much on-heap space as off-heap, as heap overhead is very large
-        if (conf.memtable_heap_space_in_mb == null)
-            conf.memtable_heap_space_in_mb = (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576));
-        if (conf.memtable_heap_space_in_mb <= 0)
-            throw new ConfigurationException("memtable_heap_space_in_mb must be positive, but was " + conf.memtable_heap_space_in_mb, false);
-        logger.info("Global memtable on-heap threshold is enabled at {}MB", conf.memtable_heap_space_in_mb);
-        if (conf.memtable_offheap_space_in_mb == 0)
+        if (conf.memtable_heap_space == null)
+            conf.memtable_heap_space = SmallestDataStorageMebibytes.inMebibytes((int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)));
+        if (conf.memtable_heap_space.toMebibytesAsInt() == 0)
+            throw new ConfigurationException("memtable_heap_space must be positive, but was " + conf.memtable_heap_space, false);
+        logger.info("Global memtable on-heap threshold is enabled at {}", conf.memtable_heap_space);
+        if (conf.memtable_offheap_space.toMebibytesAsInt() == 0)
             logger.info("Global memtable off-heap threshold is disabled, HeapAllocator will be used instead");
         else
-            logger.info("Global memtable off-heap threshold is enabled at {}MB", conf.memtable_offheap_space_in_mb);
+            logger.info("Global memtable off-heap threshold is enabled at {}", conf.memtable_offheap_space);
 
         if (conf.repair_session_max_tree_depth != null)
         {
-            logger.warn("repair_session_max_tree_depth has been deprecated and should be removed from cassandra.yaml. Use repair_session_space_in_mb instead");
+            logger.warn("repair_session_max_tree_depth has been deprecated and should be removed from cassandra.yaml. Use repair_session_space instead");
             if (conf.repair_session_max_tree_depth < 10)
                 throw new ConfigurationException("repair_session_max_tree_depth should not be < 10, but was " + conf.repair_session_max_tree_depth);
             if (conf.repair_session_max_tree_depth > 20)
@@ -497,27 +495,30 @@ public class DatabaseDescriptor
             conf.repair_session_max_tree_depth = 20;
         }
 
-        if (conf.repair_session_space_in_mb == null)
-            conf.repair_session_space_in_mb = Math.max(1, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576)));
+        if (conf.repair_session_space == null)
+            conf.repair_session_space = SmallestDataStorageMebibytes.inMebibytes(Math.max(1, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576))));
 
-        if (conf.repair_session_space_in_mb < 1)
-            throw new ConfigurationException("repair_session_space_in_mb must be > 0, but was " + conf.repair_session_space_in_mb);
-        else if (conf.repair_session_space_in_mb > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))
-            logger.warn("A repair_session_space_in_mb of " + conf.repair_session_space_in_mb + " megabytes is likely to cause heap pressure");
+        if (conf.repair_session_space.toMebibytes() < 1)
+            throw new ConfigurationException("repair_session_space must be > 0, but was " + conf.repair_session_space);
+        else if (conf.repair_session_space.toMebibytesAsInt() > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))
+            logger.warn("A repair_session_space of " + conf.repair_session_space+ " mebibytes is likely to cause heap pressure");
 
         checkForLowestAcceptedTimeouts(conf);
 
-        checkValidForByteConversion(conf.native_transport_max_frame_size_in_mb,
-                                    "native_transport_max_frame_size_in_mb", ByteUnit.MEBI_BYTES);
-
-        checkValidForByteConversion(conf.column_index_size_in_kb,
-                                    "column_index_size_in_kb", ByteUnit.KIBI_BYTES);
-
-        checkValidForByteConversion(conf.column_index_cache_size_in_kb,
-                                    "column_index_cache_size_in_kb", ByteUnit.KIBI_BYTES);
+        long valueInBytes = conf.native_transport_max_frame_size.toBytes();
+        if (valueInBytes < 0 || valueInBytes > Integer.MAX_VALUE)
+        {
+            throw new ConfigurationException(String.format("%s must be positive value < %dB, but was %dB",
+                                                           "native_transport_max_frame_size",
+                                                           conf.native_transport_max_frame_size.getUnit()
+                                                                .convert(Integer.MAX_VALUE, DataStorageSpec.DataStorageUnit.BYTES),
+                                                           valueInBytes),
+                                             false);
+        }
 
-        checkValidForByteConversion(conf.batch_size_warn_threshold_in_kb,
-                                    "batch_size_warn_threshold_in_kb", ByteUnit.KIBI_BYTES);
+        checkValidForByteConversion(conf.column_index_size, "column_index_size");
+        checkValidForByteConversion(conf.column_index_cache_size, "column_index_cache_size");
+        checkValidForByteConversion(conf.batch_size_warn_threshold, "batch_size_warn_threshold");
 
         if (conf.native_transport_max_negotiable_protocol_version != null)
             logger.warn("The configuration option native_transport_max_negotiable_protocol_version has been deprecated " +
@@ -770,11 +771,11 @@ public class DatabaseDescriptor
         if (conf.snapshot_links_per_second < 0)
             throw new ConfigurationException("snapshot_links_per_second must be >= 0");
 
-        if (conf.max_value_size_in_mb <= 0)
-            throw new ConfigurationException("max_value_size_in_mb must be positive", false);
-        else if (conf.max_value_size_in_mb >= 2048)
-            throw new ConfigurationException("max_value_size_in_mb must be smaller than 2048, but was "
-                    + conf.max_value_size_in_mb, false);
+        if (conf.max_value_size.toMebibytesAsInt() == 0)
+            throw new ConfigurationException("max_value_size must be positive", false);
+        else if (conf.max_value_size.toMebibytesAsInt() >= 2048)
+            throw new ConfigurationException("max_value_size must be smaller than 2048, but was "
+                    + conf.max_value_size.toString(), false);
 
         switch (conf.disk_optimization_strategy)
         {
@@ -796,26 +797,30 @@ public class DatabaseDescriptor
                 throw new ConfigurationException("legacy_ssl_storage_port_enabled is true (enabled) with internode encryption disabled (none). Enable encryption or disable the legacy ssl storage port.");
             }
         }
-        Integer maxMessageSize = conf.internode_max_message_size_in_bytes;
-        if (maxMessageSize != null)
+
+        if (conf.internode_max_message_size != null)
         {
-            if (maxMessageSize > conf.internode_application_receive_queue_reserve_endpoint_capacity_in_bytes)
-                throw new ConfigurationException("internode_max_message_size_in_mb must no exceed internode_application_receive_queue_reserve_endpoint_capacity_in_bytes", false);
+            long maxMessageSize = conf.internode_max_message_size.toBytes();
+
+            if (maxMessageSize > conf.internode_application_receive_queue_reserve_endpoint_capacity.toBytes())
+                throw new ConfigurationException("internode_max_message_size must no exceed internode_application_receive_queue_reserve_endpoint_capacity", false);
 
-            if (maxMessageSize > conf.internode_application_receive_queue_reserve_global_capacity_in_bytes)
-                throw new ConfigurationException("internode_max_message_size_in_mb must no exceed internode_application_receive_queue_reserve_global_capacity_in_bytes", false);
+            if (maxMessageSize > conf.internode_application_receive_queue_reserve_global_capacity.toBytes())
+                throw new ConfigurationException("internode_max_message_size must no exceed internode_application_receive_queue_reserve_global_capacity", false);
 
-            if (maxMessageSize > conf.internode_application_send_queue_reserve_endpoint_capacity_in_bytes)
-                throw new ConfigurationException("internode_max_message_size_in_mb must no exceed internode_application_send_queue_reserve_endpoint_capacity_in_bytes", false);
+            if (maxMessageSize > conf.internode_application_send_queue_reserve_endpoint_capacity.toBytes())
+                throw new ConfigurationException("internode_max_message_size must no exceed internode_application_send_queue_reserve_endpoint_capacity", false);
 
-            if (maxMessageSize > conf.internode_application_send_queue_reserve_global_capacity_in_bytes)
-                throw new ConfigurationException("internode_max_message_size_in_mb must no exceed internode_application_send_queue_reserve_global_capacity_in_bytes", false);
+            if (maxMessageSize > conf.internode_application_send_queue_reserve_global_capacity.toBytes())
+                throw new ConfigurationException("internode_max_message_size must no exceed internode_application_send_queue_reserve_global_capacity", false);
         }
         else
         {
-            conf.internode_max_message_size_in_bytes =
-                Math.min(conf.internode_application_receive_queue_reserve_endpoint_capacity_in_bytes,
-                         conf.internode_application_send_queue_reserve_endpoint_capacity_in_bytes);
+            long maxMessageSizeInBytes =
+            Math.min(conf.internode_application_receive_queue_reserve_endpoint_capacity.toBytes(),
+                     conf.internode_application_send_queue_reserve_endpoint_capacity.toBytes());
+
+            conf.internode_max_message_size = DataStorageSpec.inBytes(maxMessageSizeInBytes);
         }
 
         validateMaxConcurrentAutoUpgradeTasksConf(conf.max_concurrent_automatic_sstable_upgrades);
@@ -901,7 +906,7 @@ public class DatabaseDescriptor
 
     static int calculateDefaultSpaceInMB(String type, String path, String setting, int preferredSizeInMB, long totalSpaceInBytes, long totalSpaceNumerator, long totalSpaceDenominator)
     {
-        final long totalSizeInMB = totalSpaceInBytes / ONE_MB;
+        final long totalSizeInMB = totalSpaceInBytes / ONE_MIB;
         final int minSizeInMB = Ints.saturatedCast(totalSpaceNumerator * totalSizeInMB / totalSpaceDenominator);
 
         if (minSizeInMB < preferredSizeInMB)
@@ -1061,13 +1066,46 @@ public class DatabaseDescriptor
     @VisibleForTesting
     static void checkForLowestAcceptedTimeouts(Config conf)
     {
-        conf.read_request_timeout = max("read_request_timeout", conf.read_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
-        conf.range_request_timeout = max("range_request_timeout", conf.range_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
-        conf.request_timeout = max("request_timeout", conf.request_timeout, LOWEST_ACCEPTED_TIMEOUT);
-        conf.write_request_timeout = max("write_request_timeout", conf.write_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
-        conf.cas_contention_timeout = max("cas_contention_timeout", conf.cas_contention_timeout, LOWEST_ACCEPTED_TIMEOUT);
-        conf.counter_write_request_timeout = max("counter_write_request_timeout", conf.counter_write_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
-        conf.truncate_request_timeout = max("truncate_request_timeout", conf.truncate_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+        if(conf.read_request_timeout.toMillisecondsAsInt() < LOWEST_ACCEPTED_TIMEOUT.toMillisecondsAsInt())
+        {
+            logInfo("read_request_timeout", conf.read_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+            conf.read_request_timeout = new SmallestDurationMilliseconds("10ms");
+        }
+
+        if(conf.range_request_timeout.toMillisecondsAsInt() < LOWEST_ACCEPTED_TIMEOUT.toMillisecondsAsInt())
+        {
+            logInfo("range_request_timeout", conf.range_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+            conf.range_request_timeout = new SmallestDurationMilliseconds("10ms");
+        }
+
+        if(conf.request_timeout.toMillisecondsAsInt() < LOWEST_ACCEPTED_TIMEOUT.toMillisecondsAsInt())
+        {
+            logInfo("request_timeout", conf.request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+            conf.request_timeout = new SmallestDurationMilliseconds("10ms");
+        }
+
+        if(conf.write_request_timeout.toMillisecondsAsInt() < LOWEST_ACCEPTED_TIMEOUT.toMillisecondsAsInt())
+        {
+            logInfo("write_request_timeout", conf.write_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+            conf.write_request_timeout = new SmallestDurationMilliseconds("10ms");
+        }
+
+        if(conf.cas_contention_timeout.toMillisecondsAsInt() < LOWEST_ACCEPTED_TIMEOUT.toMillisecondsAsInt())
+        {
+            logInfo("cas_contention_timeout", conf.cas_contention_timeout, LOWEST_ACCEPTED_TIMEOUT);
+            conf.cas_contention_timeout = new SmallestDurationMilliseconds("10ms");
+        }
+
+        if(conf.counter_write_request_timeout.toMillisecondsAsInt()< LOWEST_ACCEPTED_TIMEOUT.toMillisecondsAsInt())
+        {
+            logInfo("counter_write_request_timeout", conf.counter_write_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+            conf.counter_write_request_timeout = new SmallestDurationMilliseconds("10ms");
+        }
+        if(conf.truncate_request_timeout.toMillisecondsAsInt() < LOWEST_ACCEPTED_TIMEOUT.toMillisecondsAsInt())
+        {
+            logInfo("truncate_request_timeout", conf.truncate_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+            conf.truncate_request_timeout = LOWEST_ACCEPTED_TIMEOUT;
+        }
     }
 
     private static void logInfo(String property, SmallestDurationMilliseconds actualValue, SmallestDurationMilliseconds lowestAcceptedValue)
@@ -1378,12 +1416,12 @@ public class DatabaseDescriptor
 
     public static int getMaxValueSize()
     {
-        return conf.max_value_size_in_mb * 1024 * 1024;
+        return conf.max_value_size.toBytesAsInt();
     }
 
     public static void setMaxValueSize(int maxValueSizeInBytes)
     {
-        conf.max_value_size_in_mb = maxValueSizeInBytes / 1024 / 1024;
+        conf.max_value_size = SmallestDataStorageMebibytes.inBytes(maxValueSizeInBytes);
     }
 
     /**
@@ -1470,54 +1508,56 @@ public class DatabaseDescriptor
 
     public static int getColumnIndexSize()
     {
-        return (int) ByteUnit.KIBI_BYTES.toBytes(conf.column_index_size_in_kb);
+        return conf.column_index_size.toBytesAsInt();
     }
 
-    public static int getColumnIndexSizeInKB()
+    public static int getColumnIndexSizeInKiB()
     {
-        return conf.column_index_size_in_kb;
+        return conf.column_index_size.toKibibytesAsInt();
     }
 
     public static void setColumnIndexSize(int val)
     {
-        checkValidForByteConversion(val, "column_index_size_in_kb", ByteUnit.KIBI_BYTES);
-        conf.column_index_size_in_kb = val;
+        SmallestDataStorageKibibytes memory = SmallestDataStorageKibibytes.inKibibytes(val);
+        checkValidForByteConversion(memory, "column_index_size");
+        conf.column_index_size = SmallestDataStorageKibibytes.inKibibytes(val);
     }
 
     public static int getColumnIndexCacheSize()
     {
-        return (int) ByteUnit.KIBI_BYTES.toBytes(conf.column_index_cache_size_in_kb);
+        return conf.column_index_cache_size.toBytesAsInt();
     }
 
-    public static int getColumnIndexCacheSizeInKB()
+    public static int getColumnIndexCacheSizeInKiB()
     {
-        return conf.column_index_cache_size_in_kb;
+        return conf.column_index_cache_size.toKibibytesAsInt();
     }
 
     public static void setColumnIndexCacheSize(int val)
     {
-        checkValidForByteConversion(val, "column_index_cache_size_in_kb", ByteUnit.KIBI_BYTES);
-        conf.column_index_cache_size_in_kb = val;
+        SmallestDataStorageKibibytes memory = SmallestDataStorageKibibytes.inKibibytes(val);
+        checkValidForByteConversion(memory, "column_index_cache_size");
+        conf.column_index_cache_size = SmallestDataStorageKibibytes.inKibibytes(val);
     }
 
     public static int getBatchSizeWarnThreshold()
     {
-        return (int) ByteUnit.KIBI_BYTES.toBytes(conf.batch_size_warn_threshold_in_kb);
+        return conf.batch_size_warn_threshold.toBytesAsInt();
     }
 
-    public static int getBatchSizeWarnThresholdInKB()
+    public static int getBatchSizeWarnThresholdInKiB()
     {
-        return conf.batch_size_warn_threshold_in_kb;
+        return conf.batch_size_warn_threshold.toKibibytesAsInt();
     }
 
     public static long getBatchSizeFailThreshold()
     {
-        return ByteUnit.KIBI_BYTES.toBytes(conf.batch_size_fail_threshold_in_kb);
+        return conf.batch_size_fail_threshold.toBytesAsInt();
     }
 
     public static int getBatchSizeFailThresholdInKB()
     {
-        return conf.batch_size_fail_threshold_in_kb;
+        return conf.batch_size_fail_threshold.toKibibytesAsInt();
     }
 
     public static int getUnloggedBatchAcrossPartitionsWarnThreshold()
@@ -1525,15 +1565,16 @@ public class DatabaseDescriptor
         return conf.unlogged_batch_across_partitions_warn_threshold;
     }
 
-    public static void setBatchSizeWarnThresholdInKB(int threshold)
+    public static void setBatchSizeWarnThresholdInKiB(int threshold)
     {
-        checkValidForByteConversion(threshold, "batch_size_warn_threshold_in_kb", ByteUnit.KIBI_BYTES);
-        conf.batch_size_warn_threshold_in_kb = threshold;
+        SmallestDataStorageKibibytes storage = SmallestDataStorageKibibytes.inKibibytes(threshold);
+        checkValidForByteConversion(storage, "batch_size_warn_threshold");
+        conf.batch_size_warn_threshold = SmallestDataStorageKibibytes.inKibibytes(threshold);
     }
 
     public static void setBatchSizeFailThresholdInKB(int threshold)
     {
-        conf.batch_size_fail_threshold_in_kb = threshold;
+        conf.batch_size_fail_threshold = SmallestDataStorageKibibytes.inKibibytes(threshold);
     }
 
     public static Collection<String> getInitialTokens()
@@ -2198,83 +2239,83 @@ public class DatabaseDescriptor
 
     public static int getInternodeSocketSendBufferSizeInBytes()
     {
-        return conf.internode_socket_send_buffer_size_in_bytes;
+        return conf.internode_socket_send_buffer_size.toBytesAsInt();
     }
 
     public static int getInternodeSocketReceiveBufferSizeInBytes()
     {
-        return conf.internode_socket_receive_buffer_size_in_bytes;
+        return conf.internode_socket_receive_buffer_size.toBytesAsInt();
     }
 
     public static int getInternodeApplicationSendQueueCapacityInBytes()
     {
-        return conf.internode_application_send_queue_capacity_in_bytes;
+        return conf.internode_application_send_queue_capacity.toBytesAsInt();
     }
 
     public static int getInternodeApplicationSendQueueReserveEndpointCapacityInBytes()
     {
-        return conf.internode_application_send_queue_reserve_endpoint_capacity_in_bytes;
+        return conf.internode_application_send_queue_reserve_endpoint_capacity.toBytesAsInt();
     }
 
     public static int getInternodeApplicationSendQueueReserveGlobalCapacityInBytes()
     {
-        return conf.internode_application_send_queue_reserve_global_capacity_in_bytes;
+        return conf.internode_application_send_queue_reserve_global_capacity.toBytesAsInt();
     }
 
     public static int getInternodeApplicationReceiveQueueCapacityInBytes()
     {
-        return conf.internode_application_receive_queue_capacity_in_bytes;
+        return conf.internode_application_receive_queue_capacity.toBytesAsInt();
     }
 
     public static int getInternodeApplicationReceiveQueueReserveEndpointCapacityInBytes()
     {
-        return conf.internode_application_receive_queue_reserve_endpoint_capacity_in_bytes;
+        return conf.internode_application_receive_queue_reserve_endpoint_capacity.toBytesAsInt();
     }
 
     public static int getInternodeApplicationReceiveQueueReserveGlobalCapacityInBytes()
     {
-        return conf.internode_application_receive_queue_reserve_global_capacity_in_bytes;
+        return conf.internode_application_receive_queue_reserve_global_capacity.toBytesAsInt();
     }
 
     public static int getInternodeTcpConnectTimeoutInMS()
     {
-        return conf.internode_tcp_connect_timeout_in_ms;
+        return conf.internode_tcp_connect_timeout.toMillisecondsAsInt();
     }
 
     public static void setInternodeTcpConnectTimeoutInMS(int value)
     {
-        conf.internode_tcp_connect_timeout_in_ms = value;
+        conf.internode_tcp_connect_timeout = SmallestDurationMilliseconds.inMilliseconds(value);
     }
 
     public static int getInternodeTcpUserTimeoutInMS()
     {
-        return conf.internode_tcp_user_timeout_in_ms;
+        return conf.internode_tcp_user_timeout.toMillisecondsAsInt();
     }
 
     public static void setInternodeTcpUserTimeoutInMS(int value)
     {
-        conf.internode_tcp_user_timeout_in_ms = value;
+        conf.internode_tcp_user_timeout = SmallestDurationMilliseconds.inMilliseconds(value);
     }
 
     public static int getInternodeStreamingTcpUserTimeoutInMS()
     {
-        return conf.internode_streaming_tcp_user_timeout_in_ms;
+        return conf.internode_streaming_tcp_user_timeout.toMillisecondsAsInt();
     }
 
     public static void setInternodeStreamingTcpUserTimeoutInMS(int value)
     {
-        conf.internode_streaming_tcp_user_timeout_in_ms = value;
+        conf.internode_streaming_tcp_user_timeout = SmallestDurationMilliseconds.inMilliseconds(value);
     }
 
     public static int getInternodeMaxMessageSizeInBytes()
     {
-        return conf.internode_max_message_size_in_bytes;
+        return conf.internode_max_message_size.toBytesAsInt();
     }
 
     @VisibleForTesting
     public static void setInternodeMaxMessageSizeInBytes(int value)
     {
-        conf.internode_max_message_size_in_bytes = value;
+        conf.internode_max_message_size = DataStorageSpec.inBytes(value);
     }
 
     public static boolean startNativeTransport()
@@ -2320,12 +2361,12 @@ public class DatabaseDescriptor
 
     public static int getNativeTransportMaxFrameSize()
     {
-        return (int) ByteUnit.MEBI_BYTES.toBytes(conf.native_transport_max_frame_size_in_mb);
+        return conf.native_transport_max_frame_size.toBytesAsInt();
     }
 
     public static void setNativeTransportMaxFrameSize(int bytes)
     {
-        conf.native_transport_max_frame_size_in_mb = (int) ByteUnit.MEBI_BYTES.fromBytes(bytes);
+        conf.native_transport_max_frame_size = SmallestDataStorageMebibytes.inMebibytes(bytes);
     }
 
     public static long getNativeTransportMaxConcurrentConnections()
@@ -2953,14 +2994,14 @@ public class DatabaseDescriptor
         return conf.inter_dc_tcp_nodelay;
     }
 
-    public static long getMemtableHeapSpaceInMb()
+    public static long getMemtableHeapSpaceInMiB()
     {
-        return conf.memtable_heap_space_in_mb;
+        return conf.memtable_heap_space.toMebibytes();
     }
 
-    public static long getMemtableOffheapSpaceInMb()
+    public static long getMemtableOffheapSpaceInMiB()
     {
-        return conf.memtable_offheap_space_in_mb;
+        return conf.memtable_offheap_space.toMebibytes();
     }
 
     public static Config.MemtableAllocationType getMemtableAllocationType()
@@ -2984,21 +3025,21 @@ public class DatabaseDescriptor
         conf.repair_session_max_tree_depth = depth;
     }
 
-    public static int getRepairSessionSpaceInMegabytes()
+    public static int getRepairSessionSpaceInMiB()
     {
-        return conf.repair_session_space_in_mb;
+        return conf.repair_session_space.toMebibytesAsInt();
     }
 
-    public static void setRepairSessionSpaceInMegabytes(int sizeInMegabytes)
+    public static void setRepairSessionSpaceInMiB(int sizeInMiB)
     {
-        if (sizeInMegabytes < 1)
-            throw new ConfigurationException("Cannot set repair_session_space_in_mb to " + sizeInMegabytes +
-                                             " < 1 megabyte");
-        else if (sizeInMegabytes > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))
-            logger.warn("A repair_session_space_in_mb of " + conf.repair_session_space_in_mb +
-                        " megabytes is likely to cause heap pressure.");
+        if (sizeInMiB < 1)
+            throw new ConfigurationException("Cannot set repair_session_space to " + sizeInMiB +
+                                             " < 1 mebibyte");
+        else if (sizeInMiB > (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)))
+            logger.warn("A repair_session_space of " + conf.repair_session_space +
+                        " is likely to cause heap pressure.");
 
-        conf.repair_session_space_in_mb = sizeInMegabytes;
+        conf.repair_session_space = SmallestDataStorageMebibytes.inMebibytes(sizeInMiB);
     }
 
     public static Float getMemtableCleanupThreshold()
@@ -3420,11 +3461,18 @@ public class DatabaseDescriptor
     /**
      * Ensures passed in configuration value is positive and will not overflow when converted to Bytes
      */
-    private static void checkValidForByteConversion(int val, final String name, final ByteUnit unit)
+    private static void checkValidForByteConversion(final SmallestDataStorageKibibytes value, String name)
     {
-        if (val < 0 || unit.willOverflowInBytes(val))
-            throw new ConfigurationException(String.format("%s must be positive value < %d, but was %d",
-                                                           name, unit.overflowThreshold(), val), false);
+        long valueInBytes = value.toBytes();
+        if (valueInBytes < 0 || valueInBytes > Integer.MAX_VALUE)
+        {
+            throw new ConfigurationException(String.format("%s must be positive value < %dB, but was %dB",
+                                                           name,
+                                                           value.getUnit()
+                                                                .convert(Integer.MAX_VALUE, DataStorageSpec.DataStorageUnit.BYTES),
+                                                           valueInBytes),
+                                             false);
+        }
     }
 
     public static int getValidationPreviewPurgeHeadStartInSec()
diff --git a/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java b/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
index 8f54936..514d1bc 100644
--- a/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
+++ b/src/java/org/apache/cassandra/config/SmallestDataStorageMebibytes.java
@@ -52,4 +52,15 @@ public final class SmallestDataStorageMebibytes extends DataStorageSpec
     {
         return new SmallestDataStorageMebibytes(mebibytes, DataStorageSpec.DataStorageUnit.MEBIBYTES);
     }
+
+    /**
+     * Creates a {@code SmallestDataStorageMebibytes} of the specified amount of bytes.
+     *
+     * @param bytes the amount of bytes
+     * @return a data storage
+     */
+    public static SmallestDataStorageMebibytes inBytes(long bytes)
+    {
+        return new SmallestDataStorageMebibytes(bytes, DataStorageSpec.DataStorageUnit.BYTES);
+    }
 }
diff --git a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
index dabe05e..b7e9c07 100644
--- a/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/BatchStatement.java
@@ -350,9 +350,9 @@ public class BatchStatement implements CQLStatement
             if (size > failThreshold)
             {
                 Tracing.trace(format, tableNames, FBUtilities.prettyPrintMemory(size), FBUtilities.prettyPrintMemory(failThreshold),
-                              FBUtilities.prettyPrintMemory(size - failThreshold), " (see batch_size_fail_threshold_in_kb)");
+                              FBUtilities.prettyPrintMemory(size - failThreshold), " (see batch_size_fail_threshold)");
                 logger.error(format, tableNames, FBUtilities.prettyPrintMemory(size), FBUtilities.prettyPrintMemory(failThreshold),
-                             FBUtilities.prettyPrintMemory(size - failThreshold), " (see batch_size_fail_threshold_in_kb)");
+                             FBUtilities.prettyPrintMemory(size - failThreshold), " (see batch_size_fail_threshold)");
                 throw new InvalidRequestException("Batch too large");
             }
             else if (logger.isWarnEnabled())
diff --git a/src/java/org/apache/cassandra/db/ColumnIndex.java b/src/java/org/apache/cassandra/db/ColumnIndex.java
index b872300..15405bd 100644
--- a/src/java/org/apache/cassandra/db/ColumnIndex.java
+++ b/src/java/org/apache/cassandra/db/ColumnIndex.java
@@ -36,16 +36,16 @@ import org.apache.cassandra.utils.ByteBufferUtil;
 
 /**
  * Column index builder used by {@link org.apache.cassandra.io.sstable.format.big.BigTableWriter}.
- * For index entries that exceed {@link org.apache.cassandra.config.Config#column_index_cache_size_in_kb},
+ * For index entries that exceed {@link org.apache.cassandra.config.Config#column_index_cache_size},
  * this uses the serialization logic as in {@link RowIndexEntry}.
  */
 public class ColumnIndex
 {
-    // used, if the row-index-entry reaches config column_index_cache_size_in_kb
+    // used, if the row-index-entry reaches config column_index_cache_size
     private DataOutputBuffer buffer;
     // used to track the size of the serialized size of row-index-entry (unused for buffer)
     private int indexSamplesSerializedSize;
-    // used, until the row-index-entry reaches config column_index_cache_size_in_kb
+    // used, until the row-index-entry reaches config column_index_cache_size
     private final List<IndexInfo> indexSamples = new ArrayList<>();
 
     private DataOutputBuffer reusableBuffer;
@@ -199,8 +199,8 @@ public class ColumnIndex
         }
         columnIndexCount++;
 
-        // First, we collect the IndexInfo objects until we reach Config.column_index_cache_size_in_kb in an ArrayList.
-        // When column_index_cache_size_in_kb is reached, we switch to byte-buffer mode.
+        // First, we collect the IndexInfo objects until we reach Config.column_index_cache_size in an ArrayList.
+        // When column_index_cache_size is reached, we switch to byte-buffer mode.
         if (buffer == null)
         {
             indexSamplesSerializedSize += idxSerializer.serializedSize(cIndexInfo);
@@ -285,7 +285,7 @@ public class ColumnIndex
 
         // If we serialize the IndexInfo objects directly in the code above into 'buffer',
         // we have to write the offsts to these here. The offsets have already been are collected
-        // in indexOffsets[]. buffer is != null, if it exceeds Config.column_index_cache_size_in_kb.
+        // in indexOffsets[]. buffer is != null, if it exceeds Config.column_index_cache_size.
         // In the other case, when buffer==null, the offsets are serialized in RowIndexEntry.IndexedEntry.serialize().
         if (buffer != null)
             RowIndexEntry.Serializer.serializeOffsets(buffer, indexOffsets, columnIndexCount);
diff --git a/src/java/org/apache/cassandra/db/Memtable.java b/src/java/org/apache/cassandra/db/Memtable.java
index c755591..21bf31a 100644
--- a/src/java/org/apache/cassandra/db/Memtable.java
+++ b/src/java/org/apache/cassandra/db/Memtable.java
@@ -87,8 +87,8 @@ public class Memtable implements Comparable<Memtable>
 
     private static MemtablePool createMemtableAllocatorPool()
     {
-        long heapLimit = DatabaseDescriptor.getMemtableHeapSpaceInMb() << 20;
-        long offHeapLimit = DatabaseDescriptor.getMemtableOffheapSpaceInMb() << 20;
+        long heapLimit = DatabaseDescriptor.getMemtableHeapSpaceInMiB() << 20;
+        long offHeapLimit = DatabaseDescriptor.getMemtableOffheapSpaceInMiB() << 20;
         final float cleaningThreshold = DatabaseDescriptor.getMemtableCleanupThreshold();
         final MemtableCleaner cleaner = ColumnFamilyStore::flushLargestMemtable;
         switch (DatabaseDescriptor.getMemtableAllocationType())
diff --git a/src/java/org/apache/cassandra/db/RowIndexEntry.java b/src/java/org/apache/cassandra/db/RowIndexEntry.java
index 895bea9..153dbac 100644
--- a/src/java/org/apache/cassandra/db/RowIndexEntry.java
+++ b/src/java/org/apache/cassandra/db/RowIndexEntry.java
@@ -76,7 +76,7 @@ import static org.apache.cassandra.metrics.CassandraMetricsRegistry.Metrics;
  *     samples</i> (list of {@link IndexInfo} objects) and those who don't.
  *     For each <i>portion</i> of data for a single partition in the data file,
  *     an index sample is created. The size of that <i>portion</i> is defined
- *     by {@link org.apache.cassandra.config.Config#column_index_size_in_kb}.
+ *     by {@link org.apache.cassandra.config.Config#column_index_size}.
  * </p>
  * <p>
  *     Index entries with less than 2 index samples, will just store the
@@ -97,9 +97,9 @@ import static org.apache.cassandra.metrics.CassandraMetricsRegistry.Metrics;
  *     "acceptable" amount of index samples per partition and those
  *     with an "enormous" amount of index samples. The barrier
  *     is controlled by the configuration parameter
- *     {@link org.apache.cassandra.config.Config#column_index_cache_size_in_kb}.
+ *     {@link org.apache.cassandra.config.Config#column_index_cache_size}.
  *     Index entries with a total serialized size of index samples up to
- *     {@code column_index_cache_size_in_kb} will be held in an array.
+ *     {@code column_index_cache_size} will be held in an array.
  *     Index entries exceeding that value will always be accessed from
  *     disk.
  * </p>
@@ -110,9 +110,9 @@ import static org.apache.cassandra.metrics.CassandraMetricsRegistry.Metrics;
  *     <li>{@link RowIndexEntry} just stores the offset in the data file.</li>
  *     <li>{@link IndexedEntry} is for index entries with index samples
  *     and used for both current and legacy sstables, which do not exceed
- *     {@link org.apache.cassandra.config.Config#column_index_cache_size_in_kb}.</li>
+ *     {@link org.apache.cassandra.config.Config#column_index_cache_size}.</li>
  *     <li>{@link ShallowIndexedEntry} is for index entries with index samples
- *     that exceed {@link org.apache.cassandra.config.Config#column_index_cache_size_in_kb}
+ *     that exceed {@link org.apache.cassandra.config.Config#column_index_cache_size}
  *     for sstables with an offset table to the index samples.</li>
  * </ul>
  * <p>
@@ -193,7 +193,7 @@ public class RowIndexEntry<T> implements IMeasurableMemory
      * @param headerLength      deletion time of {@link RowIndexEntry}
      * @param columnIndexCount  number of {@link IndexInfo} entries in the {@link RowIndexEntry}
      * @param indexedPartSize   serialized size of all serialized {@link IndexInfo} objects and their offsets
-     * @param indexSamples      list with IndexInfo offsets (if total serialized size is less than {@link org.apache.cassandra.config.Config#column_index_cache_size_in_kb}
+     * @param indexSamples      list with IndexInfo offsets (if total serialized size is less than {@link org.apache.cassandra.config.Config#column_index_cache_size}
      * @param offsets           offsets of IndexInfo offsets
      * @param idxInfoSerializer the {@link IndexInfo} serializer
      */
@@ -205,14 +205,14 @@ public class RowIndexEntry<T> implements IMeasurableMemory
     {
         // If the "partition building code" in BigTableWriter.append() via ColumnIndex returns a list
         // of IndexInfo objects, which is the case if the serialized size is less than
-        // Config.column_index_cache_size_in_kb, AND we have more than one IndexInfo object, we
+        // Config.column_index_cache_size, AND we have more than one IndexInfo object, we
         // construct an IndexedEntry object. (note: indexSamples.size() and columnIndexCount have the same meaning)
         if (indexSamples != null && indexSamples.size() > 1)
             return new IndexedEntry(dataFilePosition, deletionTime, headerLength,
                                     indexSamples.toArray(new IndexInfo[indexSamples.size()]), offsets,
                                     indexedPartSize, idxInfoSerializer);
         // Here we have to decide whether we have serialized IndexInfo objects that exceeds
-        // Config.column_index_cache_size_in_kb (not exceeding case covered above).
+        // Config.column_index_cache_size (not exceeding case covered above).
         // Such a "big" indexed-entry is represented as a shallow one.
         if (columnIndexCount > 1)
             return new ShallowIndexedEntry(dataFilePosition, indexFilePosition,
diff --git a/src/java/org/apache/cassandra/db/marshal/AbstractType.java b/src/java/org/apache/cassandra/db/marshal/AbstractType.java
index 3a18f76..c8eca39 100644
--- a/src/java/org/apache/cassandra/db/marshal/AbstractType.java
+++ b/src/java/org/apache/cassandra/db/marshal/AbstractType.java
@@ -514,7 +514,7 @@ public abstract class AbstractType<T> implements Comparator<ByteBuffer>, Assignm
 
             if (l > maxValueSize)
                 throw new IOException(String.format("Corrupt value length %d encountered, as it exceeds the maximum of %d, " +
-                                                    "which is set via max_value_size_in_mb in cassandra.yaml",
+                                                    "which is set via max_value_size in cassandra.yaml",
                                                     l, maxValueSize));
 
             return accessor.read(in, l);
diff --git a/src/java/org/apache/cassandra/io/sstable/IndexInfo.java b/src/java/org/apache/cassandra/io/sstable/IndexInfo.java
index e744150..fa0fb2c 100644
--- a/src/java/org/apache/cassandra/io/sstable/IndexInfo.java
+++ b/src/java/org/apache/cassandra/io/sstable/IndexInfo.java
@@ -35,7 +35,7 @@ import org.apache.cassandra.utils.ObjectSizes;
 
 /**
  * {@code IndexInfo} is embedded in the indexed version of {@link RowIndexEntry}.
- * Each instance roughly covers a range of {@link org.apache.cassandra.config.Config#column_index_size_in_kb column_index_size_in_kb} kB
+ * Each instance roughly covers a range of {@link org.apache.cassandra.config.Config#column_index_size column_index_size} KiB
  * and contains the first and last clustering value (or slice bound), its offset in the data file and width in the data file.
  * <p>
  * Each {@code IndexInfo} object is serialized as follows.
diff --git a/src/java/org/apache/cassandra/io/util/FileUtils.java b/src/java/org/apache/cassandra/io/util/FileUtils.java
index ea54497..063e3fb 100644
--- a/src/java/org/apache/cassandra/io/util/FileUtils.java
+++ b/src/java/org/apache/cassandra/io/util/FileUtils.java
@@ -76,8 +76,8 @@ public final class FileUtils
     private static final Logger logger = LoggerFactory.getLogger(FileUtils.class);
 
     public static final long ONE_KB = 1024;
-    public static final long ONE_MB = 1024 * ONE_KB;
-    public static final long ONE_GB = 1024 * ONE_MB;
+    public static final long ONE_MIB = 1024 * ONE_KB;
+    public static final long ONE_GB = 1024 * ONE_MIB;
     public static final long ONE_TB = 1024 * ONE_GB;
 
     private static final DecimalFormat df = new DecimalFormat("#.##");
@@ -405,7 +405,7 @@ public final class FileUtils
         }
         else if (value.endsWith(" MiB"))
         {
-            result = Math.round(Double.valueOf(value.replace(" MiB", "")) * ONE_MB);
+            result = Math.round(Double.valueOf(value.replace(" MiB", "")) * ONE_MIB);
             return result;
         }
         else if (value.endsWith(" bytes"))
@@ -434,9 +434,9 @@ public final class FileUtils
             String val = df.format(d);
             return val + " GiB";
         }
-        else if ( value >= ONE_MB )
+        else if (value >= ONE_MIB)
         {
-            d = value / ONE_MB;
+            d = value / ONE_MIB;
             String val = df.format(d);
             return val + " MiB";
         }
diff --git a/src/java/org/apache/cassandra/repair/ValidationManager.java b/src/java/org/apache/cassandra/repair/ValidationManager.java
index 7077dd3..2897aea 100644
--- a/src/java/org/apache/cassandra/repair/ValidationManager.java
+++ b/src/java/org/apache/cassandra/repair/ValidationManager.java
@@ -57,7 +57,7 @@ public class ValidationManager
 
         // The repair coordinator must hold RF trees in memory at once, so a given validation compaction can only
         // use 1 / RF of the allowed space.
-        long availableBytes = (DatabaseDescriptor.getRepairSessionSpaceInMegabytes() * 1048576) /
+        long availableBytes = (DatabaseDescriptor.getRepairSessionSpaceInMiB() * 1048576) /
                               cfs.keyspace.getReplicationStrategy().getReplicationFactor().allReplicas;
 
         for (Range<Token> range : ranges)
diff --git a/src/java/org/apache/cassandra/service/ActiveRepairService.java b/src/java/org/apache/cassandra/service/ActiveRepairService.java
index cc72430..ae57bf9 100644
--- a/src/java/org/apache/cassandra/service/ActiveRepairService.java
+++ b/src/java/org/apache/cassandra/service/ActiveRepairService.java
@@ -238,16 +238,28 @@ public class ActiveRepairService implements IEndpointStateChangeSubscriber, IFai
         consistent.local.cancelSession(sessionID, force);
     }
 
-    @Override
+    @Deprecated
     public void setRepairSessionSpaceInMegabytes(int sizeInMegabytes)
     {
-        DatabaseDescriptor.setRepairSessionSpaceInMegabytes(sizeInMegabytes);
+        DatabaseDescriptor.setRepairSessionSpaceInMiB(sizeInMegabytes);
     }
 
-    @Override
+    @Deprecated
     public int getRepairSessionSpaceInMegabytes()
     {
-        return DatabaseDescriptor.getRepairSessionSpaceInMegabytes();
+        return DatabaseDescriptor.getRepairSessionSpaceInMiB();
+    }
+
+    @Override
+    public void setRepairSessionSpaceInMebibytes(int sizeInMebibytes)
+    {
+        DatabaseDescriptor.setRepairSessionSpaceInMiB(sizeInMebibytes);
+    }
+
+    @Override
+    public int getRepairSessionSpaceInMebibytes()
+    {
+        return DatabaseDescriptor.getRepairSessionSpaceInMiB();
     }
 
     public List<CompositeData> getRepairStats(List<String> schemaArgs, String rangeString)
diff --git a/src/java/org/apache/cassandra/service/ActiveRepairServiceMBean.java b/src/java/org/apache/cassandra/service/ActiveRepairServiceMBean.java
index b68cb6f..3f03602 100644
--- a/src/java/org/apache/cassandra/service/ActiveRepairServiceMBean.java
+++ b/src/java/org/apache/cassandra/service/ActiveRepairServiceMBean.java
@@ -29,9 +29,14 @@ public interface ActiveRepairServiceMBean
     public List<Map<String, String>> getSessions(boolean all, String rangesStr);
     public void failSession(String session, boolean force);
 
+    @Deprecated
     public void setRepairSessionSpaceInMegabytes(int sizeInMegabytes);
+    @Deprecated
     public int getRepairSessionSpaceInMegabytes();
 
+    public void setRepairSessionSpaceInMebibytes(int sizeInMebibytes);
+    public int getRepairSessionSpaceInMebibytes();
+
     public boolean getUseOffheapMerkleTrees();
     public void setUseOffheapMerkleTrees(boolean value);
 
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 4be4fcf..4133119 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -5891,25 +5891,25 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
 
     public int getColumnIndexSizeInKB()
     {
-        return DatabaseDescriptor.getColumnIndexSizeInKB();
+        return DatabaseDescriptor.getColumnIndexSizeInKiB();
     }
 
     public void setColumnIndexSize(int columnIndexSizeInKB)
     {
-        int oldValueInKB = DatabaseDescriptor.getColumnIndexSizeInKB();
+        int oldValueInKiB = DatabaseDescriptor.getColumnIndexSizeInKiB();
         DatabaseDescriptor.setColumnIndexSize(columnIndexSizeInKB);
-        logger.info("Updated column_index_size_in_kb to {} KiB (was {} KiB)", columnIndexSizeInKB, oldValueInKB);
+        logger.info("Updated column_index_size to {} KiB (was {} KiB)", columnIndexSizeInKB, oldValueInKiB);
     }
 
     public int getColumnIndexCacheSize()
     {
-        return DatabaseDescriptor.getColumnIndexCacheSizeInKB();
+        return DatabaseDescriptor.getColumnIndexCacheSizeInKiB();
     }
 
     public void setColumnIndexCacheSize(int cacheSizeInKB)
     {
         DatabaseDescriptor.setColumnIndexCacheSize(cacheSizeInKB);
-        logger.info("Updated column_index_cache_size_in_kb to {}", cacheSizeInKB);
+        logger.info("Updated column_index_cache_size to {}", cacheSizeInKB);
     }
 
     public int getBatchSizeFailureThreshold()
@@ -5920,18 +5920,18 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
     public void setBatchSizeFailureThreshold(int threshold)
     {
         DatabaseDescriptor.setBatchSizeFailThresholdInKB(threshold);
-        logger.info("updated batch_size_fail_threshold_in_kb to {}", threshold);
+        logger.info("updated batch_size_fail_threshold to {}", threshold);
     }
 
     public int getBatchSizeWarnThreshold()
     {
-        return DatabaseDescriptor.getBatchSizeWarnThresholdInKB();
+        return DatabaseDescriptor.getBatchSizeWarnThresholdInKiB();
     }
 
     public void setBatchSizeWarnThreshold(int threshold)
     {
-        DatabaseDescriptor.setBatchSizeWarnThresholdInKB(threshold);
-        logger.info("Updated batch_size_warn_threshold_in_kb to {}", threshold);
+        DatabaseDescriptor.setBatchSizeWarnThresholdInKiB(threshold);
+        logger.info("Updated batch_size_warn_threshold to {}", threshold);
     }
 
     public int getInitialRangeTombstoneListAllocationSize()
diff --git a/src/java/org/apache/cassandra/streaming/StreamSession.java b/src/java/org/apache/cassandra/streaming/StreamSession.java
index 02255dd..00e3bf1 100644
--- a/src/java/org/apache/cassandra/streaming/StreamSession.java
+++ b/src/java/org/apache/cassandra/streaming/StreamSession.java
@@ -826,7 +826,7 @@ public class StreamSession implements IEndpointStateChangeSubscriber
                                  "The time taken ({} ms) for processing the incoming stream message ({})" +
                                  " exceeded internode streaming TCP user timeout ({} ms).\n" +
                                  "The streaming connection might be closed due to tcp user timeout.\n" +
-                                 "Try to increase the internode_streaming_tcp_user_timeout_in_ms" +
+                                 "Try to increase the internode_streaming_tcp_user_timeout" +
                                  " or set it to 0 to use system defaults.",
                                  latencyMs, message, timeout);
         }
diff --git a/src/java/org/apache/cassandra/tools/nodetool/GetColumnIndexSize.java b/src/java/org/apache/cassandra/tools/nodetool/GetColumnIndexSize.java
index 806d815..6925932 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/GetColumnIndexSize.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/GetColumnIndexSize.java
@@ -28,6 +28,6 @@ public class GetColumnIndexSize extends NodeToolCmd
     @Override
     protected void execute(NodeProbe probe)
     {
-        probe.output().out.println("Current value for column_index_size_in_kb: " + probe.getColumnIndexSizeInKB() + " KiB");
+        probe.output().out.println("Current value for column_index_size: " + probe.getColumnIndexSizeInKB() + " KiB");
     }
 }
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SetColumnIndexSize.java b/src/java/org/apache/cassandra/tools/nodetool/SetColumnIndexSize.java
index 85a066d..fe5d8b3 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/SetColumnIndexSize.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/SetColumnIndexSize.java
@@ -27,12 +27,12 @@ import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 public class SetColumnIndexSize extends NodeToolCmd
 {
     @SuppressWarnings("UnusedDeclaration")
-    @Arguments(title = "column_index_size_in_kb", usage = "<value_in_kib>", description = "Value in KiB", required = true)
-    private int columnIndexSizeInKB;
+    @Arguments(title = "column_index_size", usage = "<value_in_kib>", description = "Value in KiB", required = true)
+    private int columnIndexSizeInKiB;
 
     @Override
     protected void execute(NodeProbe probe)
     {
-        probe.setColumnIndexSize(columnIndexSizeInKB);
+        probe.setColumnIndexSize(columnIndexSizeInKiB);
     }
 }
diff --git a/test/conf/cassandra-murmur.yaml b/test/conf/cassandra-murmur.yaml
index 06507e4..9da6917 100644
--- a/test/conf/cassandra-murmur.yaml
+++ b/test/conf/cassandra-murmur.yaml
@@ -16,7 +16,7 @@ listen_address: 127.0.0.1
 storage_port: 7012
 start_native_transport: true
 native_transport_port: 9042
-column_index_size_in_kb: 4
+column_index_size: 4KiB
 saved_caches_directory: build/test/cassandra/saved_caches
 data_file_directories:
     - build/test/cassandra/data
diff --git a/test/conf/cassandra-old.yaml b/test/conf/cassandra-old.yaml
index aa5572c..11b79f2 100644
--- a/test/conf/cassandra-old.yaml
+++ b/test/conf/cassandra-old.yaml
@@ -20,7 +20,7 @@ storage_port: 7012
 ssl_storage_port: 17012
 start_native_transport: true
 native_transport_port: 9042
-column_index_size_in_kb: 4
+column_index_size: 4KiB
 saved_caches_directory: build/test/cassandra/saved_caches
 data_file_directories:
     - build/test/cassandra/data
@@ -54,3 +54,4 @@ enable_drop_compact_storage: true
 file_cache_enabled: true
 internode_send_buff_size_in_bytes: 5
 internode_recv_buff_size_in_bytes: 5
+max_hint_window_in_ms: 10800000
diff --git a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
index e528d27..b11f248 100644
--- a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
+++ b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
@@ -38,7 +38,7 @@ storage_port: 7012
 ssl_storage_port: 17012
 start_native_transport: true
 native_transport_port: 9042
-column_index_size_in_kb: 4
+column_index_size: 4KiB
 saved_caches_directory: build/test/cassandra/saved_caches
 data_file_directories:
     - build/test/cassandra/data
diff --git a/test/conf/cassandra-sslcontextfactory.yaml b/test/conf/cassandra-sslcontextfactory.yaml
index 26cea35..6e55b49 100644
--- a/test/conf/cassandra-sslcontextfactory.yaml
+++ b/test/conf/cassandra-sslcontextfactory.yaml
@@ -38,7 +38,7 @@ storage_port: 7012
 ssl_storage_port: 17012
 start_native_transport: true
 native_transport_port: 9042
-column_index_size_in_kb: 4
+column_index_size: 4KiB
 saved_caches_directory: build/test/cassandra/saved_caches
 data_file_directories:
     - build/test/cassandra/data
diff --git a/test/conf/unit-test-conf/test-native-port.yaml b/test/conf/unit-test-conf/test-native-port.yaml
index 8db2ad4..d3c5516 100644
--- a/test/conf/unit-test-conf/test-native-port.yaml
+++ b/test/conf/unit-test-conf/test-native-port.yaml
@@ -20,7 +20,7 @@ storage_port: 7010
 ssl_storage_port: 7011
 start_native_transport: true
 native_transport_port_ssl: 9142
-column_index_size_in_kb: 4
+column_index_size: 4KiB
 saved_caches_directory: build/test/cassandra/saved_caches
 data_file_directories:
 - build/test/cassandra/data
diff --git a/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java b/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java
index 7574318..d6bc7ad 100644
--- a/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java
+++ b/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java
@@ -93,7 +93,7 @@ public class InstanceConfig implements IInstanceConfig
                 .set("concurrent_reads", 2)
                 .set("memtable_flush_writers", 1)
                 .set("concurrent_compactors", 1)
-                .set("memtable_heap_space_in_mb", 10)
+                .set("memtable_heap_space", "10MiB")
                 .set("commitlog_sync", "batch")
                 .set("storage_port", storage_port)
                 .set("native_transport_port", native_transport_port)
diff --git a/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java b/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
index 7a59876..34432dc 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
@@ -29,8 +29,6 @@ import org.slf4j.LoggerFactory;
 import org.apache.cassandra.distributed.api.ConsistencyLevel;
 import org.apache.cassandra.distributed.api.ICluster;
 
-import static java.util.concurrent.TimeUnit.SECONDS;
-
 // TODO: this test should be removed after running in-jvm dtests is set up via the shared API repository
 public class LargeColumnTest extends TestBaseImpl
 {
@@ -68,11 +66,11 @@ public class LargeColumnTest extends TestBaseImpl
                                      .withNodes(nodes)
                                      .withConfig(config ->
                                                  config.set("commitlog_segment_size_in_mb", (columnSize * 3) >> 20)
-                                                       .set("internode_application_send_queue_reserve_endpoint_capacity_in_bytes", columnSize * 2)
-                                                       .set("internode_application_send_queue_reserve_global_capacity_in_bytes", columnSize * 3)
+                                                       .set("internode_application_send_queue_reserve_endpoint_capacity", String.format("%dB", (columnSize * 2)))
+                                                       .set("internode_application_send_queue_reserve_global_capacity", String.format("%dB", (columnSize * 3)))
                                                        .set("write_request_timeout", "30s")
                                                        .set("read_request_timeout", "30s")
-                                                       .set("memtable_heap_space_in_mb", 1024)
+                                                       .set("memtable_heap_space", "1024MiB")
                                      )
                                      .start()))
         {
diff --git a/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java b/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
index c56a5a7..74c9356 100644
--- a/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
+++ b/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
@@ -642,7 +642,7 @@ public class ClusterSimulation<S extends Simulation> implements AutoCloseable
                              .set("write_request_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.writeTimeoutNanos)))
                              .set("cas_contention_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.contentionTimeoutNanos)))
                              .set("request_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.requestTimeoutNanos)))
-                             .set("memtable_heap_space_in_mb", 1)
+                             .set("memtable_heap_space", "1mb")
                              .set("memtable_allocation_type", builder.memoryListener != null ? "unslabbed_heap_buffers_logged" : "heap_buffers")
                              .set("file_cache_size_in_mb", 16)
                              .set("use_deterministic_table_id", true)
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
index 5aabc80..0d13654 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
@@ -198,7 +198,7 @@ public class DatabaseDescriptorTest
     }
 
     @Test
-    public void testRpcAddress() throws Exception
+    public void testRpcAddress()
     {
         Config testConfig = DatabaseDescriptor.loadConfig();
         testConfig.rpc_address = suitableInterface.getInterfaceAddresses().get(0).getAddress().getHostAddress();
@@ -282,7 +282,7 @@ public class DatabaseDescriptorTest
         try
         {
             DatabaseDescriptor.setColumnIndexCacheSize(-1);
-            fail("Should have received a ConfigurationException column_index_cache_size_in_kb = -1");
+            fail("Should have received a ConfigurationException column_index_cache_size = -1");
         }
         catch (ConfigurationException ignored) { }
         Assert.assertEquals(2048, DatabaseDescriptor.getColumnIndexCacheSize());
@@ -290,7 +290,7 @@ public class DatabaseDescriptorTest
         try
         {
             DatabaseDescriptor.setColumnIndexCacheSize(2 * 1024 * 1024);
-            fail("Should have received a ConfigurationException column_index_cache_size_in_kb = 2GiB");
+            fail("Should have received a ConfigurationException column_index_cache_size= 2GiB");
         }
         catch (ConfigurationException ignored) { }
         Assert.assertEquals(2048, DatabaseDescriptor.getColumnIndexCacheSize());
@@ -298,7 +298,7 @@ public class DatabaseDescriptorTest
         try
         {
             DatabaseDescriptor.setColumnIndexSize(-1);
-            fail("Should have received a ConfigurationException column_index_size_in_kb = -1");
+            fail("Should have received a ConfigurationException column_index_size = -1");
         }
         catch (ConfigurationException ignored) { }
         Assert.assertEquals(4096, DatabaseDescriptor.getColumnIndexSize());
@@ -306,23 +306,23 @@ public class DatabaseDescriptorTest
         try
         {
             DatabaseDescriptor.setColumnIndexSize(2 * 1024 * 1024);
-            fail("Should have received a ConfigurationException column_index_size_in_kb = 2GiB");
+            fail("Should have received a ConfigurationException column_index_size = 2GiB");
         }
         catch (ConfigurationException ignored) { }
         Assert.assertEquals(4096, DatabaseDescriptor.getColumnIndexSize());
 
         try
         {
-            DatabaseDescriptor.setBatchSizeWarnThresholdInKB(-1);
-            fail("Should have received a ConfigurationException batch_size_warn_threshold_in_kb = -1");
+            DatabaseDescriptor.setBatchSizeWarnThresholdInKiB(-1);
+            fail("Should have received a ConfigurationException batch_size_warn_threshold = -1");
         }
         catch (ConfigurationException ignored) { }
         Assert.assertEquals(5120, DatabaseDescriptor.getBatchSizeWarnThreshold());
 
         try
         {
-            DatabaseDescriptor.setBatchSizeWarnThresholdInKB(2 * 1024 * 1024);
-            fail("Should have received a ConfigurationException batch_size_warn_threshold_in_kb = 2GiB");
+            DatabaseDescriptor.setBatchSizeWarnThresholdInKiB(2 * 1024 * 1024);
+            fail("Should have received a ConfigurationException batch_size_warn_threshold = 2GiB");
         }
         catch (ConfigurationException ignored) { }
         Assert.assertEquals(4096, DatabaseDescriptor.getColumnIndexSize());
@@ -333,7 +333,8 @@ public class DatabaseDescriptorTest
     {
         Config testConfig = new Config();
 
-        SmallestDurationMilliseconds greaterThanLowestTimeout = SmallestDurationMilliseconds.inMilliseconds(DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT.toMilliseconds() + 1);
+        SmallestDurationMilliseconds greaterThanLowestTimeout = SmallestDurationMilliseconds
+                                                                .inMilliseconds(DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT.toMilliseconds() + 1);
 
         testConfig.read_request_timeout = greaterThanLowestTimeout;
         testConfig.range_request_timeout = greaterThanLowestTimeout;
@@ -376,32 +377,32 @@ public class DatabaseDescriptorTest
     @Test
     public void testRepairSessionMemorySizeToggles()
     {
-        int previousSize = DatabaseDescriptor.getRepairSessionSpaceInMegabytes();
+        int previousSize = DatabaseDescriptor.getRepairSessionSpaceInMiB();
         try
         {
             Assert.assertEquals((Runtime.getRuntime().maxMemory() / (1024 * 1024) / 16),
-                                DatabaseDescriptor.getRepairSessionSpaceInMegabytes());
+                                DatabaseDescriptor.getRepairSessionSpaceInMiB());
 
             int targetSize = (int) (Runtime.getRuntime().maxMemory() / (1024 * 1024) / 4) + 1;
 
-            DatabaseDescriptor.setRepairSessionSpaceInMegabytes(targetSize);
-            Assert.assertEquals(targetSize, DatabaseDescriptor.getRepairSessionSpaceInMegabytes());
+            DatabaseDescriptor.setRepairSessionSpaceInMiB(targetSize);
+            Assert.assertEquals(targetSize, DatabaseDescriptor.getRepairSessionSpaceInMiB());
 
-            DatabaseDescriptor.setRepairSessionSpaceInMegabytes(10);
-            Assert.assertEquals(10, DatabaseDescriptor.getRepairSessionSpaceInMegabytes());
+            DatabaseDescriptor.setRepairSessionSpaceInMiB(10);
+            Assert.assertEquals(10, DatabaseDescriptor.getRepairSessionSpaceInMiB());
 
             try
             {
-                DatabaseDescriptor.setRepairSessionSpaceInMegabytes(0);
+                DatabaseDescriptor.setRepairSessionSpaceInMiB(0);
                 fail("Should have received a ConfigurationException for depth of 9");
             }
             catch (ConfigurationException ignored) { }
 
-            Assert.assertEquals(10, DatabaseDescriptor.getRepairSessionSpaceInMegabytes());
+            Assert.assertEquals(10, DatabaseDescriptor.getRepairSessionSpaceInMiB());
         }
         finally
         {
-            DatabaseDescriptor.setRepairSessionSpaceInMegabytes(previousSize);
+            DatabaseDescriptor.setRepairSessionSpaceInMiB(previousSize);
         }
     }
 
diff --git a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
index 885f28f..ad7abb8 100644
--- a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
@@ -22,6 +22,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.assertFalse;
 
@@ -39,11 +40,9 @@ public class LoadOldYAMLBackwardCompatibilityTest
     public void testConfigurationLoaderBackwardCompatibility()
     {
         Config config = DatabaseDescriptor.loadConfig();
-        //Confirm parameters were successfully read with their old names and the default values in cassandra-old.yaml
-        /*assertEquals(5, config.internode_socket_send_buffer_size_in_bytes);
-        assertEquals(5, config.internode_socket_receive_buffer_size_in_bytes);
+
         assertEquals(DurationSpec.inMilliseconds(10800000), config.max_hint_window);
-        assertEquals(DurationSpec.inHours(0), config.max_hint_window);*/
+        assertEquals(DurationSpec.inHours(3), config.max_hint_window);
         assertEquals(DurationSpec.inMilliseconds(0), config.native_transport_idle_timeout);
         assertEquals(DurationSpec.inMilliseconds(10000), config.request_timeout);
         assertEquals(DurationSpec.inMilliseconds(5000), config.read_request_timeout);
@@ -54,7 +53,7 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DurationSpec.inMilliseconds(60000), config.truncate_request_timeout);
         assertEquals(DurationSpec.inSeconds(300), config.streaming_keep_alive_period);
         assertEquals(DurationSpec.inMilliseconds(500), config.slow_query_log_timeout);
-        /*assertNull(config.memtable_heap_space);
+        assertNull(config.memtable_heap_space);
         assertNull(config.memtable_offheap_space);
         assertNull( config.repair_session_space);
         assertEquals(DataStorageSpec.inBytes(4194304), config.internode_application_send_queue_capacity);
@@ -68,9 +67,9 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DurationSpec.inMilliseconds(300000), config.internode_streaming_tcp_user_timeout);
         assertEquals(DataStorageSpec.inMebibytes(16), config.native_transport_max_frame_size);
         assertEquals(DataStorageSpec.inMebibytes(256), config.max_value_size);
-        assertEquals(DataStorageSpec.inKibibytes(64), config.column_index_size);
+        assertEquals(DataStorageSpec.inKibibytes(4), config.column_index_size);
         assertEquals(DataStorageSpec.inKibibytes(2), config.column_index_cache_size);
-        assertEquals(DataStorageSpec.inKibibytes(5), config.batch_size_warn_threshold);*/
+        assertEquals(DataStorageSpec.inKibibytes(5), config.batch_size_warn_threshold);
         assertEquals(DataRateSpec.inMebibytesPerSecond(64), config.compaction_throughput);
         //assertEquals(DataStorageSpec.inMebibytes(50), config.min_free_space_per_drive);
         assertEquals(DataRateSpec.inMebibytesPerSecond(23841858).toString(), config.stream_throughput_outbound.toString());
diff --git a/test/unit/org/apache/cassandra/config/YamlConfigurationLoaderTest.java b/test/unit/org/apache/cassandra/config/YamlConfigurationLoaderTest.java
index 06671df..ae2bf5f 100644
--- a/test/unit/org/apache/cassandra/config/YamlConfigurationLoaderTest.java
+++ b/test/unit/org/apache/cassandra/config/YamlConfigurationLoaderTest.java
@@ -91,8 +91,8 @@ public class YamlConfigurationLoaderTest
                                  .put("commitlog_sync", commitLogSync)
                                  .put("seed_provider", seedProvider)
                                  .put("client_encryption_options", encryptionOptions)
-                                 .put("internode_send_buff_size_in_bytes", 5)
-                                 .put("internode_recv_buff_size_in_bytes", 5)
+                                 .put("internode_socket_send_buffer_size", "5B")
+                                 .put("internode_socket_receive_buffer_size", "5B")
                                  .build();
 
         Config config = YamlConfigurationLoader.fromMap(map, Config.class);
@@ -101,8 +101,8 @@ public class YamlConfigurationLoaderTest
         assertEquals(seedProvider, config.seed_provider); // Check a parameterized class
         assertEquals(false, config.client_encryption_options.optional); // Check a nested object
         assertEquals(true, config.client_encryption_options.enabled); // Check a nested object
-        assertEquals(5, config.internode_socket_send_buffer_size_in_bytes); // Check names backward compatibility (CASSANDRA-17141)
-        assertEquals(5, config.internode_socket_receive_buffer_size_in_bytes); // Check names backward compatibility (CASSANDRA-17141)
+        assertEquals(new DataStorageSpec("5B"), config.internode_socket_send_buffer_size); // Check names backward compatibility (CASSANDRA-17141 and CASSANDRA-15234)
+        assertEquals(new DataStorageSpec("5B"), config.internode_socket_receive_buffer_size); // Check names backward compatibility (CASSANDRA-17141 and CASSANDRA-15234)
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java b/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
index 48caef6..25ec662 100644
--- a/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
+++ b/test/unit/org/apache/cassandra/db/compaction/CompactionsCQLTest.java
@@ -354,7 +354,7 @@ public class CompactionsCQLTest extends CQLTester
     {
         // write enough data to make sure we use an IndexedReader when doing a read, and make sure it fails when reading a corrupt row deletion
         DatabaseDescriptor.setCorruptedTombstoneStrategy(Config.CorruptedTombstoneStrategy.exception);
-        int maxSizePre = DatabaseDescriptor.getColumnIndexSizeInKB();
+        int maxSizePre = DatabaseDescriptor.getColumnIndexSizeInKiB();
         DatabaseDescriptor.setColumnIndexSize(1024);
         prepareWide();
         RowUpdateBuilder.deleteRowAt(getCurrentColumnFamilyStore().metadata(), System.currentTimeMillis() * 1000, -1, 22, 33).apply();
@@ -369,7 +369,7 @@ public class CompactionsCQLTest extends CQLTester
     {
         // write enough data to make sure we use an IndexedReader when doing a read, and make sure it fails when reading a corrupt standard tombstone
         DatabaseDescriptor.setCorruptedTombstoneStrategy(Config.CorruptedTombstoneStrategy.exception);
-        int maxSizePre = DatabaseDescriptor.getColumnIndexSizeInKB();
+        int maxSizePre = DatabaseDescriptor.getColumnIndexSizeInKiB();
         DatabaseDescriptor.setColumnIndexSize(1024);
         prepareWide();
         RowUpdateBuilder rub = new RowUpdateBuilder(getCurrentColumnFamilyStore().metadata(), -1, System.currentTimeMillis() * 1000, 22).clustering(33).delete("b");
@@ -385,7 +385,7 @@ public class CompactionsCQLTest extends CQLTester
     {
         // write enough data to make sure we use an IndexedReader when doing a read, and make sure it fails when reading a corrupt range tombstone
         DatabaseDescriptor.setCorruptedTombstoneStrategy(Config.CorruptedTombstoneStrategy.exception);
-        final int maxSizePreKB = DatabaseDescriptor.getColumnIndexSizeInKB();
+        final int maxSizePreKB = DatabaseDescriptor.getColumnIndexSizeInKiB();
         DatabaseDescriptor.setColumnIndexSize(1024);
         prepareWide();
         RangeTombstone rt = new RangeTombstone(Slice.ALL, new DeletionTime(System.currentTimeMillis(), -1));
diff --git a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
index 10bb783..3ad09fb 100644
--- a/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
+++ b/test/unit/org/apache/cassandra/io/sstable/SSTableWriterTestBase.java
@@ -73,7 +73,7 @@ public class SSTableWriterTestBase extends SchemaLoader
                                     SchemaLoader.standardCFMD(KEYSPACE, CF_SMALL_MAX_VALUE));
 
         maxValueSize = DatabaseDescriptor.getMaxValueSize();
-        DatabaseDescriptor.setMaxValueSize(1024 * 1024); // set max value size to 1MB
+        DatabaseDescriptor.setMaxValueSize(1024 * 1024); // set max value size to 1MiB
     }
 
     @AfterClass
diff --git a/test/unit/org/apache/cassandra/repair/ValidatorTest.java b/test/unit/org/apache/cassandra/repair/ValidatorTest.java
index 4df2140..db9ce31 100644
--- a/test/unit/org/apache/cassandra/repair/ValidatorTest.java
+++ b/test/unit/org/apache/cassandra/repair/ValidatorTest.java
@@ -66,7 +66,7 @@ import static org.junit.Assert.assertTrue;
 public class ValidatorTest
 {
     private static final long TEST_TIMEOUT = 60; //seconds
-    private static int testSizeMegabytes;
+    private static int testSizeMebibytes;
 
     private static final String keyspace = "ValidatorTest";
     private static final String columnFamily = "Standard1";
@@ -80,20 +80,20 @@ public class ValidatorTest
                                     KeyspaceParams.simple(1),
                                     SchemaLoader.standardCFMD(keyspace, columnFamily));
         partitioner = Schema.instance.getTableMetadata(keyspace, columnFamily).partitioner;
-        testSizeMegabytes = DatabaseDescriptor.getRepairSessionSpaceInMegabytes();
+        testSizeMebibytes = DatabaseDescriptor.getRepairSessionSpaceInMiB();
     }
 
     @After
     public void tearDown()
     {
         MessagingService.instance().outboundSink.clear();
-        DatabaseDescriptor.setRepairSessionSpaceInMegabytes(testSizeMegabytes);
+        DatabaseDescriptor.setRepairSessionSpaceInMiB(testSizeMebibytes);
     }
 
     @Before
     public void setup()
     {
-        DatabaseDescriptor.setRepairSessionSpaceInMegabytes(testSizeMegabytes);
+        DatabaseDescriptor.setRepairSessionSpaceInMiB(testSizeMebibytes);
     }
 
     @Test
@@ -233,7 +233,7 @@ public class ValidatorTest
         ColumnFamilyStore cfs = ks.getColumnFamilyStore(columnFamily);
         cfs.clearUnsafe();
 
-        DatabaseDescriptor.setRepairSessionSpaceInMegabytes(1);
+        DatabaseDescriptor.setRepairSessionSpaceInMiB(1);
 
         // disable compaction while flushing
         cfs.disableAutoCompaction();
@@ -292,7 +292,7 @@ public class ValidatorTest
         ColumnFamilyStore cfs = ks.getColumnFamilyStore(columnFamily);
         cfs.clearUnsafe();
 
-        DatabaseDescriptor.setRepairSessionSpaceInMegabytes(1);
+        DatabaseDescriptor.setRepairSessionSpaceInMiB(1);
 
         // disable compaction while flushing
         cfs.disableAutoCompaction();
@@ -328,7 +328,7 @@ public class ValidatorTest
         Message message = outgoingMessageSink.get(TEST_TIMEOUT, TimeUnit.SECONDS);
         MerkleTrees trees = ((ValidationResponse) message.payload).trees;
 
-        // Should have 4 trees each with a depth of on average 10 (since each range should have gotten 0.25 megabytes)
+        // Should have 4 trees each with a depth of on average 10 (since each range should have gotten 0.25 mebibytes)
         Iterator<Map.Entry<Range<Token>, MerkleTree>> iterator = trees.iterator();
         int numTrees = 0;
         double totalResolution = 0;
@@ -347,7 +347,7 @@ public class ValidatorTest
         assertEquals(trees.rowCount(), 1 << 14);
         assertEquals(4, numTrees);
 
-        // With a single tree and a megabyte we should had a total resolution of 2^12 leaves; with multiple
+        // With a single tree and a mebibyte we should had a total resolution of 2^12 leaves; with multiple
         // ranges we should get similar overall resolution, but not more.
         assertTrue(totalResolution > (1 << 11) && totalResolution < (1 << 13));
     }
diff --git a/test/unit/org/apache/cassandra/service/ClientWarningsTest.java b/test/unit/org/apache/cassandra/service/ClientWarningsTest.java
index ee652e2..e7a34e0 100644
--- a/test/unit/org/apache/cassandra/service/ClientWarningsTest.java
+++ b/test/unit/org/apache/cassandra/service/ClientWarningsTest.java
@@ -60,7 +60,7 @@ public class ClientWarningsTest extends CQLTester
     public static void setUp()
     {
         requireNetwork();
-        DatabaseDescriptor.setBatchSizeWarnThresholdInKB(1);
+        DatabaseDescriptor.setBatchSizeWarnThresholdInKiB(1);
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/service/ProtocolBetaVersionTest.java b/test/unit/org/apache/cassandra/service/ProtocolBetaVersionTest.java
index a7551f4..bfb464d 100644
--- a/test/unit/org/apache/cassandra/service/ProtocolBetaVersionTest.java
+++ b/test/unit/org/apache/cassandra/service/ProtocolBetaVersionTest.java
@@ -35,7 +35,7 @@ public class ProtocolBetaVersionTest extends CQLTester
     public static void setUp()
     {
         requireNetwork();
-        DatabaseDescriptor.setBatchSizeWarnThresholdInKB(1);
+        DatabaseDescriptor.setBatchSizeWarnThresholdInKiB(1);
     }
 
     private ProtocolVersion getBetaVersion()
diff --git a/test/unit/org/apache/cassandra/tools/nodetool/SetGetColumnIndexSizeTest.java b/test/unit/org/apache/cassandra/tools/nodetool/SetGetColumnIndexSizeTest.java
index 67b519e..b30cf06 100644
--- a/test/unit/org/apache/cassandra/tools/nodetool/SetGetColumnIndexSizeTest.java
+++ b/test/unit/org/apache/cassandra/tools/nodetool/SetGetColumnIndexSizeTest.java
@@ -42,7 +42,7 @@ public class SetGetColumnIndexSizeTest extends CQLTester
     @Test
     public void testNull()
     {
-        assertSetInvalidColumnIndexSize(null, "Required parameters are missing: column_index_size_in_kb", 1);
+        assertSetInvalidColumnIndexSize(null, "Required parameters are missing: column_index_size", 1);
     }
 
     @Test
@@ -66,20 +66,20 @@ public class SetGetColumnIndexSizeTest extends CQLTester
     @Test
     public void testNegative()
     {
-        assertSetInvalidColumnIndexSize("-7", "column_index_size_in_kb must be positive value < 2097152, but was -7", 2);
+        assertSetInvalidColumnIndexSize("-7", "Invalid data storage: value must be positive, but was -7", 2);
     }
 
     @Test
     public void testInvalidValue()
     {
-        assertSetInvalidColumnIndexSize("2097152", "column_index_size_in_kb must be positive value < 2097152, but was 2097152", 2);
+        assertSetInvalidColumnIndexSize("2097152", "column_index_size must be positive value < 2097151B, but was 2147483648B", 2);
     }
 
     @Test
     public void testUnparseable()
     {
-        assertSetInvalidColumnIndexSize("1.2", "column_index_size_in_kb: can not convert \"1.2\" to a int", 1);
-        assertSetInvalidColumnIndexSize("value", "column_index_size_in_kb: can not convert \"value\" to a int", 1);
+        assertSetInvalidColumnIndexSize("1.2", "column_index_size: can not convert \"1.2\" to a int", 1);
+        assertSetInvalidColumnIndexSize("value", "column_index_size: can not convert \"value\" to a int", 1);
     }
 
     private static void assertSetGetValidColumnIndexSize(int columnIndexSizeInKB)
@@ -105,6 +105,6 @@ public class SetGetColumnIndexSizeTest extends CQLTester
     {
         ToolResult tool = invokeNodetool("getcolumnindexsize");
         tool.assertOnCleanExit();
-        assertThat(tool.getStdout()).contains("Current value for column_index_size_in_kb: " + expected + " KiB");
+        assertThat(tool.getStdout()).contains("Current value for column_index_size: " + expected + " KiB");
     }
 }
diff --git a/test/unit/org/apache/cassandra/transport/CQLConnectionTest.java b/test/unit/org/apache/cassandra/transport/CQLConnectionTest.java
index ac32e6f..86de587 100644
--- a/test/unit/org/apache/cassandra/transport/CQLConnectionTest.java
+++ b/test/unit/org/apache/cassandra/transport/CQLConnectionTest.java
@@ -59,7 +59,7 @@ import org.apache.cassandra.utils.concurrent.NonBlockingRateLimiter;
 import org.apache.cassandra.utils.concurrent.Condition;
 
 import static org.apache.cassandra.config.EncryptionOptions.TlsEncryptionPolicy.UNENCRYPTED;
-import static org.apache.cassandra.io.util.FileUtils.ONE_MB;
+import static org.apache.cassandra.io.util.FileUtils.ONE_MIB;
 import static org.apache.cassandra.net.FramingTest.randomishBytes;
 import static org.apache.cassandra.transport.Flusher.MAX_FRAMED_PAYLOAD_SIZE;
 import static org.apache.cassandra.utils.concurrent.Condition.newOneTimeCondition;
@@ -107,7 +107,7 @@ public class CQLConnectionTest
         // set connection-local queue size to 0 so that all capacity is allocated from reserves
         DatabaseDescriptor.setNativeTransportReceiveQueueCapacityInBytes(0);
         // set transport to max frame size possible
-        DatabaseDescriptor.setNativeTransportMaxFrameSize(256 * (int) ONE_MB);
+        DatabaseDescriptor.setNativeTransportMaxFrameSize(256 * (int) ONE_MIB);
     }
 
     @Test

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


[cassandra] 08/13: Transfer parameters to the newly introduced configuration framework (4) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 ed48f3c017c5e572a523890bcd5b7c798d7eb358
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Thu Feb 3 16:43:36 2022 -0500

    Transfer parameters to the newly introduced configuration framework (4)
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                | 18 ++---
 src/java/org/apache/cassandra/config/Config.java   | 30 ++++---
 .../cassandra/config/DatabaseDescriptor.java       | 94 ++++++++--------------
 src/java/org/apache/cassandra/db/Keyspace.java     |  4 +-
 .../apache/cassandra/streaming/StreamSession.java  |  2 +-
 .../cassandra/distributed/test/CASAddTest.java     |  4 +-
 .../apache/cassandra/distributed/test/CASTest.java | 53 ++++++------
 .../distributed/test/LargeColumnTest.java          |  4 +-
 .../distributed/test/MessageFiltersTest.java       |  3 +-
 .../test/ReadRepairEmptyRangeTombstonesTest.java   |  5 +-
 .../distributed/test/ReadRepairQueryTypesTest.java |  4 +-
 .../cassandra/distributed/test/ReadRepairTest.java |  2 +-
 .../test/ring/ReadsDuringBootstrapTest.java        |  4 +-
 .../upgrade/MixedModeAvailabilityTestBase.java     |  5 +-
 .../upgrade/MixedModeConsistencyTestBase.java      |  5 +-
 .../upgrade/MixedModeMessageForwardTest.java       |  1 -
 .../cassandra/simulator/ClusterSimulation.java     |  8 +-
 .../cassandra/config/DatabaseDescriptorTest.java   | 65 ++++++++-------
 .../LoadOldYAMLBackwardCompatibilityTest.java      |  4 +-
 19 files changed, 146 insertions(+), 169 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index e9cce68..3d8168b 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -984,28 +984,28 @@ sstable_preemptive_open_interval: 50MiB
 
 # How long the coordinator should wait for read operations to complete.
 # Lowest acceptable value is 10 ms.
-read_request_timeout_in_ms: 5000
+read_request_timeout: 5000ms
 # How long the coordinator should wait for seq or index scans to complete.
 # Lowest acceptable value is 10 ms.
-range_request_timeout_in_ms: 10000
+range_request_timeout: 10000ms
 # How long the coordinator should wait for writes to complete.
 # Lowest acceptable value is 10 ms.
-write_request_timeout_in_ms: 2000
+write_request_timeout: 2000ms
 # How long the coordinator should wait for counter writes to complete.
 # Lowest acceptable value is 10 ms.
-counter_write_request_timeout_in_ms: 5000
+counter_write_request_timeout: 5000ms
 # How long a coordinator should continue to retry a CAS operation
 # that contends with other proposals for the same row.
 # Lowest acceptable value is 10 ms.
-cas_contention_timeout_in_ms: 1000
+cas_contention_timeout: 1000ms
 # How long the coordinator should wait for truncates to complete
 # (This can be much longer, because unless auto_snapshot is disabled
 # we need to flush first so we can snapshot before removing the data.)
 # Lowest acceptable value is 10 ms.
-truncate_request_timeout_in_ms: 60000
+truncate_request_timeout: 60000ms
 # The default timeout for other, miscellaneous operations.
 # Lowest acceptable value is 10 ms.
-request_timeout_in_ms: 10000
+request_timeout: 10000ms
 
 # Defensive settings for protecting Cassandra from true network partitions.
 # See (CASSANDRA-14358) for details.
@@ -1049,7 +1049,7 @@ request_timeout_in_ms: 10000
 # How long before a node logs slow queries. Select queries that take longer than
 # this timeout to execute, will generate an aggregated log message, so that slow queries
 # can be identified. Set this value to zero to disable slow query logging.
-slow_query_log_timeout_in_ms: 500
+slow_query_log_timeout: 500ms
 
 # Enable operation timeout information exchange between nodes to accurately
 # measure request timeouts.  If disabled, replicas will assume that requests
@@ -1067,7 +1067,7 @@ slow_query_log_timeout_in_ms: 500
 # 2 keep-alive cycles the stream session times out and fail
 # Default value is 300s (5 minutes), which means stalled stream
 # times out in 10 minutes by default
-# streaming_keep_alive_period_in_secs: 300
+# streaming_keep_alive_period: 300s
 
 # Limit number of connections per host for streaming
 # Increase this when you notice that joins are CPU-bound rather that network
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 172f16b..6c22d5f 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -102,29 +102,39 @@ public class Config
     /** Triggers automatic allocation of tokens if set, based on the provided replica count for a datacenter */
     public Integer allocate_tokens_for_local_replication_factor = null;
 
-    public long native_transport_idle_timeout_in_ms = 0L;
+    @Replaces(oldName = "native_transport_idle_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds native_transport_idle_timeout = new SmallestDurationMilliseconds("0ms");
 
-    public volatile long request_timeout_in_ms = 10000L;
+    @Replaces(oldName = "request_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds request_timeout = new SmallestDurationMilliseconds("10000ms");
 
-    public volatile long read_request_timeout_in_ms = 5000L;
+    @Replaces(oldName = "read_request_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds read_request_timeout = new SmallestDurationMilliseconds("5000ms");
 
-    public volatile long range_request_timeout_in_ms = 10000L;
+    @Replaces(oldName = "range_request_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds range_request_timeout = new SmallestDurationMilliseconds("10000ms");
 
-    public volatile long write_request_timeout_in_ms = 2000L;
+    @Replaces(oldName = "write_request_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds write_request_timeout = new SmallestDurationMilliseconds("2000ms");
 
-    public volatile long counter_write_request_timeout_in_ms = 5000L;
+    @Replaces(oldName = "counter_write_request_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds counter_write_request_timeout = new SmallestDurationMilliseconds("5000ms");
 
-    public volatile long cas_contention_timeout_in_ms = 1000L;
+    @Replaces(oldName = "cas_contention_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds cas_contention_timeout = new SmallestDurationMilliseconds("1000ms");
 
-    public volatile long truncate_request_timeout_in_ms = 60000L;
+    @Replaces(oldName = "truncate_request_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds truncate_request_timeout = new SmallestDurationMilliseconds("60000ms");
 
     public Integer streaming_connections_per_host = 1;
-    public Integer streaming_keep_alive_period_in_secs = 300; //5 minutes
+    @Replaces(oldName = "streaming_keep_alive_period_in_secs", converter = Converters.SECONDS_DURATION, deprecated = true)
+    public SmallestDurationSeconds streaming_keep_alive_period = new SmallestDurationSeconds("300s");
 
     @Replaces(oldName = "cross_node_timeout", converter = Converters.IDENTITY, deprecated = true)
     public boolean internode_timeout = true;
 
-    public volatile long slow_query_log_timeout_in_ms = 500L;
+    @Replaces(oldName = "slow_query_log_timeout_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds slow_query_log_timeout = new SmallestDurationMilliseconds("500ms");
 
     public volatile double phi_convict_threshold = 8.0;
 
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 978a6dd..d573def 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -104,7 +104,7 @@ public class DatabaseDescriptor
     /**
      * Request timeouts can not be less than below defined value (see CASSANDRA-9375)
      */
-    static final long LOWEST_ACCEPTED_TIMEOUT = 10L;
+    static final SmallestDurationMilliseconds LOWEST_ACCEPTED_TIMEOUT = SmallestDurationMilliseconds.inMilliseconds(10L);
 
     private static Supplier<IFailureDetector> newFailureDetector;
     private static IEndpointSnitch snitch;
@@ -1061,52 +1061,22 @@ public class DatabaseDescriptor
     @VisibleForTesting
     static void checkForLowestAcceptedTimeouts(Config conf)
     {
-        if(conf.read_request_timeout_in_ms < LOWEST_ACCEPTED_TIMEOUT)
-        {
-           logInfo("read_request_timeout_in_ms", conf.read_request_timeout_in_ms, LOWEST_ACCEPTED_TIMEOUT);
-           conf.read_request_timeout_in_ms = LOWEST_ACCEPTED_TIMEOUT;
-        }
-
-        if(conf.range_request_timeout_in_ms < LOWEST_ACCEPTED_TIMEOUT)
-        {
-           logInfo("range_request_timeout_in_ms", conf.range_request_timeout_in_ms, LOWEST_ACCEPTED_TIMEOUT);
-           conf.range_request_timeout_in_ms = LOWEST_ACCEPTED_TIMEOUT;
-        }
-
-        if(conf.request_timeout_in_ms < LOWEST_ACCEPTED_TIMEOUT)
-        {
-           logInfo("request_timeout_in_ms", conf.request_timeout_in_ms, LOWEST_ACCEPTED_TIMEOUT);
-           conf.request_timeout_in_ms = LOWEST_ACCEPTED_TIMEOUT;
-        }
-
-        if(conf.write_request_timeout_in_ms < LOWEST_ACCEPTED_TIMEOUT)
-        {
-           logInfo("write_request_timeout_in_ms", conf.write_request_timeout_in_ms, LOWEST_ACCEPTED_TIMEOUT);
-           conf.write_request_timeout_in_ms = LOWEST_ACCEPTED_TIMEOUT;
-        }
-
-        if(conf.cas_contention_timeout_in_ms < LOWEST_ACCEPTED_TIMEOUT)
-        {
-           logInfo("cas_contention_timeout_in_ms", conf.cas_contention_timeout_in_ms, LOWEST_ACCEPTED_TIMEOUT);
-           conf.cas_contention_timeout_in_ms = LOWEST_ACCEPTED_TIMEOUT;
-        }
-
-        if(conf.counter_write_request_timeout_in_ms < LOWEST_ACCEPTED_TIMEOUT)
-        {
-           logInfo("counter_write_request_timeout_in_ms", conf.counter_write_request_timeout_in_ms, LOWEST_ACCEPTED_TIMEOUT);
-           conf.counter_write_request_timeout_in_ms = LOWEST_ACCEPTED_TIMEOUT;
-        }
-
-        if(conf.truncate_request_timeout_in_ms < LOWEST_ACCEPTED_TIMEOUT)
-        {
-           logInfo("truncate_request_timeout_in_ms", conf.truncate_request_timeout_in_ms, LOWEST_ACCEPTED_TIMEOUT);
-           conf.truncate_request_timeout_in_ms = LOWEST_ACCEPTED_TIMEOUT;
-        }
+        conf.read_request_timeout = max("read_request_timeout", conf.read_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+        conf.range_request_timeout = max("range_request_timeout", conf.range_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+        conf.request_timeout = max("request_timeout", conf.request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+        conf.write_request_timeout = max("write_request_timeout", conf.write_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+        conf.cas_contention_timeout = max("cas_contention_timeout", conf.cas_contention_timeout, LOWEST_ACCEPTED_TIMEOUT);
+        conf.counter_write_request_timeout = max("counter_write_request_timeout", conf.counter_write_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
+        conf.truncate_request_timeout = max("truncate_request_timeout", conf.truncate_request_timeout, LOWEST_ACCEPTED_TIMEOUT);
     }
 
-    private static void logInfo(String property, long actualValue, long lowestAcceptedValue)
+    private static void logInfo(String property, SmallestDurationMilliseconds actualValue, SmallestDurationMilliseconds lowestAcceptedValue)
     {
-        logger.info("found {}::{} less than lowest acceptable value {}, continuing with {}", property, actualValue, lowestAcceptedValue, lowestAcceptedValue);
+        logger.info("found {}::{} less than lowest acceptable value {}, continuing with {}",
+                    property,
+                    actualValue.toString(),
+                    lowestAcceptedValue.toString(),
+                    lowestAcceptedValue);
     }
 
     public static void applyTokensConfig()
@@ -1644,82 +1614,82 @@ public class DatabaseDescriptor
 
     public static long nativeTransportIdleTimeout()
     {
-        return conf.native_transport_idle_timeout_in_ms;
+        return conf.native_transport_idle_timeout.toMilliseconds();
     }
 
     public static void setNativeTransportIdleTimeout(long nativeTransportTimeout)
     {
-        conf.native_transport_idle_timeout_in_ms = nativeTransportTimeout;
+        conf.native_transport_idle_timeout= SmallestDurationMilliseconds.inMilliseconds(nativeTransportTimeout);
     }
 
     public static long getRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.request_timeout_in_ms, MILLISECONDS);
+        return unit.convert(conf.request_timeout.toMilliseconds(), MILLISECONDS);
     }
 
     public static void setRpcTimeout(long timeOutInMillis)
     {
-        conf.request_timeout_in_ms = timeOutInMillis;
+        conf.request_timeout = SmallestDurationMilliseconds.inMilliseconds(timeOutInMillis);
     }
 
     public static long getReadRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.read_request_timeout_in_ms, MILLISECONDS);
+        return unit.convert(conf.read_request_timeout.toMilliseconds(), MILLISECONDS);
     }
 
     public static void setReadRpcTimeout(long timeOutInMillis)
     {
-        conf.read_request_timeout_in_ms = timeOutInMillis;
+        conf.read_request_timeout = SmallestDurationMilliseconds.inMilliseconds(timeOutInMillis);
     }
 
     public static long getRangeRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.range_request_timeout_in_ms, MILLISECONDS);
+        return unit.convert(conf.range_request_timeout.toMilliseconds(), MILLISECONDS);
     }
 
     public static void setRangeRpcTimeout(long timeOutInMillis)
     {
-        conf.range_request_timeout_in_ms = timeOutInMillis;
+        conf.range_request_timeout = SmallestDurationMilliseconds.inMilliseconds(timeOutInMillis);
     }
 
     public static long getWriteRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.write_request_timeout_in_ms, MILLISECONDS);
+        return unit.convert(conf.write_request_timeout.toMilliseconds(), MILLISECONDS);
     }
 
     public static void setWriteRpcTimeout(long timeOutInMillis)
     {
-        conf.write_request_timeout_in_ms = timeOutInMillis;
+        conf.write_request_timeout = SmallestDurationMilliseconds.inMilliseconds(timeOutInMillis);
     }
 
     public static long getCounterWriteRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.counter_write_request_timeout_in_ms, MILLISECONDS);
+        return unit.convert(conf.counter_write_request_timeout.toMilliseconds(), MILLISECONDS);
     }
 
     public static void setCounterWriteRpcTimeout(long timeOutInMillis)
     {
-        conf.counter_write_request_timeout_in_ms = timeOutInMillis;
+        conf.counter_write_request_timeout = SmallestDurationMilliseconds.inMilliseconds(timeOutInMillis);
     }
 
     public static long getCasContentionTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.cas_contention_timeout_in_ms, MILLISECONDS);
+        return unit.convert(conf.cas_contention_timeout.toMilliseconds(), MILLISECONDS);
     }
 
     public static void setCasContentionTimeout(long timeOutInMillis)
     {
-        conf.cas_contention_timeout_in_ms = timeOutInMillis;
+        conf.cas_contention_timeout = SmallestDurationMilliseconds.inMilliseconds(timeOutInMillis);
     }
 
     public static long getTruncateRpcTimeout(TimeUnit unit)
     {
-        return unit.convert(conf.truncate_request_timeout_in_ms, MILLISECONDS);
+        return unit.convert(conf.truncate_request_timeout.toMilliseconds(), MILLISECONDS);
     }
 
     public static void setTruncateRpcTimeout(long timeOutInMillis)
     {
-        conf.truncate_request_timeout_in_ms = timeOutInMillis;
+        conf.truncate_request_timeout = SmallestDurationMilliseconds.inMilliseconds(timeOutInMillis);
     }
 
     public static boolean hasCrossNodeTimeout()
@@ -1734,7 +1704,7 @@ public class DatabaseDescriptor
 
     public static long getSlowQueryTimeout(TimeUnit units)
     {
-        return units.convert(conf.slow_query_log_timeout_in_ms, MILLISECONDS);
+        return units.convert(conf.slow_query_log_timeout.toMilliseconds(), MILLISECONDS);
     }
 
     /**
@@ -2945,7 +2915,7 @@ public class DatabaseDescriptor
 
     public static int getStreamingKeepAlivePeriod()
     {
-        return conf.streaming_keep_alive_period_in_secs;
+        return conf.streaming_keep_alive_period.toSecondsAsInt();
     }
 
     public static int getStreamingConnectionsPerHost()
diff --git a/src/java/org/apache/cassandra/db/Keyspace.java b/src/java/org/apache/cassandra/db/Keyspace.java
index 2c27889..459f926 100644
--- a/src/java/org/apache/cassandra/db/Keyspace.java
+++ b/src/java/org/apache/cassandra/db/Keyspace.java
@@ -481,7 +481,7 @@ public class Keyspace
      *                       may happen concurrently, depending on the CL Executor type.
      * @param makeDurable    if true, don't return unless write has been made durable
      * @param updateIndexes  false to disable index updates (used by CollationController "defragmenting")
-     * @param isDroppable    true if this should throw WriteTimeoutException if it does not acquire lock within write_request_timeout_in_ms
+     * @param isDroppable    true if this should throw WriteTimeoutException if it does not acquire lock within write_request_timeout
      */
     public void apply(final Mutation mutation,
                       final boolean makeDurable,
@@ -498,7 +498,7 @@ public class Keyspace
      *                       may happen concurrently, depending on the CL Executor type.
      * @param makeDurable    if true, don't return unless write has been made durable
      * @param updateIndexes  false to disable index updates (used by CollationController "defragmenting")
-     * @param isDroppable    true if this should throw WriteTimeoutException if it does not acquire lock within write_request_timeout_in_ms
+     * @param isDroppable    true if this should throw WriteTimeoutException if it does not acquire lock within write_request_timeout
      * @param isDeferrable   true if caller is not waiting for future to complete, so that future may be deferred
      */
     private Future<?> applyInternal(final Mutation mutation,
diff --git a/src/java/org/apache/cassandra/streaming/StreamSession.java b/src/java/org/apache/cassandra/streaming/StreamSession.java
index fd24539..02255dd 100644
--- a/src/java/org/apache/cassandra/streaming/StreamSession.java
+++ b/src/java/org/apache/cassandra/streaming/StreamSession.java
@@ -670,7 +670,7 @@ public class StreamSession implements IEndpointStateChangeSubscriber
         if (e instanceof SocketTimeoutException)
         {
             logger.error("[Stream #{}] Did not receive response from peer {}{} for {} secs. Is peer down? " +
-                         "If not, maybe try increasing streaming_keep_alive_period_in_secs.", planId(),
+                         "If not, maybe try increasing streaming_keep_alive_period.", planId(),
                          hostAddressAndPort(channel.peer()),
                          channel.peer().equals(channel.connectedTo()) ? "" : " through " + hostAddressAndPort(channel.connectedTo()),
                          2 * DatabaseDescriptor.getStreamingKeepAlivePeriod(),
diff --git a/test/distributed/org/apache/cassandra/distributed/test/CASAddTest.java b/test/distributed/org/apache/cassandra/distributed/test/CASAddTest.java
index 02f9fd8..59220cc 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/CASAddTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/CASAddTest.java
@@ -35,12 +35,12 @@ public class CASAddTest extends TestBaseImpl
     private static final Logger logger = LoggerFactory.getLogger(CASAddTest.class);
 
     /**
-     * The {@code cas_contention_timeout_in_ms} used during the tests
+     * The {@code cas_contention_timeout} used during the tests
      */
     private static final long CONTENTION_TIMEOUT = 1000L;
 
     /**
-     * The {@code write_request_timeout_in_ms} used during the tests
+     * The {@code write_request_timeout} used during the tests
      */
     private static final long REQUEST_TIMEOUT = 1000L;
 
diff --git a/test/distributed/org/apache/cassandra/distributed/test/CASTest.java b/test/distributed/org/apache/cassandra/distributed/test/CASTest.java
index 8dd5977..30a8a25 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/CASTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/CASTest.java
@@ -27,9 +27,6 @@ import org.junit.Assert;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.apache.cassandra.db.Keyspace;
 import org.apache.cassandra.db.marshal.Int32Type;
 import org.apache.cassandra.dht.Murmur3Partitioner;
@@ -56,17 +53,15 @@ import static org.junit.Assert.assertTrue;
 
 public class CASTest extends TestBaseImpl
 {
-    private static final Logger logger = LoggerFactory.getLogger(CASTest.class);
-
     /**
-     * The {@code cas_contention_timeout_in_ms} used during the tests
+     * The {@code cas_contention_timeout} used during the tests
      */
-    private static final long CONTENTION_TIMEOUT = 1000L;
+    private static final String CONTENTION_TIMEOUT = "1000ms";
 
     /**
-     * The {@code write_request_timeout_in_ms} used during the tests
+     * The {@code write_request_timeout} used during the tests
      */
-    private static final long REQUEST_TIMEOUT = 1000L;
+    private static final String REQUEST_TIMEOUT = "1000ms";
 
     @Test
     public void simpleUpdate() throws Throwable
@@ -90,8 +85,8 @@ public class CASTest extends TestBaseImpl
     @Test
     public void incompletePrepare() throws Throwable
     {
-        try (Cluster cluster = init(Cluster.create(3, config -> config.set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                                                                      .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT))))
+        try (Cluster cluster = init(Cluster.create(3, config -> config.set("write_request_timeout", REQUEST_TIMEOUT)
+                                                                      .set("cas_contention_timeout", CONTENTION_TIMEOUT))))
         {
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck))");
 
@@ -114,8 +109,8 @@ public class CASTest extends TestBaseImpl
     @Test
     public void incompletePropose() throws Throwable
     {
-        try (Cluster cluster = init(Cluster.create(3, config -> config.set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                                                                      .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT))))
+        try (Cluster cluster = init(Cluster.create(3, config -> config.set("write_request_timeout", REQUEST_TIMEOUT)
+                                                                      .set("cas_contention_timeout", CONTENTION_TIMEOUT))))
         {
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck))");
 
@@ -141,8 +136,8 @@ public class CASTest extends TestBaseImpl
     @Test
     public void incompleteCommit() throws Throwable
     {
-        try (Cluster cluster = init(Cluster.create(3, config -> config.set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                                                                      .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT))))
+        try (Cluster cluster = init(Cluster.create(3, config -> config.set("write_request_timeout", REQUEST_TIMEOUT)
+                                                                      .set("cas_contention_timeout", CONTENTION_TIMEOUT))))
         {
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck))");
 
@@ -202,8 +197,8 @@ public class CASTest extends TestBaseImpl
         // does not happen on 3.0 and there is no report of such long pauses otherwise, so an hypothesis is that this
         // is due to the in-jvm dtest framework. This is is why we use a 4 seconds timeout here. Given this test is
         // not about performance, this is probably ok, even if we ideally should dug into the underlying reason.
-        try (Cluster cluster = init(Cluster.create(3, config -> config.set("write_request_timeout_in_ms", 4000L)
-                                                                      .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT))))
+        try (Cluster cluster = init(Cluster.create(3, config -> config.set("write_request_timeout", "4000ms")
+                                                                      .set("cas_contention_timeout", CONTENTION_TIMEOUT))))
         {
             String table = KEYSPACE + ".t";
             cluster.schemaChange("CREATE TABLE " + table + " (k int PRIMARY KEY, v int)");
@@ -377,8 +372,8 @@ public class CASTest extends TestBaseImpl
     public void testSuccessfulWriteBeforeRangeMovement() throws Throwable
     {
         try (Cluster cluster = Cluster.create(4, config -> config
-                .set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT)))
+                .set("write_request_timeout", REQUEST_TIMEOUT)
+                .set("cas_contention_timeout", CONTENTION_TIMEOUT)))
         {
             cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};");
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v1 int, v2 int, PRIMARY KEY (pk, ck))");
@@ -418,8 +413,8 @@ public class CASTest extends TestBaseImpl
     public void testConflictingWritesWithStaleRingInformation() throws Throwable
     {
         try (Cluster cluster = Cluster.create(4, config -> config
-                .set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT)))
+                                                           .set("write_request_timeout", REQUEST_TIMEOUT)
+                                                           .set("cas_contention_timeout", CONTENTION_TIMEOUT)))
         {
             cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};");
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v1 int, v2 int, PRIMARY KEY (pk, ck))");
@@ -458,8 +453,8 @@ public class CASTest extends TestBaseImpl
     public void testSucccessfulWriteDuringRangeMovementFollowedByRead() throws Throwable
     {
         try (Cluster cluster = Cluster.create(4, config -> config
-                .set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT)))
+                                                           .set("write_request_timeout", REQUEST_TIMEOUT)
+                                                           .set("cas_contention_timeout", CONTENTION_TIMEOUT)))
         {
             cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};");
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck))");
@@ -502,8 +497,8 @@ public class CASTest extends TestBaseImpl
     public void testSuccessfulWriteDuringRangeMovementFollowedByConflicting() throws Throwable
     {
         try (Cluster cluster = Cluster.create(4, config -> config
-                .set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT)))
+                                                           .set("write_request_timeout", REQUEST_TIMEOUT)
+                                                           .set("cas_contention_timeout", CONTENTION_TIMEOUT)))
         {
             cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};");
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v1 int, v2 int, PRIMARY KEY (pk, ck))");
@@ -554,8 +549,8 @@ public class CASTest extends TestBaseImpl
     public void testIncompleteWriteFollowedBySuccessfulWriteWithStaleRingDuringRangeMovementFollowedByRead() throws Throwable
     {
         try (Cluster cluster = Cluster.create(4, config -> config
-                .set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT)))
+                                                           .set("write_request_timeout", REQUEST_TIMEOUT)
+                                                           .set("cas_contention_timeout", CONTENTION_TIMEOUT)))
         {
             cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};");
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v1 int, v2 int, PRIMARY KEY (pk, ck))");
@@ -618,8 +613,8 @@ public class CASTest extends TestBaseImpl
     public void testIncompleteWriteFollowedBySuccessfulWriteWithStaleRingDuringRangeMovementFollowedByWrite() throws Throwable
     {
         try (Cluster cluster = Cluster.create(4, config -> config
-                .set("write_request_timeout_in_ms", REQUEST_TIMEOUT)
-                .set("cas_contention_timeout_in_ms", CONTENTION_TIMEOUT)))
+                                                           .set("write_request_timeout", REQUEST_TIMEOUT)
+                                                           .set("cas_contention_timeout", CONTENTION_TIMEOUT)))
         {
             cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3};");
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v1 int, v2 int, PRIMARY KEY (pk, ck))");
diff --git a/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java b/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
index e1733ce..7a59876 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
@@ -70,8 +70,8 @@ public class LargeColumnTest extends TestBaseImpl
                                                  config.set("commitlog_segment_size_in_mb", (columnSize * 3) >> 20)
                                                        .set("internode_application_send_queue_reserve_endpoint_capacity_in_bytes", columnSize * 2)
                                                        .set("internode_application_send_queue_reserve_global_capacity_in_bytes", columnSize * 3)
-                                                       .set("write_request_timeout_in_ms", SECONDS.toMillis(30L))
-                                                       .set("read_request_timeout_in_ms", SECONDS.toMillis(30L))
+                                                       .set("write_request_timeout", "30s")
+                                                       .set("read_request_timeout", "30s")
                                                        .set("memtable_heap_space_in_mb", 1024)
                                      )
                                      .start()))
diff --git a/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java b/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
index 9cae1bd..9ecea99 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/MessageFiltersTest.java
@@ -30,6 +30,7 @@ import com.google.common.collect.Sets;
 import org.junit.Assert;
 import org.junit.Test;
 
+import org.apache.cassandra.config.SmallestDurationMilliseconds;
 import org.apache.cassandra.distributed.Cluster;
 import org.apache.cassandra.distributed.api.ConsistencyLevel;
 import org.apache.cassandra.distributed.api.ICluster;
@@ -187,7 +188,7 @@ public class MessageFiltersTest extends TestBaseImpl
         String read = "SELECT * FROM " + KEYSPACE + ".tbl";
         String write = "INSERT INTO " + KEYSPACE + ".tbl (pk, ck, v) VALUES (1, 1, 1)";
 
-        try (ICluster<IInvokableInstance> cluster = builder().withNodes(2).withConfig(c -> c.set("range_request_timeout_in_ms", 20000)).start())
+        try (ICluster<IInvokableInstance> cluster = builder().withNodes(2).withConfig(c -> c.set("range_request_timeout", "2000ms")).start())
         {
             cluster.schemaChange("CREATE KEYSPACE " + KEYSPACE + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': " + cluster.size() + "};");
             cluster.schemaChange("CREATE TABLE " + KEYSPACE + ".tbl (pk int, ck int, v int, PRIMARY KEY (pk, ck))");
diff --git a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairEmptyRangeTombstonesTest.java b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairEmptyRangeTombstonesTest.java
index 44ee07e..6cdea9b 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairEmptyRangeTombstonesTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairEmptyRangeTombstonesTest.java
@@ -33,7 +33,6 @@ import org.apache.cassandra.distributed.Cluster;
 import org.apache.cassandra.distributed.shared.AssertUtils;
 import org.apache.cassandra.service.reads.repair.ReadRepairStrategy;
 
-import static java.util.concurrent.TimeUnit.MINUTES;
 import static org.apache.cassandra.distributed.shared.AssertUtils.row;
 
 
@@ -96,8 +95,8 @@ public class ReadRepairEmptyRangeTombstonesTest extends TestBaseImpl
     public static void setupCluster() throws IOException
     {
         cluster = init(Cluster.build(NUM_NODES)
-                              .withConfig(config -> config.set("read_request_timeout_in_ms", MINUTES.toMillis(1))
-                                                          .set("write_request_timeout_in_ms", MINUTES.toMillis(1)))
+                              .withConfig(config -> config.set("read_request_timeout", "1m")
+                                                          .set("write_request_timeout", "1m"))
                               .start());
         cluster.schemaChange(withKeyspace("CREATE TYPE %s.udt (x int, y int)"));
     }
diff --git a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java
index b79e0c4..221ac86 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairQueryTypesTest.java
@@ -118,8 +118,8 @@ public class ReadRepairQueryTypesTest extends TestBaseImpl
     public static void setupCluster() throws IOException
     {
         cluster = init(Cluster.build(NUM_NODES)
-                              .withConfig(config -> config.set("read_request_timeout_in_ms", MINUTES.toMillis(1))
-                                                          .set("write_request_timeout_in_ms", MINUTES.toMillis(1)))
+                              .withConfig(config -> config.set("read_request_timeout", "1m")
+                                                          .set("write_request_timeout", "1m"))
                               .start());
         cluster.schemaChange(withKeyspace("CREATE TYPE %s.udt (x int, y int)"));
     }
diff --git a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairTest.java b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairTest.java
index c5e3a71..7ce55bc 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/ReadRepairTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/ReadRepairTest.java
@@ -355,7 +355,7 @@ public class ReadRepairTest extends TestBaseImpl
         String key = "test1";
         try (Cluster cluster = init(Cluster.build()
                                            .withConfig(config -> config.with(Feature.GOSSIP, Feature.NETWORK)
-                                                                       .set("read_request_timeout_in_ms", Integer.MAX_VALUE))
+                                                                       .set("read_request_timeout", String.format("%dms", Integer.MAX_VALUE)))
                                            .withTokenSupplier(TokenSupplier.evenlyDistributedTokens(4))
                                            .withNodeIdTopology(NetworkTopology.singleDcNetworkTopology(4, "dc0", "rack0"))
                                            .withNodes(3)
diff --git a/test/distributed/org/apache/cassandra/distributed/test/ring/ReadsDuringBootstrapTest.java b/test/distributed/org/apache/cassandra/distributed/test/ring/ReadsDuringBootstrapTest.java
index 932dbdc..ba2cdc5 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/ring/ReadsDuringBootstrapTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/ring/ReadsDuringBootstrapTest.java
@@ -61,8 +61,8 @@ public class ReadsDuringBootstrapTest extends TestBaseImpl
                                         .withTokenSupplier(TokenSupplier.evenlyDistributedTokens(expandedNodeCount))
                                         .withNodeIdTopology(NetworkTopology.singleDcNetworkTopology(expandedNodeCount, "dc0", "rack0"))
                                         .withConfig(config -> config.with(NETWORK, GOSSIP)
-                                                                    .set("read_request_timeout_in_ms", Integer.MAX_VALUE)
-                                                                    .set("request_timeout_in_ms", Integer.MAX_VALUE))
+                                                                    .set("read_request_timeout", String.format("%dms", Integer.MAX_VALUE))
+                                                                    .set("request_timeout", String.format("%dms", Integer.MAX_VALUE)))
                                         .withInstanceInitializer(BB::install)
                                         .start())
         {
diff --git a/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeAvailabilityTestBase.java b/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeAvailabilityTestBase.java
index c1ae153..e801f76 100644
--- a/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeAvailabilityTestBase.java
+++ b/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeAvailabilityTestBase.java
@@ -30,7 +30,6 @@ import org.apache.cassandra.exceptions.ReadTimeoutException;
 import org.apache.cassandra.exceptions.WriteTimeoutException;
 import org.apache.cassandra.net.Verb;
 
-import static java.util.concurrent.TimeUnit.SECONDS;
 import static org.apache.cassandra.distributed.api.ConsistencyLevel.ALL;
 import static org.apache.cassandra.distributed.api.ConsistencyLevel.ONE;
 import static org.apache.cassandra.distributed.api.ConsistencyLevel.QUORUM;
@@ -70,8 +69,8 @@ public class MixedModeAvailabilityTestBase extends UpgradeTestBase
         .nodes(NUM_NODES)
         .nodesToUpgrade(upgradedCoordinator ? 1 : 2)
         .upgrades(initial, upgrade)
-        .withConfig(config -> config.set("read_request_timeout_in_ms", SECONDS.toMillis(2))
-                                    .set("write_request_timeout_in_ms", SECONDS.toMillis(2)))
+        .withConfig(config -> config.set("read_request_timeout", "2s")
+                                    .set("write_request_timeout", "2s"))
         .setup(c -> c.schemaChange(withKeyspace("CREATE TABLE %s.t (k uuid, c int, v int, PRIMARY KEY (k, c))")))
         .runAfterNodeUpgrade((cluster, n) -> {
 
diff --git a/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeConsistencyTestBase.java b/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeConsistencyTestBase.java
index f98fc8a..70b83e2 100644
--- a/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeConsistencyTestBase.java
+++ b/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeConsistencyTestBase.java
@@ -31,7 +31,6 @@ import org.apache.cassandra.distributed.api.ConsistencyLevel;
 import org.apache.cassandra.distributed.api.IUpgradeableInstance;
 
 import static java.lang.String.format;
-import static java.util.concurrent.TimeUnit.SECONDS;
 import static org.apache.cassandra.distributed.api.ConsistencyLevel.ALL;
 import static org.apache.cassandra.distributed.api.ConsistencyLevel.ONE;
 import static org.apache.cassandra.distributed.api.ConsistencyLevel.QUORUM;
@@ -56,8 +55,8 @@ public class MixedModeConsistencyTestBase extends UpgradeTestBase
         .nodes(3)
         .nodesToUpgrade(1)
         .upgrades(initial, upgrade)
-        .withConfig(config -> config.set("read_request_timeout_in_ms", SECONDS.toMillis(30))
-                                    .set("write_request_timeout_in_ms", SECONDS.toMillis(30)))
+        .withConfig(config -> config.set("read_request_timeout", "30s")
+                                    .set("write_request_timeout", "30s"))
         .setup(cluster -> {
             Tester.createTable(cluster);
             for (Tester tester : testers)
diff --git a/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeMessageForwardTest.java b/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeMessageForwardTest.java
index 8010853..935cc8e 100644
--- a/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeMessageForwardTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/upgrade/MixedModeMessageForwardTest.java
@@ -28,7 +28,6 @@ import org.slf4j.LoggerFactory;
 import org.apache.cassandra.distributed.UpgradeableCluster;
 import org.apache.cassandra.distributed.api.ConsistencyLevel;
 import org.apache.cassandra.distributed.api.Feature;
-import org.apache.cassandra.utils.Shared;
 
 import static org.apache.cassandra.distributed.shared.AssertUtils.*;
 
diff --git a/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java b/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
index a4938f1..c56a5a7 100644
--- a/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
+++ b/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
@@ -638,10 +638,10 @@ public class ClusterSimulation<S extends Simulation> implements AutoCloseable
                          .withSharedClasses(getSharedClassPredicate(ISOLATE, SHARE, ANY, SIMULATION))
                          .withConfig(config -> configUpdater.accept(threadAllocator.update(config
                              .with(Feature.BLANK_GOSSIP)
-                             .set("read_request_timeout_in_ms", NANOSECONDS.toMillis(builder.readTimeoutNanos))
-                             .set("write_request_timeout_in_ms", NANOSECONDS.toMillis(builder.writeTimeoutNanos))
-                             .set("cas_contention_timeout_in_ms", NANOSECONDS.toMillis(builder.contentionTimeoutNanos))
-                             .set("request_timeout_in_ms", NANOSECONDS.toMillis(builder.requestTimeoutNanos))
+                             .set("read_request_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.readTimeoutNanos)))
+                             .set("write_request_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.writeTimeoutNanos)))
+                             .set("cas_contention_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.contentionTimeoutNanos)))
+                             .set("request_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.requestTimeoutNanos)))
                              .set("memtable_heap_space_in_mb", 1)
                              .set("memtable_allocation_type", builder.memoryListener != null ? "unslabbed_heap_buffers_logged" : "heap_buffers")
                              .set("file_cache_size_in_mb", 16)
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
index 4af1f8a..5aabc80 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
@@ -113,7 +113,7 @@ public class DatabaseDescriptorTest
     }
 
     @Test
-    public void testRpcInterface() throws Exception
+    public void testRpcInterface()
     {
         Config testConfig = DatabaseDescriptor.loadConfig();
         testConfig.rpc_interface = suitableInterface.getName();
@@ -332,40 +332,45 @@ public class DatabaseDescriptorTest
     public void testLowestAcceptableTimeouts() throws ConfigurationException
     {
         Config testConfig = new Config();
-        testConfig.read_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT + 1;
-        testConfig.range_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT + 1;
-        testConfig.write_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT + 1;
-        testConfig.truncate_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT + 1;
-        testConfig.cas_contention_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT + 1;
-        testConfig.counter_write_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT + 1;
-        testConfig.request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT + 1;
-
-        assertTrue(testConfig.read_request_timeout_in_ms > DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.range_request_timeout_in_ms > DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.write_request_timeout_in_ms > DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.truncate_request_timeout_in_ms > DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.cas_contention_timeout_in_ms > DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.counter_write_request_timeout_in_ms > DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.request_timeout_in_ms > DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
+
+        SmallestDurationMilliseconds greaterThanLowestTimeout = SmallestDurationMilliseconds.inMilliseconds(DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT.toMilliseconds() + 1);
+
+        testConfig.read_request_timeout = greaterThanLowestTimeout;
+        testConfig.range_request_timeout = greaterThanLowestTimeout;
+        testConfig.write_request_timeout = greaterThanLowestTimeout;
+        testConfig.truncate_request_timeout = greaterThanLowestTimeout;
+        testConfig.cas_contention_timeout = greaterThanLowestTimeout;
+        testConfig.counter_write_request_timeout = greaterThanLowestTimeout;
+        testConfig.request_timeout = greaterThanLowestTimeout;
+
+        assertEquals(testConfig.read_request_timeout, greaterThanLowestTimeout);
+        assertEquals(testConfig.range_request_timeout, greaterThanLowestTimeout);
+        assertEquals(testConfig.write_request_timeout, greaterThanLowestTimeout);
+        assertEquals(testConfig.truncate_request_timeout, greaterThanLowestTimeout);
+        assertEquals(testConfig.cas_contention_timeout, greaterThanLowestTimeout);
+        assertEquals(testConfig.counter_write_request_timeout, greaterThanLowestTimeout);
+        assertEquals(testConfig.request_timeout, greaterThanLowestTimeout);
 
         //set less than Lowest acceptable value
-        testConfig.read_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT - 1;
-        testConfig.range_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT - 1;
-        testConfig.write_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT - 1;
-        testConfig.truncate_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT - 1;
-        testConfig.cas_contention_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT - 1;
-        testConfig.counter_write_request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT - 1;
-        testConfig.request_timeout_in_ms = DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT - 1;
+        SmallestDurationMilliseconds lowerThanLowestTimeout = SmallestDurationMilliseconds.inMilliseconds(DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT.toMilliseconds() - 1);
+
+        testConfig.read_request_timeout = lowerThanLowestTimeout;
+        testConfig.range_request_timeout = lowerThanLowestTimeout;
+        testConfig.write_request_timeout = lowerThanLowestTimeout;
+        testConfig.truncate_request_timeout = lowerThanLowestTimeout;
+        testConfig.cas_contention_timeout = lowerThanLowestTimeout;
+        testConfig.counter_write_request_timeout = lowerThanLowestTimeout;
+        testConfig.request_timeout = lowerThanLowestTimeout;
 
         DatabaseDescriptor.checkForLowestAcceptedTimeouts(testConfig);
 
-        assertTrue(testConfig.read_request_timeout_in_ms == DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.range_request_timeout_in_ms == DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.write_request_timeout_in_ms == DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.truncate_request_timeout_in_ms == DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.cas_contention_timeout_in_ms == DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.counter_write_request_timeout_in_ms == DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
-        assertTrue(testConfig.request_timeout_in_ms == DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
+        assertEquals(testConfig.read_request_timeout, DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
+        assertEquals(testConfig.range_request_timeout, DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
+        assertEquals(testConfig.write_request_timeout, DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
+        assertEquals(testConfig.truncate_request_timeout, DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
+        assertEquals(testConfig.cas_contention_timeout, DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
+        assertEquals(testConfig.counter_write_request_timeout, DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
+        assertEquals(testConfig.request_timeout, DatabaseDescriptor.LOWEST_ACCEPTED_TIMEOUT);
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
index 528da31..885f28f 100644
--- a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
@@ -43,7 +43,7 @@ public class LoadOldYAMLBackwardCompatibilityTest
         /*assertEquals(5, config.internode_socket_send_buffer_size_in_bytes);
         assertEquals(5, config.internode_socket_receive_buffer_size_in_bytes);
         assertEquals(DurationSpec.inMilliseconds(10800000), config.max_hint_window);
-        assertEquals(DurationSpec.inHours(0), config.max_hint_window);
+        assertEquals(DurationSpec.inHours(0), config.max_hint_window);*/
         assertEquals(DurationSpec.inMilliseconds(0), config.native_transport_idle_timeout);
         assertEquals(DurationSpec.inMilliseconds(10000), config.request_timeout);
         assertEquals(DurationSpec.inMilliseconds(5000), config.read_request_timeout);
@@ -54,7 +54,7 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DurationSpec.inMilliseconds(60000), config.truncate_request_timeout);
         assertEquals(DurationSpec.inSeconds(300), config.streaming_keep_alive_period);
         assertEquals(DurationSpec.inMilliseconds(500), config.slow_query_log_timeout);
-        assertNull(config.memtable_heap_space);
+        /*assertNull(config.memtable_heap_space);
         assertNull(config.memtable_offheap_space);
         assertNull( config.repair_session_space);
         assertEquals(DataStorageSpec.inBytes(4194304), config.internode_application_send_queue_capacity);

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


[cassandra] 10/13: Transfer parameters to the newly introduced configuration framework (6) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 23138252f20891c26a3692664c6affaf99e86541
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Thu Feb 3 23:49:50 2022 -0500

    Transfer parameters to the newly introduced configuration framework (6)
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                |  40 ++---
 doc/native_protocol_v4.spec                        |   4 +-
 doc/native_protocol_v5.spec                        |   4 +-
 .../apache/cassandra/batchlog/BatchlogManager.java |  10 +-
 src/java/org/apache/cassandra/config/Config.java   |  50 +++++--
 .../cassandra/config/DatabaseDescriptor.java       | 166 +++++++++++----------
 .../commitlog/AbstractCommitLogSegmentManager.java |   2 +-
 .../db/commitlog/CommitLogSegmentManagerCDC.java   |   2 +-
 .../db/commitlog/GroupCommitLogService.java        |   2 +-
 .../cassandra/hints/HintsDispatchExecutor.java     |   2 +-
 .../apache/cassandra/hints/HintsWriteExecutor.java |   4 +-
 .../org/apache/cassandra/io/util/FileUtils.java    |  26 ++--
 .../apache/cassandra/service/StorageService.java   |   8 +-
 .../cassandra/service/StorageServiceMBean.java     |   6 +-
 .../nodetool/SetHintedHandoffThrottleInKB.java     |   4 +-
 test/conf/cassandra-murmur.yaml                    |   2 +-
 test/conf/cassandra-seeds.yaml                     |   2 +-
 ...dra-sslcontextfactory-invalidconfiguration.yaml |   2 +-
 test/conf/cassandra-sslcontextfactory.yaml         |   2 +-
 test/conf/cassandra.yaml                           |   6 +-
 test/conf/unit-test-conf/test-native-port.yaml     |   2 +-
 .../test/HintedHandoffNodetoolTest.java            |   4 +-
 .../distributed/test/LargeColumnTest.java          |   2 +-
 .../cassandra/config/DatabaseDescriptorTest.java   |   4 +-
 .../commitlog/CommitLogInitWithExceptionTest.java  |   1 +
 .../commitlog/CommitLogSegmentManagerCDCTest.java  |   8 +-
 26 files changed, 193 insertions(+), 172 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 0c4acb8..9f7e657 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -68,7 +68,7 @@ max_hint_window: 3h
 # are two nodes in the cluster, each delivery thread will use the maximum
 # rate; if there are three, each will throttle to half of the maximum,
 # since we expect two nodes to be delivering hints simultaneously.)
-hinted_handoff_throttle_in_kb: 1024
+hinted_handoff_throttle: 1024KiB
 
 # Number of threads with which to deliver hints;
 # Consider increasing this number when you have multi-dc deployments, since
@@ -81,10 +81,10 @@ max_hints_delivery_threads: 2
 
 # How often hints should be flushed from the internal buffers to disk.
 # Will *not* trigger fsync.
-hints_flush_period_in_ms: 10000
+hints_flush_period: 10000ms
 
 # Maximum size for a single hints file, in megabytes.
-max_hints_file_size_in_mb: 128
+max_hints_file_size: 128MiB
 
 # Enable / disable automatic cleanup for the expired and orphaned hints file.
 # Disable the option in order to preserve those hints on the disk.
@@ -114,7 +114,7 @@ auto_hints_cleanup_enabled: false
 
 # Maximum throttle in KBs per second, total. This will be
 # reduced proportionally to the number of nodes in the cluster.
-batchlog_replay_throttle_in_kb: 1024
+batchlog_replay_throttle: 1024KiB
 
 # Authentication backend, implementing IAuthenticator; used to identify users
 # Out of the box, Cassandra provides org.apache.cassandra.auth.{AllowAllAuthenticator,
@@ -456,19 +456,19 @@ counter_cache_save_period: 7200
 #
 # group mode is similar to batch mode, where Cassandra will not ack writes
 # until the commit log has been flushed to disk. The difference is group
-# mode will wait up to commitlog_sync_group_window_in_ms between flushes.
+# mode will wait up to commitlog_sync_group_window between flushes.
 #
-# commitlog_sync_group_window_in_ms: 1000
+# commitlog_sync_group_window: 1000ms
 #
 # the default option is "periodic" where writes may be acked immediately
-# and the CommitLog is simply synced every commitlog_sync_period_in_ms
+# and the CommitLog is simply synced every commitlog_sync_period
 # milliseconds.
 commitlog_sync: periodic
-commitlog_sync_period_in_ms: 10000
+commitlog_sync_period: 10000ms
 
 # When in periodic commitlog mode, the number of milliseconds to block writes
 # while waiting for a slow disk flush to complete.
-# periodic_commitlog_sync_lag_block_in_ms: 
+# periodic_commitlog_sync_lag_block:
 
 # The size of the individual commitlog file segments.  A commitlog
 # segment may be archived, deleted, or recycled once all the data
@@ -479,14 +479,14 @@ commitlog_sync_period_in_ms: 10000
 # archiving commitlog segments (see commitlog_archiving.properties),
 # then you probably want a finer granularity of archiving; 8 or 16 MB
 # is reasonable.
-# Max mutation size is also configurable via max_mutation_size_in_kb setting in
-# cassandra.yaml. The default is half the size commitlog_segment_size_in_mb * 1024.
+# Max mutation size is also configurable via max_mutation_size setting in
+# cassandra.yaml. The default is half the size commitlog_segment_size in bytes.
 # This should be positive and less than 2048.
 #
-# NOTE: If max_mutation_size_in_kb is set explicitly then commitlog_segment_size_in_mb must
-# be set to at least twice the size of max_mutation_size_in_kb / 1024
+# NOTE: If max_mutation_size is set explicitly then commitlog_segment_size must
+# be set to at least twice the size of max_mutation_size
 #
-commitlog_segment_size_in_mb: 32
+commitlog_segment_size: 32MiB
 
 # Compression to apply to the commit log. If omitted, the commit log
 # will be written uncompressed.  LZ4, Snappy, and Deflate compressors
@@ -631,7 +631,7 @@ memtable_allocation_type: heap_buffers
 # The default value is the smaller of 8192, and 1/4 of the total space
 # of the commitlog volume.
 #
-# commitlog_total_space_in_mb: 8192
+# commitlog_total_space: 8192MiB
 
 # This sets the number of memtable flush writer threads per disk
 # as well as the total number of memtables that can be flushed concurrently.
@@ -670,12 +670,12 @@ memtable_allocation_type: heap_buffers
 #
 # The default value is the min of 4096 mb and 1/8th of the total space
 # of the drive where cdc_raw_directory resides.
-# cdc_total_space_in_mb: 4096
+# cdc_total_space: 4096MiB
 
 # When we hit our cdc_raw limit and the CDCCompactor is either running behind
 # or experiencing backpressure, we check at the following interval to see if any
 # new space for cdc-tracked tables has been made available. Default to 250ms
-# cdc_free_space_check_interval_ms: 250
+# cdc_free_space_check_interval: 250ms
 
 # A fixed memory pool size in MB for for SSTable index summaries. If left
 # empty, this will default to 5% of the heap size. If the memory usage of
@@ -1176,10 +1176,10 @@ endpoint_snitch: SimpleSnitch
 
 # controls how often to perform the more expensive part of host score
 # calculation
-dynamic_snitch_update_interval_in_ms: 100 
+dynamic_snitch_update_interval: 100ms
 # controls how often to reset all host scores, allowing a bad host to
 # possibly recover
-dynamic_snitch_reset_interval_in_ms: 600000
+dynamic_snitch_reset_interval: 600000ms
 # if set greater than zero, this will allow
 # 'pinning' of replicas to hosts in order to increase cache capacity.
 # The badness threshold will control how much worse the pinned host has to be
@@ -1394,7 +1394,7 @@ batch_size_fail_threshold: 50KiB
 unlogged_batch_across_partitions_warn_threshold: 10
 
 # Log a warning when compacting partitions larger than this value
-compaction_large_partition_warning_threshold_mb: 100
+compaction_large_partition_warning_threshold: 100MiB
 
 # Log a warning when writing more tombstones than this value to a partition
 compaction_tombstone_warning_threshold: 100000
diff --git a/doc/native_protocol_v4.spec b/doc/native_protocol_v4.spec
index 2220000..6def737 100644
--- a/doc/native_protocol_v4.spec
+++ b/doc/native_protocol_v4.spec
@@ -1103,7 +1103,7 @@ Table of Contents
                              - "VIEW": the timeout occured when a write involves
                                 VIEW update and failure to acqiure local view(MV)
                                 lock for key within timeout
-                             - "CDC": the timeout occured when cdc_total_space_in_mb is
+                             - "CDC": the timeout occured when cdc_total_space is
                                 exceeded when doing a write to data tracked by cdc.
     0x1200    Read_timeout: Timeout exception during a read request. The rest
               of the ERROR message body will be
@@ -1176,7 +1176,7 @@ Table of Contents
                              - "VIEW": the failure occured when a write involves
                                 VIEW update and failure to acqiure local view(MV)
                                 lock for key within timeout
-                             - "CDC": the failure occured when cdc_total_space_in_mb is
+                             - "CDC": the failure occured when cdc_total_space is
                                 exceeded when doing a write to data tracked by cdc.
 
     0x2000    Syntax_error: The submitted query has a syntax error.
diff --git a/doc/native_protocol_v5.spec b/doc/native_protocol_v5.spec
index 3b13527..3f6703d 100644
--- a/doc/native_protocol_v5.spec
+++ b/doc/native_protocol_v5.spec
@@ -1298,7 +1298,7 @@ Table of Contents
                              - "VIEW": the timeout occured when a write involves
                                VIEW update and failure to acqiure local view(MV)
                                lock for key within timeout
-                             - "CDC": the timeout occured when cdc_total_space_in_mb is
+                             - "CDC": the timeout occured when cdc_total_space is
                                exceeded when doing a write to data tracked by cdc.
                 <contentions> is a [short] that describes the number of contentions occured during the CAS operation.
                               The field only presents when the <writeType> is "CAS".
@@ -1381,7 +1381,7 @@ Table of Contents
                              - "VIEW": the failure occured when a write involves
                                VIEW update and failure to acqiure local view(MV)
                                lock for key within timeout
-                             - "CDC": the failure occured when cdc_total_space_in_mb is
+                             - "CDC": the failure occured when cdc_total_space is
                                exceeded when doing a write to data tracked by cdc.
     0x1600    CDC_WRITE_FAILURE: // todo
     0x1700    CAS_WRITE_UNKNOWN: An exception occured due to contended Compare And Set write/update.
diff --git a/src/java/org/apache/cassandra/batchlog/BatchlogManager.java b/src/java/org/apache/cassandra/batchlog/BatchlogManager.java
index 147e7e9..420d559 100644
--- a/src/java/org/apache/cassandra/batchlog/BatchlogManager.java
+++ b/src/java/org/apache/cassandra/batchlog/BatchlogManager.java
@@ -208,7 +208,7 @@ public class BatchlogManager implements BatchlogManagerMBean
             logger.trace("Replay cancelled as there are no peers in the ring.");
             return;
         }
-        setRate(DatabaseDescriptor.getBatchlogReplayThrottleInKB());
+        setRate(DatabaseDescriptor.getBatchlogReplayThrottleInKiB());
 
         UUID limitUuid = UUIDGen.maxTimeUUID(currentTimeMillis() - getBatchlogTimeout());
         ColumnFamilyStore store = Keyspace.open(SchemaConstants.SYSTEM_KEYSPACE_NAME).getColumnFamilyStore(SystemKeyspace.BATCHES);
@@ -229,18 +229,18 @@ public class BatchlogManager implements BatchlogManagerMBean
      * Sets the rate for the current rate limiter. When {@code throttleInKB} is 0, this sets the rate to
      * {@link Double#MAX_VALUE} bytes per second.
      *
-     * @param throttleInKB throughput to set in KB per second
+     * @param throttleInKB throughput to set in KiB per second
      */
     public void setRate(final int throttleInKB)
     {
         int endpointsCount = StorageService.instance.getTokenMetadata().getSizeOfAllEndpoints();
         if (endpointsCount > 0)
         {
-            int endpointThrottleInKB = throttleInKB / endpointsCount;
-            double throughput = endpointThrottleInKB == 0 ? Double.MAX_VALUE : endpointThrottleInKB * 1024.0;
+            int endpointThrottleInKiB = throttleInKB / endpointsCount;
+            double throughput = endpointThrottleInKiB == 0 ? Double.MAX_VALUE : endpointThrottleInKiB * 1024.0;
             if (rateLimiter.getRate() != throughput)
             {
-                logger.debug("Updating batchlog replay throttle to {} KB/s, {} KB/s per endpoint", throttleInKB, endpointThrottleInKB);
+                logger.debug("Updating batchlog replay throttle to {} KB/s, {} KB/s per endpoint", throttleInKB, endpointThrottleInKiB);
                 rateLimiter.setRate(throughput);
             }
         }
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 7ee8c42..2f56fc7 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -272,8 +272,10 @@ public class Config
     public volatile Integer concurrent_compactors;
     @Replaces(oldName = "compaction_throughput_mb_per_sec", converter = Converters.MEBIBYTES_PER_SECOND_DATA_RATE, deprecated = true)
     public volatile DataRateSpec compaction_throughput = new DataRateSpec("16MiB/s");
-    public volatile int compaction_large_partition_warning_threshold_mb = 100;
-    public int min_free_space_per_drive_in_mb = 50;
+    @Replaces(oldName = "compaction_large_partition_warning_threshold_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public volatile SmallestDataStorageMebibytes compaction_large_partition_warning_threshold = new SmallestDataStorageMebibytes("100MiB");
+    @Replaces(oldName = "min_free_space_per_drive_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes min_free_space_per_drive = new SmallestDataStorageMebibytes("50MiB");
     public volatile Integer compaction_tombstone_warning_threshold = 100000;
 
     public volatile int concurrent_materialized_view_builders = 1;
@@ -305,23 +307,29 @@ public class Config
 
     // Commit Log
     public String commitlog_directory;
-    public Integer commitlog_total_space_in_mb;
+    @Replaces(oldName = "commitlog_total_space_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes commitlog_total_space;
     public CommitLogSync commitlog_sync;
 
     /**
      * @deprecated since 4.0 This value was near useless, and we're not using it anymore
      */
     public double commitlog_sync_batch_window_in_ms = Double.NaN;
-    public double commitlog_sync_group_window_in_ms = Double.NaN;
-    public int commitlog_sync_period_in_ms;
-    public int commitlog_segment_size_in_mb = 32;
+    @Replaces(oldName = "commitlog_sync_group_window_in_ms", converter = Converters.MILLIS_DOUBLE_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds commitlog_sync_group_window = new SmallestDurationMilliseconds("0ms");
+    @Replaces(oldName = "commitlog_sync_period_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds commitlog_sync_period = new SmallestDurationMilliseconds("0ms");
+    @Replaces(oldName = "commitlog_segment_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes commitlog_segment_size = new SmallestDataStorageMebibytes("32MiB");
     public ParameterizedClass commitlog_compression;
     public FlushCompression flush_compression = FlushCompression.fast;
     public int commitlog_max_compression_buffers_in_pool = 3;
-    public Integer periodic_commitlog_sync_lag_block_in_ms;
+    @Replaces(oldName = "periodic_commitlog_sync_lag_block_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds periodic_commitlog_sync_lag_block;
     public TransparentDataEncryptionOptions transparent_data_encryption_options = new TransparentDataEncryptionOptions();
 
-    public Integer max_mutation_size_in_kb;
+    @Replaces(oldName = "max_mutation_size_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
+    public SmallestDataStorageKibibytes max_mutation_size;
 
     // Change-data-capture logs
     public boolean cdc_enabled = false;
@@ -329,16 +337,20 @@ public class Config
     // When false, new CDC mutations can always be added. But it will remove the oldest CDC commit log segment on full.
     public volatile boolean cdc_block_writes = true;
     public String cdc_raw_directory;
-    public int cdc_total_space_in_mb = 0;
-    public int cdc_free_space_check_interval_ms = 250;
+    @Replaces(oldName = "cdc_total_space_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes cdc_total_space = new SmallestDataStorageMebibytes("0MiB");
+    @Replaces(oldName = "cdc_free_space_check_interval_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds cdc_free_space_check_interval = new SmallestDurationMilliseconds("250ms");
 
     @Deprecated
     public int commitlog_periodic_queue_size = -1;
 
     public String endpoint_snitch;
     public boolean dynamic_snitch = true;
-    public int dynamic_snitch_update_interval_in_ms = 100;
-    public int dynamic_snitch_reset_interval_in_ms = 600000;
+    @Replaces(oldName = "dynamic_snitch_update_interval_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds dynamic_snitch_update_interval = new SmallestDurationMilliseconds("100ms");
+    @Replaces(oldName = "dynamic_snitch_reset_interval_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds dynamic_snitch_reset_interval = new SmallestDurationMilliseconds("10m");
     public double dynamic_snitch_badness_threshold = 1.0;
 
     public String failure_detector = "FailureDetector";
@@ -348,11 +360,17 @@ public class Config
 
     public InternodeCompression internode_compression = InternodeCompression.none;
 
-    public int hinted_handoff_throttle_in_kb = 1024;
-    public int batchlog_replay_throttle_in_kb = 1024;
+    @Replaces(oldName = "hinted_handoff_throttle_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
+    public SmallestDataStorageKibibytes hinted_handoff_throttle = new SmallestDataStorageKibibytes("1024KiB");
+    @Replaces(oldName = "batchlog_replay_throttle_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
+    public SmallestDataStorageKibibytes batchlog_replay_throttle = new SmallestDataStorageKibibytes("1024KiB");
     public int max_hints_delivery_threads = 2;
-    public int hints_flush_period_in_ms = 10000;
-    public int max_hints_file_size_in_mb = 128;
+
+    @Replaces(oldName = "hints_flush_period_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds hints_flush_period = new SmallestDurationMilliseconds("10s");
+    @Replaces(oldName = "max_hints_file_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes max_hints_file_size = new SmallestDataStorageMebibytes("128MiB");
+
     public ParameterizedClass hints_compression;
     public volatile boolean auto_hints_cleanup_enabled = false;
 
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 3b1ef66..b51f2de 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -78,7 +78,7 @@ import org.apache.commons.lang3.StringUtils;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
 import static org.apache.cassandra.config.CassandraRelevantProperties.OS_ARCH;
 import static org.apache.cassandra.config.CassandraRelevantProperties.SUN_ARCH_DATA_MODEL;
-import static org.apache.cassandra.io.util.FileUtils.ONE_GB;
+import static org.apache.cassandra.io.util.FileUtils.ONE_GIB;
 import static org.apache.cassandra.io.util.FileUtils.ONE_MIB;
 import static org.apache.cassandra.utils.Clock.Global.logInitializationOutcome;
 
@@ -381,35 +381,35 @@ public class DatabaseDescriptor
 
         if (conf.commitlog_sync == Config.CommitLogSync.batch)
         {
-            if (conf.commitlog_sync_period_in_ms != 0)
+            if (conf.commitlog_sync_period.toMilliseconds() != 0)
             {
-                throw new ConfigurationException("Batch sync specified, but commitlog_sync_period_in_ms found. Only specify commitlog_sync_batch_window_in_ms when using batch sync", false);
+                throw new ConfigurationException("Batch sync specified, but commitlog_sync_period found.", false);
             }
             logger.debug("Syncing log with batch mode");
         }
         else if (conf.commitlog_sync == CommitLogSync.group)
         {
-            if (Double.isNaN(conf.commitlog_sync_group_window_in_ms) || conf.commitlog_sync_group_window_in_ms <= 0d)
+            if (conf.commitlog_sync_group_window.toMilliseconds() == 0)
             {
-                throw new ConfigurationException("Missing value for commitlog_sync_group_window_in_ms: positive double value expected.", false);
+                throw new ConfigurationException("Missing value for commitlog_sync_group_window.", false);
             }
-            else if (conf.commitlog_sync_period_in_ms != 0)
+            else if (conf.commitlog_sync_period.toMilliseconds() != 0)
             {
-                throw new ConfigurationException("Group sync specified, but commitlog_sync_period_in_ms found. Only specify commitlog_sync_group_window_in_ms when using group sync", false);
+                throw new ConfigurationException("Group sync specified, but commitlog_sync_period found. Only specify commitlog_sync_group_window when using group sync", false);
             }
-            logger.debug("Syncing log with a group window of {}", conf.commitlog_sync_period_in_ms);
+            logger.debug("Syncing log with a group window of {}", conf.commitlog_sync_period.toString());
         }
         else
         {
-            if (conf.commitlog_sync_period_in_ms <= 0)
+            if (conf.commitlog_sync_period.toMilliseconds() <= 0)
             {
-                throw new ConfigurationException("Missing value for commitlog_sync_period_in_ms: positive integer expected", false);
+                throw new ConfigurationException("Missing value for commitlog_sync_period.", false);
             }
             else if (!Double.isNaN(conf.commitlog_sync_batch_window_in_ms))
             {
-                throw new ConfigurationException("commitlog_sync_period_in_ms specified, but commitlog_sync_batch_window_in_ms found.  Only specify commitlog_sync_period_in_ms when using periodic sync.", false);
+                throw new ConfigurationException("commitlog_sync_period specified, but commitlog_sync_batch_window found.  Only specify commitlog_sync_period when using periodic sync.", false);
             }
-            logger.debug("Syncing log with a period of {}", conf.commitlog_sync_period_in_ms);
+            logger.debug("Syncing log with a period of {}", conf.commitlog_sync_period.toString());
         }
 
         /* evaluate the DiskAccessMode Config directive, which also affects indexAccessMode selection */
@@ -551,16 +551,17 @@ public class DatabaseDescriptor
         else
             logger.info("Native transport rate-limiting disabled.");
 
-        if (conf.commitlog_total_space_in_mb == null)
+        if (conf.commitlog_total_space == null)
         {
-            final int preferredSizeInMB = 8192;
+            final int preferredSizeInMiB = 8192;
             // use 1/4 of available space.  See discussion on #10013 and #10199
             final long totalSpaceInBytes = tryGetSpace(conf.commitlog_directory, FileStore::getTotalSpace);
-            conf.commitlog_total_space_in_mb = calculateDefaultSpaceInMB("commitlog",
-                                                                         conf.commitlog_directory,
-                                                                         "commitlog_total_space_in_mb",
-                                                                         preferredSizeInMB,
-                                                                         totalSpaceInBytes, 1, 4);
+            int defaultSpaceInMiB = calculateDefaultSpaceInMiB("commitlog",
+                                                               conf.commitlog_directory,
+                                                               "commitlog_total_space",
+                                                               preferredSizeInMiB,
+                                                               totalSpaceInBytes, 1, 4);
+            conf.commitlog_total_space = SmallestDataStorageMebibytes.inMebibytes(defaultSpaceInMiB);
         }
 
         if (conf.cdc_enabled)
@@ -570,16 +571,17 @@ public class DatabaseDescriptor
                 conf.cdc_raw_directory = storagedirFor("cdc_raw");
             }
 
-            if (conf.cdc_total_space_in_mb == 0)
+            if (conf.cdc_total_space.toMebibytes() == 0)
             {
-                final int preferredSizeInMB = 4096;
+                final int preferredSizeInMiB = 4096;
                 // use 1/8th of available space.  See discussion on #10013 and #10199 on the CL, taking half that for CDC
                 final long totalSpaceInBytes = tryGetSpace(conf.cdc_raw_directory, FileStore::getTotalSpace);
-                conf.cdc_total_space_in_mb = calculateDefaultSpaceInMB("cdc",
-                                                                       conf.cdc_raw_directory,
-                                                                       "cdc_total_space_in_mb",
-                                                                       preferredSizeInMB,
-                                                                       totalSpaceInBytes, 1, 8);
+                int defaultSpaceInMiB = calculateDefaultSpaceInMiB("cdc",
+                                                                   conf.cdc_raw_directory,
+                                                                   "cdc_total_space",
+                                                                   preferredSizeInMiB,
+                                                                   totalSpaceInBytes, 1, 8);
+                conf.cdc_total_space = SmallestDataStorageMebibytes.inMebibytes(defaultSpaceInMiB);
             }
 
             logger.info("cdc_enabled is true. Starting casssandra node with Change-Data-Capture enabled.");
@@ -611,7 +613,7 @@ public class DatabaseDescriptor
 
             dataFreeBytes = saturatedSum(dataFreeBytes, tryGetSpace(datadir, FileStore::getUnallocatedSpace));
         }
-        if (dataFreeBytes < 64 * ONE_GB) // 64 GB
+        if (dataFreeBytes < 64 * ONE_GIB) // 64 GB
             logger.warn("Only {} free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots",
                         FBUtilities.prettyPrintMemory(dataFreeBytes));
 
@@ -626,7 +628,7 @@ public class DatabaseDescriptor
 
             long freeBytes = tryGetSpace(conf.local_system_data_file_directory, FileStore::getUnallocatedSpace);
 
-            if (freeBytes < ONE_GB)
+            if (freeBytes < ONE_GIB)
                 logger.warn("Only {} free in the system data volume. Consider adding more capacity or removing obsolete snapshots",
                             FBUtilities.prettyPrintMemory(freeBytes));
         }
@@ -743,17 +745,17 @@ public class DatabaseDescriptor
         if (conf.user_defined_function_fail_timeout < conf.user_defined_function_warn_timeout)
             throw new ConfigurationException("user_defined_function_warn_timeout must less than user_defined_function_fail_timeout", false);
 
-        if (conf.commitlog_segment_size_in_mb <= 0)
-            throw new ConfigurationException("commitlog_segment_size_in_mb must be positive, but was "
-                    + conf.commitlog_segment_size_in_mb, false);
-        else if (conf.commitlog_segment_size_in_mb >= 2048)
-            throw new ConfigurationException("commitlog_segment_size_in_mb must be smaller than 2048, but was "
-                    + conf.commitlog_segment_size_in_mb, false);
+        if (conf.commitlog_segment_size.toMebibytes() == 0)
+            throw new ConfigurationException("commitlog_segment_size must be positive, but was "
+                    + conf.commitlog_segment_size.toString(), false);
+        else if (conf.commitlog_segment_size.toMebibytes() >= 2048)
+            throw new ConfigurationException("commitlog_segment_size must be smaller than 2048, but was "
+                    + conf.commitlog_segment_size.toString(), false);
 
-        if (conf.max_mutation_size_in_kb == null)
-            conf.max_mutation_size_in_kb = conf.commitlog_segment_size_in_mb * 1024 / 2;
-        else if (conf.commitlog_segment_size_in_mb * 1024 < 2 * conf.max_mutation_size_in_kb)
-            throw new ConfigurationException("commitlog_segment_size_in_mb must be at least twice the size of max_mutation_size_in_kb / 1024", false);
+        if (conf.max_mutation_size == null)
+            conf.max_mutation_size = SmallestDataStorageKibibytes.inKibibytes(conf.commitlog_segment_size.toKibibytes() / 2);
+        else if (conf.commitlog_segment_size.toKibibytes() < 2 * conf.max_mutation_size.toKibibytes())
+            throw new ConfigurationException("commitlog_segment_size must be at least twice the size of max_mutation_size / 1024", false);
 
         // native transport encryption options
         if (conf.client_encryption_options != null)
@@ -904,20 +906,20 @@ public class DatabaseDescriptor
         return storagedir;
     }
 
-    static int calculateDefaultSpaceInMB(String type, String path, String setting, int preferredSizeInMB, long totalSpaceInBytes, long totalSpaceNumerator, long totalSpaceDenominator)
+    static int calculateDefaultSpaceInMiB(String type, String path, String setting, int preferredSizeInMiB, long totalSpaceInBytes, long totalSpaceNumerator, long totalSpaceDenominator)
     {
-        final long totalSizeInMB = totalSpaceInBytes / ONE_MIB;
-        final int minSizeInMB = Ints.saturatedCast(totalSpaceNumerator * totalSizeInMB / totalSpaceDenominator);
+        final long totalSizeInMiB = totalSpaceInBytes / ONE_MIB;
+        final int minSizeInMiB = Ints.saturatedCast(totalSpaceNumerator * totalSizeInMiB / totalSpaceDenominator);
 
-        if (minSizeInMB < preferredSizeInMB)
+        if (minSizeInMiB < preferredSizeInMiB)
         {
             logger.warn("Small {} volume detected at '{}'; setting {} to {}.  You can override this in cassandra.yaml",
-                        type, path, setting, minSizeInMB);
-            return minSizeInMB;
+                        type, path, setting, minSizeInMiB);
+            return minSizeInMiB;
         }
         else
         {
-            return preferredSizeInMB;
+            return preferredSizeInMiB;
         }
     }
 
@@ -1867,7 +1869,7 @@ public class DatabaseDescriptor
         conf.compaction_throughput = DataRateSpec.inMebibytesPerSecond(value);
     }
 
-    public static long getCompactionLargePartitionWarningThreshold() { return ByteUnit.MEBI_BYTES.toBytes(conf.compaction_large_partition_warning_threshold_mb); }
+    public static long getCompactionLargePartitionWarningThreshold() { return conf.compaction_large_partition_warning_threshold.toBytes(); }
 
     public static int getCompactionTombstoneWarningThreshold()
     {
@@ -1902,7 +1904,7 @@ public class DatabaseDescriptor
 
     public static long getMinFreeSpacePerDriveInBytes()
     {
-        return ByteUnit.MEBI_BYTES.toBytes(conf.min_free_space_per_drive_in_mb);
+        return conf.min_free_space_per_drive.toBytes();
     }
 
     public static boolean getDisableSTCSInL0()
@@ -2074,7 +2076,7 @@ public class DatabaseDescriptor
 
     public static int getMaxMutationSize()
     {
-        return (int) ByteUnit.KIBI_BYTES.toBytes(conf.max_mutation_size_in_kb);
+        return conf.max_mutation_size.toBytesAsInt();
     }
 
     public static int getTombstoneWarnThreshold()
@@ -2122,19 +2124,19 @@ public class DatabaseDescriptor
      */
     public static int getCommitLogSegmentSize()
     {
-        return (int) ByteUnit.MEBI_BYTES.toBytes(conf.commitlog_segment_size_in_mb);
+        return conf.commitlog_segment_size.toBytesAsInt();
     }
 
     /**
-     * Update commitlog_segment_size_in_mb in the tests.
+     * Update commitlog_segment_size in the tests.
      * {@link CommitLogSegmentManagerCDC} uses the CommitLogSegmentSize to estimate the file size on allocation.
      * It is important to keep the value unchanged for the estimation to be correct.
-     * @param sizeMegabytes
+     * @param sizeMebibytes
      */
     @VisibleForTesting /* Only for testing */
-    public static void setCommitLogSegmentSize(int sizeMegabytes)
+    public static void setCommitLogSegmentSize(int sizeMebibytes)
     {
-        conf.commitlog_segment_size_in_mb = sizeMegabytes;
+        conf.commitlog_segment_size = SmallestDataStorageMebibytes.inMebibytes(sizeMebibytes);
     }
 
     public static String getSavedCachesLocation()
@@ -2404,14 +2406,14 @@ public class DatabaseDescriptor
         conf.native_transport_allow_older_protocols = isEnabled;
     }
 
-    public static double getCommitLogSyncGroupWindow()
+    public static long getCommitLogSyncGroupWindow()
     {
-        return conf.commitlog_sync_group_window_in_ms;
+        return conf.commitlog_sync_group_window.toMilliseconds();
     }
 
-    public static void setCommitLogSyncGroupWindow(double windowMillis)
+    public static void setCommitLogSyncGroupWindow(long windowMillis)
     {
-        conf.commitlog_sync_group_window_in_ms = windowMillis;
+        conf.commitlog_sync_group_window = SmallestDurationMilliseconds.inMilliseconds(windowMillis);
     }
 
     public static int getNativeTransportReceiveQueueCapacityInBytes()
@@ -2478,20 +2480,20 @@ public class DatabaseDescriptor
 
     public static int getCommitLogSyncPeriod()
     {
-        return conf.commitlog_sync_period_in_ms;
+        return conf.commitlog_sync_period.toMillisecondsAsInt();
     }
 
     public static long getPeriodicCommitLogSyncBlock()
     {
-        Integer blockMillis = conf.periodic_commitlog_sync_lag_block_in_ms;
+        SmallestDurationMilliseconds blockMillis = conf.periodic_commitlog_sync_lag_block;
         return blockMillis == null
                ? (long)(getCommitLogSyncPeriod() * 1.5)
-               : blockMillis;
+               : blockMillis.toMilliseconds();
     }
 
     public static void setCommitLogSyncPeriod(int periodMillis)
     {
-        conf.commitlog_sync_period_in_ms = periodMillis;
+        conf.commitlog_sync_period = SmallestDurationMilliseconds.inMilliseconds(periodMillis);
     }
 
     public static Config.CommitLogSync getCommitLogSync()
@@ -2656,20 +2658,20 @@ public class DatabaseDescriptor
 
     public static int getDynamicUpdateInterval()
     {
-        return conf.dynamic_snitch_update_interval_in_ms;
+        return conf.dynamic_snitch_update_interval.toMillisecondsAsInt();
     }
     public static void setDynamicUpdateInterval(int dynamicUpdateInterval)
     {
-        conf.dynamic_snitch_update_interval_in_ms = dynamicUpdateInterval;
+        conf.dynamic_snitch_update_interval = SmallestDurationMilliseconds.inMilliseconds(dynamicUpdateInterval);
     }
 
     public static int getDynamicResetInterval()
     {
-        return conf.dynamic_snitch_reset_interval_in_ms;
+        return conf.dynamic_snitch_reset_interval.toMillisecondsAsInt();
     }
     public static void setDynamicResetInterval(int dynamicResetInterval)
     {
-        conf.dynamic_snitch_reset_interval_in_ms = dynamicResetInterval;
+        conf.dynamic_snitch_reset_interval = SmallestDurationMilliseconds.inMilliseconds(dynamicResetInterval);
     }
 
     public static double getDynamicBadnessThreshold()
@@ -2703,24 +2705,24 @@ public class DatabaseDescriptor
         conf.client_encryption_options = update.apply(conf.client_encryption_options);
     }
 
-    public static int getHintedHandoffThrottleInKB()
+    public static int getHintedHandoffThrottleInKiB()
     {
-        return conf.hinted_handoff_throttle_in_kb;
+        return conf.hinted_handoff_throttle.toKibibytesAsInt();
     }
 
-    public static void setHintedHandoffThrottleInKB(int throttleInKB)
+    public static void setHintedHandoffThrottleInKiB(int throttleInKiB)
     {
-        conf.hinted_handoff_throttle_in_kb = throttleInKB;
+        conf.hinted_handoff_throttle = SmallestDataStorageKibibytes.inKibibytes(throttleInKiB);
     }
 
-    public static int getBatchlogReplayThrottleInKB()
+    public static int getBatchlogReplayThrottleInKiB()
     {
-        return conf.batchlog_replay_throttle_in_kb;
+        return conf.batchlog_replay_throttle.toKibibytesAsInt();
     }
 
-    public static void setBatchlogReplayThrottleInKB(int throttleInKB)
+    public static void setBatchlogReplayThrottleInKiB(int throttleInKiB)
     {
-        conf.batchlog_replay_throttle_in_kb = throttleInKB;
+        conf.batchlog_replay_throttle = SmallestDataStorageKibibytes.inKibibytes(throttleInKiB);
     }
 
     public static int getMaxHintsDeliveryThreads()
@@ -2730,12 +2732,12 @@ public class DatabaseDescriptor
 
     public static int getHintsFlushPeriodInMS()
     {
-        return conf.hints_flush_period_in_ms;
+        return conf.hints_flush_period.toMillisecondsAsInt();
     }
 
     public static long getMaxHintsFileSize()
     {
-        return  ByteUnit.MEBI_BYTES.toBytes(conf.max_hints_file_size_in_mb);
+        return  conf.max_hints_file_size.toBytes();
     }
 
     public static ParameterizedClass getHintsCompression()
@@ -2818,9 +2820,9 @@ public class DatabaseDescriptor
         return conf.disk_optimization_estimate_percentile;
     }
 
-    public static long getTotalCommitlogSpaceInMB()
+    public static long getTotalCommitlogSpaceInMiB()
     {
-        return conf.commitlog_total_space_in_mb;
+        return conf.commitlog_total_space.toMebibytes();
     }
 
     public static boolean shouldMigrateKeycacheOnCompaction()
@@ -3215,20 +3217,20 @@ public class DatabaseDescriptor
         return conf.cdc_raw_directory;
     }
 
-    public static int getCDCSpaceInMB()
+    public static int getCDCSpaceInMiB()
     {
-        return conf.cdc_total_space_in_mb;
+        return conf.cdc_total_space.toMebibytesAsInt();
     }
 
     @VisibleForTesting
-    public static void setCDCSpaceInMB(int input)
+    public static void setCDCSpaceInMiB(int input)
     {
-        conf.cdc_total_space_in_mb = input;
+        conf.cdc_total_space = SmallestDataStorageMebibytes.inMebibytes(input);
     }
 
     public static int getCDCDiskCheckInterval()
     {
-        return conf.cdc_free_space_check_interval_ms;
+        return conf.cdc_free_space_check_interval.toMillisecondsAsInt();
     }
 
     @VisibleForTesting
diff --git a/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java b/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java
index 485e3fd..de29224 100644
--- a/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java
+++ b/src/java/org/apache/cassandra/db/commitlog/AbstractCommitLogSegmentManager.java
@@ -383,7 +383,7 @@ public abstract class AbstractCommitLogSegmentManager
 
     private long unusedCapacity()
     {
-        long total = DatabaseDescriptor.getTotalCommitlogSpaceInMB() * 1024 * 1024;
+        long total = DatabaseDescriptor.getTotalCommitlogSpaceInMiB() * 1024 * 1024;
         long currentSize = size.get();
         logger.trace("Total active commitlog segment space used is {} out of {}", currentSize, total);
         return total - currentSize;
diff --git a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDC.java b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDC.java
index cbd88ca..71c6efa 100644
--- a/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDC.java
+++ b/src/java/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDC.java
@@ -315,7 +315,7 @@ public class CommitLogSegmentManagerCDC extends AbstractCommitLogSegmentManager
 
         private long allowableCDCBytes()
         {
-            return (long)DatabaseDescriptor.getCDCSpaceInMB() * 1024 * 1024;
+            return (long)DatabaseDescriptor.getCDCSpaceInMiB() * 1024 * 1024;
         }
 
         public void submitOverflowSizeRecalculation()
diff --git a/src/java/org/apache/cassandra/db/commitlog/GroupCommitLogService.java b/src/java/org/apache/cassandra/db/commitlog/GroupCommitLogService.java
index a76923e..ad4448a 100644
--- a/src/java/org/apache/cassandra/db/commitlog/GroupCommitLogService.java
+++ b/src/java/org/apache/cassandra/db/commitlog/GroupCommitLogService.java
@@ -35,7 +35,7 @@ public class GroupCommitLogService extends AbstractCommitLogService
     {
         // wait until record has been safely persisted to disk
         pending.incrementAndGet();
-        // wait for commitlog_sync_group_window_in_ms
+        // wait for commitlog_sync_group_window
         alloc.awaitDiskSync(commitLog.metrics.waitingOnCommit);
         pending.decrementAndGet();
     }
diff --git a/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java b/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java
index 7f70b21..991e2a2 100644
--- a/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java
+++ b/src/java/org/apache/cassandra/hints/HintsDispatchExecutor.java
@@ -216,7 +216,7 @@ final class HintsDispatchExecutor
             // not total outgoing hints traffic from this node - this is why the rate limiter is not shared between
             // all the dispatch tasks (as there will be at most one dispatch task for a particular host id at a time).
             int nodesCount = Math.max(1, StorageService.instance.getTokenMetadata().getAllEndpoints().size() - 1);
-            double throttleInBytes = DatabaseDescriptor.getHintedHandoffThrottleInKB() * 1024.0 / nodesCount;
+            double throttleInBytes = DatabaseDescriptor.getHintedHandoffThrottleInKiB() * 1024.0 / nodesCount;
             this.rateLimiter = RateLimiter.create(throttleInBytes == 0 ? Double.MAX_VALUE : throttleInBytes);
         }
 
diff --git a/src/java/org/apache/cassandra/hints/HintsWriteExecutor.java b/src/java/org/apache/cassandra/hints/HintsWriteExecutor.java
index 8089d61..9d64e4a 100644
--- a/src/java/org/apache/cassandra/hints/HintsWriteExecutor.java
+++ b/src/java/org/apache/cassandra/hints/HintsWriteExecutor.java
@@ -62,7 +62,7 @@ final class HintsWriteExecutor
     }
 
     /*
-     * Should be very fast (worst case scenario - write a few 10s of megabytes to disk).
+     * Should be very fast (worst case scenario - write a few 10s of mebibytes to disk).
      */
     void shutdownBlocking()
     {
@@ -242,7 +242,7 @@ final class HintsWriteExecutor
                 we are removing it specifically after we closed the store above in try block
                 so hints are persisted on disk before.
 
-                There is a periodic flushing of a buffer driven by hints_flush_period_in_ms and clearing
+                There is a periodic flushing of a buffer driven by hints_flush_period and clearing
                 this entry upon every flush would remove the information what is the earliest hint in the buffer
                 for a respective node prematurely.
 
diff --git a/src/java/org/apache/cassandra/io/util/FileUtils.java b/src/java/org/apache/cassandra/io/util/FileUtils.java
index 063e3fb..08ab4f2 100644
--- a/src/java/org/apache/cassandra/io/util/FileUtils.java
+++ b/src/java/org/apache/cassandra/io/util/FileUtils.java
@@ -75,10 +75,10 @@ public final class FileUtils
 
     private static final Logger logger = LoggerFactory.getLogger(FileUtils.class);
 
-    public static final long ONE_KB = 1024;
-    public static final long ONE_MIB = 1024 * ONE_KB;
-    public static final long ONE_GB = 1024 * ONE_MIB;
-    public static final long ONE_TB = 1024 * ONE_GB;
+    public static final long ONE_KIB = 1024;
+    public static final long ONE_MIB = 1024 * ONE_KIB;
+    public static final long ONE_GIB = 1024 * ONE_MIB;
+    public static final long ONE_TIB = 1024 * ONE_GIB;
 
     private static final DecimalFormat df = new DecimalFormat("#.##");
     private static final AtomicReference<Optional<FSErrorHandler>> fsErrorHandler = new AtomicReference<>(Optional.empty());
@@ -390,17 +390,17 @@ public final class FileUtils
         }
         if (value.endsWith(" TiB"))
         {
-            result = Math.round(Double.valueOf(value.replace(" TiB", "")) * ONE_TB);
+            result = Math.round(Double.valueOf(value.replace(" TiB", "")) * ONE_TIB);
             return result;
         }
         else if (value.endsWith(" GiB"))
         {
-            result = Math.round(Double.valueOf(value.replace(" GiB", "")) * ONE_GB);
+            result = Math.round(Double.valueOf(value.replace(" GiB", "")) * ONE_GIB);
             return result;
         }
         else if (value.endsWith(" KiB"))
         {
-            result = Math.round(Double.valueOf(value.replace(" KiB", "")) * ONE_KB);
+            result = Math.round(Double.valueOf(value.replace(" KiB", "")) * ONE_KIB);
             return result;
         }
         else if (value.endsWith(" MiB"))
@@ -422,15 +422,15 @@ public final class FileUtils
     public static String stringifyFileSize(double value)
     {
         double d;
-        if ( value >= ONE_TB )
+        if (value >= ONE_TIB)
         {
-            d = value / ONE_TB;
+            d = value / ONE_TIB;
             String val = df.format(d);
             return val + " TiB";
         }
-        else if ( value >= ONE_GB )
+        else if (value >= ONE_GIB)
         {
-            d = value / ONE_GB;
+            d = value / ONE_GIB;
             String val = df.format(d);
             return val + " GiB";
         }
@@ -440,9 +440,9 @@ public final class FileUtils
             String val = df.format(d);
             return val + " MiB";
         }
-        else if ( value >= ONE_KB )
+        else if (value >= ONE_KIB)
         {
-            d = value / ONE_KB;
+            d = value / ONE_KIB;
             String val = df.format(d);
             return val + " KiB";
         }
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 4133119..1236279 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1591,12 +1591,12 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
 
     public int getBatchlogReplayThrottleInKB()
     {
-        return DatabaseDescriptor.getBatchlogReplayThrottleInKB();
+        return DatabaseDescriptor.getBatchlogReplayThrottleInKiB();
     }
 
     public void setBatchlogReplayThrottleInKB(int throttleInKB)
     {
-        DatabaseDescriptor.setBatchlogReplayThrottleInKB(throttleInKB);
+        DatabaseDescriptor.setBatchlogReplayThrottleInKiB(throttleInKB);
         BatchlogManager.instance.setRate(throttleInKB);
     }
 
@@ -5971,8 +5971,8 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
 
     public void setHintedHandoffThrottleInKB(int throttleInKB)
     {
-        DatabaseDescriptor.setHintedHandoffThrottleInKB(throttleInKB);
-        logger.info("updated hinted_handoff_throttle_in_kb to {}", throttleInKB);
+        DatabaseDescriptor.setHintedHandoffThrottleInKiB(throttleInKB);
+        logger.info("updated hinted_handoff_throttle to {} KiB", throttleInKB);
     }
 
     @Override
diff --git a/src/java/org/apache/cassandra/service/StorageServiceMBean.java b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
index 8e386ec..103b4dd 100644
--- a/src/java/org/apache/cassandra/service/StorageServiceMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageServiceMBean.java
@@ -536,12 +536,12 @@ public interface StorageServiceMBean extends NotificationEmitter
     public void updateSnitch(String epSnitchClassName, Boolean dynamic, Integer dynamicUpdateInterval, Integer dynamicResetInterval, Double dynamicBadnessThreshold) throws ClassNotFoundException;
 
     /*
-      Update dynamic_snitch_update_interval_in_ms
+      Update dynamic_snitch_update_interval in ms
      */
     public void setDynamicUpdateInterval(int dynamicUpdateInterval);
 
     /*
-      Get dynamic_snitch_update_interval_in_ms
+      Get dynamic_snitch_update_interval in ms
      */
     public int getDynamicUpdateInterval();
 
@@ -796,7 +796,7 @@ public interface StorageServiceMBean extends NotificationEmitter
     /** Sets the threshold for warning queries due to a large batch size */
     public void setBatchSizeWarnThreshold(int batchSizeDebugThreshold);
 
-    /** Sets the hinted handoff throttle in kb per second, per delivery thread. */
+    /** Sets the hinted handoff throttle in KiB per second, per delivery thread. */
     public void setHintedHandoffThrottleInKB(int throttleInKB);
 
     /**
diff --git a/src/java/org/apache/cassandra/tools/nodetool/SetHintedHandoffThrottleInKB.java b/src/java/org/apache/cassandra/tools/nodetool/SetHintedHandoffThrottleInKB.java
index 96f1bdf..b7b7b61 100644
--- a/src/java/org/apache/cassandra/tools/nodetool/SetHintedHandoffThrottleInKB.java
+++ b/src/java/org/apache/cassandra/tools/nodetool/SetHintedHandoffThrottleInKB.java
@@ -23,10 +23,10 @@ import io.airlift.airline.Command;
 import org.apache.cassandra.tools.NodeProbe;
 import org.apache.cassandra.tools.NodeTool.NodeToolCmd;
 
-@Command(name = "sethintedhandoffthrottlekb", description =  "Set hinted handoff throttle in kb per second, per delivery thread.")
+@Command(name = "sethintedhandoffthrottlekb", description =  "Set hinted handoff throttle in KiB per second, per delivery thread.")
 public class SetHintedHandoffThrottleInKB extends NodeToolCmd
 {
-    @Arguments(title = "throttle_in_kb", usage = "<value_in_kb_per_sec>", description = "Value in KB per second", required = true)
+    @Arguments(title = "throttle_in_kb", usage = "<value_in_kb_per_sec>", description = "Value in KiB per second", required = true)
     private Integer throttleInKB = null;
 
     @Override
diff --git a/test/conf/cassandra-murmur.yaml b/test/conf/cassandra-murmur.yaml
index 9da6917..05dac76 100644
--- a/test/conf/cassandra-murmur.yaml
+++ b/test/conf/cassandra-murmur.yaml
@@ -6,7 +6,7 @@ cluster_name: Test Cluster
 memtable_allocation_type: heap_buffers
 commitlog_sync: batch
 commitlog_sync_batch_window_in_ms: 1.0
-commitlog_segment_size_in_mb: 5
+commitlog_segment_size: 5MiB
 commitlog_directory: build/test/cassandra/commitlog
 cdc_raw_directory: build/test/cassandra/cdc_raw
 cdc_enabled: false
diff --git a/test/conf/cassandra-seeds.yaml b/test/conf/cassandra-seeds.yaml
index 5e016cb..d5dd83e 100644
--- a/test/conf/cassandra-seeds.yaml
+++ b/test/conf/cassandra-seeds.yaml
@@ -7,7 +7,7 @@ cluster_name: Test Cluster
 memtable_allocation_type: offheap_objects
 commitlog_sync: batch
 commitlog_sync_batch_window_in_ms: 1.0
-commitlog_segment_size_in_mb: 5
+commitlog_segment_size: 5MiB
 commitlog_directory: build/test/cassandra/commitlog
 cdc_raw_directory: build/test/cassandra/cdc_raw
 cdc_enabled: false
diff --git a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
index b11f248..8f51e85 100644
--- a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
+++ b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
@@ -25,7 +25,7 @@ cluster_name: Test Cluster
 memtable_allocation_type: offheap_objects
 commitlog_sync: batch
 commitlog_sync_batch_window_in_ms: 1.0
-commitlog_segment_size_in_mb: 5
+commitlog_segment_size: 5MiB
 commitlog_directory: build/test/cassandra/commitlog
 # commitlog_compression:
 # - class_name: LZ4Compressor
diff --git a/test/conf/cassandra-sslcontextfactory.yaml b/test/conf/cassandra-sslcontextfactory.yaml
index 6e55b49..63c40a2 100644
--- a/test/conf/cassandra-sslcontextfactory.yaml
+++ b/test/conf/cassandra-sslcontextfactory.yaml
@@ -25,7 +25,7 @@ cluster_name: Test Cluster
 memtable_allocation_type: offheap_objects
 commitlog_sync: batch
 commitlog_sync_batch_window_in_ms: 1.0
-commitlog_segment_size_in_mb: 5
+commitlog_segment_size: 5MiB
 commitlog_directory: build/test/cassandra/commitlog
 # commitlog_compression:
 # - class_name: LZ4Compressor
diff --git a/test/conf/cassandra.yaml b/test/conf/cassandra.yaml
index bd5a1b8..e1a49f2 100644
--- a/test/conf/cassandra.yaml
+++ b/test/conf/cassandra.yaml
@@ -7,7 +7,7 @@ cluster_name: Test Cluster
 memtable_allocation_type: offheap_objects
 commitlog_sync: batch
 commitlog_sync_batch_window_in_ms: 1.0
-commitlog_segment_size_in_mb: 5
+commitlog_segment_size: 5MiB
 commitlog_directory: build/test/cassandra/commitlog
 # commitlog_compression:
 # - class_name: LZ4Compressor
@@ -20,7 +20,7 @@ storage_port: 7012
 ssl_storage_port: 17012
 start_native_transport: true
 native_transport_port: 9042
-column_index_size_in_kb: 4
+column_index_size: 4KiB
 saved_caches_directory: build/test/cassandra/saved_caches
 data_file_directories:
     - build/test/cassandra/data
@@ -50,7 +50,7 @@ stream_entire_sstables: true
 stream_throughput_outbound: 23841858MiB/s
 sasi_indexes_enabled: true
 materialized_views_enabled: true
-enable_drop_compact_storage: true
+drop_compact_storage_enabled: true
 file_cache_enabled: true
 auto_hints_cleanup_enabled: true
 track_warnings:
diff --git a/test/conf/unit-test-conf/test-native-port.yaml b/test/conf/unit-test-conf/test-native-port.yaml
index d3c5516..cef6b1d 100644
--- a/test/conf/unit-test-conf/test-native-port.yaml
+++ b/test/conf/unit-test-conf/test-native-port.yaml
@@ -7,7 +7,7 @@ cluster_name: Test Cluster
 memtable_allocation_type: offheap_objects
 commitlog_sync: batch
 commitlog_sync_batch_window_in_ms: 1.0
-commitlog_segment_size_in_mb: 5
+commitlog_segment_size: 5MiB
 commitlog_directory: build/test/cassandra/commitlog
 # commitlog_compression:
 # - class_name: LZ4Compressor
diff --git a/test/distributed/org/apache/cassandra/distributed/test/HintedHandoffNodetoolTest.java b/test/distributed/org/apache/cassandra/distributed/test/HintedHandoffNodetoolTest.java
index 5045301..5ab83ba 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/HintedHandoffNodetoolTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/HintedHandoffNodetoolTest.java
@@ -122,9 +122,9 @@ public class HintedHandoffNodetoolTest extends TestBaseImpl
     @Test
     public void testThrottle()
     {
-        Integer throttleInKB = cluster.get(node).callOnInstance(DatabaseDescriptor::getHintedHandoffThrottleInKB);
+        Integer throttleInKB = cluster.get(node).callOnInstance(DatabaseDescriptor::getHintedHandoffThrottleInKiB);
         cluster.get(node).nodetoolResult("sethintedhandoffthrottlekb", String.valueOf(throttleInKB * 2)).asserts().success();
-        Integer newThrottleInKB = cluster.get(node).callOnInstance(DatabaseDescriptor::getHintedHandoffThrottleInKB);
+        Integer newThrottleInKB = cluster.get(node).callOnInstance(DatabaseDescriptor::getHintedHandoffThrottleInKiB);
         assertEquals(throttleInKB * 2, newThrottleInKB.intValue());
     }
 
diff --git a/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java b/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
index 34432dc..b03171b 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/LargeColumnTest.java
@@ -65,7 +65,7 @@ public class LargeColumnTest extends TestBaseImpl
         try (ICluster cluster = init(builder()
                                      .withNodes(nodes)
                                      .withConfig(config ->
-                                                 config.set("commitlog_segment_size_in_mb", (columnSize * 3) >> 20)
+                                                 config.set("commitlog_segment_size", String.format("%dMiB",(columnSize * 3) >> 20))
                                                        .set("internode_application_send_queue_reserve_endpoint_capacity", String.format("%dB", (columnSize * 2)))
                                                        .set("internode_application_send_queue_reserve_global_capacity", String.format("%dB", (columnSize * 3)))
                                                        .set("write_request_timeout", "30s")
diff --git a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
index 0d13654..eea55f7 100644
--- a/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
+++ b/test/unit/org/apache/cassandra/config/DatabaseDescriptorTest.java
@@ -451,7 +451,7 @@ public class DatabaseDescriptorTest
         int spaceInBytes = 999 * 1024 * 1024;
 
         assertEquals(666, // total size is less than preferred, so return lower limit
-                     DatabaseDescriptor.calculateDefaultSpaceInMB("type", "/path", "setting_name", preferredInMB, spaceInBytes, numerator, denominator));
+                     DatabaseDescriptor.calculateDefaultSpaceInMiB("type", "/path", "setting_name", preferredInMB, spaceInBytes, numerator, denominator));
 
         // check preferred size is used for a small storage volume
         preferredInMB = 100;
@@ -460,7 +460,7 @@ public class DatabaseDescriptorTest
         spaceInBytes = 999 * 1024 * 1024;
 
         assertEquals(100, // total size is more than preferred so keep the configured limit
-                     DatabaseDescriptor.calculateDefaultSpaceInMB("type", "/path", "setting_name", preferredInMB, spaceInBytes, numerator, denominator));
+                     DatabaseDescriptor.calculateDefaultSpaceInMiB("type", "/path", "setting_name", preferredInMB, spaceInBytes, numerator, denominator));
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java b/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
index fbad0b4..7cd1445 100644
--- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
+++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogInitWithExceptionTest.java
@@ -90,6 +90,7 @@ public class CommitLogInitWithExceptionTest
             Assert.fail();
         }
 
+
         Assert.assertTrue(CommitLog.instance.segmentManager.executor.isTerminated()); // exit successfully
     }
 
diff --git a/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java b/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java
index 6c1d375..b5902e5 100644
--- a/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java
+++ b/test/unit/org/apache/cassandra/db/commitlog/CommitLogSegmentManagerCDCTest.java
@@ -49,7 +49,7 @@ public class CommitLogSegmentManagerCDCTest extends CQLTester
     public static void setUpClass()
     {
         DatabaseDescriptor.setCDCEnabled(true);
-        DatabaseDescriptor.setCDCSpaceInMB(1024);
+        DatabaseDescriptor.setCDCSpaceInMiB(1024);
         CQLTester.setUpClass();
     }
 
@@ -407,15 +407,15 @@ public class CommitLogSegmentManagerCDCTest extends CQLTester
 
     private void testWithCDCSpaceInMb(int size, Testable test) throws Throwable
     {
-        int origSize = DatabaseDescriptor.getCDCSpaceInMB();
-        DatabaseDescriptor.setCDCSpaceInMB(size);
+        int origSize = DatabaseDescriptor.getCDCSpaceInMiB();
+        DatabaseDescriptor.setCDCSpaceInMiB(size);
         try
         {
             test.run();
         }
         finally
         {
-            DatabaseDescriptor.setCDCSpaceInMB(origSize);
+            DatabaseDescriptor.setCDCSpaceInMiB(origSize);
         }
     }
 

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


[cassandra] 11/13: Transfer parameters to the newly introduced configuration framework (7) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 6d5203615f7a9670cb1698b74123666bc25ba471
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Fri Feb 4 00:25:14 2022 -0500

    Transfer parameters to the newly introduced configuration framework (7)
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                |  42 ++++----
 .../org/apache/cassandra/cache/OHCProvider.java    |   2 +-
 .../cassandra/cache/SerializingCacheProvider.java  |   2 +-
 src/java/org/apache/cassandra/config/Config.java   |  61 +++++++----
 .../org/apache/cassandra/config/Converters.java    |  13 ++-
 .../cassandra/config/DatabaseDescriptor.java       | 119 ++++++++++-----------
 .../cassandra/config/SmallestDurationSeconds.java  |  29 +++++
 .../apache/cassandra/db/virtual/SettingsTable.java |  15 ++-
 .../org/apache/cassandra/service/CacheService.java |   8 +-
 test/conf/cassandra-murmur.yaml                    |   2 +-
 test/conf/cassandra-old.yaml                       |   2 +-
 test/conf/cassandra-seeds.yaml                     |   2 +-
 ...dra-sslcontextfactory-invalidconfiguration.yaml |   4 +-
 test/conf/cassandra-sslcontextfactory.yaml         |   4 +-
 test/conf/cassandra.yaml                           |   4 +-
 test/conf/unit-test-conf/test-native-port.yaml     |   4 +-
 .../cassandra/distributed/impl/InstanceConfig.java |   8 +-
 .../cassandra/distributed/test/NodeToolTest.java   |   2 +-
 .../cassandra/simulator/ClusterSimulation.java     |   4 +-
 .../LoadOldYAMLBackwardCompatibilityTest.java      |  21 ++--
 test/unit/org/apache/cassandra/cql3/CQLTester.java |   7 +-
 .../cql3/validation/entities/JsonTest.java         |   4 +-
 22 files changed, 214 insertions(+), 145 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 9f7e657..cf4326a 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -344,8 +344,8 @@ commit_failure_policy: stop
 # fit in the cache. In most cases it is not neccessary to change this value.
 # Constantly re-preparing statements is a performance penalty.
 #
-# Default value ("auto") is 1/256th of the heap or 10MB, whichever is greater
-prepared_statements_cache_size_mb:
+# Default value ("auto") is 1/256th of the heap or 10MiB, whichever is greater
+# prepared_statements_cache_size:
 
 # Maximum size of the key cache in memory.
 #
@@ -359,7 +359,7 @@ prepared_statements_cache_size_mb:
 # NOTE: if you reduce the size, you may not get you hottest keys loaded on startup.
 #
 # Default value is empty to make it "auto" (min(5% of Heap (in MB), 100MB)). Set to 0 to disable key cache.
-key_cache_size_in_mb:
+# key_cache_size:
 
 # Duration in seconds after which Cassandra should
 # save the key cache. Caches are saved to saved_caches_directory as
@@ -370,7 +370,7 @@ key_cache_size_in_mb:
 # has limited use.
 #
 # Default is 14400 or 4 hours.
-key_cache_save_period: 14400
+key_cache_save_period: 4h
 
 # Number of keys from the key cache to save
 # Disabled by default, meaning all keys are going to be saved
@@ -394,7 +394,7 @@ key_cache_save_period: 14400
 # headroom for OS block level cache. Do never allow your system to swap.
 #
 # Default value is 0, to disable row caching.
-row_cache_size_in_mb: 0
+row_cache_size: 0MiB
 
 # Duration in seconds after which Cassandra should save the row cache.
 # Caches are saved to saved_caches_directory as specified in this configuration file.
@@ -404,7 +404,7 @@ row_cache_size_in_mb: 0
 # has limited use.
 #
 # Default is 0 to disable saving the row cache.
-row_cache_save_period: 0
+row_cache_save_period: 0s
 
 # Number of keys from the row cache to save.
 # Specify 0 (which is the default), meaning all keys are going to be saved
@@ -423,14 +423,14 @@ row_cache_save_period: 0
 #
 # Default value is empty to make it "auto" (min(2.5% of Heap (in MB), 50MB)). Set to 0 to disable counter cache.
 # NOTE: if you perform counter deletes and rely on low gcgs, you should disable the counter cache.
-counter_cache_size_in_mb:
+# counter_cache_size:
 
 # Duration in seconds after which Cassandra should
 # save the counter cache (keys only). Caches are saved to saved_caches_directory as
 # specified in this configuration file.
 #
 # Default is 7200 or 2 hours.
-counter_cache_save_period: 7200
+counter_cache_save_period: 7200s
 
 # Number of keys from the counter cache to save
 # Disabled by default, meaning all keys are going to be saved
@@ -443,7 +443,7 @@ counter_cache_save_period: 7200
 # Number of seconds the server will wait for each cache (row, key, etc ...) to load while starting
 # the Cassandra process. Setting this to a negative value is equivalent to disabling all cache loading on startup
 # while still having the cache during runtime.
-# cache_load_timeout_seconds: 30
+# cache_load_timeout: 30s
 
 # commitlog_sync may be either "periodic", "group", or "batch." 
 # 
@@ -550,7 +550,7 @@ concurrent_materialized_view_writes: 32
 # overhead which is roughly 128 bytes per chunk (i.e. 0.2% of the reserved size
 # if the default 64k chunk size is used).
 # Memory is only allocated when needed.
-# networking_cache_size_in_mb: 128
+# networking_cache_size: 128MiB
 
 # Enable the sstable chunk cache.  The chunk cache will store recently accessed
 # sections of the sstable in-memory as uncompressed buffers.
@@ -564,11 +564,11 @@ concurrent_materialized_view_writes: 32
 # overhead which is roughly 128 bytes per chunk (i.e. 0.2% of the reserved size
 # if the default 64k chunk size is used).
 # Memory is only allocated when needed.
-# file_cache_size_in_mb: 512
+# file_cache_size: 512MiB
 
 # Flag indicating whether to allocate on or off heap when the sstable buffer
 # pool is exhausted, that is when it has exceeded the maximum memory
-# file_cache_size_in_mb, beyond which it will not cache buffers but allocate on request.
+# file_cache_size, beyond which it will not cache buffers but allocate on request.
 
 # buffer_pool_use_heap_if_exhausted: true
 
@@ -683,13 +683,13 @@ memtable_allocation_type: heap_buffers
 # shrink their index summaries in order to meet this limit.  However, this
 # is a best-effort process. In extreme conditions Cassandra may need to use
 # more than this amount of memory.
-index_summary_capacity_in_mb:
+# index_summary_capacity:
 
 # How frequently index summaries should be resampled.  This is done
 # periodically to redistribute memory from the fixed-size pool to sstables
 # proportional their recent read rates.  Setting to -1 will disable this
 # process, leaving existing index summaries at their current sampling level.
-index_summary_resize_interval_in_minutes: 60
+index_summary_resize_interval: 60m
 
 # Whether to, when doing sequential writing, fsync() at intervals in
 # order to force the operating system to flush the dirty
@@ -1304,10 +1304,10 @@ internode_compression: dc
 inter_dc_tcp_nodelay: false
 
 # TTL for different trace types used during logging of the repair process.
-tracetype_query_ttl: 86400
-tracetype_repair_ttl: 604800
+trace_type_query_ttl: 1d
+trace_type_repair_ttl: 7d
 
-# If unset, all GC Pauses greater than gc_log_threshold_in_ms will log at
+# If unset, all GC Pauses greater than gc_log_threshold will log at
 # INFO level
 # UDFs (user defined functions) are disabled by default.
 # As of Cassandra 3.0 there is a sandbox in place that should prevent execution of evil code.
@@ -1401,16 +1401,16 @@ compaction_tombstone_warning_threshold: 100000
 
 # GC Pauses greater than 200 ms will be logged at INFO level
 # This threshold can be adjusted to minimize logging if necessary
-# gc_log_threshold_in_ms: 200
+# gc_log_threshold: 200ms
 
-# GC Pauses greater than gc_warn_threshold_in_ms will be logged at WARN level
+# GC Pauses greater than gc_warn_threshold will be logged at WARN level
 # Adjust the threshold based on your application throughput requirement. Setting to 0
 # will deactivate the feature.
-# gc_warn_threshold_in_ms: 1000
+# gc_warn_threshold: 1000ms
 
 # Maximum size of any value in SSTables. Safety measure to detect SSTable corruption
 # early. Any value size larger than this threshold will result into marking an SSTable
-# as corrupted. This should be positive and less than 2048.
+# as corrupted. This should be positive and less than 2GiB.
 # max_value_size: 256MiB
 
 # ** Impact on keyspace creation **
diff --git a/src/java/org/apache/cassandra/cache/OHCProvider.java b/src/java/org/apache/cassandra/cache/OHCProvider.java
index afdc872..4a705a6 100644
--- a/src/java/org/apache/cassandra/cache/OHCProvider.java
+++ b/src/java/org/apache/cassandra/cache/OHCProvider.java
@@ -37,7 +37,7 @@ public class OHCProvider implements CacheProvider<RowCacheKey, IRowCacheEntry>
     public ICache<RowCacheKey, IRowCacheEntry> create()
     {
         OHCacheBuilder<RowCacheKey, IRowCacheEntry> builder = OHCacheBuilder.newBuilder();
-        builder.capacity(DatabaseDescriptor.getRowCacheSizeInMB() * 1024 * 1024)
+        builder.capacity(DatabaseDescriptor.getRowCacheSizeInMiB() * 1024 * 1024)
                .keySerializer(KeySerializer.instance)
                .valueSerializer(ValueSerializer.instance)
                .throwOOME(true);
diff --git a/src/java/org/apache/cassandra/cache/SerializingCacheProvider.java b/src/java/org/apache/cassandra/cache/SerializingCacheProvider.java
index 813f6fe..56393c4 100644
--- a/src/java/org/apache/cassandra/cache/SerializingCacheProvider.java
+++ b/src/java/org/apache/cassandra/cache/SerializingCacheProvider.java
@@ -30,7 +30,7 @@ public class SerializingCacheProvider implements CacheProvider<RowCacheKey, IRow
 {
     public ICache<RowCacheKey, IRowCacheEntry> create()
     {
-        return SerializingCache.create(DatabaseDescriptor.getRowCacheSizeInMB() * 1024 * 1024, new RowCacheSerializer());
+        return SerializingCache.create(DatabaseDescriptor.getRowCacheSizeInMiB() * 1024 * 1024, new RowCacheSerializer());
     }
 
     // Package Public: used by external Row Cache plugins
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 2f56fc7..a6b0413 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -376,41 +376,52 @@ public class Config
 
     public volatile boolean incremental_backups = false;
     public boolean trickle_fsync = false;
+    @Replaces(oldName = "trickle_fsync_interval_in_kb", converter = Converters.KIBIBYTES_DATASTORAGE, deprecated = true)
     public SmallestDataStorageKibibytes trickle_fsync_interval = new SmallestDataStorageKibibytes("10240KiB");
 
+    @Replaces(oldName = "sstable_preemptive_open_interval_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
     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;
-    public volatile int key_cache_save_period = 14400;
     public volatile int key_cache_keys_to_save = Integer.MAX_VALUE;
+    @Replaces(oldName = "key_cache_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes key_cache_size = null;
+    @Replaces(oldName = "key_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION, deprecated = true)
+    public volatile SmallestDurationSeconds key_cache_save_period = new SmallestDurationSeconds("4h");
 
     public String row_cache_class_name = "org.apache.cassandra.cache.OHCProvider";
-    public long row_cache_size_in_mb = 0;
-    public volatile int row_cache_save_period = 0;
+    @Replaces(oldName = "row_cache_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes row_cache_size = new SmallestDataStorageMebibytes("0MiB");
+    @Replaces(oldName = "row_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION, deprecated = true)
+    public volatile SmallestDurationSeconds row_cache_save_period = new SmallestDurationSeconds("0s");
     public volatile int row_cache_keys_to_save = Integer.MAX_VALUE;
 
-    public Long counter_cache_size_in_mb = null;
-    public volatile int counter_cache_save_period = 7200;
+    @Replaces(oldName = "counter_cache_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes counter_cache_size = null;
+    @Replaces(oldName = "counter_cache_save_period", converter = Converters.SECONDS_CUSTOM_DURATION, deprecated = true)
+    public volatile SmallestDurationSeconds counter_cache_save_period = new SmallestDurationSeconds("7200s");
     public volatile int counter_cache_keys_to_save = Integer.MAX_VALUE;
 
-    public int cache_load_timeout_seconds = 30;
+    @Replaces(oldName = "cache_load_timeout_seconds ", converter = Converters.SECONDS_DURATION, deprecated = true)
+    public SmallestDurationSeconds cache_load_timeout = new SmallestDurationSeconds("30s");
 
     private static boolean isClientMode = false;
     private static Supplier<Config> overrideLoadConfig = null;
 
-    public Integer networking_cache_size_in_mb;
+    @Replaces(oldName = "networking_cache_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes networking_cache_size;
 
-    public Integer file_cache_size_in_mb;
+    @Replaces(oldName = "file_cache_size_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes file_cache_size;
 
     public boolean file_cache_enabled = Boolean.getBoolean("cassandra.file_cache_enabled");
 
     /**
-     * Because of the current {@link org.apache.cassandra.utils.memory.BufferPool} slab sizes of 64 kb, we
-     * store in the file cache buffers that divide 64 kb, so we need to round the buffer sizes to powers of two.
+     * Because of the current {@link org.apache.cassandra.utils.memory.BufferPool} slab sizes of 64 KiB, we
+     * store in the file cache buffers that divide 64 KiB, so we need to round the buffer sizes to powers of two.
      * This boolean controls weather they are rounded up or down. Set it to true to round up to the
      * next power of two, set it to false to round down to the previous power of two. Note that buffer sizes are
-     * already rounded to 4 kb and capped between 4 kb minimum and 64 kb maximum by the {@link DiskOptimizationStrategy}.
+     * already rounded to 4 KiB and capped between 4 KiB minimum and 64 kb maximum by the {@link DiskOptimizationStrategy}.
      * By default, this boolean is set to round down when {@link #disk_optimization_strategy} is {@code ssd},
      * and to round up when it is {@code spinning}.
      */
@@ -436,15 +447,21 @@ public class Config
 
     public final ReplicaFilteringProtectionOptions replica_filtering_protection = new ReplicaFilteringProtectionOptions();
 
-    public volatile Long index_summary_capacity_in_mb;
-    public volatile int index_summary_resize_interval_in_minutes = 60;
+    @Replaces(oldName = "index_summary_capacity_in_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public volatile SmallestDataStorageMebibytes index_summary_capacity;
+    @Replaces(oldName = "index_summary_resize_interval_in_minutes", converter = Converters.MINUTES_DURATION, deprecated = true)
+    public volatile SmallestDurationMinutes index_summary_resize_interval = new SmallestDurationMinutes("60m");
 
-    public int gc_log_threshold_in_ms = 200;
-    public int gc_warn_threshold_in_ms = 1000;
+    @Replaces(oldName = "gc_log_threshold_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds gc_log_threshold = new SmallestDurationMilliseconds("200ms");
+    @Replaces(oldName = "gc_warn_threshold_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public SmallestDurationMilliseconds gc_warn_threshold = new SmallestDurationMilliseconds("1s");
 
     // TTL for different types of trace events.
-    public int tracetype_query_ttl = (int) TimeUnit.DAYS.toSeconds(1);
-    public int tracetype_repair_ttl = (int) TimeUnit.DAYS.toSeconds(7);
+    @Replaces(oldName = "tracetype_query_ttl", converter = Converters.SECONDS_DURATION, deprecated=true)
+    public SmallestDurationSeconds trace_type_query_ttl = new SmallestDurationSeconds("1d");
+    @Replaces(oldName = "tracetype_repair_ttl", converter = Converters.SECONDS_DURATION, deprecated=true)
+    public SmallestDurationSeconds trace_type_repair_ttl = new SmallestDurationSeconds("7d");
 
     /**
      * Maintain statistics on whether writes achieve the ideal consistency level
@@ -453,10 +470,11 @@ public class Config
     public volatile ConsistencyLevel ideal_consistency_level = null;
 
     /**
-     * Size of the CQL prepared statements cache in MB.
-     * Defaults to 1/256th of the heap size or 10MB, whichever is greater.
+     * Size of the CQL prepared statements cache in MiB.
+     * Defaults to 1/256th of the heap size or 10MiB, whichever is greater.
      */
-    public Long prepared_statements_cache_size_mb = null;
+    @Replaces(oldName = "prepared_statements_cache_size_mb", converter = Converters.MEBIBYTES_DATA_STORAGE, deprecated = true)
+    public SmallestDataStorageMebibytes prepared_statements_cache_size = null;
 
     @Replaces(oldName = "enable_user_defined_functions", converter = Converters.IDENTITY, deprecated = true)
     public boolean user_defined_functions_enabled = false;
@@ -494,6 +512,7 @@ public class Config
      * Time in milliseconds after a warning will be emitted to the log and to the client that a UDF runs too long.
      * (Only valid, if user_defined_functions_threads_enabled==true)
      */
+    //No need of unit conversion as this parameter is not exposed in the yaml file
     public long user_defined_function_warn_timeout = 500;
     /**
      * Time in milliseconds after a fatal UDF run-time situation is detected and action according to
diff --git a/src/java/org/apache/cassandra/config/Converters.java b/src/java/org/apache/cassandra/config/Converters.java
index eb64552..f2f7120 100644
--- a/src/java/org/apache/cassandra/config/Converters.java
+++ b/src/java/org/apache/cassandra/config/Converters.java
@@ -26,7 +26,9 @@ import java.util.function.Function;
  * parameter name(suffix). (CASSANDRA-15234)
  * It is important to be noted that this converter is not intended to be used when we don't change name of a configuration
  * parameter but we want to add unit. This would always default to the old value provided without a unit at the moment.
- * In case this functionality is needed at some point, please, raise a Jira ticket.
+ * In case this functionality is needed at some point, please, raise a Jira ticket. There is only one exception handling
+ * three parameters (key_cache_save_period, row_cache_save_period, counter_cache_save_period) - the SECONDS_CUSTOM_DURATION
+ * converter.
  */
 public enum Converters
 {
@@ -51,6 +53,15 @@ public enum Converters
     SECONDS_DURATION(Long.class,
                      o -> SmallestDurationSeconds.inSeconds((Long) o),
                      o -> ((SmallestDurationSeconds)o).toSeconds()),
+    /**
+     * This converter is used to support backward compatibility for Duration parameters where we added the opportunity
+     * for the users to add a unit in the parameters' values but we didn't change the names. (key_cache_save_period,
+     * row_cache_save_period, counter_cache_save_period)
+     * Example: row_cache_save_period = 0 and row_cache_save_period = 0s (quantity of 0s) are equal.
+     */
+    SECONDS_CUSTOM_DURATION(String.class,
+                            o -> SmallestDurationSeconds.inSecondsString((String) o),
+                            o -> ((SmallestDurationSeconds)o).toSeconds()),
     MINUTES_DURATION(Long.class,
                      o -> SmallestDurationMinutes.inMinutes((Long) o),
                      o -> ((SmallestDurationMinutes)o).toMinutes()),
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index b51f2de..25e5c8b 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -128,11 +128,11 @@ public class DatabaseDescriptor
     // depend on the configured IAuthenticator, so defer creating it until that's been set.
     private static IRoleManager roleManager;
 
-    private static long preparedStatementsCacheSizeInMB;
+    private static long preparedStatementsCacheSizeInMiB;
 
-    private static long keyCacheSizeInMB;
-    private static long counterCacheSizeInMB;
-    private static long indexSummaryCapacityInMB;
+    private static long keyCacheSizeInMiB;
+    private static long counterCacheSizeInMiB;
+    private static long indexSummaryCapacityInMiB;
 
     private static String localDC;
     private static Comparator<Replica> localComparator;
@@ -431,11 +431,6 @@ public class DatabaseDescriptor
             logger.info("DiskAccessMode is {}, indexAccessMode is {}", conf.disk_access_mode, indexAccessMode);
         }
 
-        if (conf.gc_warn_threshold_in_ms < 0)
-        {
-            throw new ConfigurationException("gc_warn_threshold_in_ms must be a positive integer");
-        }
-
         /* phi convict threshold for FailureDetector */
         if (conf.phi_convict_threshold < 5 || conf.phi_convict_threshold > 16)
         {
@@ -459,11 +454,11 @@ public class DatabaseDescriptor
         if (conf.concurrent_replicates != null)
             logger.warn("concurrent_replicates has been deprecated and should be removed from cassandra.yaml");
 
-        if (conf.networking_cache_size_in_mb == null)
-            conf.networking_cache_size_in_mb = Math.min(128, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576)));
+        if (conf.networking_cache_size == null)
+            conf.networking_cache_size = SmallestDataStorageMebibytes.inMebibytes(Math.min(128, (int) (Runtime.getRuntime().maxMemory() / (16 * 1048576))));
 
-        if (conf.file_cache_size_in_mb == null)
-            conf.file_cache_size_in_mb = Math.min(512, (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)));
+        if (conf.file_cache_size == null)
+            conf.file_cache_size = SmallestDataStorageMebibytes.inMebibytes(Math.min(512, (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576))));
 
         // round down for SSDs and round up for spinning disks
         if (conf.file_cache_round_up == null)
@@ -682,60 +677,60 @@ public class DatabaseDescriptor
 
         try
         {
-            // if prepared_statements_cache_size_mb option was set to "auto" then size of the cache should be "max(1/256 of Heap (in MB), 10MB)"
-            preparedStatementsCacheSizeInMB = (conf.prepared_statements_cache_size_mb == null)
+            // if prepared_statements_cache_size option was set to "auto" then size of the cache should be "max(1/256 of Heap (in MiB), 10MiB)"
+            preparedStatementsCacheSizeInMiB = (conf.prepared_statements_cache_size == null)
                                               ? Math.max(10, (int) (Runtime.getRuntime().maxMemory() / 1024 / 1024 / 256))
-                                              : conf.prepared_statements_cache_size_mb;
+                                              : conf.prepared_statements_cache_size.toMebibytes();
 
-            if (preparedStatementsCacheSizeInMB <= 0)
+            if (preparedStatementsCacheSizeInMiB <= 0)
                 throw new NumberFormatException(); // to escape duplicating error message
         }
         catch (NumberFormatException e)
         {
-            throw new ConfigurationException("prepared_statements_cache_size_mb option was set incorrectly to '"
-                                             + conf.prepared_statements_cache_size_mb + "', supported values are <integer> >= 0.", false);
+            throw new ConfigurationException("prepared_statements_cache_size option was set incorrectly to '"
+                                             + conf.prepared_statements_cache_size + "', supported values are <integer> >= 0.", false);
         }
 
         try
         {
-            // if key_cache_size_in_mb option was set to "auto" then size of the cache should be "min(5% of Heap (in MB), 100MB)
-            keyCacheSizeInMB = (conf.key_cache_size_in_mb == null)
+            // if key_cache_size option was set to "auto" then size of the cache should be "min(5% of Heap (in MiB), 100MiB)
+            keyCacheSizeInMiB = (conf.key_cache_size == null)
                                ? Math.min(Math.max(1, (int) (Runtime.getRuntime().totalMemory() * 0.05 / 1024 / 1024)), 100)
-                               : conf.key_cache_size_in_mb;
+                               : conf.key_cache_size.toMebibytes();
 
-            if (keyCacheSizeInMB < 0)
+            if (keyCacheSizeInMiB < 0)
                 throw new NumberFormatException(); // to escape duplicating error message
         }
         catch (NumberFormatException e)
         {
-            throw new ConfigurationException("key_cache_size_in_mb option was set incorrectly to '"
-                                             + conf.key_cache_size_in_mb + "', supported values are <integer> >= 0.", false);
+            throw new ConfigurationException("key_cache_size option was set incorrectly to '"
+                                             + (conf.key_cache_size != null ? conf.key_cache_size.toString() : null) + "', supported values are <integer> >= 0.", false);
         }
 
         try
         {
-            // if counter_cache_size_in_mb option was set to "auto" then size of the cache should be "min(2.5% of Heap (in MB), 50MB)
-            counterCacheSizeInMB = (conf.counter_cache_size_in_mb == null)
+            // if counter_cache_size option was set to "auto" then size of the cache should be "min(2.5% of Heap (in MiB), 50MiB)
+            counterCacheSizeInMiB = (conf.counter_cache_size == null)
                                    ? Math.min(Math.max(1, (int) (Runtime.getRuntime().totalMemory() * 0.025 / 1024 / 1024)), 50)
-                                   : conf.counter_cache_size_in_mb;
+                                   : conf.counter_cache_size.toMebibytes();
 
-            if (counterCacheSizeInMB < 0)
+            if (counterCacheSizeInMiB < 0)
                 throw new NumberFormatException(); // to escape duplicating error message
         }
         catch (NumberFormatException e)
         {
-            throw new ConfigurationException("counter_cache_size_in_mb option was set incorrectly to '"
-                                             + conf.counter_cache_size_in_mb + "', supported values are <integer> >= 0.", false);
+            throw new ConfigurationException("counter_cache_size option was set incorrectly to '"
+                                             + conf.counter_cache_size + "', supported values are <integer> >= 0.", false);
         }
 
         // if set to empty/"auto" then use 5% of Heap size
-        indexSummaryCapacityInMB = (conf.index_summary_capacity_in_mb == null)
+        indexSummaryCapacityInMiB = (conf.index_summary_capacity == null)
                                    ? Math.max(1, (int) (Runtime.getRuntime().totalMemory() * 0.05 / 1024 / 1024))
-                                   : conf.index_summary_capacity_in_mb;
+                                   : conf.index_summary_capacity.toMebibytes();
 
-        if (indexSummaryCapacityInMB < 0)
-            throw new ConfigurationException("index_summary_capacity_in_mb option was set incorrectly to '"
-                                             + conf.index_summary_capacity_in_mb + "', it should be a non-negative integer.", false);
+        if (indexSummaryCapacityInMiB < 0)
+            throw new ConfigurationException("index_summary_capacity option was set incorrectly to '"
+                                             + conf.index_summary_capacity.toString() + "', it should be a non-negative integer.", false);
 
         if (conf.user_defined_function_fail_timeout < 0)
             throw new ConfigurationException("user_defined_function_fail_timeout must not be negative", false);
@@ -2777,25 +2772,25 @@ public class DatabaseDescriptor
 
     public static int getFileCacheSizeInMB()
     {
-        if (conf.file_cache_size_in_mb == null)
+        if (conf.file_cache_size == null)
         {
             // In client mode the value is not set.
             assert DatabaseDescriptor.isClientInitialized();
             return 0;
         }
 
-        return conf.file_cache_size_in_mb;
+        return conf.file_cache_size.toMebibytesAsInt();
     }
 
     public static int getNetworkingCacheSizeInMB()
     {
-        if (conf.networking_cache_size_in_mb == null)
+        if (conf.networking_cache_size == null)
         {
             // In client mode the value is not set.
             assert DatabaseDescriptor.isClientInitialized();
             return 0;
         }
-        return conf.networking_cache_size_in_mb;
+        return conf.networking_cache_size.toMebibytesAsInt();
     }
 
     public static boolean getFileCacheRoundUp()
@@ -2856,22 +2851,22 @@ public class DatabaseDescriptor
 
     public static long getKeyCacheSizeInMB()
     {
-        return keyCacheSizeInMB;
+        return keyCacheSizeInMiB;
     }
 
     public static long getIndexSummaryCapacityInMB()
     {
-        return indexSummaryCapacityInMB;
+        return indexSummaryCapacityInMiB;
     }
 
     public static int getKeyCacheSavePeriod()
     {
-        return conf.key_cache_save_period;
+        return conf.key_cache_save_period.toSecondsAsInt();
     }
 
     public static void setKeyCacheSavePeriod(int keyCacheSavePeriod)
     {
-        conf.key_cache_save_period = keyCacheSavePeriod;
+        conf.key_cache_save_period = SmallestDurationSeconds.inSeconds(keyCacheSavePeriod);
     }
 
     public static int getKeyCacheKeysToSave()
@@ -2889,25 +2884,25 @@ public class DatabaseDescriptor
         return conf.row_cache_class_name;
     }
 
-    public static long getRowCacheSizeInMB()
+    public static long getRowCacheSizeInMiB()
     {
-        return conf.row_cache_size_in_mb;
+        return conf.row_cache_size.toMebibytes();
     }
 
     @VisibleForTesting
-    public static void setRowCacheSizeInMB(long val)
+    public static void setRowCacheSizeInMiB(long val)
     {
-        conf.row_cache_size_in_mb = val;
+        conf.row_cache_size = SmallestDataStorageMebibytes.inMebibytes(val);
     }
 
     public static int getRowCacheSavePeriod()
     {
-        return conf.row_cache_save_period;
+        return conf.row_cache_save_period.toSecondsAsInt();
     }
 
     public static void setRowCacheSavePeriod(int rowCacheSavePeriod)
     {
-        conf.row_cache_save_period = rowCacheSavePeriod;
+        conf.row_cache_save_period = SmallestDurationSeconds.inSeconds(rowCacheSavePeriod);
     }
 
     public static int getRowCacheKeysToSave()
@@ -2915,9 +2910,9 @@ public class DatabaseDescriptor
         return conf.row_cache_keys_to_save;
     }
 
-    public static long getCounterCacheSizeInMB()
+    public static long getCounterCacheSizeInMiB()
     {
-        return counterCacheSizeInMB;
+        return counterCacheSizeInMiB;
     }
 
     public static void setRowCacheKeysToSave(int rowCacheKeysToSave)
@@ -2927,23 +2922,23 @@ public class DatabaseDescriptor
 
     public static int getCounterCacheSavePeriod()
     {
-        return conf.counter_cache_save_period;
+        return conf.counter_cache_save_period.toSecondsAsInt();
     }
 
     public static void setCounterCacheSavePeriod(int counterCacheSavePeriod)
     {
-        conf.counter_cache_save_period = counterCacheSavePeriod;
+        conf.counter_cache_save_period = SmallestDurationSeconds.inSeconds(counterCacheSavePeriod);
     }
 
     public static int getCacheLoadTimeout()
     {
-        return conf.cache_load_timeout_seconds;
+        return conf.cache_load_timeout.toSecondsAsInt();
     }
 
     @VisibleForTesting
     public static void setCacheLoadTimeout(int seconds)
     {
-        conf.cache_load_timeout_seconds = seconds;
+        conf.cache_load_timeout = SmallestDurationSeconds.inSeconds(seconds);
     }
 
     public static int getCounterCacheKeysToSave()
@@ -3051,7 +3046,7 @@ public class DatabaseDescriptor
 
     public static int getIndexSummaryResizeIntervalInMinutes()
     {
-        return conf.index_summary_resize_interval_in_minutes;
+        return conf.index_summary_resize_interval.toMinutesAsInt();
     }
 
     public static boolean hasLargeAddressSpace()
@@ -3072,17 +3067,17 @@ public class DatabaseDescriptor
 
     public static int getTracetypeRepairTTL()
     {
-        return conf.tracetype_repair_ttl;
+        return conf.trace_type_repair_ttl.toSecondsAsInt();
     }
 
     public static int getTracetypeQueryTTL()
     {
-        return conf.tracetype_query_ttl;
+        return conf.trace_type_query_ttl.toSecondsAsInt();
     }
 
     public static long getPreparedStatementsCacheSizeMB()
     {
-        return preparedStatementsCacheSizeInMB;
+        return preparedStatementsCacheSizeInMiB;
     }
 
     public static boolean enableUserDefinedFunctions()
@@ -3178,7 +3173,7 @@ public class DatabaseDescriptor
 
     public static long getGCLogThreshold()
     {
-        return conf.gc_log_threshold_in_ms;
+        return conf.gc_log_threshold.toMilliseconds();
     }
 
     public static EncryptionContext getEncryptionContext()
@@ -3188,7 +3183,7 @@ public class DatabaseDescriptor
 
     public static long getGCWarnThreshold()
     {
-        return conf.gc_warn_threshold_in_ms;
+        return conf.gc_warn_threshold.toMilliseconds();
     }
 
     public static boolean isCDCEnabled()
diff --git a/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java b/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
index f8ab4ad..f732315 100644
--- a/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
+++ b/src/java/org/apache/cassandra/config/SmallestDurationSeconds.java
@@ -19,6 +19,8 @@
 package org.apache.cassandra.config;
 
 import java.util.concurrent.TimeUnit;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * Wrapper class for Cassandra duration configuration parameters which are internally represented in Seconds. In order
@@ -27,6 +29,8 @@ import java.util.concurrent.TimeUnit;
  */
 public final class SmallestDurationSeconds extends DurationSpec
 {
+    private static final Pattern VALUES_PATTERN = Pattern.compile(("\\d+"));
+
     /**
      * Creates a {@code SmallestDurationSeconds} of the specified amount of seconds and provides the smallest
      * required unit of seconds for the respective parameter of type {@code SmallestDurationSeconds}.
@@ -54,4 +58,29 @@ public final class SmallestDurationSeconds extends DurationSpec
     {
         return new SmallestDurationSeconds(seconds, TimeUnit.SECONDS);
     }
+
+    /**
+     * Creates a {@code SmallestDurationSeconds} of the specified amount of seconds. Custom method for special cases.
+     *
+     * @param value which can be in the old form only presenting the quantity or the post CASSANDRA-15234 form - a
+     * value consisting of quantity and unit. This method is necessary for three parameters which didn't change their
+     * names but only their value format. (key_cache_save_period, row_cache_save_period, counter_cache_save_period)
+     * @return a duration
+     */
+    public static SmallestDurationSeconds inSecondsString(String value)
+    {
+        //parse the string field value
+        Matcher matcher = VALUES_PATTERN.matcher(value);
+
+        long seconds;
+        //if the provided string value is just a number, then we create a Duration Spec value in seconds
+        if (matcher.matches())
+        {
+            seconds = Long.parseLong(value);
+            return new SmallestDurationSeconds(seconds, TimeUnit.SECONDS);
+        }
+
+        //otherwise we just use the standard constructors
+        return new SmallestDurationSeconds(value);
+    }
 }
diff --git a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
index fa302b0..b82180d 100644
--- a/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
+++ b/src/java/org/apache/cassandra/db/virtual/SettingsTable.java
@@ -19,7 +19,9 @@ package org.apache.cassandra.db.virtual;
 
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.function.BiConsumer;
@@ -56,6 +58,17 @@ final class SettingsTable extends AbstractVirtualTable
               .filter(f -> f.isAnnotationPresent(Replaces.class))
               .collect(Collectors.toMap(Field::getName, Functions.identity()));
 
+    // CASSANDRA-15234 - a few configuration parameters kept their names but added unit to their value, only the
+    // new value format is displayed for them
+    private final List<String> EXCLUDED_CONFIG = new ArrayList<String>()
+    {
+        {
+            add("key_cache_save_period");
+            add("row_cache_save_period");
+            add("counter_cache_save_period");
+        }
+    };
+
     @VisibleForTesting
     final Map<String, BiConsumer<SimpleDataSet, Field>> overrides =
         ImmutableMap.<String, BiConsumer<SimpleDataSet, Field>>builder()
@@ -116,7 +129,7 @@ final class SettingsTable extends AbstractVirtualTable
                 value = Arrays.toString((Object[]) value);
             result.row(f.getName()).column(VALUE, value.toString());
 
-            if (ANNOTATED_FIELDS.containsKey(f.getName()))
+            if (ANNOTATED_FIELDS.containsKey(f.getName()) && !EXCLUDED_CONFIG.contains(f.getName()))
             {
                 Replaces annotation = f.getAnnotation(Replaces.class);
                 result.row(annotation.oldName())
diff --git a/src/java/org/apache/cassandra/service/CacheService.java b/src/java/org/apache/cassandra/service/CacheService.java
index 1725d5f..2bacc343 100644
--- a/src/java/org/apache/cassandra/service/CacheService.java
+++ b/src/java/org/apache/cassandra/service/CacheService.java
@@ -121,10 +121,10 @@ public class CacheService implements CacheServiceMBean
      */
     private AutoSavingCache<RowCacheKey, IRowCacheEntry> initRowCache()
     {
-        logger.info("Initializing row cache with capacity of {} MBs", DatabaseDescriptor.getRowCacheSizeInMB());
+        logger.info("Initializing row cache with capacity of {} MBs", DatabaseDescriptor.getRowCacheSizeInMiB());
 
         CacheProvider<RowCacheKey, IRowCacheEntry> cacheProvider;
-        String cacheProviderClassName = DatabaseDescriptor.getRowCacheSizeInMB() > 0
+        String cacheProviderClassName = DatabaseDescriptor.getRowCacheSizeInMiB() > 0
                                         ? DatabaseDescriptor.getRowCacheClassName() : "org.apache.cassandra.cache.NopCacheProvider";
         try
         {
@@ -150,9 +150,9 @@ public class CacheService implements CacheServiceMBean
 
     private AutoSavingCache<CounterCacheKey, ClockAndCount> initCounterCache()
     {
-        logger.info("Initializing counter cache with capacity of {} MBs", DatabaseDescriptor.getCounterCacheSizeInMB());
+        logger.info("Initializing counter cache with capacity of {} MBs", DatabaseDescriptor.getCounterCacheSizeInMiB());
 
-        long capacity = DatabaseDescriptor.getCounterCacheSizeInMB() * 1024 * 1024;
+        long capacity = DatabaseDescriptor.getCounterCacheSizeInMiB() * 1024 * 1024;
 
         AutoSavingCache<CounterCacheKey, ClockAndCount> cache =
             new AutoSavingCache<>(CaffeineCache.create(capacity),
diff --git a/test/conf/cassandra-murmur.yaml b/test/conf/cassandra-murmur.yaml
index 05dac76..c0c2ae7 100644
--- a/test/conf/cassandra-murmur.yaml
+++ b/test/conf/cassandra-murmur.yaml
@@ -37,7 +37,7 @@ incremental_backups: true
 concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
-row_cache_size_in_mb: 16
+row_cache_size: 16MiB
 user_defined_functions_enabled: true
 scripted_user_defined_functions_enabled: true
 sasi_indexes_enabled: true
diff --git a/test/conf/cassandra-old.yaml b/test/conf/cassandra-old.yaml
index 11b79f2..27af143 100644
--- a/test/conf/cassandra-old.yaml
+++ b/test/conf/cassandra-old.yaml
@@ -44,7 +44,7 @@ row_cache_class_name: org.apache.cassandra.cache.OHCProvider
 row_cache_size_in_mb: 16
 enable_user_defined_functions: true
 enable_scripted_user_defined_functions: true
-prepared_statements_cache_size_mb: 1
+prepared_statements_cache_size_mb:
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
 stream_throughput_outbound_megabits_per_sec: 200000000
diff --git a/test/conf/cassandra-seeds.yaml b/test/conf/cassandra-seeds.yaml
index d5dd83e..0cfd06b 100644
--- a/test/conf/cassandra-seeds.yaml
+++ b/test/conf/cassandra-seeds.yaml
@@ -38,6 +38,6 @@ incremental_backups: true
 concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
-row_cache_size_in_mb: 16
+row_cache_size: 16MiB
 user_defined_functions_enabled: true
 scripted_user_defined_functions_enabled: true
diff --git a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
index 8f51e85..1e473ae 100644
--- a/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
+++ b/test/conf/cassandra-sslcontextfactory-invalidconfiguration.yaml
@@ -70,10 +70,10 @@ incremental_backups: true
 concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
-row_cache_size_in_mb: 16
+row_cache_size: 16MiB
 user_defined_functions_enabled: true
 scripted_user_defined_functions_enabled: true
-prepared_statements_cache_size_mb: 1
+prepared_statements_cache_size: 1MiB
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
 stream_throughput_outbound: 23841823841858MiB/s
diff --git a/test/conf/cassandra-sslcontextfactory.yaml b/test/conf/cassandra-sslcontextfactory.yaml
index 63c40a2..fde4bfd 100644
--- a/test/conf/cassandra-sslcontextfactory.yaml
+++ b/test/conf/cassandra-sslcontextfactory.yaml
@@ -73,10 +73,10 @@ incremental_backups: true
 concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
-row_cache_size_in_mb: 16
+row_cache_size: 16MiB
 user_defined_functions_enabled: true
 scripted_user_defined_functions_enabled: true
-prepared_statements_cache_size_mb: 1
+prepared_statements_cache_size: 1MiB
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
 stream_throughput_outbound: 23841858MiB/s
diff --git a/test/conf/cassandra.yaml b/test/conf/cassandra.yaml
index e1a49f2..58afdb9 100644
--- a/test/conf/cassandra.yaml
+++ b/test/conf/cassandra.yaml
@@ -41,10 +41,10 @@ incremental_backups: true
 concurrent_compactors: 4
 compaction_throughput: 0MiB/s
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
-row_cache_size_in_mb: 16
+row_cache_size: 16MiB
 user_defined_functions_enabled: true
 scripted_user_defined_functions_enabled: true
-prepared_statements_cache_size_mb: 1
+prepared_statements_cache_size: 1MiB
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
 stream_throughput_outbound: 23841858MiB/s
diff --git a/test/conf/unit-test-conf/test-native-port.yaml b/test/conf/unit-test-conf/test-native-port.yaml
index cef6b1d..a234ad5 100644
--- a/test/conf/unit-test-conf/test-native-port.yaml
+++ b/test/conf/unit-test-conf/test-native-port.yaml
@@ -41,10 +41,10 @@ incremental_backups: true
 concurrent_compactors: 4
 compaction_throughput_mb_per_sec: 0
 row_cache_class_name: org.apache.cassandra.cache.OHCProvider
-row_cache_size_in_mb: 16
+row_cache_size: 16MiB
 user_defined_functions_enabled: true
 scripted_user_defined_functions_enabled: true
-prepared_statements_cache_size_mb: 1
+prepared_statements_cache_size: 1MiB
 corrupted_tombstone_strategy: exception
 stream_entire_sstables: true
 stream_throughput_outbound: 23841858MiB/s
diff --git a/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java b/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java
index d6bc7ad..7861a98 100644
--- a/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java
+++ b/test/distributed/org/apache/cassandra/distributed/impl/InstanceConfig.java
@@ -104,11 +104,11 @@ public class InstanceConfig implements IInstanceConfig
                 .set("diagnostic_events_enabled", true)
                 .set("auto_bootstrap", false)
                 // capacities that are based on `totalMemory` that should be fixed size
-                .set("index_summary_capacity_in_mb", 50l)
-                .set("counter_cache_size_in_mb", 50l)
-                .set("key_cache_size_in_mb", 50l)
+                .set("index_summary_capacity", "50MiB")
+                .set("counter_cache_size", "50MiB")
+                .set("key_cache_size", "50MiB")
                 // legacy parameters
-                .forceSet("commitlog_sync_batch_window_in_ms", 1.0);
+                .forceSet("commitlog_sync_batch_window_in_ms", "1");
         this.featureFlags = EnumSet.noneOf(Feature.class);
     }
 
diff --git a/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java b/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java
index 89e6168..ea45bd1 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/NodeToolTest.java
@@ -110,7 +110,7 @@ public class NodeToolTest extends TestBaseImpl
     @Test
     public void testSetCacheCapacityWhenDisabled() throws Throwable
     {
-        try (ICluster cluster = init(builder().withNodes(1).withConfig(c->c.set("row_cache_size_in_mb", "0")).start()))
+        try (ICluster cluster = init(builder().withNodes(1).withConfig(c->c.set("row_cache_size", "0MiB")).start()))
         {
             NodeToolResult ringResult = cluster.get(1).nodetoolResult("setcachecapacity", "1", "1", "1");
             ringResult.asserts().stderrContains("is not permitted as this cache is disabled");
diff --git a/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java b/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
index 74c9356..6882390 100644
--- a/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
+++ b/test/simulator/main/org/apache/cassandra/simulator/ClusterSimulation.java
@@ -642,9 +642,9 @@ public class ClusterSimulation<S extends Simulation> implements AutoCloseable
                              .set("write_request_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.writeTimeoutNanos)))
                              .set("cas_contention_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.contentionTimeoutNanos)))
                              .set("request_timeout", String.format("%dms", NANOSECONDS.toMillis(builder.requestTimeoutNanos)))
-                             .set("memtable_heap_space", "1mb")
+                             .set("memtable_heap_space", "1MiB")
                              .set("memtable_allocation_type", builder.memoryListener != null ? "unslabbed_heap_buffers_logged" : "heap_buffers")
-                             .set("file_cache_size_in_mb", 16)
+                             .set("file_cache_size", "16MiB")
                              .set("use_deterministic_table_id", true)
                              .set("disk_access_mode", "standard")
                              .set("failure_detector", SimulatedFailureDetector.Instance.class.getName())
diff --git a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
index ad7abb8..da1d094 100644
--- a/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
+++ b/test/unit/org/apache/cassandra/config/LoadOldYAMLBackwardCompatibilityTest.java
@@ -71,14 +71,14 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DataStorageSpec.inKibibytes(2), config.column_index_cache_size);
         assertEquals(DataStorageSpec.inKibibytes(5), config.batch_size_warn_threshold);
         assertEquals(DataRateSpec.inMebibytesPerSecond(64), config.compaction_throughput);
-        //assertEquals(DataStorageSpec.inMebibytes(50), config.min_free_space_per_drive);
+        assertEquals(DataStorageSpec.inMebibytes(50), config.min_free_space_per_drive);
         assertEquals(DataRateSpec.inMebibytesPerSecond(23841858).toString(), config.stream_throughput_outbound.toString());
         assertEquals(DataRateSpec.megabitsPerSecondInMebibytesPerSecond(200000000).toString(), config.stream_throughput_outbound.toString());
         assertEquals(DataRateSpec.inMebibytesPerSecond(24), config.inter_dc_stream_throughput_outbound);
-        /*assertNull(config.commitlog_total_space);
+        assertNull(config.commitlog_total_space);
         assertEquals(DurationSpec.inDoubleMilliseconds(0), config.commitlog_sync_group_window);
         assertEquals(DurationSpec.inMilliseconds(0), config.commitlog_sync_period);
-        assertEquals(DataStorageSpec.inMebibytes(32), config.commitlog_segment_size);
+        assertEquals(DataStorageSpec.inMebibytes(5), config.commitlog_segment_size);
         assertNull(config.periodic_commitlog_sync_lag_block);  //Integer
         assertNull(config.max_mutation_size);
         assertEquals(DataStorageSpec.inMebibytes(0), config.cdc_total_space);
@@ -88,11 +88,11 @@ 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);
-        assertEquals(DataStorageSpec.inMebibytes(0), config.row_cache_size);
+        assertNull( config.key_cache_size);
+        assertEquals(DataStorageSpec.inMebibytes(16), config.row_cache_size);
         assertNull(config.counter_cache_size);
         assertNull(config.networking_cache_size);
         assertNull(config.file_cache_size);
@@ -101,7 +101,7 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DurationSpec.inMilliseconds(1000), config.gc_warn_threshold);
         assertEquals(DurationSpec.inSeconds(86400), config.trace_type_query_ttl);
         assertEquals(DurationSpec.inSeconds(604800), config.trace_type_repair_ttl);
-        assertNull(config.prepared_statements_cache_size);*/
+        assertNull(config.prepared_statements_cache_size);
         assertTrue(config.user_defined_functions_enabled);
         assertTrue(config.scripted_user_defined_functions_enabled);
         assertTrue(config.materialized_views_enabled);
@@ -115,13 +115,14 @@ public class LoadOldYAMLBackwardCompatibilityTest
         assertEquals(DurationSpec.inMilliseconds(0), config.roles_update_interval);
         assertEquals(DurationSpec.inMilliseconds(2000), config.credentials_validity);
         assertEquals(DurationSpec.inMilliseconds(0), config.credentials_update_interval);
-        //assertEquals(DurationSpec.inMinutes(60), config.index_summary_resize_interval);
+        assertEquals(DurationSpec.inMinutes(60), config.index_summary_resize_interval);
 
         //parameters which names have not changed with CASSANDRA-15234
-        /*assertEquals(DurationSpec.inSecondsString("14400"), config.key_cache_save_period);
+        assertEquals(DurationSpec.inSecondsString("14400"), config.key_cache_save_period);
+        assertEquals(DurationSpec.inSecondsString("14400s"), config.key_cache_save_period);
         assertEquals(DurationSpec.inHours(4), config.key_cache_save_period);
         assertEquals(DurationSpec.inSecondsString("0"), config.row_cache_save_period);
         assertEquals(DurationSpec.inSeconds(0), config.row_cache_save_period);
-        assertEquals(DurationSpec.inHours(2), config.counter_cache_save_period);*/
+        assertEquals(DurationSpec.inHours(2), config.counter_cache_save_period);
     }
 }
diff --git a/test/unit/org/apache/cassandra/cql3/CQLTester.java b/test/unit/org/apache/cassandra/cql3/CQLTester.java
index e5395e1..7d5be0d 100644
--- a/test/unit/org/apache/cassandra/cql3/CQLTester.java
+++ b/test/unit/org/apache/cassandra/cql3/CQLTester.java
@@ -67,6 +67,7 @@ import org.apache.cassandra.auth.IRoleManager;
 import org.apache.cassandra.concurrent.ScheduledExecutors;
 import org.apache.cassandra.concurrent.Stage;
 import org.apache.cassandra.config.EncryptionOptions;
+import org.apache.cassandra.config.SmallestDataStorageMebibytes;
 import org.apache.cassandra.db.virtual.VirtualKeyspaceRegistry;
 import org.apache.cassandra.db.virtual.VirtualSchemaKeyspace;
 import org.apache.cassandra.exceptions.InvalidRequestException;
@@ -127,7 +128,7 @@ public abstract class CQLTester
     public static final String KEYSPACE_PER_TEST = "cql_test_keyspace_alt";
     protected static final boolean USE_PREPARED_VALUES = Boolean.valueOf(System.getProperty("cassandra.test.use_prepared", "true"));
     protected static final boolean REUSE_PREPARED = Boolean.valueOf(System.getProperty("cassandra.test.reuse_prepared", "true"));
-    protected static final long ROW_CACHE_SIZE_IN_MB = Integer.valueOf(System.getProperty("cassandra.test.row_cache_size_in_mb", "0"));
+    protected static final long ROW_CACHE_SIZE_IN_MIB = new SmallestDataStorageMebibytes(System.getProperty("cassandra.test.row_cache_size", "0MiB")).toMebibytes();
     private static final AtomicInteger seqNumber = new AtomicInteger();
     protected static final ByteBuffer TOO_BIG = ByteBuffer.allocate(FBUtilities.MAX_UNSIGNED_SHORT + 1024);
     public static final String DATA_CENTER = ServerTestUtils.DATA_CENTER;
@@ -303,8 +304,8 @@ public abstract class CQLTester
     @BeforeClass
     public static void setUpClass()
     {
-        if (ROW_CACHE_SIZE_IN_MB > 0)
-            DatabaseDescriptor.setRowCacheSizeInMB(ROW_CACHE_SIZE_IN_MB);
+        if (ROW_CACHE_SIZE_IN_MIB > 0)
+            DatabaseDescriptor.setRowCacheSizeInMiB(ROW_CACHE_SIZE_IN_MIB);
         StorageService.instance.setPartitionerUnsafe(Murmur3Partitioner.instance);
 
         // Once per-JVM is enough
diff --git a/test/unit/org/apache/cassandra/cql3/validation/entities/JsonTest.java b/test/unit/org/apache/cassandra/cql3/validation/entities/JsonTest.java
index f550fdf..810ee5a 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/entities/JsonTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/entities/JsonTest.java
@@ -50,8 +50,8 @@ public class JsonTest extends CQLTester
     @BeforeClass
     public static void setUpClass()
     {
-        if (ROW_CACHE_SIZE_IN_MB > 0)
-            DatabaseDescriptor.setRowCacheSizeInMB(ROW_CACHE_SIZE_IN_MB);
+        if (ROW_CACHE_SIZE_IN_MIB > 0)
+            DatabaseDescriptor.setRowCacheSizeInMiB(ROW_CACHE_SIZE_IN_MIB);
 
         StorageService.instance.setPartitionerUnsafe(ByteOrderedPartitioner.instance);
 

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


[cassandra] 07/13: Transfer parameters to the newly introduced configuration framework (3) patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234

Posted by ed...@apache.org.
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 755fd9446b084e659e98bd7336b9e910c2e12577
Author: Ekaterina Dimitrova <ek...@datastax.com>
AuthorDate: Thu Feb 3 14:39:48 2022 -0500

    Transfer parameters to the newly introduced configuration framework (3)
    patch by Ekaterina Dimitrova; reviewed by Caleb Rackliffe, David Capwell, Michael Semb Wever and Benjamin Lerer for CASSANDRA-15234
---
 conf/cassandra.yaml                                | 36 +++++++++----------
 src/java/org/apache/cassandra/auth/AuthConfig.java |  6 ++--
 .../apache/cassandra/auth/AuthenticatedUser.java   |  2 +-
 src/java/org/apache/cassandra/auth/Roles.java      |  2 +-
 src/java/org/apache/cassandra/config/Config.java   | 21 ++++++++----
 .../cassandra/config/DatabaseDescriptor.java       | 40 +++++++++++-----------
 .../apache/cassandra/service/StorageService.java   |  2 +-
 .../test/BootstrapBinaryDisabledTest.java          |  4 +--
 .../db/virtual/CredentialsCacheKeysTableTest.java  |  2 +-
 .../virtual/JmxPermissionsCacheKeysTableTest.java  |  2 +-
 .../NetworkPermissionsCacheKeysTableTest.java      |  2 +-
 .../db/virtual/PermissionsCacheKeysTableTest.java  |  2 +-
 .../db/virtual/RolesCacheKeysTableTest.java        |  2 +-
 13 files changed, 65 insertions(+), 58 deletions(-)

diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 884a432..e9cce68 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -61,7 +61,7 @@ hinted_handoff_enabled: true
 # this defines the maximum amount of time a dead host will have hints
 # generated.  After it has been dead this long, new hints for it will not be
 # created until it has been seen alive and gone down again.
-max_hint_window_in_ms: 10800000 # 3 hours
+max_hint_window: 3h
 
 # Maximum throttle in KBs per second, per delivery thread.  This will be
 # reduced proportionally to the number of nodes in the cluster.  (If there
@@ -101,10 +101,10 @@ auto_hints_cleanup_enabled: false
 # Enable / disable persistent hint windows.
 #
 # If set to false, a hint will be stored only in case a respective node
-# that hint is for is down less than or equal to max_hint_window_in_ms.
+# that hint is for is down less than or equal to max_hint_window.
 #
 # If set to true, a hint will be stored in case there is not any
-# hint which was stored earlier than max_hint_window_in_ms. This is for cases
+# hint which was stored earlier than max_hint_window. This is for cases
 # when a node keeps to restart and hints are not delivered yet, we would be saving
 # hints for that node indefinitely.
 #
@@ -172,21 +172,21 @@ network_authorizer: AllowAllNetworkAuthorizer
 # Will be disabled automatically for AllowAllAuthenticator.
 # For a long-running cache using roles_cache_active_update, consider
 # setting to something longer such as a daily validation: 86400000
-roles_validity_in_ms: 2000
+roles_validity: 2000ms
 
 # Refresh interval for roles cache (if enabled).
 # After this interval, cache entries become eligible for refresh. Upon next
 # access, an async reload is scheduled and the old value returned until it
-# completes. If roles_validity_in_ms is non-zero, then this must be
+# completes. If roles_validity is non-zero, then this must be
 # also.
 # This setting is also used to inform the interval of auto-updating if
 # using roles_cache_active_update.
-# Defaults to the same value as roles_validity_in_ms.
+# Defaults to the same value as roles_validity.
 # For a long-running cache, consider setting this to 60000 (1 hour) etc.
-# roles_update_interval_in_ms: 2000
+# roles_update_interval: 2000ms
 
 # If true, cache contents are actively updated by a background task at the
-# interval set by roles_update_interval_in_ms. If false, cache entries
+# interval set by roles_update_interval. If false, cache entries
 # become eligible for refresh after their update interval. Upon next access,
 # an async reload is scheduled and the old value returned until it completes.
 # roles_cache_active_update: false
@@ -197,21 +197,21 @@ roles_validity_in_ms: 2000
 # Will be disabled automatically for AllowAllAuthorizer.
 # For a long-running cache using permissions_cache_active_update, consider
 # setting to something longer such as a daily validation: 86400000
-permissions_validity_in_ms: 2000
+permissions_validity: 2000ms
 
 # Refresh interval for permissions cache (if enabled).
 # After this interval, cache entries become eligible for refresh. Upon next
 # access, an async reload is scheduled and the old value returned until it
-# completes. If permissions_validity_in_ms is non-zero, then this must be
+# completes. If permissions_validity is non-zero, then this must be
 # also.
 # This setting is also used to inform the interval of auto-updating if
 # using permissions_cache_active_update.
-# Defaults to the same value as permissions_validity_in_ms.
+# Defaults to the same value as permissions_validity.
 # For a longer-running permissions cache, consider setting to update hourly (60000)
-# permissions_update_interval_in_ms: 2000
+# permissions_update_interval: 2000ms
 
 # If true, cache contents are actively updated by a background task at the
-# interval set by permissions_update_interval_in_ms. If false, cache entries
+# interval set by permissions_update_interval. If false, cache entries
 # become eligible for refresh after their update interval. Upon next access,
 # an async reload is scheduled and the old value returned until it completes.
 # permissions_cache_active_update: false
@@ -227,21 +227,21 @@ permissions_validity_in_ms: 2000
 # Defaults to 2000, set to 0 to disable credentials caching.
 # For a long-running cache using credentials_cache_active_update, consider
 # setting to something longer such as a daily validation: 86400000
-credentials_validity_in_ms: 2000
+credentials_validity: 2000ms
 
 # Refresh interval for credentials cache (if enabled).
 # After this interval, cache entries become eligible for refresh. Upon next
 # access, an async reload is scheduled and the old value returned until it
-# completes. If credentials_validity_in_ms is non-zero, then this must be
+# completes. If credentials_validity is non-zero, then this must be
 # also.
 # This setting is also used to inform the interval of auto-updating if
 # using credentials_cache_active_update.
-# Defaults to the same value as credentials_validity_in_ms.
+# Defaults to the same value as credentials_validity.
 # For a longer-running permissions cache, consider setting to update hourly (60000)
-# credentials_update_interval_in_ms: 2000
+# credentials_update_interval: 2000ms
 
 # If true, cache contents are actively updated by a background task at the
-# interval set by credentials_update_interval_in_ms. If false (default), cache entries
+# interval set by credentials_update_interval. If false (default), cache entries
 # become eligible for refresh after their update interval. Upon next access,
 # an async reload is scheduled and the old value returned until it completes.
 # credentials_cache_active_update: false
diff --git a/src/java/org/apache/cassandra/auth/AuthConfig.java b/src/java/org/apache/cassandra/auth/AuthConfig.java
index cc38296..28ee102 100644
--- a/src/java/org/apache/cassandra/auth/AuthConfig.java
+++ b/src/java/org/apache/cassandra/auth/AuthConfig.java
@@ -56,11 +56,11 @@ public final class AuthConfig
         // work with PasswordAuthenticator, so log a message if some other authenticator
         // is in use and non-default values are detected
         if (!(authenticator instanceof PasswordAuthenticator)
-            && (conf.credentials_update_interval_in_ms != -1
-                || conf.credentials_validity_in_ms != 2000
+            && (conf.credentials_update_interval.toMillisecondsAsInt() != 0
+                || conf.credentials_validity.toMillisecondsAsInt() != 2000
                 || conf.credentials_cache_max_entries != 1000))
         {
-            logger.info("Configuration options credentials_update_interval_in_ms, credentials_validity_in_ms and " +
+            logger.info("Configuration options credentials_update_interval, credentials_validity and " +
                         "credentials_cache_max_entries may not be applicable for the configured authenticator ({})",
                         authenticator.getClass().getName());
         }
diff --git a/src/java/org/apache/cassandra/auth/AuthenticatedUser.java b/src/java/org/apache/cassandra/auth/AuthenticatedUser.java
index ccac0ff..620a1d2 100644
--- a/src/java/org/apache/cassandra/auth/AuthenticatedUser.java
+++ b/src/java/org/apache/cassandra/auth/AuthenticatedUser.java
@@ -27,7 +27,7 @@ import org.apache.cassandra.dht.Datacenters;
  * Returned from IAuthenticator#authenticate(), represents an authenticated user everywhere internally.
  *
  * Holds the name of the user and the roles that have been granted to the user. The roles will be cached
- * for roles_validity_in_ms.
+ * for roles_validity.
  */
 public class AuthenticatedUser
 {
diff --git a/src/java/org/apache/cassandra/auth/Roles.java b/src/java/org/apache/cassandra/auth/Roles.java
index 9d3e232..f18851a 100644
--- a/src/java/org/apache/cassandra/auth/Roles.java
+++ b/src/java/org/apache/cassandra/auth/Roles.java
@@ -61,7 +61,7 @@ public class Roles
      * Get detailed info on all the roles granted to the role identified by the supplied RoleResource.
      * This includes superuser status and login privileges for the primary role and all roles granted directly
      * to it or inherited.
-     * The returnred roles may be cached if roles_validity_in_ms > 0
+     * The returned roles may be cached if roles_validity > 0
      * This method is used where we need to know specific attributes of the collection of granted roles, i.e.
      * when checking for superuser status which may be inherited from *any* granted role.
      *
diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java
index 7602118..172f16b 100644
--- a/src/java/org/apache/cassandra/config/Config.java
+++ b/src/java/org/apache/cassandra/config/Config.java
@@ -56,17 +56,23 @@ public class Config
     public String authorizer;
     public String role_manager;
     public String network_authorizer;
-    public volatile int permissions_validity_in_ms = 2000;
+    @Replaces(oldName = "permissions_validity_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds permissions_validity = new SmallestDurationMilliseconds("2s");
     public volatile int permissions_cache_max_entries = 1000;
-    public volatile int permissions_update_interval_in_ms = -1;
+    @Replaces(oldName = "permissions_update_interval_in_ms", converter = Converters.MILLIS_CUSTOM_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds permissions_update_interval = new SmallestDurationMilliseconds("0ms");
     public volatile boolean permissions_cache_active_update = false;
-    public volatile int roles_validity_in_ms = 2000;
+    @Replaces(oldName = "roles_validity_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds roles_validity = new SmallestDurationMilliseconds("2s");
     public volatile int roles_cache_max_entries = 1000;
-    public volatile int roles_update_interval_in_ms = -1;
+    @Replaces(oldName = "roles_update_interval_in_ms", converter = Converters.MILLIS_CUSTOM_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds roles_update_interval= new SmallestDurationMilliseconds("0ms");
     public volatile boolean roles_cache_active_update = false;
-    public volatile int credentials_validity_in_ms = 2000;
+    @Replaces(oldName = "credentials_validity_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds credentials_validity = new SmallestDurationMilliseconds("2s");
     public volatile int credentials_cache_max_entries = 1000;
-    public volatile int credentials_update_interval_in_ms = -1;
+    @Replaces(oldName = "credentials_update_interval_in_ms", converter = Converters.MILLIS_CUSTOM_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds credentials_update_interval= new SmallestDurationMilliseconds("0ms");
     public volatile boolean credentials_cache_active_update = false;
 
     /* Hashing strategy Random or OPHF */
@@ -75,7 +81,8 @@ public class Config
     public boolean auto_bootstrap = true;
     public volatile boolean hinted_handoff_enabled = true;
     public Set<String> hinted_handoff_disabled_datacenters = Sets.newConcurrentHashSet();
-    public volatile int max_hint_window_in_ms = 3 * 3600 * 1000; // three hours
+    @Replaces(oldName = "max_hint_window_in_ms", converter = Converters.MILLIS_DURATION, deprecated = true)
+    public volatile SmallestDurationMilliseconds max_hint_window = new SmallestDurationMilliseconds("3h");
     public String hints_directory;
     public boolean hint_window_persistent_enabled = true;
 
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index 297e619..978a6dd 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -1282,24 +1282,24 @@ public class DatabaseDescriptor
 
     public static int getPermissionsValidity()
     {
-        return conf.permissions_validity_in_ms;
+        return conf.permissions_validity.toMillisecondsAsInt();
     }
 
     public static void setPermissionsValidity(int timeout)
     {
-        conf.permissions_validity_in_ms = timeout;
+        conf.permissions_validity = SmallestDurationMilliseconds.inMilliseconds(timeout);
     }
 
     public static int getPermissionsUpdateInterval()
     {
-        return conf.permissions_update_interval_in_ms == -1
-             ? conf.permissions_validity_in_ms
-             : conf.permissions_update_interval_in_ms;
+        return conf.permissions_update_interval.toMilliseconds() == 0
+             ? conf.permissions_validity.toMillisecondsAsInt()
+             : conf.permissions_update_interval.toMillisecondsAsInt();
     }
 
     public static void setPermissionsUpdateInterval(int updateInterval)
     {
-        conf.permissions_update_interval_in_ms = updateInterval;
+        conf.permissions_update_interval = SmallestDurationMilliseconds.inMilliseconds(updateInterval);
     }
 
     public static int getPermissionsCacheMaxEntries()
@@ -1324,19 +1324,19 @@ public class DatabaseDescriptor
 
     public static int getRolesValidity()
     {
-        return conf.roles_validity_in_ms;
+        return conf.roles_validity.toMillisecondsAsInt();
     }
 
     public static void setRolesValidity(int validity)
     {
-        conf.roles_validity_in_ms = validity;
+        conf.roles_validity = SmallestDurationMilliseconds.inMilliseconds(validity);
     }
 
     public static int getRolesUpdateInterval()
     {
-        return conf.roles_update_interval_in_ms == -1
-             ? conf.roles_validity_in_ms
-             : conf.roles_update_interval_in_ms;
+        return conf.roles_update_interval.toMillisecondsAsInt() == 0
+             ? conf.roles_validity.toMillisecondsAsInt()
+             : conf.roles_update_interval.toMillisecondsAsInt();
     }
 
     public static void setRolesCacheActiveUpdate(boolean update)
@@ -1351,7 +1351,7 @@ public class DatabaseDescriptor
 
     public static void setRolesUpdateInterval(int interval)
     {
-        conf.roles_update_interval_in_ms = interval;
+        conf.roles_update_interval = SmallestDurationMilliseconds.inMilliseconds(interval);
     }
 
     public static int getRolesCacheMaxEntries()
@@ -1366,24 +1366,24 @@ public class DatabaseDescriptor
 
     public static int getCredentialsValidity()
     {
-        return conf.credentials_validity_in_ms;
+        return conf.credentials_validity.toMillisecondsAsInt();
     }
 
     public static void setCredentialsValidity(int timeout)
     {
-        conf.credentials_validity_in_ms = timeout;
+        conf.credentials_validity = SmallestDurationMilliseconds.inMilliseconds(timeout);
     }
 
     public static int getCredentialsUpdateInterval()
     {
-        return conf.credentials_update_interval_in_ms == -1
-               ? conf.credentials_validity_in_ms
-               : conf.credentials_update_interval_in_ms;
+        return conf.credentials_update_interval.toMillisecondsAsInt() == 0
+               ? conf.credentials_validity.toMillisecondsAsInt()
+               : conf.credentials_update_interval.toMillisecondsAsInt();
     }
 
     public static void setCredentialsUpdateInterval(int updateInterval)
     {
-        conf.credentials_update_interval_in_ms = updateInterval;
+        conf.credentials_update_interval = SmallestDurationMilliseconds.inMilliseconds(updateInterval);
     }
 
     public static int getCredentialsCacheMaxEntries()
@@ -2618,12 +2618,12 @@ public class DatabaseDescriptor
 
     public static void setMaxHintWindow(int ms)
     {
-        conf.max_hint_window_in_ms = ms;
+        conf.max_hint_window = SmallestDurationMilliseconds.inMilliseconds(ms);
     }
 
     public static int getMaxHintWindow()
     {
-        return conf.max_hint_window_in_ms;
+        return conf.max_hint_window.toMillisecondsAsInt();
     }
 
     public static File getHintsDirectory()
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 9d6a295..4be4fcf 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -940,7 +940,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
                 {
                     //only go into hibernate state if replacing the same address (CASSANDRA-8523)
                     logger.warn("Writes will not be forwarded to this node during replacement because it has the same address as " +
-                                "the node to be replaced ({}). If the previous node has been down for longer than max_hint_window_in_ms, " +
+                                "the node to be replaced ({}). If the previous node has been down for longer than max_hint_window, " +
                                 "repair must be run after the replacement process in order to make this node consistent.",
                                 DatabaseDescriptor.getReplaceAddress());
                     appStates.put(ApplicationState.STATUS_WITH_PORT, valueFactory.hibernate(true));
diff --git a/test/distributed/org/apache/cassandra/distributed/test/BootstrapBinaryDisabledTest.java b/test/distributed/org/apache/cassandra/distributed/test/BootstrapBinaryDisabledTest.java
index 55b6c86..3f50c30 100644
--- a/test/distributed/org/apache/cassandra/distributed/test/BootstrapBinaryDisabledTest.java
+++ b/test/distributed/org/apache/cassandra/distributed/test/BootstrapBinaryDisabledTest.java
@@ -50,8 +50,8 @@ public class BootstrapBinaryDisabledTest extends TestBaseImpl
         config.put("authenticator", "org.apache.cassandra.auth.PasswordAuthenticator");
         config.put("authorizer", "org.apache.cassandra.auth.CassandraAuthorizer");
         config.put("role_manager", "org.apache.cassandra.auth.CassandraRoleManager");
-        config.put("permissions_validity_in_ms", 0);
-        config.put("roles_validity_in_ms", 0);
+        config.put("permissions_validity", "0ms");
+        config.put("roles_validity", "0ms");
 
         int originalNodeCount = 1;
         int expandedNodeCount = originalNodeCount + 2;
diff --git a/test/unit/org/apache/cassandra/db/virtual/CredentialsCacheKeysTableTest.java b/test/unit/org/apache/cassandra/db/virtual/CredentialsCacheKeysTableTest.java
index 7039563..ad28c13 100644
--- a/test/unit/org/apache/cassandra/db/virtual/CredentialsCacheKeysTableTest.java
+++ b/test/unit/org/apache/cassandra/db/virtual/CredentialsCacheKeysTableTest.java
@@ -73,7 +73,7 @@ public class CredentialsCacheKeysTableTest extends CQLTester
     @AfterClass
     public static void tearDownClass()
     {
-        DatabaseDescriptor.setCredentialsValidity(DatabaseDescriptor.getRawConfig().credentials_validity_in_ms);
+        DatabaseDescriptor.setCredentialsValidity(DatabaseDescriptor.getRawConfig().credentials_validity.toMillisecondsAsInt());
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/db/virtual/JmxPermissionsCacheKeysTableTest.java b/test/unit/org/apache/cassandra/db/virtual/JmxPermissionsCacheKeysTableTest.java
index 0f16df2..f670fbd 100644
--- a/test/unit/org/apache/cassandra/db/virtual/JmxPermissionsCacheKeysTableTest.java
+++ b/test/unit/org/apache/cassandra/db/virtual/JmxPermissionsCacheKeysTableTest.java
@@ -94,7 +94,7 @@ public class JmxPermissionsCacheKeysTableTest extends CQLTester
     @AfterClass
     public static void tearDownClass()
     {
-        DatabaseDescriptor.setPermissionsValidity(DatabaseDescriptor.getRawConfig().permissions_validity_in_ms);
+        DatabaseDescriptor.setPermissionsValidity(DatabaseDescriptor.getRawConfig().permissions_validity.toMillisecondsAsInt());
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/db/virtual/NetworkPermissionsCacheKeysTableTest.java b/test/unit/org/apache/cassandra/db/virtual/NetworkPermissionsCacheKeysTableTest.java
index b8e7617..8f7f82b 100644
--- a/test/unit/org/apache/cassandra/db/virtual/NetworkPermissionsCacheKeysTableTest.java
+++ b/test/unit/org/apache/cassandra/db/virtual/NetworkPermissionsCacheKeysTableTest.java
@@ -74,7 +74,7 @@ public class NetworkPermissionsCacheKeysTableTest extends CQLTester
     @AfterClass
     public static void tearDownClass()
     {
-        DatabaseDescriptor.setPermissionsValidity(DatabaseDescriptor.getRawConfig().permissions_validity_in_ms);
+        DatabaseDescriptor.setPermissionsValidity(DatabaseDescriptor.getRawConfig().permissions_validity.toMillisecondsAsInt());
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/db/virtual/PermissionsCacheKeysTableTest.java b/test/unit/org/apache/cassandra/db/virtual/PermissionsCacheKeysTableTest.java
index 699dd66..1bfbb0b 100644
--- a/test/unit/org/apache/cassandra/db/virtual/PermissionsCacheKeysTableTest.java
+++ b/test/unit/org/apache/cassandra/db/virtual/PermissionsCacheKeysTableTest.java
@@ -89,7 +89,7 @@ public class PermissionsCacheKeysTableTest extends CQLTester
     @AfterClass
     public static void tearDownClass()
     {
-        DatabaseDescriptor.setPermissionsValidity(DatabaseDescriptor.getRawConfig().permissions_validity_in_ms);
+        DatabaseDescriptor.setPermissionsValidity(DatabaseDescriptor.getRawConfig().permissions_validity.toMillisecondsAsInt());
     }
 
     @Test
diff --git a/test/unit/org/apache/cassandra/db/virtual/RolesCacheKeysTableTest.java b/test/unit/org/apache/cassandra/db/virtual/RolesCacheKeysTableTest.java
index 5a4ccf2..6e5131d 100644
--- a/test/unit/org/apache/cassandra/db/virtual/RolesCacheKeysTableTest.java
+++ b/test/unit/org/apache/cassandra/db/virtual/RolesCacheKeysTableTest.java
@@ -74,7 +74,7 @@ public class RolesCacheKeysTableTest extends CQLTester
     @AfterClass
     public static void tearDownClass()
     {
-        DatabaseDescriptor.setRolesValidity(DatabaseDescriptor.getRawConfig().roles_validity_in_ms);
+        DatabaseDescriptor.setRolesValidity(DatabaseDescriptor.getRawConfig().roles_validity.toMillisecondsAsInt());
     }
 
     @Test

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