使用DirectRunner测试数据流,并获得大量verifyUnmodifiedThrowingCheckedExceptions [英] Test Dataflow with DirectRunner and got lots of verifyUnmodifiedThrowingCheckedExceptions

查看:81
本文介绍了使用DirectRunner测试数据流,并获得大量verifyUnmodifiedThrowingCheckedExceptions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mac上使用DirectRunner测试数据流管道,并收到很多类似这样的警告"消息,也许我知道如何摆脱它们,因为它太多了,我什至看不到调试消息./p>

谢谢

Apr 05, 2018 2:14:48 PM org.apache.beam.sdk.util.MutationDetectors$CodedValueMutationDetector verifyUnmodifiedThrowingCheckedExceptions
WARNING: Coder of type class org.apache.beam.sdk.coders.SerializableCoder has a #structuralValue method which does not return true when the encoding of the elements is equal. 
Element com.apigee.analytics.platform.core.service.schema.EventRow@4a590d0b

解决方案

SerializableCoder 本文详细介绍了自定义编码器.

I was testing my Dataflow pipeline using DirectRunner from my Mac and got lots of "WARNING" message like this, may I know how to get rid of them because it is too much that I can not even see my debug message.

Thanks

Apr 05, 2018 2:14:48 PM org.apache.beam.sdk.util.MutationDetectors$CodedValueMutationDetector verifyUnmodifiedThrowingCheckedExceptions
WARNING: Coder of type class org.apache.beam.sdk.coders.SerializableCoder has a #structuralValue method which does not return true when the encoding of the elements is equal. 
Element com.apigee.analytics.platform.core.service.schema.EventRow@4a590d0b

解决方案

It may help to ensure that all serialized values have proper equals() implementations since SerializableCoder expects them:

The structural value of the object is the object itself. The SerializableCoder should be only used for objects with a proper Object#equals implementation.

You can implement your own Coder for your POJOs. SerializableCoder does not guarantee a deterministic encoding according to docs:

SerializableCoder does not guarantee a deterministic encoding, as Java serialization may produce different binary encodings for two equivalent objects.

This article explains custom coders in details.

这篇关于使用DirectRunner测试数据流,并获得大量verifyUnmodifiedThrowingCheckedExceptions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆