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

    https://github.com/apache/storm/pull/2502#discussion_r167807269
  
    --- Diff: 
storm-client/src/jvm/org/apache/storm/executor/spout/SpoutOutputCollectorImpl.java
 ---
    @@ -44,14 +48,15 @@
         private final Boolean isEventLoggers;
         private final Boolean isDebug;
         private final RotatingMap<Long, TupleInfo> pending;
    +    private TupleInfo globalTupleInfo = new TupleInfo();  // thread 
safety: assumes Collector.emit*() calls are externally synchronized (if needed).
    --- End diff --
    
    To get the id of the current thread  involves a call to 
Thread.currentThread() which is quite 
[expensive](!http://www.jutils.com/checks/performance.html)... so not good to 
use to determine whether or not to use fast path.
    
    I am introducing that check if topology.debug is enabled as a compromise. 
This mode could 
     be used mode to do any checks in dev mode that are unnecessary or 
expensive to do repeatedly in production.
    
    I have opened: 
[STORM-2945](!https://issues.apache.org/jira/browse/STORM-2945) to nail down 
and document background emits support.. we can document both spout & bolt 
support semantics together in the same document.


---

Reply via email to