flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject git commit: FLUME-2305. BucketWriter#close must cancel idleFuture
Date Tue, 28 Jan 2014 23:51:59 GMT
Updated Branches:
  refs/heads/flume-1.5 8467f8e31 -> 251478f2e


FLUME-2305. BucketWriter#close must cancel idleFuture

(Hari Shreedharan via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/251478f2
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/251478f2
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/251478f2

Branch: refs/heads/flume-1.5
Commit: 251478f2e937330d302abdcfd529ce0a6732b9af
Parents: 8467f8e
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Tue Jan 28 15:49:44 2014 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Tue Jan 28 15:51:03 2014 -0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java  | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/251478f2/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java
----------------------------------------------------------------------
diff --git a/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java
b/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java
index 62e47de..7fb3bdd 100644
--- a/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java
+++ b/flume-ng-sinks/flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java
@@ -317,6 +317,11 @@ class BucketWriter {
       timedRollFuture = null;
     }
 
+    if (idleFuture != null && !idleFuture.isDone()) {
+      idleFuture.cancel(false); // do not cancel myself if running!
+      idleFuture = null;
+    }
+
     if (bucketPath != null && fileSystem != null) {
       renameBucket(); // could block or throw IOException
       fileSystem = null;


Mime
View raw message