Skip to content

Commit fabbeb6

Browse files
GuoPhilipsesteveloughran
authored andcommitted
HDFS-16355. Improve the description of dfs.block.scanner.volume.bytes.per.second (apache#3724)
Co-authored-by: gf13871 <[email protected]> Signed-off-by: Akira Ajisaka <[email protected]> (cherry picked from commit 046a620) Change-Id: I2cae5d1c27a492d896da5338a92c7a86f88a8b43
1 parent ed7ee51 commit fabbeb6

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

hadoop-hdfs-project/hadoop-hdfs/src/main/resources/hdfs-default.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,7 @@
15911591
<name>dfs.block.scanner.volume.bytes.per.second</name>
15921592
<value>1048576</value>
15931593
<description>
1594-
If this is 0, the DataNode's block scanner will be disabled. If this
1594+
If this is configured less than or equal to zero, the DataNode's block scanner will be disabled. If this
15951595
is positive, this is the number of bytes per second that the DataNode's
15961596
block scanner will try to scan from each volume.
15971597
</description>

hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockScanner.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,17 @@ public void testVolumeIteratorWithCaching() throws Exception {
282282
public void testDisableVolumeScanner() throws Exception {
283283
Configuration conf = new Configuration();
284284
disableBlockScanner(conf);
285-
TestContext ctx = new TestContext(conf, 1);
286-
try {
287-
Assert.assertFalse(ctx.datanode.getBlockScanner().isEnabled());
288-
} finally {
289-
ctx.close();
285+
try(TestContext ctx = new TestContext(conf, 1)) {
286+
assertFalse(ctx.datanode.getBlockScanner().isEnabled());
287+
}
288+
}
289+
290+
@Test(timeout=60000)
291+
public void testDisableVolumeScanner2() throws Exception {
292+
Configuration conf = new Configuration();
293+
conf.setLong(DFS_BLOCK_SCANNER_VOLUME_BYTES_PER_SECOND, -1L);
294+
try(TestContext ctx = new TestContext(conf, 1)) {
295+
assertFalse(ctx.datanode.getBlockScanner().isEnabled());
290296
}
291297
}
292298

0 commit comments

Comments
 (0)