Package org.apache.hadoop.fs
Interface Options.CreateFileOptionKeys
- Enclosing class:
- Options
@Public
@Evolving
public static interface Options.CreateFileOptionKeys
The standard
createFile() options.
If an option is not supported during file creation and it is considered part of a commit protocol, then, when supplied in a must() option, it MUST be rejected.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringcreateFile()option to write a file in the close() operation iff there is nothing at the destination.static final StringOverwrite a file only if there is an Etag match.static final StringString to define the content filetype.static final StringA flag which requires the filesystem to create files/objects in close(), rather than create/createFile.
-
Field Details
-
FS_OPTION_CREATE_CONDITIONAL_OVERWRITE
createFile()option to write a file in the close() operation iff there is nothing at the destination. this is the equivalent ofcreate(path, overwrite=true)except that the existence check is postponed to the end of the write.Value "fs.option.create.conditional.overwrite".
This can be set in the builder.
- It is for object stores stores which only upload/manifest files at the end of the stream write.
- Streams which support it SHALL not manifest any object to the destination path until close()
- It MUST be declared as a stream capability in streams for which this overwrite is enabled.
- It MUST be exported as a path capability for all stores where the feature is available and enabled
- If passed to a filesystem as a
must()parameter where the option value istrue, and it is supported/enabled, the FS SHALL omit all overwrite checks increate, including for the existence of an object or a directory underneath. Instead, duringclose()the object will only be manifest at the target path if there is no object at the destination. - The existence check and object creation SHALL be atomic.
- If passed to a filesystem as a
must()parameter where the option value istrue, and the FS does not recognise the feature, or it is recognized but disabled on this FS instance, the filesystem SHALL reject the request. - If passed to a filesystem as a
opt()parameter where the option value istrue, the filesystem MAY ignore the request, or it MAY enable the feature. Any filesystem which does not support the feature, including from older releases, SHALL ignore it.
- See Also:
-
FS_OPTION_CREATE_CONDITIONAL_OVERWRITE_ETAG
Overwrite a file only if there is an Etag match. This option takes a string, Value "fs.option.create.conditional.overwrite.etag".This is similar to
FS_OPTION_CREATE_CONDITIONAL_OVERWRITE.- If supported and enabled, it SHALL be declared as a capability of the filesystem
- If supported and enabled, it SHALL be declared as a capability of the stream
- The string passed as the value SHALL be the etag value as returned by
EtagSource.getEtag() - This value MUST NOT be empty
- If passed to a filesystem which supports it, then when the file is created, the store SHALL check for the existence of a file/object at the destination path.
- If there is no object there, the operation SHALL be rejected by raising
either a
org.apache.hadoop.fs.FileAlreadyExistsExceptionexception, or ajava.nio.file.FileAlreadyExistsException - If there is an object there, its Etag SHALL be compared to the value passed here.
- If there is no match, the operation SHALL be rejected by raising
either a
org.apache.hadoop.fs.FileAlreadyExistsExceptionexception, or ajava.nio.file.FileAlreadyExistsException - If the etag does match, the file SHALL be created.
- The check and create SHALL be atomic
- The check and create MAY be at the end of the write, in
close(), or it MAY be in thecreate()operation. That is: some stores MAY perform the check early - If supported and enabled, stores MAY check for the existence of subdirectories; this behavior is implementation-specific.
- See Also:
-
FS_OPTION_CREATE_IN_CLOSE
A flag which requires the filesystem to create files/objects in close(), rather than create/createFile.Object stores with this behavior should also export it as a path capability. Value "fs.option.create.in.close".
- See Also:
-
FS_OPTION_CREATE_CONTENT_TYPE
String to define the content filetype. Value "fs.option.create.content.type".- See Also:
-