public static int createPreSplitLoadTestTable(Configuration conf, TableDescriptor td,
    ColumnFamilyDescriptor[] cds, int numRegionsPerServer) throws IOException {
    TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(td);
    for (ColumnFamilyDescriptor cd : cds) {
      if (!td.hasColumnFamily(cd.getName())) {
        builder.setColumnFamily(cd);
      }
    }
    td = builder.build();
    int totalNumberOfRegions = 0;
    Connection unmanagedConnection = ConnectionFactory.createConnection(conf);
    Admin admin = unmanagedConnection.getAdmin();

    try {
      // create a table a pre-splits regions.
      // The number of splits is set as:
      // region servers * regions per region server).
      int numberOfServers = admin.getRegionServers().size();
      if (numberOfServers == 0) {
        throw new IllegalStateException("No live regionservers");
      }

      totalNumberOfRegions = numberOfServers * numRegionsPerServer;
      LOG.info("Number of live regionservers: " + numberOfServers + ", "
        + "pre-splitting table into " + totalNumberOfRegions + " regions " + "(regions per server: "
        + numRegionsPerServer + ")");

      byte[][] splits = new RegionSplitter.HexStringSplit().split(totalNumberOfRegions);

      admin.createTable(td, splits);
    } catch (MasterNotRunningException e) {
      LOG.error("Master not running", e);
      throw new IOException(e);
    } catch (TableExistsException e) {
      LOG.warn("Table " + td.getTableName() + " already exists, continuing");
    } finally {
      admin.close();
      unmanagedConnection.close();
    }
    return totalNumberOfRegions;
  }
Creates a pre-split table for load testing. If the table already exists, logs a warning and
continues.
@return the number of regions the table was split into
hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestingUtility.java