mirror of https://github.com/apache/cassandra
Correct size unit to mebibypes
This commit is contained in:
parent
e40f8163af
commit
b83da7d978
2
NEWS.txt
2
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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue