flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject git commit: FLUME-2110. Scribe Source must check if category is null before inserting the headers.
Date Fri, 28 Jun 2013 21:00:06 GMT
Updated Branches:
  refs/heads/trunk 4cb3b6d8e -> d66bf94b1


FLUME-2110. Scribe Source must check if category is null before inserting the headers.

(Hari Shreedharan via Mike Percy)


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

Branch: refs/heads/trunk
Commit: d66bf94b1dd059bc7e4b1ff332be59a280498077
Parents: 4cb3b6d
Author: Mike Percy <mpercy@apache.org>
Authored: Fri Jun 28 13:59:33 2013 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Fri Jun 28 13:59:33 2013 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/flume/source/scribe/ScribeSource.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/d66bf94b/flume-ng-sources/flume-scribe-source/src/main/java/org/apache/flume/source/scribe/ScribeSource.java
----------------------------------------------------------------------
diff --git a/flume-ng-sources/flume-scribe-source/src/main/java/org/apache/flume/source/scribe/ScribeSource.java
b/flume-ng-sources/flume-scribe-source/src/main/java/org/apache/flume/source/scribe/ScribeSource.java
index b3a8de3..f9a14c1 100644
--- a/flume-ng-sources/flume-scribe-source/src/main/java/org/apache/flume/source/scribe/ScribeSource.java
+++ b/flume-ng-sources/flume-scribe-source/src/main/java/org/apache/flume/source/scribe/ScribeSource.java
@@ -149,7 +149,11 @@ public class ScribeSource extends AbstractSource implements
 
           for (LogEntry entry : list) {
             Map<String, String> headers = new HashMap<String, String>(1, 1);
-            headers.put(SCRIBE_CATEGORY, entry.getCategory());
+            String category = entry.getCategory();
+
+            if (category != null) {
+              headers.put(SCRIBE_CATEGORY, category);
+            }
 
             Event event = EventBuilder.withBody(entry.getMessage().getBytes(), headers);
             events.add(event);


Mime
View raw message