Github user hmcl commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1649#discussion_r76275357
  
    --- Diff: 
external/storm-kafka-client/src/main/java/org/apache/storm/kafka/spout/KafkaSpout.java
 ---
    @@ -221,7 +224,22 @@ private boolean commit() {
         }
     
         private boolean poll() {
    -        return !waitingToEmit() && numUncommittedOffsets < 
kafkaSpoutConfig.getMaxUncommittedOffsets();
    +        final int maxUncommittedOffsets = 
kafkaSpoutConfig.getMaxUncommittedOffsets();
    +        final boolean poll = !waitingToEmit() && numUncommittedOffsets < 
maxUncommittedOffsets;
    +
    +        if (!poll) {
    +            final boolean isLoggable = logTimer.isExpiredResetOnTrue();
    --- End diff --
    
    This check is here in order to throttle the number of messages that get 
printed. Although logs are with debug level, a lot of messages will get printed 
(one each time nextTuple is called), which will spam the logs, and limit the 
ability to debug. What this code does is to print one message per second, 
rather than one per call to nextTuple. By doing this, no info is lost, and 
things are much cleaner.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to