public boolean run(Configuration conf, String[] args) throws IOException {
    // Read CLI arguments
    CommandLine line = null;
    try {
      Parser parser = new GnuParser();
      line = parser.parse(getOptions(), args);
      readCommandLineParameters(conf, line);
    } catch (ParseException | IOException exception) {
      logger.error("Error while parsing CLI arguments.", exception);
      printUsage();
      return false;
    }

    if (line.hasOption("-h")) {
      printUsage();
      return true;
    }

    Preconditions.checkArgument(!StringUtils.isEmpty(table), "Table name must not be empty");
    Preconditions.checkArgument(mapperCount > 0, "Mapper count must be greater than 0");
    Preconditions.checkArgument((splitCount > 0) && (splitCount < Utility.MAX_SPLIT_COUNT),
      "Split count must be greater than 0 and less than " + Utility.MAX_SPLIT_COUNT);
    Preconditions.checkArgument(rowsPerMapper > 0, "Rows per mapper must be greater than 0");

    Path outputDirectory = generateOutputDirectory();
    logger.info("HFiles will be generated at " + outputDirectory.toString());

    try (Connection connection = ConnectionFactory.createConnection(conf)) {
      final Admin admin = connection.getAdmin();
      final TableName tableName = TableName.valueOf(table);
      if (admin.tableExists(tableName)) {
        if (deleteTableIfExist) {
          logger.info(
            "Deleting the table since it already exist and delete-if-exist flag is set to true");
          Utility.deleteTable(admin, table);
        } else {
          logger.info("Table already exists, cannot generate HFiles for existing table.");
          return false;
        }
      }

      // Creating the pre-split table
      Utility.createTable(admin, table, splitCount, tableOptions);
      logger.info(table + " created successfully");

      Job job = createSubmittableJob(conf);

      Table hbaseTable = connection.getTable(tableName);

      // Auto configure partitioner and reducer
      HFileOutputFormat2.configureIncrementalLoad(job, hbaseTable, hbaseTable.getRegionLocator());

      FileOutputFormat.setOutputPath(job, outputDirectory);

      boolean result = job.waitForCompletion(true);

      if (result) {
        logger.info("HFiles generated successfully. Starting bulk load to " + table);
        BulkLoadHFilesTool bulkLoadHFilesTool = new BulkLoadHFilesTool(conf);
        Map<BulkLoadHFiles.LoadQueueItem, ByteBuffer> bulkLoadedHFiles =
          bulkLoadHFilesTool.bulkLoad(tableName, outputDirectory);
        boolean status = !bulkLoadedHFiles.isEmpty();
        logger.info("BulkLoadHFiles finished successfully with status " + status);
        return status;
      } else {
        logger.info("Failed to generate HFiles.");
        return false;
      }
    } catch (Exception e) {
      logger.error("Failed to generate data", e);
      return false;
    } finally {
      FileSystem.get(conf).deleteOnExit(outputDirectory);
    }
  }
Additional HBase meta-data options to be set for the table
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/bulkdatagenerator/BulkDataGeneratorTool.java