HDFS-12791. NameNode Fsck http Connection can timeout for directories with multiple levels. Contributed by Mukul Kumar Singh.

This commit is contained in:
Chen Liang 2017-11-09 18:47:34 -08:00
parent 5eb7dbe9b3
commit 10a1f557e7
1 changed files with 7 additions and 4 deletions

View File

@ -471,6 +471,13 @@ public class NamenodeFsck implements DataEncryptionKeyFactory {
void check(String parent, HdfsFileStatus file, Result replRes, Result ecRes)
throws IOException {
String path = file.getFullName(parent);
if (showprogress &&
(totalDirs + totalSymlinks + replRes.totalFiles + ecRes.totalFiles)
% 100 == 0) {
out.println();
out.flush();
}
if (file.isDirectory()) {
checkDir(path, replRes, ecRes);
return;
@ -489,10 +496,6 @@ public class NamenodeFsck implements DataEncryptionKeyFactory {
final Result r = file.getErasureCodingPolicy() != null ? ecRes: replRes;
collectFileSummary(path, file, r, blocks);
if (showprogress && (replRes.totalFiles + ecRes.totalFiles) % 100 == 0) {
out.println();
out.flush();
}
collectBlocksSummary(parent, file, r, blocks);
}