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

stack commented on HDFS-14483:
------------------------------

Test failures seem related, no?

nit: Was expecting ByteBufferPositionedReadable to be a sub-interface of 
ByteBufferReadable/PositionedReadable. Probably fine as is but mildly 
'surprising'.

Comparing the BB-based decrypt to the byte[] version, this confuses me:

        buf.limit(start + len + Math.min(n - len, localInBuffer.remaining()));

In the byte[] version, its len - n vs n - len figuring how much to decrypt.  I 
see the byte[] decrypt loop is n < length vs the bb decrypt which is len < n... 
so I think its fine but take a look please.

Should these resets be in the finally block just below?

425               buf.position(start + len);
426               buf.limit(limit);

Nice javadoc in ByteBufferPositionedReadable

Appreciate the improvement in testPositionedRead

nit: more permutations in testPositionedReadWithByteBuffer would be 
nice-to-have -- though the testByteBufferPread addition is good. Maybe a 
follow-on? Could test more edge cases... a failed read or a read that does not 
fill the read request amount? The positionedReadCheckWithByteBuffer is nice.

Nice addition of the strncmp check in the test_libhdfs_ops.c file and bulking 
up of the pread tests.

Yeah, skip the re-formatting of unrelated code (especially when adds mistake as 
in '916             method = "open";')... which adds an offset.

Nice comments added to c function names.

Patch looks great.





> Backport HDFS-3246 ByteBuffer pread interface to branch-2.8.x
> -------------------------------------------------------------
>
>                 Key: HDFS-14483
>                 URL: https://issues.apache.org/jira/browse/HDFS-14483
>             Project: Hadoop HDFS
>          Issue Type: Task
>            Reporter: Zheng Hu
>            Assignee: Lisheng Sun
>            Priority: Major
>         Attachments: HDFS-14483.branch-2.8.v1.patch
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to