You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Yi Liu (JIRA)" <ji...@apache.org> on 2014/06/02 17:56:02 UTC
[jira] [Commented] (HDFS-6392) Wire crypto streams for encrypted
files in DFSClient
[ https://issues.apache.org/jira/browse/HDFS-6392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14015482#comment-14015482 ]
Yi Liu commented on HDFS-6392:
------------------------------
Thanks Charles for the patch, I found most of code in this patch has overlap with HDFS-6391.
{code}
public OutputStream getWrappedStream() {
- return wrappedStream;
+ if (wrappedStream instanceof CryptoOutputStream) {
+ return ((CryptoOutputStream) wrappedStream).getWrappedStream();
+ } else {
+ return wrappedStream;
+ }
}
{code}
I see some existing code uses {{getWrappedStream}} to get the wrapped output stream, then invoke {{#hflush/#hsync}}, for example: in {{HdfsDataOutputStream}} {code}((DFSOutputStream) getWrappedStream()).hsync(syncFlags);{code}
So we can’t do {code} return ((CryptoOutputStream) wrappedStream).getWrappedStream();{code}, otherwise will break {{#hflush/#hsync}} functionality; instead maybe return the {{wrappedStream}} directly. Furthermore, in {{HdfsDataOutputStream}} it does {{((DFSOutputStream) getWrappedStream())}}, we should also consider this.
> Wire crypto streams for encrypted files in DFSClient
> -----------------------------------------------------
>
> Key: HDFS-6392
> URL: https://issues.apache.org/jira/browse/HDFS-6392
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: namenode, security
> Reporter: Alejandro Abdelnur
> Assignee: Charles Lamb
> Attachments: HDFS-6392.1.patch, HDFS-6392.2.patch
>
>
> When the DFS client gets a key material and IV for a file being opened/created, it should wrap the stream with a crypto stream initialized with the key material and IV.
--
This message was sent by Atlassian JIRA
(v6.2#6252)