You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Lei (Eddy) Xu (JIRA)" <ji...@apache.org> on 2018/02/15 19:59:00 UTC

[jira] [Comment Edited] (HADOOP-14396) Add builder interface to FileContext

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

Lei (Eddy) Xu edited comment on HADOOP-14396 at 2/15/18 7:58 PM:
-----------------------------------------------------------------

Updated the patch to address reviews:

bq. FSDataOutputStreamBuilder line 79: fs = null when built from file context. Later in getFS() there is Preconditions.checkNotNull(fs); So, the expectation is no one should be calling getFS() when it is constructed from FileContext ?

If using {{FileContext}}, the fs field is not used.  Yes, no one should call {{getFS()}} if it is constructed from FileContext. 

bq.  Why do we need an additional "donotCreateParent" option? 

It is not necessary indeed. Removed in the new patch.

bq. Can you please extend the test with few build() options like recursive / progress added ?

Done

bq. There is an annotation @Nonnull FileContext fc and also later Preconditions.checkNotNull(fc); Is the later needed in the constructor?

My understand is that @Nonnull is for compile time check, but Precondition is for runtime check. Giving this is a public API, it prevents other call hdfs client as library. 

The checkstyle and warnings were deleted from Yetus. Will fix them if any in the new build.


was (Author: eddyxu):
Updated the patch to address reviews:

bq. FSDataOutputStreamBuilder line 79: fs = null when built from file context. Later in getFS() there is Preconditions.checkNotNull(fs); So, the expectation is no one should be calling getFS() when it is constructed from FileContext ?

If using {{FileContext}}, the fs field is not used.  Yes, no one should call {{getFS()}} if it is constructed from FileContext. 

bq.  Why do we need an additional "donotCreateParent" option? 

It is not necessary indeed. Removed in the new patch.

bq. Can you please extend the test with few build() options like recursive / progress added ?

Done

bq. There is an annotation @Nonnull FileContext fc and also later Preconditions.checkNotNull(fc); Is the later needed in the constructor?

My understand is that @Nonnull is for compile time check, but Precondition is for runtime check. Giving this is a public API, it prevents other call hdfs client as library. 

> Add builder interface to FileContext
> ------------------------------------
>
>                 Key: HADOOP-14396
>                 URL: https://issues.apache.org/jira/browse/HADOOP-14396
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs
>    Affects Versions: 2.9.0, 3.0.0-alpha3
>            Reporter: Lei (Eddy) Xu
>            Assignee: Lei (Eddy) Xu
>            Priority: Major
>         Attachments: HADOOP-14396.00.patch, HADOOP-14396.01.patch
>
>
> Add builder interface for {{FileContext#create}} and {{FileContext#append}}.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org