From e52bc697f8f9c255dfc4d01b71272931153721c9 Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Thu, 24 Sep 2015 17:43:23 +0530 Subject: [PATCH] HDFS-9076. Log full path instead of inodeId in DFSClient#closeAllFilesBeingWritten() (Contributed by Surendra Singh Lilhore) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/hdfs/DFSClient.java | 4 ++-- .../main/java/org/apache/hadoop/hdfs/DFSOutputStream.java | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index fdecdda18a5..85a1ef7b086 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1400,6 +1400,9 @@ Release 2.8.0 - UNRELEASED TestSWebHdfsFileContextMainOperations fail due to invalid HDFS path on Windows. (Chris Nauroth via wheat9) + HDFS-9076. Log full path instead of inodeId in DFSClient + #closeAllFilesBeingWritten() (Surendra Singh Lilhore via vinayakumarb) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java index d7751a5c775..eff1a0b6408 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java @@ -583,8 +583,8 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory, out.close(); } } catch(IOException ie) { - LOG.error("Failed to " + (abort? "abort": "close") + - " inode " + inodeId, ie); + LOG.error("Failed to " + (abort ? "abort" : "close") + " file: " + + out.getSrc() + " with inode: " + inodeId, ie); } } } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java index acb24f3112b..de1d1ee1a78 100755 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java @@ -902,6 +902,13 @@ public class DFSOutputStream extends FSOutputSummer return fileId; } + /** + * Return the source of stream. + */ + String getSrc() { + return src; + } + /** * Returns the data streamer object. */