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

Andrew Wang commented on HDFS-11170:
------------------------------------

Thanks for working on this [~zhouwei], looks great overall :) A few review 
comments:

* Since {{path}} is a required parameter, it should be passed as an argument to 
the CreateBuilder constructor. This way we don't need to check it later.
* It looks like {{overwrite}} is sort of deprecated in favor of {{flags}}, so I 
think we should only support {{flags}}.
* What do you think about having a factory method in FileSystem to get the 
FS-specific builder? It's nice since then users can have generic code for the 
common CreateBuilder args, then test if it's a DFSCreateBuilder to 
conditionally set additional parameters. This way we don't need to pass in the 
FileSystem as a CreateBuilder argument too, it can set the correct defaults in 
the constructor.
* Would prefer we don't change the flags semantics to take null, the builder 
can set an empty EnumSet as appropriate.
* In FileSystem#doCreate and DFS#doCreate, I'd prefer we always call the same 
{{create}} method with the defaults filled in appropriately. I think this works 
if we stop supporting {{overwrite}}, and add a new private {{DFS#create}} that 
takes {{checksumOpt}} and {{flags}} along with {{favoredNodes}} is set.

> Add create API in filesystem public class to support assign parameter through 
> builder
> -------------------------------------------------------------------------------------
>
>                 Key: HDFS-11170
>                 URL: https://issues.apache.org/jira/browse/HDFS-11170
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: SammiChen
>            Assignee: Wei Zhou
>         Attachments: HDFS-11170-00.patch
>
>
> FileSystem class supports multiple create functions to help user create file. 
> Some create functions has many parameters, it's hard for user to exactly 
> remember these parameters and their orders. This task is to add builder  
> based create functions to help user more easily create file. 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to