[ https://issues.apache.org/jira/browse/HDFS-7410?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14223869#comment-14223869 ]
Colin Patrick McCabe commented on HDFS-7410: -------------------------------------------- [~umamaheswararao]: Good point. But I think in practice, duplicating every flag we want for both create and append would be a major pain. I think we can address this concern by checking the flags and throwing an exception if {{CreateFlags}} not supported in append are passed into append. For example, append can't support passing in {{CreateFlag.CREATE}} or {{CreateFlag.OVERWRITE}}. But it can support {{CreateFlag.SYNC_BLOCK}}. Another argument in favor of using {{CreateFlag}} for append is that some {{FileContext}} code paths allow create to become an append, if {{CreateFlag.APPEND}} is specified! For example, check {{DFSClient#primitiveCreate}}... it calls {{primitiveAppend}} if {{CreateFlags.APPEND}} is present.... This probably needs to be better documented, and possibly harmonized between FileSystem and FileContext. Maybe another path we could take here is just to make that work for FileSystem (i.e. have our create calls check for CreateFlags.APPEND and turn the operation into an append if that is found)... this would avoid having adding yet more APIs, and would make this more consistent with FileContext. > Support CreateFlags with append() to support hsync() for appending streams > -------------------------------------------------------------------------- > > Key: HDFS-7410 > URL: https://issues.apache.org/jira/browse/HDFS-7410 > Project: Hadoop HDFS > Issue Type: Improvement > Components: hdfs-client > Reporter: Vinayakumar B > Assignee: Vinayakumar B > Attachments: HDFS-7410-001.patch, HDFS-7410-002.patch > > > Current FileSystem APIs include CreateFlag only for the create() api, and > some of these (SYNC_BLOCK) are for only client side and will not be stored in > metadata of the file. So append() operation will not know about these flags. > It would be Good to support these features for append too. > Compatibility: One more overloaded append API needs to be added to support > the flags keeping the current API as is. -- This message was sent by Atlassian JIRA (v6.3.4#6332)