瀏覽代碼

HADOOP-3894. Merge -r 735120:735121 from trunk to branch 0.20.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.20@735123 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Shvachko 16 年之前
父節點
當前提交
7e40875da0
共有 2 個文件被更改,包括 6 次插入3 次删除
  1. 2 0
      CHANGES.txt
  2. 4 3
      src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

+ 2 - 0
CHANGES.txt

@@ -553,6 +553,8 @@ Release 0.19.1 - Unreleased
     HADOOP-4739. Fix spelling and grammar, improve phrasing of some sections in
     mapred tutorial. (Vivek Ratan via cdouglas)
 
+    HADOOP-3894. DFSClient logging improvements. (Steve Loughran via shv)
+
   BUG FIXES
 
     HADOOP-4697. Fix getBlockLocations in KosmosFileSystem to handle multiple

+ 4 - 3
src/hdfs/org/apache/hadoop/hdfs/DFSClient.java

@@ -963,8 +963,7 @@ public class DFSClient implements FSConstants, java.io.Closeable {
           try {
             out.close();
           } catch (IOException ie) {
-            System.err.println("Exception closing file " + src);
-            ie.printStackTrace();
+            LOG.error("Exception closing file " + src+ " : " + ie, ie);
           }
         }
       }
@@ -2432,7 +2431,9 @@ public class DFSClient implements FSConstants, java.io.Closeable {
       while (!success && clientRunning) {
         DatanodeInfo[] newnodes = null;
         if (nodes == null) {
-          String msg = "Could not get block locations. Aborting...";
+          String msg = "Could not get block locations. " +
+                                          "Source file \"" + src
+                                          + "\" - Aborting...";
           LOG.warn(msg);
           setLastException(new IOException(msg));
           closed = true;