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

2017-06-17 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12013868/badge)](https://:/builds/12013868)

Coverage increased (+0.3%) to 38.879% when pulling 
**30b1a2cda3bf343f98a05664029d27ebc8e116fd on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-17 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12013903/badge)](https://:/builds/12013903)

Coverage increased (+0.08%) to 38.686% when pulling 
**3615adf98fccab887397c5993fcf70ad0f8c369c on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002869/badge)](https://:/builds/12002869)

Coverage increased (+0.3%) to 38.906% when pulling 
**bfd9569de9a8a0d91116ffed57a56a5162a31c8f on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002869/badge)](https://:/builds/12002869)

Coverage increased (+0.3%) to 38.906% when pulling 
**bfd9569de9a8a0d91116ffed57a56a5162a31c8f on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002813/badge)](https://:/builds/12002813)

Coverage decreased (-0.2%) to 38.456% when pulling 
**bfd9569de9a8a0d91116ffed57a56a5162a31c8f on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002813/badge)](https://:/builds/12002813)

Coverage decreased (-0.2%) to 38.456% when pulling 
**bfd9569de9a8a0d91116ffed57a56a5162a31c8f on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002316/badge)](https://:/builds/12002316)

Coverage increased (+0.2%) to 38.829% when pulling 
**514e24a050a6315790d468922219fe13e6fa2faf on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002316/badge)](https://:/builds/12002316)

Coverage increased (+0.2%) to 38.829% when pulling 
**514e24a050a6315790d468922219fe13e6fa2faf on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002316/badge)](https://:/builds/12002316)

Coverage increased (+0.2%) to 38.829% when pulling 
**514e24a050a6315790d468922219fe13e6fa2faf on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002006/badge)](https://:/builds/12002006)

Coverage decreased (-0.5%) to 38.107% when pulling 
**e607868064557020cff064ade2a14e9f9d1bcc87 on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12002006/badge)](https://:/builds/12002006)

Coverage decreased (-0.5%) to 38.107% when pulling 
**e607868064557020cff064ade2a14e9f9d1bcc87 on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12001600/badge)](https://:/builds/12001600)

Coverage increased (+0.6%) to 39.205% when pulling 
**7761c997faf4eea4852b5c314c094135e222a967 on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12001600/badge)](https://:/builds/12001600)

Coverage increased (+0.6%) to 39.205% when pulling 
**7761c997faf4eea4852b5c314c094135e222a967 on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12001600/badge)](https://:/builds/12001600)

Coverage increased (+0.6%) to 39.205% when pulling 
**7761c997faf4eea4852b5c314c094135e222a967 on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12000450/badge)](https://:/builds/12000450)

Coverage decreased (-0.2%) to 38.431% when pulling 
**e65375c77598e519bed9d69334734ca9e00ba560 on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user coveralls commented on the issue:

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

[![Coverage 
Status](https://:/builds/12000450/badge)](https://:/builds/12000450)

Coverage decreased (-0.2%) to 38.431% when pulling 
**e65375c77598e519bed9d69334734ca9e00ba560 on huangyiminghappy:Branch_0616** 
into **0c5e53db6f4d0ed9f25747379a8b679e2da5392d on apache:master**.



> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread huangyiminghappy (JIRA)

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

huangyiminghappy commented on ROCKETMQ-226:
---

the code {color:red}FOR_SEG {color}is not useful,It is not multiple loop,You do 
not need to jump to the specified loop,so i suggest remove the 
{color:red}FOR_SEQ {color}code  


> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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}
> the code {color:red}{color:red}FOR_SEG{color} {color} is not useful,It is not 
> multiple loop,You do not need to jump to the specified loop,so i suggest 
> remove the FOR_SEQ code like this:
>  
> {code:java}
> public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
> {
> String brokerAddr = null;
> boolean slave = false;
> boolean found = false;
> HashMap map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user huangyiminghappy commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/121
  
the  code ## FOR_SEG   is not useful,It is not multiple loop,You do not 
need to jump to the specified loop,so i suggest remove the FOR_SEQ code
` public FindBrokerResult findBrokerAddressInAdmin(final String brokerName) 
{
String brokerAddr = null;
boolean slave = false;
boolean found = false;

HashMap map = 
this.brokerAddrTable.get(brokerName);
if (map != null && !map.isEmpty()) {
FOR_SEG:
for (Map.Entry 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;
}`


> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ROCKETMQ-226:
-

Github user vongosling commented on the issue:

https://github.com/apache/incubator-rocketmq/pull/121
  
Could you follow standard PR(notice topic style) ? and squash your many 
commits ?


> 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> for (Map.Entry 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)


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

2017-06-16 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ROCKETMQ-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 
Date:   2017-05-17T06:20:16Z

Remove spaces before and after the properties

commit 4492a1deb3be6e818dd18d48cdca49170dd67bd1
Author: huangyiming 
Date:   2017-05-17T06:26:18Z

Update MixAll.java

Remove spaces before and after the properties

commit 5d49dd476afae25c998376086ce17e7ef87f1c63
Author: huangyiming 
Date:   2017-05-17T07:39:59Z

Remove spaces before and after the properties

commit a2894b66f2d9c7dcd0546b0146595b525ca4918c
Author: huangyiming 
Date:   2017-05-17T07:42:18Z

Remove spaces before and after the properties

commit 7ffc22e4514111953256a2eab68d8b6896511e69
Author: huangyiming 
Date:   2017-05-17T08:11:07Z

remove spaces before and after the properties

commit 92f83bc14bd1da9c21228c3e3671bc8a67f5b288
Author: huangyiming 
Date:   2017-05-17T08:18:16Z

remove spaces before and after the properties

commit d142037b053d568ac6ec45c3316abb41a760fde8
Author: huangyiming 
Date:   2017-05-17T08:24:44Z

remove spaces before and after the properties

commit 86ee77b85a1568fb239c3437ff42dac374c19aee
Author: huangyiming 
Date:   2017-05-17T08:51:40Z

remove spaces before and after the properties

commit 42c2c65924557ebaa6f30e9f449694125fa6bcea
Author: huangyiming 
Date:   2017-05-18T02:54:21Z

remove spaces before and after the properties

commit 4ef07e4249daa9e9122a45bf195fb7f0e87246e1
Author: huangyiming 
Date:   2017-05-18T10:15:32Z

Remove spaces before and after the properties

commit 818b159683b17224447749faa140b9ce12388730
Author: huangyiming 
Date:   2017-06-16T06:45:52Z

Remove spaces before and after the properties

commit d485513ed51ca4b7206fbf962ab4801e90eeefae
Author: huangyiming 
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 map = 
> this.brokerAddrTable.get(brokerName);
> if (map != null && !map.isEmpty()) {
> FOR_SEG:
> for (Map.Entry 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