PJ Van Aeken created FLUME-2281:
-----------------------------------

             Summary: File Header available in Deserializer
                 Key: FLUME-2281
                 URL: https://issues.apache.org/jira/browse/FLUME-2281
             Project: Flume
          Issue Type: Improvement
            Reporter: PJ Van Aeken


At the moment, the file header in a Spooling Directory source is set after the 
event is deserialized. So you cannot use the file header to make more 
intelligent deserialization decisions based on the type of file you are dealing 
with. 

A possible solution would be to simply move the code that sets the header. In 
the org.apache.flume.client.avro.ReliableSpoolingFileEventReader, you can move 
this section (line 254 - 259) :

if (annotateFileName) {
    String filename = currentFile.get().getFile().getAbsolutePath();
    for (Event event : events) {
        event.getHeaders().put(fileNameHeader, filename);
    }
}


And then move it to line 239, right above the deserialization code.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to