MAPREDUCE-6045. need close the DataInputStream after open it in TestMapReduce.java (zxu via rkanter)
This commit is contained in:
parent
a4876c130f
commit
d9e4d67d18
|
@ -285,6 +285,9 @@ Release 2.7.0 - UNRELEASED
|
|||
MAPREDUCE-6166. Reducers do not validate checksum of map outputs when
|
||||
fetching directly to disk. (Eric Payne via gera)
|
||||
|
||||
MAPREDUCE-6045. need close the DataInputStream after open it in
|
||||
TestMapReduce.java (zxu via rkanter)
|
||||
|
||||
Release 2.6.0 - 2014-11-18
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -465,11 +465,15 @@ public class TestMapReduce {
|
|||
private static boolean isSequenceFile(FileSystem fs,
|
||||
Path f) throws IOException {
|
||||
DataInputStream in = fs.open(f);
|
||||
byte[] seq = "SEQ".getBytes();
|
||||
for(int i=0; i < seq.length; ++i) {
|
||||
if (seq[i] != in.read()) {
|
||||
return false;
|
||||
try {
|
||||
byte[] seq = "SEQ".getBytes();
|
||||
for (int i = 0; i < seq.length; ++i) {
|
||||
if (seq[i] != in.read()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue