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 authored and jpechane committed Sep 26, 2023
1 parent 4f90531 commit fe2f175
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.vitess.converters;

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

import io.debezium.connector.vitess.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 VitessRecordParser(schema, record);
public RecordParser createParser(RecordAndMetadata recordAndMetadata) {
return new VitessRecordParser(recordAndMetadata);
}

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

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.connector.vitess.SourceInfo;
import io.debezium.converters.recordandmetadata.RecordAndMetadata;
import io.debezium.converters.spi.RecordParser;
import io.debezium.data.Envelope;
import io.debezium.util.Collect;
Expand All @@ -25,8 +24,8 @@ public class VitessRecordParser extends RecordParser {

private static final Set<String> VITESS_SOURCE_FIELD = Collect.unmodifiableSet(SourceInfo.VGTID_KEY, SourceInfo.KEYSPACE_NAME_KEY);

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

@Override
Expand Down

0 comments on commit fe2f175

Please sign in to comment.