public static UpdateFavoredNodesRequest buildUpdateFavoredNodesRequest(
    final List<Pair<RegionInfo, List<ServerName>>> updateRegionInfos) {
    UpdateFavoredNodesRequest.Builder ubuilder = UpdateFavoredNodesRequest.newBuilder();
    if (updateRegionInfos != null && !updateRegionInfos.isEmpty()) {
      RegionUpdateInfo.Builder builder = RegionUpdateInfo.newBuilder();
      for (Pair<RegionInfo, List<ServerName>> pair : updateRegionInfos) {
        builder.setRegion(ProtobufUtil.toRegionInfo(pair.getFirst()));
        for (ServerName server : pair.getSecond()) {
          builder.addFavoredNodes(ProtobufUtil.toServerName(server));
        }
        ubuilder.addUpdateInfo(builder.build());
        builder.clear();
      }
    }
    return ubuilder.build();
  }
Create a protocol buffer UpdateFavoredNodesRequest to update a list of favorednode mappings
@param updateRegionInfos a list of favored node mappings
@return a protocol buffer UpdateFavoredNodesRequest
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/RequestConverter.java