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

chen zhu commented on KAFKA-3261:
---------------------------------

[~ijuma] yes, that can be done. 

But if we use the same regrex(in this case the regrex in EndPoint class), when 
doing parsing in the BrokerEndPoint class, the input string will be split to 
three parts: an empty string, host, and port. That might confuse readers as the 
first part is always an empty string that is of no use in the class. Do you 
think consolidating regrexes would be better/cleaner than the current 
implementation?

> Consolidate class kafka.cluster.BrokerEndPoint and kafka.cluster.EndPoint
> -------------------------------------------------------------------------
>
>                 Key: KAFKA-3261
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3261
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Guozhang Wang
>            Assignee: chen zhu
>
> These two classes are serving similar purposes and can be consolidated. Also 
> as [~sasakitoa] suggested we can remove their "uriParseExp" variables but use 
> (a possibly modified)
> {code}
> private static final Pattern HOST_PORT_PATTERN = 
> Pattern.compile(".*?\\[?([0-9a-zA-Z\\-.:]*)\\]?:([0-9]+)");
> {code}
> in org.apache.kafka.common.utils.Utils instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to