Skip to content

Commit

Permalink
DBZ-3642 Pass record and metadata when creating parser for CloudEvent…
Browse files Browse the repository at this point in the history
…s conversion
  • Loading branch information
rkudryashov committed Sep 16, 2023
1 parent 1c08455 commit d28fe04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
*/
package io.debezium.connector.db2.converters;

import org.apache.kafka.connect.data.Schema;
import org.apache.kafka.connect.data.Struct;

import io.debezium.connector.db2.Module;
import io.debezium.converters.recordandmetadata.RecordAndMetadata;
import io.debezium.converters.spi.CloudEventsMaker;
import io.debezium.converters.spi.CloudEventsProvider;
import io.debezium.converters.spi.RecordParser;
Expand All @@ -26,8 +24,8 @@ public String getName() {
}

@Override
public RecordParser createParser(Schema schema, Struct record) {
return new Db2RecordParser(schema, record);
public RecordParser createParser(RecordAndMetadata recordAndMetadata) {
return new Db2RecordParser(recordAndMetadata);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@

import java.util.Set;

import org.apache.kafka.connect.data.Schema;
import org.apache.kafka.connect.data.Struct;
import org.apache.kafka.connect.errors.DataException;

import io.debezium.converters.recordandmetadata.RecordAndMetadata;
import io.debezium.converters.spi.RecordParser;
import io.debezium.data.Envelope;
import io.debezium.util.Collect;
Expand All @@ -29,8 +28,8 @@ public class Db2RecordParser extends RecordParser {
CHANGE_LSN_KEY,
COMMIT_LSN_KEY);

public Db2RecordParser(Schema schema, Struct record) {
super(schema, record, Envelope.FieldName.BEFORE, Envelope.FieldName.AFTER);
public Db2RecordParser(RecordAndMetadata recordAndMetadata) {
super(recordAndMetadata, Envelope.FieldName.BEFORE, Envelope.FieldName.AFTER);
}

@Override
Expand Down

0 comments on commit d28fe04

Please sign in to comment.