当前位置:   article > 正文

Flink序列化Java集合:List和Map的异常处理

generic types have been disabled in the executionconfig and type java.util.l

我的Flink pipeline 当前使用的是一个Pojo,它包含一些列表和 map(字符串),如下所示

public class MyPojo {

private List myList = new ArrayList<>();

private OtherPojo otherPojo = new OtherPojo();

// getters + setters...

}

public class OtherPojo {

private Map myMap = new HashMap<>();

// getters + setters...

}

出于性能原因,我想绕过Kryo序列化,因此我使用环境设置配置().disableGenericTypes();如Flink文档中所述。

现在, Flink抱怨这些名单:

Exception in thread "main" java.lang.UnsupportedOperationException: Generic types have been disabled in the ExecutionConfig and type java.util.List is treated as a generic type.

at org.apache.flink.api.java.typeutils.GenericTypeInfo.createSerializer(GenericTypeInfo.java:86)

at org.apache.flink.api.java.typeutils.PojoTypeInfo.createPojoSerializer(PojoTypeInfo.java:319)</

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/煮酒与君饮/article/detail/767642
推荐阅读
相关标签
  

闽ICP备14008679号