HDFS-11087. NamenodeFsck should check if the output writer is still writable. Contributed by Erik Krogen.
(cherry picked from commit 98d9e9c4c823d865ddfc017e71c82d12c8328e53)
This commit is contained in:
parent
95edf265b3
commit
c997fc629d
@ -488,7 +488,14 @@ void check(String parent, HdfsFileStatus file, Result res) throws IOException {
|
|||||||
} else {
|
} else {
|
||||||
out.print('.');
|
out.print('.');
|
||||||
}
|
}
|
||||||
if (res.totalFiles % 100 == 0) { out.println(); out.flush(); }
|
if (res.totalFiles % 100 == 0) {
|
||||||
|
out.println();
|
||||||
|
// checkError here will attempt to flush the stream, or report an error
|
||||||
|
// if the stream has encountered an error or been closed by the client
|
||||||
|
if (out.checkError()) {
|
||||||
|
throw new IOException("fsck encountered an error in its output stream");
|
||||||
|
}
|
||||||
|
}
|
||||||
int missing = 0;
|
int missing = 0;
|
||||||
int corrupt = 0;
|
int corrupt = 0;
|
||||||
long missize = 0;
|
long missize = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user