Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,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 @@ -283,6 +283,18 @@ public void testDisableVolumeScanner() throws Exception {
Configuration conf = new Configuration();
disableBlockScanner(conf);
TestContext ctx = new TestContext(conf, 1);
try {
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);
TestContext ctx = new TestContext(conf, 1);
try {
Assert.assertFalse(ctx.datanode.getBlockScanner().isEnabled());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a static import for assertFalse, you don't need the prefix Assert.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ayushtkn for your careful review, have just updated

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems it's still not updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jojochuang for you review, sorry for long time no reply, just have updated the comment.

} finally {
Expand Down