@Test(timeout=120000) public void test2NNBlockRescanInterval() throws IOException { ((Log4JLogger)BlockPoolSliceScanner.LOG).getLogger().setLevel(Level.ALL); Configuration conf = new HdfsConfiguration(); cluster = new MiniDFSCluster.Builder(conf) .nnTopology(MiniDFSNNTopology.simpleFederatedTopology(3)) .build(); try { FileSystem fs = cluster.getFileSystem(1); Path file2 = new Path("/test/testBlockScanInterval"); DFSTestUtil.createFile(fs, file2, 30, (short) 1, 0); fs = cluster.getFileSystem(0); Path file1 = new Path("/test/testBlockScanInterval"); DFSTestUtil.createFile(fs, file1, 30, (short) 1, 0); for (int i = 0; i < 8; i++) { LOG.info("Verifying that the blockscanner scans exactly once"); waitAndScanBlocks(1, 1); } } finally { cluster.shutdown(); } }
/** * HDFS-3828: DN rescans blocks too frequently * * @throws Exception */ @Test(timeout=120000) public void testBlockRescanInterval() throws IOException { ((Log4JLogger)BlockPoolSliceScanner.LOG).getLogger().setLevel(Level.ALL); Configuration conf = new HdfsConfiguration(); cluster = new MiniDFSCluster.Builder(conf).build(); try { FileSystem fs = cluster.getFileSystem(); Path file1 = new Path("/test/testBlockScanInterval"); DFSTestUtil.createFile(fs, file1, 30, (short) 1, 0); for (int i = 0; i < 4; i++) { LOG.info("Verifying that the blockscanner scans exactly once"); waitAndScanBlocks(1, 1); } } finally { cluster.shutdown(); } }