HADOOP-11101. How about inputstream close statement from catch block to finally block in FileContext#copy() ( Contributed by skrho )

(cherry picked from commit dff95f7af8)
This commit is contained in:
Vinayakumar B 2014-09-25 12:46:47 +05:30
parent 83926b3c57
commit 1e097ba429
2 changed files with 4 additions and 2 deletions

View File

@ -206,6 +206,9 @@ Release 2.6.0 - UNRELEASED
HADOOP-11009. Add Timestamp Preservation to DistCp (Gary Steelman via aw)
HADOOP-11101. How about inputstream close statement from catch block to
finally block in FileContext#copy() ( skrho via vinayakumarb )
OPTIMIZATIONS
HADOOP-10838. Byte array native checksumming. (James Thomas via todd)

View File

@ -2035,10 +2035,9 @@ public boolean copy(final Path src, final Path dst, boolean deleteSource,
EnumSet.of(CreateFlag.CREATE);
out = create(qDst, createFlag);
IOUtils.copyBytes(in, out, conf, true);
} catch (IOException e) {
} finally {
IOUtils.closeStream(out);
IOUtils.closeStream(in);
throw e;
}
}
if (deleteSource) {