rocketmq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (ROCKETMQ-96) Rename tmp variable
Date Thu, 11 May 2017 06:24:04 GMT


ASF GitHub Bot commented on ROCKETMQ-96:

Github user Jaskey commented on the issue:
    @shroman @lizhanhui @zhouxinyu 
    There are users asking the same question about the logic of consume orderly and they both
complain that the `msgTreeMapTemp` is very hard to understand it's implication, so would you
please review this pr and merge it in 4.1.
    Besides, I wonder if there is the same issue in below method, the signature of the method
is trying to determine if there are some tmp msg(which will be only used in consumer orderly
service), while the implementation is to determine the `msgTreeMap`?
    Is the implementation wrong or the is signature misleading.
        public boolean hasTempMessage() {
            try {
                try {
                    return !this.msgTreeMap.isEmpty();
                } finally {
            } catch (InterruptedException e) {
            return true;

> Rename tmp variable 
> --------------------
>                 Key: ROCKETMQ-96
>                 URL:
>             Project: Apache RocketMQ
>          Issue Type: Improvement
>          Components: rocketmq-client
>    Affects Versions: 4.0.0-incubating
>            Reporter: Jaskey Lam
>            Assignee: Jaskey Lam
>            Priority: Minor
>             Fix For: 4.1.0-incubating
> 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

View raw message