DataCube<LongOp> cube = new DataCube<LongOp>(dims, rollups);
DataCubeIo<LongOp> cubeIo = new DataCubeIo<LongOp>(cube, hbaseDbHarness, 1,
Long.MAX_VALUE, SyncLevel.FULL_SYNC);
// Before doing any snapshotting/backfilling, there's one value "5" in the cube.
cubeIo.writeSync(new LongOp(5), new WriteBuilder(cube).at(onlyDimension, "coord1"));
// Snapshot the source table
Assert.assertTrue(new HBaseSnapshotter(conf, CUBE_DATA_TABLE, CF, SNAPSHOT_DEST_TABLE,
new Path("hdfs:///test_hfiles"), false, null, null).runWithCheckedExceptions());
// Simulate a backfill by copying the live cube
Assert.assertTrue(new HBaseSnapshotter(conf, CUBE_DATA_TABLE, CF, BACKFILLED_TABLE,
new Path("hdfs:///test_hfiles"), true, null, null).runWithCheckedExceptions());
// Simulate two writes to the live table that wouldn't be seen by the app as it backfills.
// This is like a client doing a write concurrently with a backfill.
cubeIo.writeSync(new LongOp(6), new WriteBuilder(cube).at(onlyDimension, "coord1"));
cubeIo.writeSync(new LongOp(7), new WriteBuilder(cube).at(onlyDimension, "coord2"));
HBaseBackfillMerger backfiller = new HBaseBackfillMerger(conf, ArrayUtils.EMPTY_BYTE_ARRAY,
CUBE_DATA_TABLE, SNAPSHOT_DEST_TABLE, BACKFILLED_TABLE, CF,
LongOp.LongOpDeserializer.class);
Assert.assertTrue(backfiller.runWithCheckedExceptions());