HDFS-16355. Improve the description of dfs.block.scanner.volume.bytes.per.second (#3724)

Co-authored-by: gf13871 <gf13871@ly.com>
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
(cherry picked from commit 046a6204b4)
This commit is contained in:
GuoPhilipse 2022-03-27 21:23:48 +08:00 committed by Akira Ajisaka
parent ab5ea272ec
commit 6300fc1fcd
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
2 changed files with 12 additions and 6 deletions

View File

@ -1602,7 +1602,7 @@
<name>dfs.block.scanner.volume.bytes.per.second</name> <name>dfs.block.scanner.volume.bytes.per.second</name>
<value>1048576</value> <value>1048576</value>
<description> <description>
If this is 0, the DataNode's block scanner will be disabled. If this If this is configured less than or equal to zero, the DataNode's block scanner will be disabled. If this
is positive, this is the number of bytes per second that the DataNode's is positive, this is the number of bytes per second that the DataNode's
block scanner will try to scan from each volume. block scanner will try to scan from each volume.
</description> </description>

View File

@ -282,11 +282,17 @@ public void testVolumeIteratorWithCaching() throws Exception {
public void testDisableVolumeScanner() throws Exception { public void testDisableVolumeScanner() throws Exception {
Configuration conf = new Configuration(); Configuration conf = new Configuration();
disableBlockScanner(conf); disableBlockScanner(conf);
TestContext ctx = new TestContext(conf, 1); try(TestContext ctx = new TestContext(conf, 1)) {
try { assertFalse(ctx.datanode.getBlockScanner().isEnabled());
Assert.assertFalse(ctx.datanode.getBlockScanner().isEnabled()); }
} finally { }
ctx.close();
@Test(timeout=60000)
public void testDisableVolumeScanner2() throws Exception {
Configuration conf = new Configuration();
conf.setLong(DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND, -1L);
try(TestContext ctx = new TestContext(conf, 1)) {
assertFalse(ctx.datanode.getBlockScanner().isEnabled());
} }
} }