Skip to content

Commit baab006

Browse files
committed
[FLINK-39633][postgres] Apply spotless format
1 parent f818f49 commit baab006

2 files changed

Lines changed: 8 additions & 14 deletions

File tree

flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/source/reader/external/IncrementalSourceScanFetcher.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,11 @@ boolean isChangeRecordInChunkRange(SourceRecord record) {
269269
// Skip records of other captured tables; their schema may not be loaded yet
270270
// and their PKs do not align with this chunk's bounds.
271271
TableId recordTableId = taskContext.getTableId(record);
272-
if (recordTableId == null
273-
|| !recordTableId.equals(currentSnapshotSplit.getTableId())) {
272+
if (recordTableId == null || !recordTableId.equals(currentSnapshotSplit.getTableId())) {
274273
return false;
275274
}
276275
return taskContext.isRecordBetween(
277-
record,
278-
currentSnapshotSplit.getSplitStart(),
279-
currentSnapshotSplit.getSplitEnd());
276+
record, currentSnapshotSplit.getSplitStart(), currentSnapshotSplit.getSplitEnd());
280277
}
281278

282279
@VisibleForTesting

flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/test/java/org/apache/flink/cdc/connectors/base/source/reader/external/IncrementalSourceScanFetcherTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,11 @@ class IncrementalSourceScanFetcherTest {
4141
private static final TableId OTHER_TABLE = TableId.parse("test_db.table_b");
4242

4343
/**
44-
* Reproduces the NPE seen in PostgreSQL backfill when the WAL stream carries change records
45-
* for a captured table other than the one currently being snapshotted. Before the fix, the
46-
* fetcher passed the foreign-table record to {@code isRecordBetween}, which dereferenced a
47-
* null Debezium {@code Table} from the schema cache and threw NPE. After the fix, the
48-
* foreign-table record is filtered out by tableId and {@code isRecordBetween} is never
49-
* invoked.
44+
* Reproduces the NPE seen in PostgreSQL backfill when the WAL stream carries change records for
45+
* a captured table other than the one currently being snapshotted. Before the fix, the fetcher
46+
* passed the foreign-table record to {@code isRecordBetween}, which dereferenced a null
47+
* Debezium {@code Table} from the schema cache and threw NPE. After the fix, the foreign-table
48+
* record is filtered out by tableId and {@code isRecordBetween} is never invoked.
5049
*/
5150
@Test
5251
void testIsChangeRecordInChunkRangeFiltersOutForeignTableRecord() {
@@ -105,9 +104,7 @@ void testIsChangeRecordInChunkRangeIgnoresNonDataChangeRecord() {
105104

106105
private static SnapshotSplit newSnapshotSplit(TableId tableId) {
107106
RowType splitKeyType =
108-
(RowType)
109-
DataTypes.ROW(DataTypes.FIELD("id", DataTypes.BIGINT()))
110-
.getLogicalType();
107+
(RowType) DataTypes.ROW(DataTypes.FIELD("id", DataTypes.BIGINT())).getLogicalType();
111108
return new SnapshotSplit(
112109
tableId,
113110
0,

0 commit comments

Comments
 (0)