### Question:
ImportTsv extends Configured implements Tool { private static void createTable(HBaseAdmin admin, String tableName, String[] columns) throws IOException { HTableDescriptor htd = new HTableDescriptor(TableName.valueOf(tableName)); Set<String> cfSet = new HashSet<String>(); for (String aColumn : columns) { if (TsvParser.ROWKEY_COLUMN_SPEC.equals(aColumn) || TsvParser.TIMESTAMPKEY_COLUMN_SPEC.equals(aColumn)) continue; cfSet.add(aColumn.split(":", 2)[0]); } for (String cf : cfSet) { HColumnDescriptor hcd = new HColumnDescriptor(Bytes.toBytes(cf)); htd.addFamily(hcd); } LOG.warn(format("Creating table '%s' with '%s' columns and default descriptors.", tableName, cfSet)); admin.createTable(htd); }  static Job createSubmittableJob(Configuration conf, String[] args); @Override int run(String[] args); static void main(String[] args); final static String MAPPER_CONF_KEY; final static String BULK_OUTPUT_CONF_KEY; final static String TIMESTAMP_CONF_KEY; final static String JOB_NAME_CONF_KEY; final static String SKIP_LINES_CONF_KEY; final static String COLUMNS_CONF_KEY; final static String SEPARATOR_CONF_KEY; }### Answer:
@Test public void testMROnTable() throws Exception { String table = "test-" + UUID.randomUUID(); String[] args = new String[] { "-D" + ImportTsv.COLUMNS_CONF_KEY + "=HBASE_ROW_KEY,FAM:A,FAM:B", "-D" + ImportTsv.SEPARATOR_CONF_KEY + "=\u001b", table }; util.createTable(table, FAMILY); doMROnTableTest(util, FAMILY, null, args, 1); util.deleteTable(table); }
@Test public void testMROnTableWithTimestamp() throws Exception { String table = "test-" + UUID.randomUUID(); String[] args = new String[] { "-D" + ImportTsv.COLUMNS_CONF_KEY + "=HBASE_ROW_KEY,HBASE_TS_KEY,FAM:A,FAM:B", "-D" + ImportTsv.SEPARATOR_CONF_KEY + "=,", table }; String data = "KEY,1234,VALUE1,VALUE2\n"; util.createTable(table, FAMILY); doMROnTableTest(util, FAMILY, data, args, 1); util.deleteTable(table); }
@Test public void testMROnTableWithCustomMapper() throws Exception { String table = "test-" + UUID.randomUUID(); String[] args = new String[] { "-D" + ImportTsv.MAPPER_CONF_KEY + "=org.apache.hadoop.hbase.mapreduce.TsvImporterCustomTestMapper", table }; util.createTable(table, FAMILY); doMROnTableTest(util, FAMILY, null, args, 3); util.deleteTable(table); }
@Test public void testBulkOutputWithAnExistingTable() throws Exception { String table = "test-" + UUID.randomUUID(); Path hfiles = new Path(util.getDataTestDirOnTestFS(table), "hfiles"); String[] args = new String[] { "-D" + ImportTsv.COLUMNS_CONF_KEY + "=HBASE_ROW_KEY,FAM:A,FAM:B", "-D" + ImportTsv.SEPARATOR_CONF_KEY + "=\u001b", "-D" + ImportTsv.BULK_OUTPUT_CONF_KEY + "=" + hfiles.toString(), table }; util.createTable(table, FAMILY); doMROnTableTest(util, FAMILY, null, args, 3); util.deleteTable(table); }