Repository: flume Updated Branches: refs/heads/trunk e3b9b09cc -> 9e28ea671
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/9e28ea67 Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/9e28ea67 Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/9e28ea67 Branch: refs/heads/trunk Commit: 9e28ea671cf1baf86e26f468643f94141dc94323 Parents: e3b9b09 Author: Brock Noland <[email protected]> Authored: Fri Aug 22 12:11:20 2014 -0700 Committer: Brock Noland <[email protected]> Committed: Fri Aug 22 12:11:20 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/9e28ea67/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);
