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

    https://github.com/apache/storm/pull/2241#discussion_r129445604
  
    --- Diff: storm-client/src/jvm/org/apache/storm/tuple/TupleImpl.java ---
    @@ -24,50 +24,56 @@
     import org.apache.storm.task.GeneralTopologyContext;
     
     public class TupleImpl implements Tuple {
    -    private final List<Object> values;
    -    private final int taskId;
    -    private final String streamId;
    -    private final GeneralTopologyContext context;
    -    private final MessageId id;
    +    private List<Object> values;
    +    private int taskId;
    +    private String streamId;
    +    private GeneralTopologyContext context;
    +    private MessageId id;
    +    private final String srcComponent;
         private Long _processSampleStartTime;
         private Long _executeSampleStartTime;
         private long _outAckVal = 0;
    -    
    +
         public TupleImpl(Tuple t) {
             this.values = t.getValues();
             this.taskId = t.getSourceTask();
             this.streamId = t.getSourceStreamId();
             this.id = t.getMessageId();
             this.context = t.getContext();
    -        if (t instanceof TupleImpl) {
    +        this.srcComponent = t.getSourceComponent();
    +        try {
                 TupleImpl ti = (TupleImpl) t;
                 this._processSampleStartTime = ti._processSampleStartTime;
                 this._executeSampleStartTime = ti._executeSampleStartTime;
                 this._outAckVal = ti._outAckVal;
    +        } catch (ClassCastException e) {
    +            // ignore ... if t is not a TupleImpl type .. faster than 
checking and then casting
             }
         }
     
    -    public TupleImpl(GeneralTopologyContext context, List<Object> values, 
int taskId, String streamId, MessageId id) {
    +    public TupleImpl(GeneralTopologyContext context, List<Object> values, 
String srcComponent, int taskId, String streamId, MessageId id) {
    --- End diff --
    
    because its a hashmap lookup .. which we want to avoid in critical path.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to