[
https://issues.apache.org/jira/browse/BEAM-626?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15481574#comment-15481574
]
ASF GitHub Bot commented on BEAM-626:
-------------------------------------
GitHub user aviemzur opened a pull request:
https://github.com/apache/incubator-beam/pull/941
[BEAM-626] Changes in AvroCoder serialization so it can serialize in Kryo
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
- [ ] Make sure the PR title is formatted like:
`[BEAM-<Jira issue #>] Description of pull request`
- [ ] Make sure tests pass via `mvn clean verify`. (Even better, enable
Travis-CI on your fork and ensure the whole test matrix passes).
- [ ] Replace `<Jira issue #>` in the title with the actual Jira issue
number, if there is one.
- [ ] If this contribution is large, please file an Apache
[Individual Contributor License
Agreement](https://www.apache.org/licenses/icla.txt).
---
Changes in AvroCoder serialization so it can serialize in Kryo.
Changed writeReplace and readResolve to lazy initialized members.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aviemzur/incubator-beam
avro-coder-serialization-changes
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-beam/pull/941.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #941
----
commit e83658fd6a394b90e8b46b3e61d879e56ee7a767
Author: Aviem Zur <[email protected]>
Date: 2016-09-08T08:21:41Z
Changes in AvroCoder serialization so it can serialize in Kryo
----
> AvroCoder not deserializing correctly in Kryo
> ---------------------------------------------
>
> Key: BEAM-626
> URL: https://issues.apache.org/jira/browse/BEAM-626
> Project: Beam
> Issue Type: Bug
> Components: sdk-java-core
> Reporter: Aviem Zur
> Assignee: Davor Bonaci
> Priority: Minor
>
> Unlike with Java serialization, when deserializing AvroCoder using Kryo, the
> resulting AvroCoder is missing all of its transient fields.
> The reason it works with Java serialization is because of the usage of
> writeReplace and readResolve, which Kryo does not adhere to.
> In ProtoCoder for example there are also unserializable members, the way it
> is solved there is lazy initializing these members via their getters, so they
> are initialized in the deserialized object on first call to the member.
> It seems AvroCoder is the only class in Beam to use writeReplace convention.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)