Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-1264

HDFEventSink throws NPE if event is generated without timestamp in header

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Sinks+Sources
    • Labels:

      Description

      If timestamp is null then it may defaults to new Date().getTime()

      long ts = Long.valueOf(headers.get("timestamp"));

      2012-06-09 00:48:36,166 ERROR hdfs.HDFSEventSink: process failed
      java.lang.NumberFormatException: null
      	at java.lang.Long.parseLong(Long.java:375)
      	at java.lang.Long.valueOf(Long.java:525)
      	at org.apache.flume.formatter.output.BucketPath.replaceShorthand(BucketPath.java:220)
      	at org.apache.flume.formatter.output.BucketPath.escapeString(BucketPath.java:310)
      	at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:366)
      	at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
      	at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
      	at java.lang.Thread.run(Thread.java:662)
      2012-06-09 00:48:36,168 ERROR flume.SinkRunner: Unable to deliver event. Exception follows.
      org.apache.flume.EventDeliveryException: java.lang.NumberFormatException: null
      	at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:414)
      	at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
      	at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NumberFormatException: null
      	at java.lang.Long.parseLong(Long.java:375)
      	at java.lang.Long.valueOf(Long.java:525)
      	at org.apache.flume.formatter.output.BucketPath.replaceShorthand(BucketPath.java:220)
      	at org.apache.flume.formatter.output.BucketPath.escapeString(BucketPath.java:310)
      	at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:366)
      	... 3 more
      
      
      

        Attachments

        1. FLUME-1264_1.patch
          3 kB
          Alexander Alten-Lorenz
        2. FLUME-1264.trunk.v1.patch
          2 kB
          Mubarak Seyed

          Issue Links

            Activity

              People

              • Assignee:
                mubarakseyed Mubarak Seyed
                Reporter:
                mubarakseyed Mubarak Seyed
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: