[ 
https://issues.apache.org/jira/browse/TEZ-1194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14085424#comment-14085424
 ] 

Bikas Saha commented on TEZ-1194:
---------------------------------

bq. Should DagTypeConverter#convert*DAGPlan check the versions?
Is there anything specific that we need to check? In the minimum, we need to 
serialize the version and then de-serialize it later on - whatever that value 
may be. To avoid copying buffers we may have to add the version in 
TezEntityDescriptor proto object directly instead of creating a TezUserPayload 
proto object (like we have already discussed in the initial TezUserPayload 
jira).

bq. I prefer to use if(userPayload.hasPayload()), and payload in the 
user-facing APIs should be not Nullable. Do you agree with this? If the answer 
is positive, should we do this on another JIRA?
I agree hasPayload() is a better choice. Not sure about getPayload() not being 
Nullable. It is expected to Nullable. That is the main reason why we have the 
hasPayload() method or else we do not need that method. hasPayload() is a 
convenient implementation so that the users dont have to do it.  Protobuf 
follows the same pattern. Its seem simple enough to do in this jira. The code 
is already added in this jira. We just need to wrap it around hasUserPayload() 
method. However, if you feel this should go to a different jira then please 
feel free to do so.

Thanks for iterating quickly on this!

> Make TezUserPayload user facing for payload specification and change to 
> ByteBuffer
> ----------------------------------------------------------------------------------
>
>                 Key: TEZ-1194
>                 URL: https://issues.apache.org/jira/browse/TEZ-1194
>             Project: Apache Tez
>          Issue Type: Sub-task
>            Reporter: Bikas Saha
>            Assignee: Tsuyoshi OZAWA
>            Priority: Blocker
>         Attachments: TEZ-1194.1.patch, TEZ-1194.2.patch
>
>
> 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)

Reply via email to