Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-25705

Convert proto to RSGroupInfo is costly

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0-alpha-1, 2.2.3
    • 3.0.0-alpha-1
    • rsgroup
    • 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

          Activity

            People

              mokai87 mokai
              mokai87 mokai
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: