[
https://issues.apache.org/jira/browse/TEZ-1390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14099810#comment-14099810
]
Tsuyoshi OZAWA edited comment on TEZ-1390 at 8/16/14 10:06 PM:
---------------------------------------------------------------
ProtoConverters#convert*EventFromProto can use
proto.getUserPayload().asReadOnlyByteBuffer(). If the cost of copy is high, we
should make it zero-copy. IMO, we should benchmark before and after the change.
Do you know good benchmark suite to do this?
{code}
public static DataMovementEvent convertDataMovementEventFromProto(
EventProtos.DataMovementEventProto proto) {
return new DataMovementEvent(proto.getSourceIndex(),
proto.getTargetIndex(),
proto.getVersion(),
proto.getUserPayload() != null ?
proto.getUserPayload().toByteArray() : null);
}
{code}
was (Author: ozawa):
ProtoConverters#convert*EventFromProto can use
proto.getUserPayload().asReadOnlyByteBuffer. If the cost of copy is high, we
should make it zero-copy. IMO, we should benchmark before and after the change.
Do you know good benchmark suite to do this?
{code}
public static DataMovementEvent convertDataMovementEventFromProto(
EventProtos.DataMovementEventProto proto) {
return new DataMovementEvent(proto.getSourceIndex(),
proto.getTargetIndex(),
proto.getVersion(),
proto.getUserPayload() != null ?
proto.getUserPayload().toByteArray() : null);
}
{code}
> 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, TEZ-1390.2.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)