hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject hadoop git commit: HDFS-8183. Erasure Coding: Improve DFSStripedOutputStream closing of datastreamer threads. Contributed by Rakesh R.
Date Thu, 30 Apr 2015 07:13:46 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-7285 d9785b6cb -> 5a838388c


HDFS-8183. Erasure Coding: Improve DFSStripedOutputStream closing of datastreamer threads.
Contributed by Rakesh R.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5a838388
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5a838388
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5a838388

Branch: refs/heads/HDFS-7285
Commit: 5a838388c0cf1eca40220faf24f3fde0ab48f1f0
Parents: d9785b6
Author: Zhe Zhang <zhz@apache.org>
Authored: Thu Apr 30 00:13:32 2015 -0700
Committer: Zhe Zhang <zhz@apache.org>
Committed: Thu Apr 30 00:13:32 2015 -0700

----------------------------------------------------------------------
 .../hadoop-hdfs/CHANGES-HDFS-EC-7285.txt                |  3 +++
 .../org/apache/hadoop/hdfs/DFSStripedOutputStream.java  | 12 ++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5a838388/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
index ca60487..3c75152 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-EC-7285.txt
@@ -149,3 +149,6 @@
 
     HDFS-8282. Erasure coding: move striped reading logic to StripedBlockUtil.
     (Zhe Zhang)
+
+    HDFS-8183. Erasure Coding: Improve DFSStripedOutputStream closing of 
+    datastreamer threads. (Rakesh R via Zhe Zhang)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5a838388/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSStripedOutputStream.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSStripedOutputStream.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSStripedOutputStream.java
index c930187..5e2a534 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSStripedOutputStream.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSStripedOutputStream.java
@@ -331,18 +331,26 @@ public class DFSStripedOutputStream extends DFSOutputStream {
   // interrupt datastreamer if force is true
   @Override
   protected void closeThreads(boolean force) throws IOException {
+    int index = 0;
+    boolean exceptionOccurred = false;
     for (StripedDataStreamer streamer : streamers) {
       try {
         streamer.close(force);
         streamer.join();
         streamer.closeSocket();
-      } catch (InterruptedException e) {
-        throw new IOException("Failed to shutdown streamer");
+      } catch (InterruptedException | IOException e) {
+        DFSClient.LOG.error("Failed to shutdown streamer: name="
+            + streamer.getName() + ", index=" + index + ", file=" + src, e);
+        exceptionOccurred = true;
       } finally {
         streamer.setSocketToNull();
         setClosed();
+        index++;
       }
     }
+    if (exceptionOccurred) {
+      throw new IOException("Failed to shutdown streamer");
+    }
   }
 
   /**


Mime
View raw message