SinkRecord adds an overridden method
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.
@@ -25,6 +25,7 @@ import lombok.AllArgsConstructor;
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;
@@ -106,4 +107,13 @@ public class SinkRecord<T> implements Record<T> {
return null;
}
+ @Override
+ public Optional<Long> getEventTime() {
+ return sourceRecord.getEventTime();
+ }
+
+ @Override
+ public Optional<Message<T>> getMessage() {
+ return sourceRecord.getMessage();
+ }
}
