@Override
  protected int doWork() throws Exception {
    ProcessBasedLocalHBaseCluster hbaseCluster =
      new ProcessBasedLocalHBaseCluster(conf, NUM_DATANODES, numRegionServers);
    hbaseCluster.startMiniDFS();

    // start the process based HBase cluster
    hbaseCluster.startHBase();

    // create tables if needed
    LoadTestUtil.createPreSplitLoadTestTable(conf, TABLE_NAME, DEFAULT_COLUMN_FAMILY,
      Compression.Algorithm.NONE, DataBlockEncoding.NONE);

    LOG.debug("Loading data....\n\n");
    loadData();

    LOG.debug("Sleeping for " + SLEEP_SEC_AFTER_DATA_LOAD + " seconds....\n\n");
    Threads.sleep(5 * SLEEP_SEC_AFTER_DATA_LOAD);

    Connection connection = ConnectionFactory.createConnection(conf);

    int metaRSPort = HBaseTestingUtil.getMetaRSPort(connection);

    LOG.debug("Killing hbase:meta region server running on port " + metaRSPort);
    hbaseCluster.killRegionServer(metaRSPort);
    Threads.sleep(2000);

    LOG.debug("Restarting region server running on port metaRSPort");
    hbaseCluster.startRegionServer(metaRSPort);
    Threads.sleep(2000);

    LOG.debug("Trying to scan meta");

    Table metaTable = connection.getTable(TableName.META_TABLE_NAME);
    ResultScanner scanner = metaTable.getScanner(new Scan());
    Result result;
    while ((result = scanner.next()) != null) {
      LOG.info("Region assignment from META: " + Bytes.toStringBinary(result.getRow()) + " => "
        + Bytes.toStringBinary(
          result.getFamilyMap(HConstants.CATALOG_FAMILY).get(HConstants.SERVER_QUALIFIER)));
    }
    metaTable.close();
    connection.close();
    return 0;
  }
Loads data into the table using the multi-threaded writer.
hbase-diagnostics/src/test/java/org/apache/hadoop/hbase/util/RestartMetaTest.java