[ https://issues.apache.org/jira/browse/PIG-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13765473#comment-13765473 ]
Rohini Palaniswamy commented on PIG-3255: ----------------------------------------- Came across a good article - http://haacked.com/archive/2008/02/20/versioning-issues-with-abstract-base-classes-and-interfaces.aspx. Similar approach but cleaner to code. Idea is to create StreamToPigBase and PigToStreamBase abstract classes that implement StreamToPig and PigToStream interfaces respectively and add the new method there. In the InputHandler and OutputHandler check if it is an instanceof StreamToPigBase, then call new method else call the old interface one. With this don't have to check if v1 or v2 interface is implemented during reflection and change Input/OutputHandler and its implementations to set two different serializer/de-serializers. Will still go ahead and deprecate the interface so that it can be removed in the next release. > 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, PIG-3255-3.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