Serialization 在flink(scala)中使用kryo在特定类型上注册protobuf序列化程序时出现问题
我有一个代码片段,如下所示:Serialization 在flink(scala)中使用kryo在特定类型上注册protobuf序列化程序时出现问题,serialization,protocol-buffers,apache-flink,kryo,Serialization,Protocol Buffers,Apache Flink,Kryo,我有一个代码片段,如下所示: env.getConfig.registerTypeWithKryoSerializer(classOf[EventMeta], classOf[ProtobufSerializer[EventMeta]]) 其中,EventMeta是scalaPB根据proto消息生成的case类。我们使用flink 1.10.1和scala 2.11 我试图翻译文档中的Java代码:env.getConfig.registerTypeWithKryoSerializer(Ev
env.getConfig.registerTypeWithKryoSerializer(classOf[EventMeta], classOf[ProtobufSerializer[EventMeta]])
其中,EventMeta
是scalaPB根据proto消息生成的case类。我们使用flink 1.10.1和scala 2.11
我试图翻译文档中的Java代码:env.getConfig.registerTypeWithKryoSerializer(EventMeta.class,ProtobufSerializer.class)
,但编译器一直告诉我:
overloaded method value registerTypeWithKryoSerializer with alternatives:
[error] (x$1: Class[_],x$2: Class[_ <: com.esotericsoftware.kryo.Serializer[_]])Unit <and>
[error] [T <: com.esotericsoftware.kryo.Serializer[_] with java.io.Serializable](x$1: Class[_], x$2: T)Unit
[error] cannot be applied to (Class[com.here.lanes.laneroadreference.derivation.statefun.state.EventMeta.EventMeta], Class[org.apache.flink.statefun.flink.common.protobuf.ProtobufSerializer[com.here.lanes.laneroadreference.derivation.statefun.state.EventMeta.EventMeta]])
[error] env.getConfig.registerTypeWithKryoSerializer(classOf[EventMeta], classOf[ProtobufSerializer[EventMeta]])
重载方法值寄存器类型WithKryoserializer和可选项:
[错误](x$1:Class[ux],x$2:Class[_