pankaj72981 commented on a change in pull request #3109:
URL: https://github.com/apache/hbase/pull/3109#discussion_r604094212



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
##########
@@ -1773,12 +1775,15 @@ public static ServerName toServerName(final byte [] 
data) throws Deserialization
 
   public static RSGroupInfo toGroupInfo(RSGroupProtos.RSGroupInfo proto) {
     RSGroupInfo RSGroupInfo = new RSGroupInfo(proto.getName());
-    for(HBaseProtos.ServerName el: proto.getServersList()) {
-      RSGroupInfo.addServer(Address.fromParts(el.getHostName(), el.getPort()));
-    }
-    for(TableProtos.TableName pTableName: proto.getTablesList()) {
-      RSGroupInfo.addTable(ProtobufUtil.toTableName(pTableName));
-    }
+
+    Collection<Address> addresses = proto.getServersList().parallelStream()
+      .map(serverName -> Address.fromParts(serverName.getHostName(), 
serverName.getPort()))
+      .collect(Collectors.toList());
+    RSGroupInfo.addAllServers(addresses);

Review comment:
       nit: Rename the local variable name from `RSGroupInfo`  to `rsGroupInfo`




-- 
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.

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


Reply via email to