Source:
<code>public void testHBaseSnapshotImport() throws Exception { try (Connection connection = BigtableConfiguration.connect(projectId, instanceId)) { System.out.println("DEBUG (create test table) ==>"); TableName tableName = TableName.valueOf(tableId); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(CF)); connection.getAdmin().createTable(descriptor, SnapshotTestingUtils.getSplitKeys()); System.out.println("DEBUG (import snapshot) ==>"); DataflowPipelineOptions importPipelineOpts = PipelineOptionsFactory.as(DataflowPipelineOptions.class); importPipelineOpts.setRunner(DirectRunner.class); importPipelineOpts.setGcpTempLocation(dataflowStagingLocation); importPipelineOpts.setNumWorkers(1); importPipelineOpts.setProject(projectId); ImportJobFromHbaseSnapshot.ImportOptions importOpts = importPipelineOpts.as(ImportJobFromHbaseSnapshot.ImportOptions.class); importOpts.setBigtableProject(StaticValueProvider.of(projectId)); importOpts.setBigtableInstanceId(StaticValueProvider.of(instanceId)); importOpts.setBigtableTableId(StaticValueProvider.of(tableId)); importOpts.setBigtableAppProfileId(null); importOpts.setHbaseRootDir(StaticValueProvider.of(hbaseSnapshotDir)); importOpts.setRestoreDir(StaticValueProvider.of(restoreDir)); importOpts.setSnapshotName(StaticValueProvider.of(TEST_SNAPSHOT_NAME)); State state = ImportJobFromHbaseSnapshot.buildPipeline(importOpts).run().waitUntilFinish(); Assert.assertEquals(State.DONE, state); BigtableTableUtils destTable = new BigtableTableUtils(connection, tableId, CF); Assert.assertEquals( 100 , <START> destTable.readAllCellsFromTable().toArray().length); <END> } }</code><technical_language>Please add a TODO for me, add sync-table this. data in this table verified</technical_language>

Target:
public void testHBaseSnapshotImport() throws Exception { try (Connection connection = BigtableConfiguration.connect(projectId, instanceId)) { System.out.println("DEBUG (create test table) ==>"); TableName tableName = TableName.valueOf(tableId); HTableDescriptor descriptor = new HTableDescriptor(tableName); descriptor.addFamily(new HColumnDescriptor(CF)); connection.getAdmin().createTable(descriptor, SnapshotTestingUtils.getSplitKeys()); System.out.println("DEBUG (import snapshot) ==>"); DataflowPipelineOptions importPipelineOpts = PipelineOptionsFactory.as(DataflowPipelineOptions.class); importPipelineOpts.setRunner(DataflowRunner.class); importPipelineOpts.setGcpTempLocation(dataflowStagingLocation); importPipelineOpts.setNumWorkers(1); importPipelineOpts.setProject(projectId); importPipelineOpts.setRegion(region); ImportJobFromHbaseSnapshot.ImportOptions importOpts = importPipelineOpts.as(ImportJobFromHbaseSnapshot.ImportOptions.class); importOpts.setBigtableProject(StaticValueProvider.of(projectId)); importOpts.setBigtableInstanceId(StaticValueProvider.of(instanceId)); importOpts.setBigtableTableId(StaticValueProvider.of(tableId)); importOpts.setBigtableAppProfileId(null); importOpts.setGcsProject(projectId); importOpts.setHbaseRootDir(hbaseSnapshotDir); importOpts.setRestoreDir(restoreDir); importOpts.setSnapshotName(TEST_SNAPSHOT_NAME); State state = ImportJobFromHbaseSnapshot.buildPipeline(importOpts).run().waitUntilFinish(); Assert.assertEquals(State.DONE, state); BigtableTableUtils destTable = new BigtableTableUtils(connection, tableId, CF); Assert.assertEquals( 100 , destTable.readAllCellsFromTable().toArray().length); } }