public static void updateMetaWithFavoredNodesInfo(
    Map<RegionInfo, List<ServerName>> regionToFavoredNodes, Connection connection)
    throws IOException {
    List<Put> puts = new ArrayList<>();
    for (Map.Entry<RegionInfo, List<ServerName>> entry : regionToFavoredNodes.entrySet()) {
      Put put = makePut(entry.getKey(), entry.getValue());
      if (put != null) {
        puts.add(put);
      }
    }
    try (Table table = connection.getTable(TableName.META_TABLE_NAME)) {
      table.put(puts);
    }
    LOG.info("Added " + puts.size() + " region favored nodes in META");
  }
Update meta table with favored nodes info
@param regionToFavoredNodes map of RegionInfo's to their favored nodes
@param connection           connection to be used
hbase-balancer/src/main/java/org/apache/hadoop/hbase/favored/FavoredNodeAssignmentHelper.java