Skip to content

Commit

Permalink
SinkRecord adds an overridden method (apache#8038)
Browse files Browse the repository at this point in the history
Motivation
When I was writing the io connector, I needed to use Message in the sink, but SinkRecord did not implement the getMessage method.

Modifications
Add the implementation of getMessage and getEventTime to SinkRecord.

Verifying this change
No needed.
  • Loading branch information
jianyun8023 authored Sep 17, 2020
1 parent 609d3d4 commit e78a864
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import lombok.Data;

import lombok.extern.slf4j.Slf4j;
import org.apache.pulsar.client.api.Message;
import org.apache.pulsar.client.api.Schema;
import org.apache.pulsar.client.impl.schema.KeyValueSchema;
import org.apache.pulsar.functions.api.KVRecord;
Expand Down Expand Up @@ -106,4 +107,13 @@ public Schema<T> getSchema() {
return null;
}

@Override
public Optional<Long> getEventTime() {
return sourceRecord.getEventTime();
}

@Override
public Optional<Message<T>> getMessage() {
return sourceRecord.getMessage();
}
}

0 comments on commit e78a864

Please sign in to comment.