@Test public void testCopyTable() throws Exception { final byte[] TABLENAME1 = Bytes.toBytes("testCopyTable1"); final byte[] TABLENAME2 = Bytes.toBytes("testCopyTable2"); final byte[] FAMILY = Bytes.toBytes("family"); final byte[] COLUMN1 = Bytes.toBytes("c1"); HTable t1 = TEST_UTIL.createTable(TABLENAME1, FAMILY); HTable t2 = TEST_UTIL.createTable(TABLENAME2, FAMILY); for (int i = 0; i < 10; i++) { Put p = new Put(Bytes.toBytes("row" + i)); p.add(FAMILY, COLUMN1, COLUMN1); t1.put(p); } CopyTable copy = new CopyTable(TEST_UTIL.getConfiguration()); assertEquals( 0, copy.run(new String[] { "--new.name=" + Bytes.toString(TABLENAME2), Bytes.toString(TABLENAME1) })); for (int i = 0; i < 10; i++) { Get g = new Get(Bytes.toBytes("row" + i)); Result r = t2.get(g); assertEquals(1, r.size()); assertTrue(CellUtil.matchingQualifier(r.rawCells()[0], COLUMN1)); } t1.close(); t2.close(); TEST_UTIL.deleteTable(TABLENAME1); TEST_UTIL.deleteTable(TABLENAME2); }
public CopyTable(Configuration conf) { super(conf); }
CopyTable extends Configured implements Tool { public CopyTable(Configuration conf) { super(conf); } }
CopyTable extends Configured implements Tool { public CopyTable(Configuration conf) { super(conf); } CopyTable(Configuration conf); }
CopyTable extends Configured implements Tool { public CopyTable(Configuration conf) { super(conf); } CopyTable(Configuration conf); static Job createSubmittableJob(Configuration conf, String[] args); static void main(String[] args); @Override int run(String[] args); }
CopyTable extends Configured implements Tool { public CopyTable(Configuration conf) { super(conf); } CopyTable(Configuration conf); static Job createSubmittableJob(Configuration conf, String[] args); static void main(String[] args); @Override int run(String[] args);  }