BlockScanner { public boolean isEnabled() { return (conf.scanPeriodMs > 0) && (conf.targetBytesPerSec > 0); } BlockScanner(DataNode datanode);  BlockScanner(DataNode datanode, Configuration conf); boolean isEnabled(); synchronized void addVolumeScanner(FsVolumeReference ref); synchronized void removeVolumeScanner(FsVolumeSpi volume); synchronized void removeAllVolumeScanners(); static final Logger LOG; }
@Test(timeout=60000) 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(); } }