You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by yc...@apache.org on 2022/02/25 22:41:57 UTC

[cassandra] branch trunk updated: Correct size unit to mebibypes

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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new b83da7d  Correct size unit to mebibypes
b83da7d is described below

commit b83da7d978f1bae5f289f1561dd080d48dc4505b
Author: Yifan Cai <yc...@apache.org>
AuthorDate: Fri Feb 25 14:38:43 2022 -0800

    Correct size unit to mebibypes
---
 NEWS.txt                                                     | 2 +-
 conf/cassandra.yaml                                          | 2 +-
 src/java/org/apache/cassandra/config/DatabaseDescriptor.java | 4 ++--
 src/java/org/apache/cassandra/service/StorageProxy.java      | 8 ++++----
 src/java/org/apache/cassandra/service/StorageProxyMBean.java | 4 ++--
 test/unit/org/apache/cassandra/service/StorageProxyTest.java | 6 +++---
 6 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/NEWS.txt b/NEWS.txt
index f9626f1..05a6886 100644
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -57,7 +57,7 @@ using the provided 'sstableupgrade' tool.
 New features
 ------------
     - Support for String concatenation has been added through the + operator.
-    - New configuration max_hints_size_per_host to limit the size of local hints files per host in megabytes. Setting to
+    - New configuration max_hints_size_per_host to limit the size of local hints files per host in mebibytes. Setting to
       non-positive value disables the limit, which is the default behavior. Setting to a positive value to ensure
       the total size of the hints files per host does not exceed the limit.
     - Added ability to configure auth caches through corresponding `nodetool` commands.
diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml
index 0e21434..bb8cb28 100644
--- a/conf/cassandra.yaml
+++ b/conf/cassandra.yaml
@@ -86,7 +86,7 @@ hints_flush_period: 10000ms
 # Maximum size for a single hints file, in megabytes.
 max_hints_file_size: 128MiB
 
-# The file size limit to store hints for an unreachable host, in megabytes.
+# The file size limit to store hints for an unreachable host, in mebibytes.
 # Once the local hints files have reached the limit, no more new hints will be created.
 # Set a non-positive value will disable the size limit.
 # max_hints_size_per_host: 0MiB
diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index ced4ad3..af0b67a 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -2645,12 +2645,12 @@ public class DatabaseDescriptor
         return conf.max_hint_window.toMillisecondsAsInt();
     }
 
-    public static void setMaxHintsSizePerHostInMb(int value)
+    public static void setMaxHintsSizePerHostInMiB(int value)
     {
         conf.max_hints_size_per_host = DataStorageSpec.inMebibytes(value);
     }
 
-    public static int getMaxHintsSizePerHostInMb()
+    public static int getMaxHintsSizePerHostInMiB()
     {
         return conf.max_hints_size_per_host.toMebibytesAsInt();
     }
diff --git a/src/java/org/apache/cassandra/service/StorageProxy.java b/src/java/org/apache/cassandra/service/StorageProxy.java
index 69c231d..a66ccc2 100644
--- a/src/java/org/apache/cassandra/service/StorageProxy.java
+++ b/src/java/org/apache/cassandra/service/StorageProxy.java
@@ -2275,14 +2275,14 @@ public class StorageProxy implements StorageProxyMBean
         DatabaseDescriptor.setMaxHintWindow(ms);
     }
 
-    public int getMaxHintsSizePerHostInMb()
+    public int getMaxHintsSizePerHostInMiB()
     {
-        return DatabaseDescriptor.getMaxHintsSizePerHostInMb();
+        return DatabaseDescriptor.getMaxHintsSizePerHostInMiB();
     }
 
-    public void setMaxHintsSizePerHostInMb(int value)
+    public void setMaxHintsSizePerHostInMiB(int value)
     {
-        DatabaseDescriptor.setMaxHintsSizePerHostInMb(value);
+        DatabaseDescriptor.setMaxHintsSizePerHostInMiB(value);
     }
 
     public static boolean shouldHint(Replica replica)
diff --git a/src/java/org/apache/cassandra/service/StorageProxyMBean.java b/src/java/org/apache/cassandra/service/StorageProxyMBean.java
index 7ac83ae..0f69032 100644
--- a/src/java/org/apache/cassandra/service/StorageProxyMBean.java
+++ b/src/java/org/apache/cassandra/service/StorageProxyMBean.java
@@ -32,8 +32,8 @@ public interface StorageProxyMBean
     public Set<String> getHintedHandoffDisabledDCs();
     public int getMaxHintWindow();
     public void setMaxHintWindow(int ms);
-    public int getMaxHintsSizePerHostInMb();
-    public void setMaxHintsSizePerHostInMb(int value);
+    public int getMaxHintsSizePerHostInMiB();
+    public void setMaxHintsSizePerHostInMiB(int value);
     public int getMaxHintsInProgress();
     public void setMaxHintsInProgress(int qs);
     public int getHintsInProgress();
diff --git a/test/unit/org/apache/cassandra/service/StorageProxyTest.java b/test/unit/org/apache/cassandra/service/StorageProxyTest.java
index 77e9952..1338cd6 100644
--- a/test/unit/org/apache/cassandra/service/StorageProxyTest.java
+++ b/test/unit/org/apache/cassandra/service/StorageProxyTest.java
@@ -88,15 +88,15 @@ public class StorageProxyTest
     public void testShouldHintOnExceedingSize() throws Exception
     {
         shouldHintTest(replica -> {
-            final int originalHintsSizeLimit = DatabaseDescriptor.getMaxHintsSizePerHostInMb();
+            final int originalHintsSizeLimit = DatabaseDescriptor.getMaxHintsSizePerHostInMiB();
             try
             {
-                DatabaseDescriptor.setMaxHintsSizePerHostInMb(1);
+                DatabaseDescriptor.setMaxHintsSizePerHostInMiB(1);
                 assertThat(StorageProxy.shouldHint(replica)).isFalse();
             }
             finally
             {
-                DatabaseDescriptor.setMaxHintsSizePerHostInMb(originalHintsSizeLimit);
+                DatabaseDescriptor.setMaxHintsSizePerHostInMiB(originalHintsSizeLimit);
             }
         });
     }

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