Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0
    • Sinks+Sources
    • Mac OS 10.10.3, Java 1.7.0_60

    • Patch

    Description

      A NPE is thrown when KafkaSource calls counter.incrementKafkaEmptyCount() because it expects MonitoredCounterGroup.counterMap to contain key "source.kafka.empty.count". A patch is included which adds this key to the ATTRIBUTES string array, which is used to pre-populate keys with an initial value.

      Attachments

        1. FLUME-2672.patch
          0.8 kB
          Rigo MacTaggart
        2. FLUME-2672-with-test.patch
          3 kB
          Rigo MacTaggart
        3. FLUME-2672-with-test-git-diff.patch
          3 kB
          Rigo MacTaggart

        Activity

          paliwalashish Ashish Paliwal added a comment -

          +1, Patch looks good. May be we should have some test cases around counters as well.

          paliwalashish Ashish Paliwal added a comment - +1, Patch looks good. May be we should have some test cases around counters as well.

          Added a test for KafkaSourceCounter. The test exercises the increment/getter methods.

          rigo Rigo MacTaggart added a comment - Added a test for KafkaSourceCounter. The test exercises the increment/getter methods.

          Any additional work need to be done on this issue?

          rigo Rigo MacTaggart added a comment - Any additional work need to be done on this issue?
          xnag Xuri Nagarin added a comment -

          Is there a workaround available for this issue?

          xnag Xuri Nagarin added a comment - Is there a workaround available for this issue?

          ashishpaliwal - If this looks ok to you, do you mind committing it? Thanks!

          hshreedharan Hari Shreedharan added a comment - ashishpaliwal - If this looks ok to you, do you mind committing it? Thanks!
          paliwalashish Ashish Paliwal added a comment -

          Let me check and commit.

          paliwalashish Ashish Paliwal added a comment - Let me check and commit.
          paliwalashish Ashish Paliwal added a comment -

          Getting an error while applying the patch.

          bash-3.2$ git apply --check FLUME-2672-with-test.patch 
          error: src/main/java/org/apache/flume/instrumentation/kafka/KafkaSourceCounter.java: No such file or directory
          
          paliwalashish Ashish Paliwal added a comment - Getting an error while applying the patch. bash-3.2$ git apply --check FLUME-2672-with-test.patch error: src/main/java/org/apache/flume/instrumentation/kafka/KafkaSourceCounter.java: No such file or directory
          jrufus Johny Rufus added a comment -

          rigo, will it be possible to attach a 'git diff', instead of diffing from IntelliJ

          jrufus Johny Rufus added a comment - rigo , will it be possible to attach a 'git diff', instead of diffing from IntelliJ
          jrufus Johny Rufus added a comment -

          rigo, I can take your patch and submit a git diff based on your changes, but the TestKafkaSourceCounter.java is missing the Apache License header, without which we wont be able to process your patch, can you kindly look at adding the Apache License header

          jrufus Johny Rufus added a comment - rigo , I can take your patch and submit a git diff based on your changes, but the TestKafkaSourceCounter.java is missing the Apache License header, without which we wont be able to process your patch, can you kindly look at adding the Apache License header

          Sorry of the delay; attached is a new patch file which includes the ASF header.

          rigo Rigo MacTaggart added a comment - Sorry of the delay; attached is a new patch file which includes the ASF header.
          jrufus Johny Rufus added a comment -

          +1, Running tests and committing

          jrufus Johny Rufus added a comment - +1, Running tests and committing

          Commit 67189ca84d24154150fa2ca4194b3b8d79400bda in flume's branch refs/heads/trunk from jrufus
          [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=67189ca ]

          FLUME-2672. NPE in KafkaSourceCounter

          (Rigo MacTaggart via Johny Rufus)

          jira-bot ASF subversion and git services added a comment - Commit 67189ca84d24154150fa2ca4194b3b8d79400bda in flume's branch refs/heads/trunk from jrufus [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=67189ca ] FLUME-2672 . NPE in KafkaSourceCounter (Rigo MacTaggart via Johny Rufus)

          Commit 22083176c50bb4c6da81906ae2eeb3d43c030f7a in flume's branch refs/heads/flume-1.7 from jrufus
          [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=2208317 ]

          FLUME-2672. NPE in KafkaSourceCounter

          (Rigo MacTaggart via Johny Rufus)

          jira-bot ASF subversion and git services added a comment - Commit 22083176c50bb4c6da81906ae2eeb3d43c030f7a in flume's branch refs/heads/flume-1.7 from jrufus [ https://git-wip-us.apache.org/repos/asf?p=flume.git;h=2208317 ] FLUME-2672 . NPE in KafkaSourceCounter (Rigo MacTaggart via Johny Rufus)
          jrufus Johny Rufus added a comment -

          Thanks rigo for the patch !!

          jrufus Johny Rufus added a comment - Thanks rigo for the patch !!
          hudson Hudson added a comment -

          SUCCESS: Integrated in Flume-trunk-hbase-1 #122 (See https://builds.apache.org/job/Flume-trunk-hbase-1/122/)
          FLUME-2672. NPE in KafkaSourceCounter (johnyrufus: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=67189ca84d24154150fa2ca4194b3b8d79400bda)

          • flume-ng-core/src/test/java/org/apache/flume/instrumentation/kafka/KafkaSourceCounterTest.java
          • flume-ng-core/src/main/java/org/apache/flume/instrumentation/kafka/KafkaSourceCounter.java
          hudson Hudson added a comment - SUCCESS: Integrated in Flume-trunk-hbase-1 #122 (See https://builds.apache.org/job/Flume-trunk-hbase-1/122/ ) FLUME-2672 . NPE in KafkaSourceCounter (johnyrufus: http://git-wip-us.apache.org/repos/asf/flume/repo?p=flume.git&a=commit&h=67189ca84d24154150fa2ca4194b3b8d79400bda ) flume-ng-core/src/test/java/org/apache/flume/instrumentation/kafka/KafkaSourceCounterTest.java flume-ng-core/src/main/java/org/apache/flume/instrumentation/kafka/KafkaSourceCounter.java

          People

            rigo Rigo MacTaggart
            rigo Rigo MacTaggart
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: