Updated Branches:
  refs/heads/trunk b9960ab5f -> 2a55d67f5

FLUME-1434: Distinguish background worker with channel name

(Denny Ye 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/2a55d67f
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/2a55d67f
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/2a55d67f

Branch: refs/heads/trunk
Commit: 2a55d67f5bf16a296c019c6b27b89943d356c8b4
Parents: b9960ab
Author: Brock Noland <[email protected]>
Authored: Tue Aug 7 09:19:33 2012 -0500
Committer: Brock Noland <[email protected]>
Committed: Tue Aug 7 09:19:33 2012 -0500

----------------------------------------------------------------------
 .../java/org/apache/flume/channel/file/Log.java    |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/2a55d67f/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java
----------------------------------------------------------------------
diff --git 
a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java
 
b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java
index 778db64..2b733b1 100644
--- 
a/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java
+++ 
b/flume-ng-channels/flume-file-channel/src/main/java/org/apache/flume/channel/file/Log.java
@@ -156,6 +156,9 @@ class Log {
             + checkpointDir + " could not be created");
     Preconditions.checkNotNull(logDirs, "logDirs");
     Preconditions.checkArgument(logDirs.length > 0, "logDirs empty");
+    Preconditions.checkArgument(name != null && !name.trim().isEmpty(), 
+            "channel name should be specified");
+
     this.channelName = name;
     this.channelNameDescriptor = "[channel=" + name + "]";
 
@@ -186,7 +189,7 @@ class Log {
     this.checkpointWriteTimeout = checkpointWriteTimeout;
     logFiles = new AtomicReferenceArray<LogFile.Writer>(this.logDirs.length);
     worker = new BackgroundWorker(this);
-    worker.setName("Log-BackgroundWorker");
+    worker.setName("Log-BackgroundWorker-" + name);
     worker.setDaemon(true);
     worker.start();
   }

Reply via email to