DBZ-7944 Move signal collection check to snapshot select logic

This commit is contained in:
Chris Cranford 2024-06-12 16:17:02 -04:00 committed by Jiri Pechanec
parent 7c2ca32b6b
commit cf3cf909e5

View File

@ -349,10 +349,6 @@ private void determineCapturedTables(RelationalSnapshotContext<P, O> ctx, Set<Pa
for (TableId tableId : snapshottedTableIds) {
if (connectorConfig.getTableFilters().dataCollectionFilter().isIncluded(tableId)) {
if (tableId.equals(signalDataCollectionTableId)) {
// Skip the signal data collection as data shouldn't be captured
continue;
}
LOGGER.trace("Adding table {} to the list of captured tables for which the data will be snapshotted", tableId);
capturedTables.add(tableId);
}
@ -716,6 +712,11 @@ protected ChangeRecordEmitter<P> getChangeRecordEmitter(P partition, O offset, T
*/
private Optional<String> determineSnapshotSelect(RelationalSnapshotContext<P, O> snapshotContext, TableId tableId,
Map<DataCollectionId, String> snapshotSelectOverridesByTable) {
if (tableId.equals(signalDataCollectionTableId)) {
// Skip the signal data collection as data shouldn't be captured
return Optional.empty();
}
String overriddenSelect = getSnapshotSelectOverridesByTable(tableId, snapshotSelectOverridesByTable);
if (overriddenSelect != null) {
return Optional.of(enhanceOverriddenSelect(snapshotContext, overriddenSelect, tableId));