You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flume.apache.org by br...@apache.org on 2014/08/22 21:12:13 UTC
git commit: FLUME-2425 - FileChannel should trim data and checkpoint
directories (Johny Rufus via Brock Noland)
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 <br...@apache.org>
Authored: Fri Aug 22 12:11:20 2014 -0700
Committer: Brock Noland <br...@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);