Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ private void dumpByCalculator() throws SQLException {
List<String> columnNames = dumperContext.getQueryColumnNames();
TableInventoryCalculateParameter calculateParam = new TableInventoryCalculateParameter(dataSource, table,
columnNames, dumperContext.getUniqueKeyColumns(), QueryType.RANGE_QUERY, null);
QueryRange queryRange = new QueryRange(((PrimaryKeyIngestPosition<?>) initialPosition).getBeginValue(), dumperContext.isFirstDump(),
((PrimaryKeyIngestPosition<?>) initialPosition).getEndValue());
QueryRange queryRange = new QueryRange(((PrimaryKeyIngestPosition<?>) initialPosition).getBeginValue(), true, ((PrimaryKeyIngestPosition<?>) initialPosition).getEndValue());
calculateParam.setQueryRange(queryRange);
RecordTableInventoryDumpCalculator dumpCalculator = new RecordTableInventoryDumpCalculator(dumperContext.getBatchSize(), StreamingRangeType.SMALL);
long rowCount = 0L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ public final class InventoryDumperContext {

private JobRateLimitAlgorithm rateLimitAlgorithm;

private boolean firstDump = true;

public InventoryDumperContext(final DumperCommonContext commonContext) {
this.commonContext = new DumperCommonContext(
commonContext.getDataSourceName(), commonContext.getDataSourceConfig(), commonContext.getTableNameMapper(), commonContext.getTableAndSchemaNameMapper());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private Collection<InventoryDumperContext> splitByPrimaryKey(final InventoryDump
JobRateLimitAlgorithm rateLimitAlgorithm = jobProcessContext.getReadRateLimitAlgorithm();
int i = 0;
for (IngestPosition each : getInventoryPositions(dumperContext, jobItemContext)) {
result.add(createPrimaryKeySplitDumperContext(dumperContext, each, i++, batchSize, rateLimitAlgorithm, jobItemContext));
result.add(createPrimaryKeySplitDumperContext(dumperContext, each, i++, batchSize, rateLimitAlgorithm));
}
return result;
}
Expand Down Expand Up @@ -151,8 +151,7 @@ private Range<Long> getUniqueKeyValuesRange(final TransmissionJobItemContext job
}

private InventoryDumperContext createPrimaryKeySplitDumperContext(final InventoryDumperContext dumperContext, final IngestPosition position,
final int shardingItem, final int batchSize, final JobRateLimitAlgorithm rateLimitAlgorithm,
final TransmissionJobItemContext jobItemContext) {
final int shardingItem, final int batchSize, final JobRateLimitAlgorithm rateLimitAlgorithm) {
InventoryDumperContext result = new InventoryDumperContext(dumperContext.getCommonContext());
result.getCommonContext().setPosition(position);
result.setShardingItem(shardingItem);
Expand All @@ -162,11 +161,6 @@ private InventoryDumperContext createPrimaryKeySplitDumperContext(final Inventor
result.setInsertColumnNames(dumperContext.getInsertColumnNames());
result.setBatchSize(batchSize);
result.setRateLimitAlgorithm(rateLimitAlgorithm);
result.setFirstDump(isFirstDump(jobItemContext));
return result;
}

private boolean isFirstDump(final TransmissionJobItemContext jobItemContext) {
return null == jobItemContext.getInitProgress() && jobItemContext.getProcessedRecordsCount() == 0;
}
}