Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.0.0-alpha-1, 2.2.3
-
None
-
Reviewed
Description
Convert RSGroupProtos.RSGroupInfo to RSGroupInfo is costly if the RSGroup has too many RSs and tables.
We can use parallelStream to handle the HBaseProtos.ServerName list and TableProtos.TableName list in ProtubufUtil#toGroupInfo as blow.
Collection<Address> addresses = proto.getServersList()
.parallelStream()
.map(server -> Address.fromParts(server.getHostName(), server.getPort()))
.collect(Collectors.toList());Collection<TableName> tables = proto.getTablesList()
.parallelStream()
.map(tableName -> ProtobufUtil.toTableName(tableName))
.collect(Collectors.toList());
Get the RSGroupInfo which has 9 RS and 20k tables, the time cost reduced from 6038 ms to 684 ms.
Attachments
Issue Links
- links to
There are no Sub-Tasks for this issue.