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

Bikas Saha edited comment on TEZ-1194 at 7/23/14 10:02 PM:
-----------------------------------------------------------

Why are the hashCode and equals needed?

Lets keep public TezUserPayload(byte[] payload) and set the version to 0 for 
the common case simplicity.

This patch should also replace all API's that accept a payload via byte[] to 
now accept payload via TezUserPayload. E.g. 
TezEntityDescriptor.setUserPayload(byte[]). Should become 
TezEntityDescriptor.setUserPayload(TezUsedPayload). Similarly all instances of 
byte[] getUserPayload() should become TezUserPayload getUserPayload().

Once this version of the patch is ready, we can add TezUserPayload(ByteBuffer) 
and decide whether we want to keep TezUserPayload(byte[]) or not.


was (Author: bikassaha):
Why are the hashCode and equals needed?

Lets keep public TezUserPayload(byte[] payload) and set the version to 0 for 
the common case simplicity.

This patch should also replace all API's that accept a payload via byte[] to 
now accept payload via TezUserPayload. E.g. 
TezEntityDescriptor.setUserPayload(byte[]). Should become 
TezEntityDescriptor.setUserPayload(TezUsedPayload).

Once this version of the patch is ready, we can add TezUserPayload(ByteBuffer) 
and decide whether we want to keep TezUserPayload(byte[]) or not.

> 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
>         Attachments: TEZ-1194.1.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