flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arv...@apache.org
Subject svn commit: r1307286 - in /incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs: HDFSDataStream.java HDFSSequenceFile.java
Date Fri, 30 Mar 2012 07:27:44 GMT
Author: arvind
Date: Fri Mar 30 07:27:44 2012
New Revision: 1307286

URL: http://svn.apache.org/viewvc?rev=1307286&view=rev
Log:
FLUME-1080. HDFSEventSink append support fails with exception.

(Inder Singh via Arvind Prabhakar)

Modified:
    incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSDataStream.java
    incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSSequenceFile.java

Modified: incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSDataStream.java
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSDataStream.java?rev=1307286&r1=1307285&r2=1307286&view=diff
==============================================================================
--- incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSDataStream.java
(original)
+++ incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSDataStream.java
Fri Mar 30 07:27:44 2012
@@ -38,7 +38,8 @@ public class HDFSDataStream implements H
     Path dstPath = new Path(filePath);
     FileSystem hdfs = dstPath.getFileSystem(conf);
 
-    if (conf.getBoolean("hdfs.append.support", false) == true) {
+    if (conf.getBoolean("hdfs.append.support", false) == true && hdfs.isFile
+            (dstPath)) {
       outStream = hdfs.append(dstPath);
     } else {
       outStream = hdfs.create(dstPath);

Modified: incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSSequenceFile.java
URL: http://svn.apache.org/viewvc/incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSSequenceFile.java?rev=1307286&r1=1307285&r2=1307286&view=diff
==============================================================================
--- incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSSequenceFile.java
(original)
+++ incubator/flume/trunk/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/HDFSSequenceFile.java
Fri Mar 30 07:27:44 2012
@@ -50,7 +50,8 @@ public class HDFSSequenceFile implements
     Path dstPath = new Path(filePath);
     FileSystem hdfs = dstPath.getFileSystem(conf);
 
-    if (conf.getBoolean("hdfs.append.support", false) == true) {
+    if (conf.getBoolean("hdfs.append.support", false) == true && hdfs.isFile
+            (dstPath)) {
       FSDataOutputStream outStream = hdfs.append(dstPath);
       writer = SequenceFile.createWriter(conf, outStream, fmt.getKeyClass(),
           fmt.getValueClass(), compType, codeC);



Mime
View raw message