Skip to content

Commit

Permalink
Rename DumperCommonContext
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Nov 3, 2023
1 parent 676cdf2 commit 39ac916
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ private MigrationJobItemContext mockJobItemContext() {

private InventoryTask mockInventoryTask(final MigrationTaskConfiguration taskConfig) {
InventoryDumperContext dumperContext = new InventoryDumperContext(taskConfig.getDumperContext().getCommonContext());
dumperContext.setPosition(new PlaceholderPosition());
dumperContext.getCommonContext().setPosition(new PlaceholderPosition());
dumperContext.setActualTableName("t_order");
dumperContext.setLogicTableName("t_order");
dumperContext.setUniqueKeyColumns(Collections.singletonList(PipelineContextUtils.mockOrderIdColumnMetaData()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void beforeClass() {
@BeforeEach
void setUp() {
MigrationTaskConfiguration taskConfig = PipelineContextUtils.mockMigrationJobItemContext(JobConfigurationBuilder.createJobConfiguration()).getTaskConfig();
taskConfig.getDumperContext().setPosition(new PlaceholderPosition());
taskConfig.getDumperContext().getCommonContext().setPosition(new PlaceholderPosition());
incrementalTask = new IncrementalTask("ds_0", PipelineContextUtils.getExecuteEngine(), mock(Dumper.class),
Collections.singletonList(mock(Importer.class)), new IncrementalTaskProgress(new PlaceholderPosition()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void assertGetProgress() throws SQLException, ExecutionException, InterruptedExc
initTableData(taskConfig.getDumperContext());
// TODO use t_order_0, and also others
InventoryDumperContext inventoryDumperContext = createInventoryDumperContext("t_order", "t_order");
AtomicReference<IngestPosition> position = new AtomicReference<>(inventoryDumperContext.getPosition());
AtomicReference<IngestPosition> position = new AtomicReference<>(inventoryDumperContext.getCommonContext().getPosition());
InventoryTask inventoryTask = new InventoryTask(PipelineTaskUtils.generateInventoryTaskId(inventoryDumperContext),
PipelineContextUtils.getExecuteEngine(), PipelineContextUtils.getExecuteEngine(), mock(Dumper.class), mock(Importer.class), position);
CompletableFuture.allOf(inventoryTask.start().toArray(new CompletableFuture[0])).get(10L, TimeUnit.SECONDS);
Expand All @@ -102,7 +102,7 @@ private InventoryDumperContext createInventoryDumperContext(final String logicTa
result.setLogicTableName(logicTableName);
result.setActualTableName(actualTableName);
result.setUniqueKeyColumns(Collections.singletonList(PipelineContextUtils.mockOrderIdColumnMetaData()));
result.setPosition(
result.getCommonContext().setPosition(
null == taskConfig.getDumperContext().getCommonContext().getPosition() ? new IntegerPrimaryKeyPosition(0, 1000) : taskConfig.getDumperContext().getCommonContext().getPosition());
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ private ConsistencyCheckJobItemProgressContext createConsistencyCheckJobItemProg

private MigrationJobConfiguration createJobConfiguration() throws SQLException {
MigrationJobItemContext jobItemContext = PipelineContextUtils.mockMigrationJobItemContext(JobConfigurationBuilder.createJobConfiguration());
initTableData(jobItemContext.getTaskConfig().getDumperContext().getDataSourceConfig());
initTableData(jobItemContext.getTaskConfig().getDumperContext().getCommonContext().getDataSourceConfig());
initTableData(jobItemContext.getTaskConfig().getImporterConfig().getDataSourceConfig());
return jobItemContext.getJobConfig();
}
Expand Down

0 comments on commit 39ac916

Please sign in to comment.