You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by mf...@apache.org on 2014/06/03 14:25:05 UTC

git commit: STREAMS-104 | Moved reset into the try/catch

Repository: incubator-streams
Updated Branches:
  refs/heads/master 71e1a9e06 -> 0ab4fb101


STREAMS-104 | Moved reset into the try/catch


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/0ab4fb10
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/0ab4fb10
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/0ab4fb10

Branch: refs/heads/master
Commit: 0ab4fb101a386f982bb3d5218b33ce05c59b4328
Parents: 71e1a9e
Author: mfranklin <mf...@apache.org>
Authored: Tue Jun 3 08:24:58 2014 -0400
Committer: mfranklin <mf...@apache.org>
Committed: Tue Jun 3 08:24:58 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/streams/hdfs/WebHdfsPersistWriter.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/0ab4fb10/streams-contrib/streams-persist-hdfs/src/main/java/org/apache/streams/hdfs/WebHdfsPersistWriter.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-persist-hdfs/src/main/java/org/apache/streams/hdfs/WebHdfsPersistWriter.java b/streams-contrib/streams-persist-hdfs/src/main/java/org/apache/streams/hdfs/WebHdfsPersistWriter.java
index 5131696..1a77842 100644
--- a/streams-contrib/streams-persist-hdfs/src/main/java/org/apache/streams/hdfs/WebHdfsPersistWriter.java
+++ b/streams-contrib/streams-persist-hdfs/src/main/java/org/apache/streams/hdfs/WebHdfsPersistWriter.java
@@ -152,9 +152,9 @@ public class WebHdfsPersistWriter implements StreamsPersistWriter, Flushable, Cl
                 this.currentWriter.write(line);
             } catch (Exception io) {
                 LOGGER.warn("Failed to write even after creating a new file.  Attempting to reconnect", io);
-                connectToWebHDFS();
-                resetFile();
                 try {
+                    connectToWebHDFS();
+                    resetFile();
                     this.currentWriter.write(line);
                 } catch (Exception ex) {
                     LOGGER.error("Failed to write to HDFS after reconnecting client. Terminating writer.", ex);