[
https://issues.apache.org/jira/browse/HADOOP-10603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Yi Liu updated HADOOP-10603:
----------------------------
Attachment: HADOOP-10603.9.patch
Hi [~andrew.wang], I update the patch and merge test cases from HADOOP-10617.
The test cases cover all functionality of crypto streams.
The new patch address all your and Charles’ comments, excluding following items
(Not get enough time :-)), if I missed some, please correct me.
* Test for {{calculateIV}}
* Test for {{so I'd prefer to see a Precondition check and inBuf.remaining() ==
padding). Test case would be nice if I'm right about this.}}
* An ASCII art diagram showing how padding and the stream offset works would
also be nice. Javadoc for the special padding handling would be nice.
* {quote}
We need to return -1 on EOF for zero-byte reads, see HDFS-5762.
{quote}
I see I handle this already? If the underlying stream return -1, we will return
-1. I will add test case for this.
* Comment in skip about why we subtract then add outBuffer.remaining() would be
good.
Please help to review. The new patch also includes some
interfaces/implementation refining. Meanwhile, I will update for above items in
next patch together with the new comments if you have. Thanks.
> Crypto input and output streams implementing Hadoop stream interfaces
> ---------------------------------------------------------------------
>
> Key: HADOOP-10603
> URL: https://issues.apache.org/jira/browse/HADOOP-10603
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: security
> Affects Versions: fs-encryption (HADOOP-10150 and HDFS-6134)
> Reporter: Alejandro Abdelnur
> Assignee: Yi Liu
> Fix For: fs-encryption (HADOOP-10150 and HDFS-6134)
>
> Attachments: CryptoInputStream.java, CryptoOutputStream.java,
> HADOOP-10603.1.patch, HADOOP-10603.2.patch, HADOOP-10603.3.patch,
> HADOOP-10603.4.patch, HADOOP-10603.5.patch, HADOOP-10603.6.patch,
> HADOOP-10603.7.patch, HADOOP-10603.8.patch, HADOOP-10603.9.patch,
> HADOOP-10603.patch
>
>
> A common set of Crypto Input/Output streams. They would be used by
> CryptoFileSystem, HDFS encryption, MapReduce intermediate data and spills.
> Note we cannot use the JDK Cipher Input/Output streams directly because we
> need to support the additional interfaces that the Hadoop FileSystem streams
> implement (Seekable, PositionedReadable, ByteBufferReadable,
> HasFileDescriptor, CanSetDropBehind, CanSetReadahead,
> HasEnhancedByteBufferAccess, Syncable, CanSetDropBehind).
--
This message was sent by Atlassian JIRA
(v6.2#6252)