Skip to content

[BEAM-2792] Translate basic coders through the Runner API#3746

Closed
robertwb wants to merge 4 commits intoapache:masterfrom
robertwb:runner-api-coders
Closed

[BEAM-2792] Translate basic coders through the Runner API#3746
robertwb wants to merge 4 commits intoapache:masterfrom
robertwb:runner-api-coders

Conversation

@robertwb
Copy link
Contributor

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a JIRA issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@robertwb
Copy link
Contributor Author

R: @tgroh

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 69.967% when pulling 19ef059 on robertwb:runner-api-coders into 9b175cc on apache:master.

return cls()


@Coder.register_urn(urns.PICKLED_CODER, google.protobuf.wrappers_pb2.BytesValue)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the update to payload, might this be 'None' instead of BytesValue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, though we may consider accepting "str" here.

@staticmethod
def from_runner_api(proto, context):
"""For internal use only; no backwards-compatibility guarantees.
def register_simple_urn(urn, cls):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Java name we use is "Structured" (formerly "Standard"); I prefer it to "simple", because it suggests something about the coder (it's not just defined by a blob of bytes)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed, though even ufuncs with payloads may be "structured" (e.g. the "standard" windowing fns).

@robertwb
Copy link
Contributor Author

Is "approved" equivalent to an LGTM?

def register_urn(cls, urn, parameter_type, fn=None):
"""Registeres a urn with a constructor.

For example, if 'beam:fn:foo' had paramter type FooPayload, one could
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"parameter"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


@classmethod
def register_urn(cls, urn, parameter_type, fn=None):
"""Registeres a urn with a constructor.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Registers"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@robertwb
Copy link
Contributor Author

Unrelated java setup failure. Jenkins: retest this please.

@tgroh
Copy link
Member

tgroh commented Aug 24, 2017

Yeah, approved and LGTM occupy the same "I think this can be submitted" space

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 69.962% when pulling f37f88e on robertwb:runner-api-coders into 9b175cc on apache:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 69.965% when pulling f37f88e on robertwb:runner-api-coders into 9b175cc on apache:master.

@asfgit asfgit closed this in f3de736 Aug 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants