lhotari commented on a change in pull request #9448:
URL: https://github.com/apache/pulsar/pull/9448#discussion_r586187210
##########
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());
Review comment:
Wouldn't it be cleaner to simply handle what is currently supported? One
reason could be to address the compiler warnings related to unchecked or unsafe
operations without suppressing the compiler warnings. If compiler warnings are
ignored, it probably doesn't make a difference.
----------------------------------------------------------------
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]