@@ -67,6 +67,7 @@ public void testListCorruptFilesCorruptedBlock() throws Exception {
6767
6868 try {
6969 Configuration conf = new HdfsConfiguration ();
70+ conf .setInt (DFSConfigKeys .DFS_NAMENODE_MAX_CORRUPT_FILE_BLOCKS_RETURNED_KEY , 100 );
7071 conf .setInt (DFSConfigKeys .DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY , 1 ); // datanode scans directories
7172 conf .setInt (DFSConfigKeys .DFS_BLOCKREPORT_INTERVAL_MSEC_KEY , 3 * 1000 ); // datanode sends block reports
7273 // Set short retry timeouts so this test runs faster
@@ -138,6 +139,8 @@ public void testListCorruptFileBlocksInSafeMode() throws Exception {
138139
139140 try {
140141 Configuration conf = new HdfsConfiguration ();
142+ // max list corrupt file blocks returned
143+ conf .setInt (DFSConfigKeys .DFS_NAMENODE_MAX_CORRUPT_FILE_BLOCKS_RETURNED_KEY , 100 );
141144 // datanode scans directories
142145 conf .setInt (DFSConfigKeys .DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY , 1 );
143146 // datanode sends block reports
@@ -260,6 +263,7 @@ public void testListCorruptFileBlocksInSafeMode() throws Exception {
260263 @ Test (timeout =300000 )
261264 public void testlistCorruptFileBlocks () throws Exception {
262265 Configuration conf = new Configuration ();
266+ conf .setInt (DFSConfigKeys .DFS_NAMENODE_MAX_CORRUPT_FILE_BLOCKS_RETURNED_KEY , 100 );
263267 conf .setLong (DFSConfigKeys .DFS_BLOCKREPORT_INTERVAL_MSEC_KEY , 1000 );
264268 conf .setInt (DFSConfigKeys .DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY , 1 ); // datanode scans
265269 // directories
@@ -371,6 +375,7 @@ private int countPaths(RemoteIterator<Path> iter) throws IOException {
371375 @ Test (timeout =300000 )
372376 public void testlistCorruptFileBlocksDFS () throws Exception {
373377 Configuration conf = new Configuration ();
378+ conf .setInt (DFSConfigKeys .DFS_NAMENODE_MAX_CORRUPT_FILE_BLOCKS_RETURNED_KEY , 100 );
374379 conf .setLong (DFSConfigKeys .DFS_BLOCKREPORT_INTERVAL_MSEC_KEY , 1000 );
375380 conf .setInt (DFSConfigKeys .DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY , 1 ); // datanode scans
376381 // directories
@@ -448,11 +453,12 @@ public void testMaxCorruptFiles() throws Exception {
448453 MiniDFSCluster cluster = null ;
449454 try {
450455 Configuration conf = new HdfsConfiguration ();
456+ conf .setInt (DFSConfigKeys .DFS_NAMENODE_MAX_CORRUPT_FILE_BLOCKS_RETURNED_KEY , 2 * 100 );
451457 conf .setInt (DFSConfigKeys .DFS_BLOCKREPORT_INTERVAL_MSEC_KEY , 3 * 1000 ); // datanode sends block reports
452458 cluster = new MiniDFSCluster .Builder (conf ).build ();
453459 FileSystem fs = cluster .getFileSystem ();
454460 final int maxCorruptFileBlocks =
455- FSNamesystem . DEFAULT_MAX_CORRUPT_FILEBLOCKS_RETURNED ;
461+ conf . getInt ( DFSConfigKeys . DFS_NAMENODE_MAX_CORRUPT_FILE_BLOCKS_RETURNED_KEY , 100 ) ;
456462
457463 // create 110 files with one block each
458464 DFSTestUtil util = new DFSTestUtil .Builder ().setName ("testMaxCorruptFiles" ).
@@ -533,6 +539,7 @@ public void testMaxCorruptFiles() throws Exception {
533539 @ Test (timeout = 60000 )
534540 public void testListCorruptFileBlocksOnRelativePath () throws Exception {
535541 Configuration conf = new Configuration ();
542+ conf .setInt (DFSConfigKeys .DFS_NAMENODE_MAX_CORRUPT_FILE_BLOCKS_RETURNED_KEY , 100 );
536543 conf .setLong (DFSConfigKeys .DFS_BLOCKREPORT_INTERVAL_MSEC_KEY , 1000 );
537544 conf .setInt (DFSConfigKeys .DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY , 1 );
538545
0 commit comments