zhaomoran commented on code in PR #5642:
URL: https://github.com/apache/hbase/pull/5642#discussion_r1462708661


##########
hbase-common/src/main/java/org/apache/hadoop/hbase/ServerName.java:
##########
@@ -143,11 +143,10 @@ public static ServerName valueOf(final String hostname, 
final int port, final lo
    * instances, though we may return a shared immutable object as an internal 
optimization.
    */
   public static ServerName valueOf(final String serverName) {
-    int firstSep = serverName.indexOf(SERVERNAME_SEPARATOR);
-    int lastSep = serverName.lastIndexOf(SERVERNAME_SEPARATOR);
-    String hostname = serverName.substring(0, firstSep);
-    int port = Integer.parseInt(serverName.substring(firstSep + 1, lastSep));
-    long startCode = Long.parseLong(serverName.substring(lastSep + 1));
+    String[] splits = serverName.split(",");

Review Comment:
   I would suggest modifying the compact_ rs annotation which can supports 
hostname:port or hostname,port,startCode with more reasonable semantics. 
Internally, we can support it by using the existing parseServerName.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to