java.io.Serializable, java.lang.Comparable<CreateFlag>@Public @Evolving public enum CreateFlag extends java.lang.Enum<CreateFlag>
EnumSet.of(CreateFlag.CREATE, CreateFlag.APPEND)
Use the CreateFlag as follows:
Syncable.hsync() should be called after each write,
if true synchronous behavior is required.HadoopIllegalArgumentException:
| Enum Constant | Description |
|---|---|
APPEND |
Append to a file.
|
CREATE |
Create a file.
|
IGNORE_CLIENT_LOCALITY |
Advise that the first block replica NOT take into account DataNode
locality.
|
LAZY_PERSIST |
Create the block on transient storage (RAM) if available.
|
NEW_BLOCK |
Append data to a new block instead of the end of the last partial block.
|
NO_LOCAL_RACK |
Advise that a block replica NOT be written to the local rack DataNode where
'local' means the same rack as the client is being run on.
|
NO_LOCAL_WRITE |
Advise that a block replica NOT be written to the local DataNode where
'local' means the same host as the client is being run on.
|
OVERWRITE |
Truncate/overwrite a file.
|
SHOULD_REPLICATE |
Enforce the file to be a replicated file, no matter what its parent
directory's replication or erasure coding policy is.
|
SYNC_BLOCK |
Force closed blocks to disk.
|
| Modifier and Type | Method | Description |
|---|---|---|
static void |
validate(java.lang.Object path,
boolean pathExists,
java.util.EnumSet<CreateFlag> flag) |
Validate the CreateFlag for create operation
|
static void |
validate(java.util.EnumSet<CreateFlag> flag) |
Validate the CreateFlag and throw exception if it is invalid
|
static void |
validateForAppend(java.util.EnumSet<CreateFlag> flag) |
Validate the CreateFlag for the append operation.
|
static CreateFlag |
valueOf(java.lang.String name) |
Returns the enum constant of this type with the specified name.
|
static CreateFlag[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CreateFlag CREATE
public static final CreateFlag OVERWRITE
public static final CreateFlag APPEND
public static final CreateFlag SYNC_BLOCK
public static final CreateFlag LAZY_PERSIST
public static final CreateFlag NEW_BLOCK
@LimitedPrivate("HBase")
public static final CreateFlag NO_LOCAL_WRITE
public static final CreateFlag SHOULD_REPLICATE
public static final CreateFlag IGNORE_CLIENT_LOCALITY
public static final CreateFlag NO_LOCAL_RACK
public static CreateFlag[] values()
for (CreateFlag c : CreateFlag.values()) System.out.println(c);
public static CreateFlag valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static void validate(java.util.EnumSet<CreateFlag> flag)
flag - set of CreateFlagHadoopIllegalArgumentException - if the CreateFlag is invalidpublic static void validate(java.lang.Object path,
boolean pathExists,
java.util.EnumSet<CreateFlag> flag)
throws java.io.IOException
path - Object representing the path; usually String or PathpathExists - pass true if the path exists in the file systemflag - set of CreateFlagjava.io.IOException - on errorHadoopIllegalArgumentException - if the CreateFlag is invalidpublic static void validateForAppend(java.util.EnumSet<CreateFlag> flag)
flag - enum set flag.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.