flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject git commit: FLUME-2425 - FileChannel should trim data and checkpoint directories (Johny Rufus via Brock Noland)
Date Fri, 22 Aug 2014 19:12:13 GMT
Repository: flume
Updated Branches:
  refs/heads/flume-1.6 5734a4ab5 -> 42d8f95a8


FLUME-2425 - FileChannel should trim data and checkpoint directories (Johny Rufus via Brock
Noland)


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

Branch: refs/heads/flume-1.6
Commit: 42d8f95a89c180400abb665b421cf25f5cbc8380
Parents: 5734a4a
Author: Brock Noland <brock@apache.org>
Authored: Fri Aug 22 12:11:20 2014 -0700
Committer: Brock Noland <brock@apache.org>
Committed: Fri Aug 22 12:11:42 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/flume/channel/file/FileChannel.java   | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/42d8f95a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FileChannel.java
----------------------------------------------------------------------
diff --git a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FileChannel.java
b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FileChannel.java
index 413bfbc..61c353a 100644
--- a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FileChannel.java
+++ b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/FileChannel.java
@@ -21,8 +21,10 @@ package org.apache.flume.channel.file;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
+import com.google.common.base.Splitter;
 import com.google.common.base.Strings;
 import com.google.common.base.Throwables;
+import com.google.common.collect.Iterables;
 import org.apache.flume.*;
 import org.apache.flume.annotations.Disposable;
 import org.apache.flume.annotations.InterfaceAudience;
@@ -120,13 +122,15 @@ public class FileChannel extends BasicChannelSemantics {
 
     String strCheckpointDir =
         context.getString(FileChannelConfiguration.CHECKPOINT_DIR,
-            homePath + "/.flume/file-channel/checkpoint");
+            homePath + "/.flume/file-channel/checkpoint").trim();
 
     String strBackupCheckpointDir = context.getString
       (FileChannelConfiguration.BACKUP_CHECKPOINT_DIR, "").trim();
 
-    String[] strDataDirs = context.getString(FileChannelConfiguration.DATA_DIRS,
-        homePath + "/.flume/file-channel/data").split(",");
+    String[] strDataDirs = Iterables.toArray(
+        Splitter.on(",").trimResults().omitEmptyStrings().split(
+            context.getString(FileChannelConfiguration.DATA_DIRS,
+                homePath + "/.flume/file-channel/data")), String.class);
 
     checkpointDir = new File(strCheckpointDir);
 


Mime
View raw message