[BEAM-1928] Add Coder utilities for Proto conversions#2487
Conversation
|
R: @lukecwik |
| return toCustomCoder(coder); | ||
| } | ||
|
|
||
| private static RunnerApi.Coder toCustomCoder(Coder<?> coder) throws IOException { |
There was a problem hiding this comment.
I think it would be wise to just support component coders and known coder types upfront instead of migrating to it later.
|
Refer to this link for build results (access rights to CI server needed): |
Add Known Coders
|
Refer to this link for build results (access rights to CI server needed): |
| // TODO: standardize such things | ||
| public static final String CUSTOM_CODER_URN = "urn:beam:coders:javasdk:0.1"; | ||
|
|
||
| // The URNs for coders are shared across languages |
There was a problem hiding this comment.
coders are shared --> coders which are shared
| public class Coders { | ||
| private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); | ||
|
|
||
| // This URN says that the coder is just a UDF blob the indicated SDK understands |
There was a problem hiding this comment.
blob the indicated SDK --> blob this SDK
| import org.apache.beam.sdk.util.WindowedValue; | ||
| import org.apache.beam.sdk.util.WindowedValue.FullWindowedValueCoder; | ||
|
|
||
| /** Utilities for working with {@link Coder Coders}. */ |
There was a problem hiding this comment.
update comment:
Converts to and from Beam Runner API proto representations of {@link Coder Coders}.
|
Refer to this link for build results (access rights to CI server needed): |
Be sure to do all of the following to help us incorporate your contribution
quickly and easily:
[BEAM-<Jira issue #>] Description of pull requestmvn clean verify. (Even better, enableTravis-CI on your fork and ensure the whole test matrix passes).
<Jira issue #>in the title with the actual Jira issuenumber, if there is one.
Individual Contributor License Agreement.