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

Rohini Palaniswamy commented on PIG-3255:
-----------------------------------------

If the interface change is ok, then thinking of changing even the 
PigToStream.java interface 

public byte[] serialize(Tuple t) throws IOException;

to 

public DataBuffer serialize(Tuple t) throws IOException;
 
 where DataBuffer will be same as 
http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/DataOutputBuffer.java?revision=1306187&view=markup

Don't want to use DataOutputBuffer itself as it is marked 
@InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"})
@InterfaceStability.Unstable

This will get rid of one more byte array copy. Thoughts ? 

                
> Avoid extra byte array copy in streaming deserialize
> ----------------------------------------------------
>
>                 Key: PIG-3255
>                 URL: https://issues.apache.org/jira/browse/PIG-3255
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Rohini Palaniswamy
>            Assignee: Rohini Palaniswamy
>             Fix For: 0.12
>
>         Attachments: PIG-3255-1.patch, PIG-3255-2.patch
>
>
> PigStreaming.java:
>  public Tuple deserialize(byte[] bytes) throws IOException {
>         Text val = new Text(bytes);  
>         return StorageUtil.textToTuple(val, fieldDel);
>     }
> Should remove new Text(bytes) copy and construct the tuple directly from the 
> bytes

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to