beam-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mairbek Khadikov <mair...@google.com>
Subject SerializableCoder Structured Value
Date Mon, 27 Nov 2017 23:55:52 GMT
Hi all,

Currently SerializableCoder#consistentWithEquals returns false, which
contradicts it's own documentation "{@link SerializableCoder} does not
guarantee a deterministic encoding, as Java serialization may produce
different binary encodings for two equivalent objects".

In practice, it leads to failures in org.apache.beam.sdk.util.
MutationDetectors$CodedValueMutationDetector. For example, some libraries
cache hash values https://github.com/google/protobuf/pull/3939/files#diff-
24c442a23a43e041e4f50d324638fedbR142

I'm thinking about changing SerializableCoder#consistentWithEquals to
return true, so that the structural value would be the object itself
instead of it the serialized bytes. Thoughts?

WIP branch https://github.com/mairbek/beam/tree/ser

Sincerely,
Mairbek

-- 

Mairbek Khadikov |  Software Engineer |  mairbek@google.com

Mime
View raw message