You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@rocketmq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/06/16 08:54:00 UTC

[jira] [Commented] (ROCKETMQ-226) Remove the code that is not useful in the loop

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

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

GitHub user huangyiminghappy opened a pull request:

    https://github.com/apache/incubator-rocketmq/pull/121

    Remove the code that is not useful in the loop[ROCKETMQ-226]

    Remove the code that is not useful in the loop

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/huangyiminghappy/incubator-rocketmq Branch_0616

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-rocketmq/pull/121.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #121
    
----
commit 0011c2fc9fd7092301e9ab87bb4b654bf7e90ae6
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T06:20:16Z

    Remove spaces before and after the properties

commit 4492a1deb3be6e818dd18d48cdca49170dd67bd1
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T06:26:18Z

    Update MixAll.java
    
    Remove spaces before and after the properties

commit 5d49dd476afae25c998376086ce17e7ef87f1c63
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T07:39:59Z

    Remove spaces before and after the properties

commit a2894b66f2d9c7dcd0546b0146595b525ca4918c
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T07:42:18Z

    Remove spaces before and after the properties

commit 7ffc22e4514111953256a2eab68d8b6896511e69
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T08:11:07Z

    remove spaces before and after the properties

commit 92f83bc14bd1da9c21228c3e3671bc8a67f5b288
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T08:18:16Z

    remove spaces before and after the properties

commit d142037b053d568ac6ec45c3316abb41a760fde8
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T08:24:44Z

    remove spaces before and after the properties

commit 86ee77b85a1568fb239c3437ff42dac374c19aee
Author: huangyiming <hu...@163.com>
Date:   2017-05-17T08:51:40Z

    remove spaces before and after the properties

commit 42c2c65924557ebaa6f30e9f449694125fa6bcea
Author: huangyiming <hu...@163.com>
Date:   2017-05-18T02:54:21Z

    remove spaces before and after the properties

commit 4ef07e4249daa9e9122a45bf195fb7f0e87246e1
Author: huangyiming <hu...@163.com>
Date:   2017-05-18T10:15:32Z

    Remove spaces before and after the properties

commit 818b159683b17224447749faa140b9ce12388730
Author: huangyiming <hu...@163.com>
Date:   2017-06-16T06:45:52Z

    Remove spaces before and after the properties

commit d485513ed51ca4b7206fbf962ab4801e90eeefae
Author: huangyiming <hu...@163.com>
Date:   2017-06-16T08:39:37Z

    Remove the code that is not useful in the loop

----


> Remove the code that is not useful in the loop
> ----------------------------------------------
>
>                 Key: ROCKETMQ-226
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-226
>             Project: Apache RocketMQ
>          Issue Type: Wish
>          Components: rocketmq-client
>    Affects Versions: 4.0.0-incubating
>            Reporter: huangyiminghappy
>            Assignee: Xiaorui Wang
>            Priority: Minor
>             Fix For: 4.1.0-incubating
>
>         Attachments: 555.png, 666.png
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> in the clientComponent ,org.apache.rocketmq.client.impl.factory.MQClientInstance class has the method like this:
> {code:java}
>  public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) {
>         String brokerAddr = null;
>         boolean slave = false;
>         boolean found = false;
>         HashMap<Long/* brokerId */, String/* address */> map = this.brokerAddrTable.get(brokerName);
>         if (map != null && !map.isEmpty()) {
>             FOR_SEG:
>             for (Map.Entry<Long, String> entry : map.entrySet()) {
>                 Long id = entry.getKey();
>                 brokerAddr = entry.getValue();
>                 if (brokerAddr != null) {
>                     found = true;
>                     if (MixAll.MASTER_ID == id) {
>                         slave = false;
>                         break FOR_SEG;
>                     } else {
>                         slave = true;
>                     }
>                     break;
>                 }
>             } // end of for
>         }
>         if (found) {
>             return new FindBrokerResult(brokerAddr, slave);
>         }
>         return null;
>     }
> {code}
> I think the {color:red}{color:red}FOR_SEG{color} {color}should remove,it is not useful,it should modify like this:
> {code:java}
>     public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) {
>         String brokerAddr = null;
>         boolean slave = false;
>         boolean found = false;
>         HashMap<Long/* brokerId */, String/* address */> map = this.brokerAddrTable.get(brokerName);
>         if (map != null && !map.isEmpty()) {
>             for (Map.Entry<Long, String> entry : map.entrySet()) {
>                 Long id = entry.getKey();
>                 brokerAddr = entry.getValue();
>                 if (brokerAddr != null) {
>                     found = true;
>                     if (MixAll.MASTER_ID == id) {
>                         slave = false;
>                     } else {
>                         slave = true;
>                     }
>                     break;
>                 }
>             } // end of for
>         }
>         if (found) {
>             return new FindBrokerResult(brokerAddr, slave);
>         }
>         return null;
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)