Enum Class AddBlockFlag

java.lang.Object
java.lang.Enum<AddBlockFlag>
org.apache.hadoop.hdfs.AddBlockFlag
All Implemented Interfaces:
Serializable, Comparable<AddBlockFlag>, Constable

@Private @Evolving public enum AddBlockFlag extends Enum<AddBlockFlag>
AddBlockFlag provides hints for new block allocation and placement. Users can use this flag to control per DFSOutputStream
See Also:
  • Enum Constant Details

    • NO_LOCAL_WRITE

      public static final AddBlockFlag 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.
      See Also:
      • CreateFlag.NO_LOCAL_WRITE
    • IGNORE_CLIENT_LOCALITY

      public static final AddBlockFlag IGNORE_CLIENT_LOCALITY
      Advise that the first block replica NOT take into account DataNode locality. The first block replica should be placed randomly within the cluster. Subsequent block replicas should follow DataNode locality rules.
      See Also:
      • CreateFlag.IGNORE_CLIENT_LOCALITY
    • NO_LOCAL_RACK

      public static final AddBlockFlag NO_LOCAL_RACK
      Advise that a block replica NOT be written to the local rack DataNode where 'local' means the same host as the client is being run on.
      See Also:
      • CreateFlag.NO_LOCAL_WRITE
  • Method Details

    • values

      public static AddBlockFlag[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AddBlockFlag valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • valueOf

      public static AddBlockFlag valueOf(short mode)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      mode - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getMode

      public short getMode()