我创建了一个自定义时间提取器类,如此
class MyTimestampExtractor extends TimestampExtractor {
override def extract(record: ConsumerRecord[Object, Object], previousTimestamp: java.lang.Long): java.lang.Long = {
record.value() match {
}
}
}
但是这会导致编译错误
method extract overrides nothing.
Note: the super classes of class MyTimestampExtractor contain the following, non final members named extract:
def extract(x$1: org.apache.kafka.clients.consumer.ConsumerRecord[Object,Object],x$2: Long): Long
override def extract(record: ConsumerRecord[Object, Object], previousTimestamp: java.lang.Long): java.lang.Long = {
我有一个Object和Long的import语句,如此
import java.lang.{Object, Long}
我尝试过的事情
似乎对编译器没有任何作用。