[ https://issues.apache.org/jira/browse/BEAM-2174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15997756#comment-15997756 ]
ASF GitHub Bot commented on BEAM-2174: -------------------------------------- GitHub user lukecwik opened a pull request: https://github.com/apache/beam/pull/2910 [BEAM-2174] Update CoderRegistry to allow creating coders through CoderFactory for a wider range of types Be sure to do all of the following to help us incorporate your contribution quickly and easily: - [x] Make sure the PR title is formatted like: `[BEAM-<Jira issue #>] Description of pull request` - [x] Make sure tests pass via `mvn clean verify`. - [x] Replace `<Jira issue #>` in the title with the actual Jira issue number, if there is one. - [x] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). --- This removes getInstanceComponents and hard codes the inference for commonly "known" types into Create removing the additionally complexity that was brought along with it. Also: * @DefaultCoder to become a CoderFactory * Created a ProtoCoderFactory which delegates to the ProtoCoder for all Message types * Created a SerializableCoderFactory which delegates to the SerializableCoder for all Serializable types * Created a WritableCoderFactory which delegates to the Hadoop WritableCoder for all Hadoop Writable types * Renamed getDefaultCoder to getCoder on CoderRegistry You can merge this pull request into a Git repository by running: $ git pull https://github.com/lukecwik/incubator-beam coder_registrar Alternatively you can review and apply these changes as the patch at: https://github.com/apache/beam/pull/2910.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 #2910 ---- commit 917cc45411c602143450e109390b6a7750fc2f06 Author: Luke Cwik <lc...@google.com> Date: 2017-05-05T02:55:47Z [BEAM-2174] Update CoderRegistry to allow creating coders through CoderFactory for a wider range of types ---- > Allow coder factories to create Coders for a wider range of types > ----------------------------------------------------------------- > > Key: BEAM-2174 > URL: https://issues.apache.org/jira/browse/BEAM-2174 > Project: Beam > Issue Type: Improvement > Components: sdk-java-core > Reporter: Luke Cwik > Assignee: Luke Cwik > Fix For: First stable release > > > By allowing the CoderFactory to see they type it can look at annotations on > the type allowing: > * @DefaultCoder to become a CoderFactory > * Creating a ProtoCoderFactory which delegates to the ProtoCoder for all > Message types > * Creating a SerializableCoderFactory which delegates to the > SerializableCoder for all Serializable types > * Creating a WritableCoderFactory which delegates to the Hadoop WritableCoder > for all Hadoop Writable types > This requires plumbing through TypeDescriptor as the primary method of > looking up coders within the CoderRegistry > This also removes the concept of fallback coder providers since every coder > factory is treated as a fallback. -- This message was sent by Atlassian JIRA (v6.3.15#6346)