Skip to content

Commit

Permalink
HDFS-16355. Improve the description of dfs.block.scanner.volume.bytes…
Browse files Browse the repository at this point in the history
….per.second (apache#3724)

Co-authored-by: gf13871 <gf13871@ly.com>
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
  • Loading branch information
GuoPhilipse and tclxgf13871 authored Mar 27, 2022
1 parent adbaf48 commit 046a620
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@
<name>dfs.block.scanner.volume.bytes.per.second</name>
<value>1048576</value>
<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
block scanner will try to scan from each volume.
</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,17 @@ public void testVolumeIteratorWithCaching() throws Exception {
public void testDisableVolumeScanner() throws Exception {
Configuration conf = new Configuration();
disableBlockScanner(conf);
TestContext ctx = new TestContext(conf, 1);
try {
Assert.assertFalse(ctx.datanode.getBlockScanner().isEnabled());
} finally {
ctx.close();
try(TestContext ctx = new TestContext(conf, 1)) {
assertFalse(ctx.datanode.getBlockScanner().isEnabled());
}
}

@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());
}
}

Expand Down

0 comments on commit 046a620

Please sign in to comment.