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

Jing Zhao commented on HADOOP-12060:
------------------------------------

Thanks for working on this, Kai! The patch looks good to me overall. Here are 
my comments:
# We need to have explicit checks for the following requirement in both the 
encode and decode APIs. Maybe you can put the check into the current 
{{checkParameters}} method.
{code}
+   * Note, for both inputs and outputs, no mixing of on-heap buffers and direct
+   * buffers are allowed.
{code}
# Maybe we can also use this change to improve the javadoc of the current APIs. 
Some APIs only list their parameters in the javadoc without explanation. And 
for API like decode maybe we can add more details about how to use it. E.g., 
for the input array, the API expect the parity bytes to be placed before the 
data bytes. Also for specific API implementation we should explicitly state if 
the given byte arrays or byte buffers may be modified by the API.
# For ByteBuffer#slice we usually first set new position and limit on the 
original bytebuffer then call slice. We can do the same in 
{{SlicedBufferAllocator#allocate}}. This means we may also need to update 
{{TestCoderBase#allocateOutputBuffer}}.

> Address some issues related to ByteBuffer type input/output buffers for raw 
> erasure coders
> ------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-12060
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12060
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: io
>            Reporter: Kai Zheng
>            Assignee: Kai Zheng
>         Attachments: HADOOP-12060-HDFS-7285-v1.patch
>
>
> In HDFS-8319 [~jingzhao] raised some issues about ByteBuffer type 
> input/output buffers for raw erasure coders:
> * Should support ByteBuffers originated from {{ByteBuffer#slice}} calls;
> * Should clearly spec in Javadoc that no mixing of on-heap buffers and direct 
> buffers are allowed, and with necessary checking codes ensuring the same type 
> of buffers are used.
> In HDFS-8319 patch by [~jingzhao] there are some good refactoring codes that 
> would be incorporated here.
> As discussed open this to address the issues separately.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to