[
https://issues.apache.org/jira/browse/TEZ-1390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14096795#comment-14096795
]
Siddharth Seth commented on TEZ-1390:
-------------------------------------
[~ozawa] - thanks for posting the patch.
- UserPayload.getPayload() - I think this needs to return a read only buffer,
and we should make that clear in the Javadocs. Two reasons for this. 1) We
don't want user code modifying the buffer directly. Typically changes to this
buffer, if they need to reflect in task payloads, will need to be made via
events so that Tez can keep track of the changes, for recovery and thread
safety. 2) It helps with avoiding byte copies since the underlying storage for
data over RPC will eventually be protobuf (task-am).
- We can use ByteString.asReadOnlyByteBuffer in DAGConverterUtils instead of
ByteByffer.wrap(byteString.toArray())
- The EntityDescriptor serde will need to change accordingly - since array()
cannot be accessed for read only buffers. I think the get(byte[]) method will
have to be used. That's inefficient at the moment - since we aren't on PB RPC
yet, but can be made far more efficient when we move over.
This patch also ends up highlighting some places where we need to convert
byte[] to ByteBuffer (TEZ-1194) - EdgeManagerPluginContext, and various
Configurers. I think we should do that as a separate jira, sot hat this can
through fast. There's way too many changes happening rightnow for patches to
stay current.
> Replace byte[] with ByteBuffer as the type of user payload in the API
> ---------------------------------------------------------------------
>
> Key: TEZ-1390
> URL: https://issues.apache.org/jira/browse/TEZ-1390
> Project: Apache Tez
> Issue Type: Improvement
> Reporter: Bikas Saha
> Assignee: Tsuyoshi OZAWA
> Priority: Blocker
> Attachments: TEZ-1390.1.patch, pig.payload.txt
>
>
> This is just and API change. Internally we can continue to use byte[] since
> thats a much bigger change.
> The translation from ByteBuffer to byte[] in the API layer should not have
> perf impact.
--
This message was sent by Atlassian JIRA
(v6.2#6252)