HdfsFileStatus.Builder (Apache Hadoop HDFS Client 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.protocol, interface: HdfsFileStatus, class: Builder

Package org.apache.hadoop.hdfs.protocol

# Class HdfsFileStatus.Builder

java.lang.Object
org.apache.hadoop.hdfs.protocol.HdfsFileStatus.Builder

Enclosing interface:
  HdfsFileStatus

@Private @Unstable public static class HdfsFileStatus.Builder extends Object
Builder class for HdfsFileStatus instances. Note default values for parameters.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `HdfsFileStatus.Builder`
  `atime(long atime)`
  Set the access time of this entity (default = 0).
  `HdfsFileStatus.Builder`
  `blocksize(long blocksize)`
  Set the blocksize of this entity (default = 0).
  `HdfsFileStatus`
  `build()`
  `HdfsFileStatus.Builder`
  `children(int childrenNum)`
  Set the number of children for this entity (default = 0).
  `HdfsFileStatus.Builder`
  `ecPolicy(ErasureCodingPolicy ecPolicy)`
  Set the erasure coding policy for this entity (default = null).
  `HdfsFileStatus.Builder`
  `feInfo(org.apache.hadoop.fs.FileEncryptionInfo feInfo)`
  Set the encryption info for this entity (default = null).
  `HdfsFileStatus.Builder`
  `fileId(long fileId)`
  Set the fileId for this entity (default = -1).
  `HdfsFileStatus.Builder`
  `flags(EnumSet<HdfsFileStatus.Flags> flags)`
  Set `HdfsFileStatus.Flags` for this entity (default = `EnumSet.noneOf(Class)`).
  `HdfsFileStatus.Builder`
  `group(String group)`
  Set the group for this entity (default = null).
  `HdfsFileStatus.Builder`
  `isdir(boolean isdir)`
  Set the isDir flag for the entity (default = false).
  `HdfsFileStatus.Builder`
  `length(long length)`
  Set the length of the entity (default = 0).
  `HdfsFileStatus.Builder`
  `locations(LocatedBlocks locations)`
  Set the block locations for this entity (default = null).
  `HdfsFileStatus.Builder`
  `mtime(long mtime)`
  Set the modification time of this entity (default = 0).
  `HdfsFileStatus.Builder`
  `owner(String owner)`
  Set the owner for this entity (default = null).
  `HdfsFileStatus.Builder`
  `path(byte[] path)`
  Set path bytes for this entity (default = `HdfsFileStatus.EMPTY_NAME`).
  `HdfsFileStatus.Builder`
  `perm(org.apache.hadoop.fs.permission.FsPermission permission)`
  Set the permission mask of this entity (default = null).
  `HdfsFileStatus.Builder`
  `replication(int replication)`
  Set the replication of this entity (default = 0).
  `HdfsFileStatus.Builder`
  `storagePolicy(byte storagePolicy)`
  Set the storage policy for this entity (default = `HdfsConstants.BLOCK_STORAGE_POLICY_ID_UNSPECIFIED`).
  `HdfsFileStatus.Builder`
  `symlink(byte[] symlink)`
  Set symlink bytes for this entity (default = null).

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### Builder

    public Builder()

- ## Method Details

  - ### length

    public HdfsFileStatus.Builder length(long length)
    Set the length of the entity (default = 0).
    Parameters:
      `length` - Entity length
    Returns:
      This Builder instance

  - ### isdir

    public HdfsFileStatus.Builder isdir(boolean isdir)
    Set the isDir flag for the entity (default = false).
    Parameters:
      `isdir` - True if the referent is a directory.
    Returns:
      This Builder instance

  - ### replication

    public HdfsFileStatus.Builder replication(int replication)
    Set the replication of this entity (default = 0).
    Parameters:
      `replication` - Number of replicas
    Returns:
      This Builder instance

  - ### blocksize

    public HdfsFileStatus.Builder blocksize(long blocksize)
    Set the blocksize of this entity (default = 0).
    Parameters:
      `blocksize` - Target, default blocksize
    Returns:
      This Builder instance

  - ### mtime

    public HdfsFileStatus.Builder mtime(long mtime)
    Set the modification time of this entity (default = 0).
    Parameters:
      `mtime` - Last modified time
    Returns:
      This Builder instance

  - ### atime

    public HdfsFileStatus.Builder atime(long atime)
    Set the access time of this entity (default = 0).
    Parameters:
      `atime` - Last accessed time
    Returns:
      This Builder instance

  - ### perm

    public HdfsFileStatus.Builder perm(org.apache.hadoop.fs.permission.FsPermission permission)
    Set the permission mask of this entity (default = null).
    Parameters:
      `permission` - Permission bitmask
    Returns:
      This Builder instance

  - ### flags

    public HdfsFileStatus.Builder flags(EnumSet<HdfsFileStatus.Flags> flags)
    Set `HdfsFileStatus.Flags` for this entity (default = `EnumSet.noneOf(Class)`).
    Parameters:
      `flags` - Flags
    Returns:
      This builder instance

  - ### owner

    public HdfsFileStatus.Builder owner(String owner)
    Set the owner for this entity (default = null).
    Parameters:
      `owner` - Owner
    Returns:
      This Builder instance

  - ### group

    public HdfsFileStatus.Builder group(String group)
    Set the group for this entity (default = null).
    Parameters:
      `group` - Group
    Returns:
      This Builder instance

  - ### symlink

    public HdfsFileStatus.Builder symlink(byte[] symlink)
    Set symlink bytes for this entity (default = null).
    Parameters:
      `symlink` - Symlink bytes (see `DFSUtilClient.bytes2String(byte[])`)
    Returns:
      This Builder instance

  - ### path

    public HdfsFileStatus.Builder path(byte[] path)
    Set path bytes for this entity (default = `HdfsFileStatus.EMPTY_NAME`).
    Parameters:
      `path` - Path bytes (see `HdfsFileStatus.makeQualified(URI, Path)`).
    Returns:
      This Builder instance

  - ### fileId

    public HdfsFileStatus.Builder fileId(long fileId)
    Set the fileId for this entity (default = -1).
    Parameters:
      `fileId` - FileId
    Returns:
      This Builder instance

  - ### children

    public HdfsFileStatus.Builder children(int childrenNum)
    Set the number of children for this entity (default = 0).
    Parameters:
      `childrenNum` - Number of children
    Returns:
      This Builder instance

  - ### feInfo

    public HdfsFileStatus.Builder feInfo(org.apache.hadoop.fs.FileEncryptionInfo feInfo)
    Set the encryption info for this entity (default = null).
    Parameters:
      `feInfo` - Encryption info
    Returns:
      This Builder instance

  - ### storagePolicy

    public HdfsFileStatus.Builder storagePolicy(byte storagePolicy)
    Set the storage policy for this entity (default = `HdfsConstants.BLOCK_STORAGE_POLICY_ID_UNSPECIFIED`).
    Parameters:
      `storagePolicy` - Storage policy
    Returns:
      This Builder instance

  - ### ecPolicy

    public HdfsFileStatus.Builder ecPolicy(ErasureCodingPolicy ecPolicy)
    Set the erasure coding policy for this entity (default = null).
    Parameters:
      `ecPolicy` - Erasure coding policy
    Returns:
      This Builder instance

  - ### locations

    public HdfsFileStatus.Builder locations(LocatedBlocks locations)
    Set the block locations for this entity (default = null).
    Parameters:
      `locations` - HDFS locations (see `HdfsLocatedFileStatus.makeQualifiedLocated(URI, Path)`)
    Returns:
      This Builder instance

  - ### build

    public HdfsFileStatus build()
    Returns:
      An `HdfsFileStatus` instance from these parameters.