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

Vinayakumar B commented on HDFS-7889:
-------------------------------------

{quote}Moving newStreamForCreate to DFSClient: I suggest we also rename it as 
newDFSOuputStreamForCreate since DFSClient handles different types of streams.
Let's not have the not supported operation logic in 
DFSOutputStream#newStreamForAppend. Maybe we should also move it to 
DFSClient.{quote}
I think, moving out creation of {{DFSOutputStream}} to DFSClient is not needed. 
Since the {{DFSStripedOutputStream}} is a subclass of {{DFSOutputStream}} it 
would look good if it stays in {{DFSOutputStream}} itself and this 
{{DFSOutputStream#newStreamForCreate}} works as a factory method.
Just need to add the below checks in {{DFSOutputStream#newStreamForCreate}}
{code}+
+      final DFSOutputStream out;
+      if (stat.getStoragePolicy() == HdfsConstants.EC_STORAGE_POLICY_ID) {
+        out = new DFSStripedOutputStream(dfsClient, src, stat, flag, progress,
+            checksum, favoredNodes);
+      } else {
+        out = new DFSOutputStream(dfsClient, src, stat, flag, progress,
+            checksum, favoredNodes);
+      }{code}

Agree?

> Subclass DFSOutputStream to support writing striping layout files
> -----------------------------------------------------------------
>
>                 Key: HDFS-7889
>                 URL: https://issues.apache.org/jira/browse/HDFS-7889
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Li Bo
>            Assignee: Li Bo
>         Attachments: HDFS-7889-001.patch, HDFS-7889-002.patch, 
> HDFS-7889-003.patch, HDFS-7889-004.patch, HDFS-7889-005.patch, 
> HDFS-7889-006.patch
>
>
> After HDFS-7888, we can subclass  {{DFSOutputStream}} to support writing 
> striping layout files. 



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

Reply via email to