Skip to content

Commit

Permalink
Don't create AvroData for each KafkaSourceRecord (apache#12859)
Browse files Browse the repository at this point in the history
(cherry picked from commit 792a77e)
  • Loading branch information
dlg99 authored and nicoloboschi committed Dec 1, 2021
1 parent 116f90e commit 742e246
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,12 @@ public synchronized KafkaSourceRecord processSourceRecord(final SourceRecord src
return record;
}

private static Map<String, String> PROPERTIES = Collections.emptyMap();
private static Optional<Long> RECORD_SEQUENCE = Optional.empty();
private static long FLUSH_TIMEOUT_MS = 2000;
private static final AvroData avroData = new AvroData(1000);

private class KafkaSourceRecord extends AbstractKafkaSourceRecord<KeyValue<byte[], byte[]>> implements KVRecord<byte[], byte[]> {

KafkaSourceRecord(SourceRecord srcRecord) {
super(srcRecord);
AvroData avroData = new AvroData(1000);
byte[] keyBytes = keyConverter.fromConnectData(
srcRecord.topic(), srcRecord.keySchema(), srcRecord.key());
this.key = keyBytes != null ? Optional.of(Base64.getEncoder().encodeToString(keyBytes)) : Optional.empty();
Expand Down

0 comments on commit 742e246

Please sign in to comment.