[
https://issues.apache.org/jira/browse/TEZ-1194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14029607#comment-14029607
]
Siddharth Seth commented on TEZ-1194:
-------------------------------------
Is type safety really a concern here. The userpayload is going to be some kind
of a byte payload (either byte[], or ideally a ByteBuffer).
bq. Once a layer of indirection is in place then it makes way for many things.
Right?
Examples ? What kind of helper APIs ?
The protobuf message example I provided earlier, has one advantage of users not
having to explicitly serialize since that's something Tez could manage via the
PB APIs. However, it has the disadvantage when providing a view back to the
user - requiring an explicit cast, and potentially deserializing when not
required.
The API in it's current form is fairly simple and easy to understand - users
provide a byte view, and get exactly this back.
> Make TezUserPayload user facing for payload specification
> ---------------------------------------------------------
>
> Key: TEZ-1194
> URL: https://issues.apache.org/jira/browse/TEZ-1194
> Project: Apache Tez
> Issue Type: Sub-task
> Reporter: Bikas Saha
>
> Now that we have TezUserPayload being used internally to represent user
> payload it may be useful to make it user facing on the API for specifying
> payloads. Advantages
> 1) Clear code for the user instead of having untyped byte[] everywhere
> 2) Lets us internally evolve the representation of user payload and make it
> more efficient without having to break APIs. We can start with
> TezUserPayload(byte[]) and then move on to TezUserPayload(ByteBuffer) and so
> on while maintaining backwards compatibility without needing to add new
> methods. Old code can be translated within TezUserPayload while user migrates
> the code.
--
This message was sent by Atlassian JIRA
(v6.2#6252)