[ 
https://issues.apache.org/jira/browse/ROCKETMQ-96?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15906879#comment-15906879
 ] 

ASF GitHub Bot commented on ROCKETMQ-96:
----------------------------------------

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

    https://github.com/apache/incubator-rocketmq/pull/60#discussion_r105590475
  
    --- Diff: 
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ProcessQueue.java 
---
    @@ -46,7 +46,7 @@
         private final TreeMap<Long, MessageExt> msgTreeMap = new TreeMap<Long, 
MessageExt>();
         private final AtomicLong msgCount = new AtomicLong();
         private final Lock lockConsume = new ReentrantLock();
    -    private final TreeMap<Long, MessageExt> msgTreeMapTemp = new 
TreeMap<Long, MessageExt>();
    +    private final TreeMap<Long, MessageExt> consumingMsgOrderlyTreeMap = 
new TreeMap<Long, MessageExt>();//subset of msgTreeMap, used when consume 
orderly
    --- End diff --
    
    It would be nice to have a Javadoc comment here. Something like,
    ```java
    /**
    * Subset of msgTreeMap used when consuming orderly.
    */
    private final TreeMap<Long, MessageExt> msgOrderlyTreeMap = ...
    ```


> Rename tmp variable 
> --------------------
>
>                 Key: ROCKETMQ-96
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-96
>             Project: Apache RocketMQ
>          Issue Type: Improvement
>          Components: rocketmq-client
>    Affects Versions: 4.0.0-incubating
>            Reporter: Jaskey Lam
>            Assignee: Jaskey Lam
>            Priority: Minor
>
> Some variable is named with tmp which is very difficult to read and 
> understand its usage.
> For exampe:
> 1. in sendDefaultImpl, when select message queue, the variable is named with 
>     
>       MessageQueue tmpmq = this.selectOneMessageQueue(topicPublishInfo, 
> lastBrokerName);
> 2. In process queue, a field is named `msgTreeMapTemp`, which takes me 
> minutes to understand why it is desgined for, which should be rename to some 
> name like consumeingOrderlyMsgTreeMap



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to