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:11 GMT
Updated Branches:
  refs/heads/flume-1.5 368cf270e -> 2d506844a


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

Branch: refs/heads/flume-1.5
Commit: 2d506844ab41a666893f301016f8438622a8f29e
Parents: 368cf27
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:58 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/2d506844/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