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

    https://github.com/apache/storm/pull/2241#discussion_r129223991
  
    --- Diff: storm-client/src/jvm/org/apache/storm/utils/TransferDrainer.java 
---
    @@ -21,101 +21,100 @@
     import java.util.HashMap;
     import java.util.Iterator;
     import java.util.Map;
    +import java.util.Map.Entry;
     
     import org.apache.storm.generated.NodeInfo;
     import org.apache.storm.messaging.IConnection;
     import org.apache.storm.messaging.TaskMessage;
    -import com.google.common.collect.Maps;
     import org.slf4j.Logger;
     import org.slf4j.LoggerFactory;
     
     public class TransferDrainer {
     
    -  private Map<Integer, ArrayList<ArrayList<TaskMessage>>> bundles = new 
HashMap();
    +  private Map<Integer, ArrayList<TaskMessage>> bundles = new HashMap();
    +
       private static final Logger LOG = 
LoggerFactory.getLogger(TransferDrainer.class);
    -  
    -  public void add(HashMap<Integer, ArrayList<TaskMessage>> 
taskTupleSetMap) {
    -    for (Map.Entry<Integer, ArrayList<TaskMessage>> entry : 
taskTupleSetMap.entrySet()) {
    -      addListRefToMap(this.bundles, entry.getKey(), entry.getValue());
    +
    +  // Cache the msgs grouped by destination node
    +  public void add(TaskMessage taskMsg) {
    --- End diff --
    
    It seems `add` and `send` are always invoked in the same thread from 
(JCQueue.Consumer's `accept` and `flush`) and there is no contention. Is that 
right?


---
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