lhotari commented on a change in pull request #9448:
URL: https://github.com/apache/pulsar/pull/9448#discussion_r585525313
##########
File path:
pulsar-io/kafka/src/main/java/org/apache/pulsar/io/kafka/KafkaAbstractSource.java
##########
@@ -151,18 +153,32 @@ public void start() {
runnerThread.start();
}
- public abstract V extractValue(ConsumerRecord<String, byte[]> record);
+ public Object extractValue(ConsumerRecord<Object, Object> consumerRecord) {
+ return consumerRecord.value();
+ }
+ public Optional<String> extractKey(ConsumerRecord<Object, Object>
consumerRecord) {
+ // we are currently supporting only String keys
+ return Optional.ofNullable((String) consumerRecord.key());
+ }
+
+ public abstract Schema<V> extractSchema(ConsumerRecord<Object, Object>
consumerRecord);
+
+ @Slf4j
static private class KafkaRecord<V> implements Record<V> {
Review comment:
(see previous comment about possibly removing the type parameter from
KafkaRecord class if it's always Object)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]