@Test public void testWALPlayer() throws Exception { final byte[] TABLENAME1 = Bytes.toBytes("testWALPlayer1"); final byte[] TABLENAME2 = Bytes.toBytes("testWALPlayer2"); final byte[] FAMILY = Bytes.toBytes("family"); final byte[] COLUMN1 = Bytes.toBytes("c1"); final byte[] COLUMN2 = Bytes.toBytes("c2"); final byte[] ROW = Bytes.toBytes("row"); HTable t1 = TEST_UTIL.createTable(TABLENAME1, FAMILY); HTable t2 = TEST_UTIL.createTable(TABLENAME2, FAMILY); Put p = new Put(ROW); p.add(FAMILY, COLUMN1, COLUMN1); p.add(FAMILY, COLUMN2, COLUMN2); t1.put(p); Delete d = new Delete(ROW); d.deleteColumns(FAMILY, COLUMN1); t1.delete(d); HLog log = cluster.getRegionServer(0).getWAL(); log.rollWriter(); String walInputDir = new Path(cluster.getMaster().getMasterFileSystem() .getRootDir(), HConstants.HREGION_LOGDIR_NAME).toString(); Configuration configuration= TEST_UTIL.getConfiguration(); WALPlayer player = new WALPlayer(configuration); String optionName="_test_.name"; configuration.set(optionName, "1000"); player.setupTime(configuration, optionName); assertEquals(1000,configuration.getLong(optionName,0)); assertEquals(0, player.run(new String[] { walInputDir, Bytes.toString(TABLENAME1), Bytes.toString(TABLENAME2) })); Get g = new Get(ROW); Result r = t2.get(g); assertEquals(1, r.size()); assertTrue(CellUtil.matchingQualifier(r.rawCells()[0], COLUMN2)); }
public WALPlayer(Configuration conf) { super(conf); }
WALPlayer extends Configured implements Tool { public WALPlayer(Configuration conf) { super(conf); } }
WALPlayer extends Configured implements Tool { public WALPlayer(Configuration conf) { super(conf); } WALPlayer(Configuration conf); }
WALPlayer extends Configured implements Tool { public WALPlayer(Configuration conf) { super(conf); } WALPlayer(Configuration conf); Job createSubmittableJob(String[] args); static void main(String[] args); @Override int run(String[] args); }
WALPlayer extends Configured implements Tool { public WALPlayer(Configuration conf) { super(conf); } WALPlayer(Configuration conf); Job createSubmittableJob(String[] args); static void main(String[] args); @Override int run(String[] args);  }