Interface HdfsFileStatus

All Superinterfaces:
Comparable<Object>, ObjectInputValidation, Serializable, org.apache.hadoop.io.Writable
All Known Implementing Classes:
HdfsLocatedFileStatus, HdfsNamedFileStatus

@Private @Evolving public interface HdfsFileStatus extends org.apache.hadoop.io.Writable, Comparable<Object>, Serializable, ObjectInputValidation
HDFS metadata for an entity in the filesystem.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Builder class for HdfsFileStatus instances.
    static enum 
    Set of features potentially active on an instance.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final byte[]
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    compareTo(org.apache.hadoop.fs.FileStatus stat)
    See FileStatus.compareTo(FileStatus).
    static org.apache.hadoop.fs.permission.FsPermission
    convert(boolean isdir, boolean symlink, org.apache.hadoop.fs.permission.FsPermission p, Set<HdfsFileStatus.Flags> f)
    Set redundant flags for compatibility with existing applications.
    static Set<org.apache.hadoop.fs.FileStatus.AttrFlags>
     
    long
    See FileStatus.getAccessTime().
    long
    See FileStatus.getBlockSize().
    int
     
    Get the erasure coding policy if it's set.
    org.apache.hadoop.fs.FileEncryptionInfo
    Get metadata for encryption, if present.
    long
    Inode ID for this entity, if a file.
    default String
    Get the string representation of the full path name.
    default org.apache.hadoop.fs.Path
    getFullPath(org.apache.hadoop.fs.Path parent)
    Get the full path.
    See FileStatus.getGroup().
    long
    See FileStatus.getLen().
    default String
    Get the string representation of the local name.
    byte[]
    Get the Java UTF8 representation of the local name.
    long
    See FileStatus.getModificationTime().
     
    See FileStatus.getOwner().
    org.apache.hadoop.fs.Path
    See FileStatus.getPath().
    org.apache.hadoop.fs.permission.FsPermission
    See FileStatus.getPermission().
    short
    See FileStatus.getReplication().
    byte
     
    org.apache.hadoop.fs.Path
    See FileStatus.getSymlink().
    byte[]
    Opaque referant for the symlink, to be resolved at the client.
    boolean
    See FileStatus.hasAcl().
    boolean
    See FileStatus.isDir().
    boolean
    See FileStatus.isDirectory().
    default boolean
    Check if the local name is empty.
    boolean
    See FileStatus.isEncrypted().
    boolean
    See FileStatus.isErasureCoded().
    boolean
    See FileStatus.isFile().
    boolean
    See FileStatus.isSnapshotEnabled().
    boolean
    See FileStatus.isSymlink().
    default org.apache.hadoop.fs.FileStatus
    makeQualified(URI defaultUri, org.apache.hadoop.fs.Path parent)
    Resolve the short name of the Path given the URI, parent provided.
    void
    See FileStatus.setGroup(String).
    void
    setNamespace(String namespace)
     
    void
    See FileStatus.setOwner(String).
    void
    setPath(org.apache.hadoop.fs.Path p)
    See FileStatus.setPath(Path).
    void
    setPermission(org.apache.hadoop.fs.permission.FsPermission permission)
    See FileStatus.setPermission(FsPermission).
    void
    setSymlink(org.apache.hadoop.fs.Path sym)
    See FileStatus.setSymlink(Path sym).

    Methods inherited from interface java.lang.Comparable

    compareTo

    Methods inherited from interface java.io.ObjectInputValidation

    validateObject

    Methods inherited from interface org.apache.hadoop.io.Writable

    readFields, write
  • Field Details

    • EMPTY_NAME

      static final byte[] EMPTY_NAME
  • Method Details

    • getFileId

      long getFileId()
      Inode ID for this entity, if a file.
      Returns:
      inode ID.
    • getFileEncryptionInfo

      org.apache.hadoop.fs.FileEncryptionInfo getFileEncryptionInfo()
      Get metadata for encryption, if present.
      Returns:
      the FileEncryptionInfo for this stream, or null if not encrypted.
    • isEmptyLocalName

      default boolean isEmptyLocalName()
      Check if the local name is empty.
      Returns:
      true if the name is empty
    • getLocalName

      default String getLocalName()
      Get the string representation of the local name.
      Returns:
      the local name in string
    • getLocalNameInBytes

      byte[] getLocalNameInBytes()
      Get the Java UTF8 representation of the local name.
      Returns:
      the local name in java UTF8
    • getFullName

      default String getFullName(String parent)
      Get the string representation of the full path name.
      Parameters:
      parent - the parent path
      Returns:
      the full path in string
    • getFullPath

      default org.apache.hadoop.fs.Path getFullPath(org.apache.hadoop.fs.Path parent)
      Get the full path.
      Parameters:
      parent - the parent path
      Returns:
      the full path
    • getSymlinkInBytes

      byte[] getSymlinkInBytes()
      Opaque referant for the symlink, to be resolved at the client.
    • getChildrenNum

      int getChildrenNum()
      Returns:
      number of children for this inode.
    • getErasureCodingPolicy

      ErasureCodingPolicy getErasureCodingPolicy()
      Get the erasure coding policy if it's set.
      Returns:
      the erasure coding policy
    • getStoragePolicy

      byte getStoragePolicy()
      Returns:
      the storage policy id
    • makeQualified

      default org.apache.hadoop.fs.FileStatus makeQualified(URI defaultUri, org.apache.hadoop.fs.Path parent)
      Resolve the short name of the Path given the URI, parent provided. This FileStatus reference will not contain a valid Path until it is resolved by this method.
      Parameters:
      defaultUri - FileSystem to fully qualify HDFS path.
      parent - Parent path of this element.
      Returns:
      Reference to this instance.
    • getPath

      org.apache.hadoop.fs.Path getPath()
      See FileStatus.getPath().
    • setPath

      void setPath(org.apache.hadoop.fs.Path p)
      See FileStatus.setPath(Path).
    • getLen

      long getLen()
      See FileStatus.getLen().
    • isFile

      boolean isFile()
      See FileStatus.isFile().
    • isDirectory

      boolean isDirectory()
      See FileStatus.isDirectory().
    • isDir

      boolean isDir()
      See FileStatus.isDir().
    • isSymlink

      boolean isSymlink()
      See FileStatus.isSymlink().
    • getBlockSize

      long getBlockSize()
      See FileStatus.getBlockSize().
    • getReplication

      short getReplication()
      See FileStatus.getReplication().
    • getModificationTime

      long getModificationTime()
      See FileStatus.getModificationTime().
    • getAccessTime

      long getAccessTime()
      See FileStatus.getAccessTime().
    • getPermission

      org.apache.hadoop.fs.permission.FsPermission getPermission()
      See FileStatus.getPermission().
    • setPermission

      void setPermission(org.apache.hadoop.fs.permission.FsPermission permission)
      See FileStatus.setPermission(FsPermission).
    • getOwner

      String getOwner()
      See FileStatus.getOwner().
    • setOwner

      void setOwner(String owner)
      See FileStatus.setOwner(String).
    • getGroup

      String getGroup()
      See FileStatus.getGroup().
    • setGroup

      void setGroup(String group)
      See FileStatus.setGroup(String).
    • hasAcl

      boolean hasAcl()
      See FileStatus.hasAcl().
    • isEncrypted

      boolean isEncrypted()
      See FileStatus.isEncrypted().
    • isErasureCoded

      boolean isErasureCoded()
      See FileStatus.isErasureCoded().
    • isSnapshotEnabled

      boolean isSnapshotEnabled()
      See FileStatus.isSnapshotEnabled().
    • getSymlink

      org.apache.hadoop.fs.Path getSymlink() throws IOException
      See FileStatus.getSymlink().
      Throws:
      IOException
    • setSymlink

      void setSymlink(org.apache.hadoop.fs.Path sym)
      See FileStatus.setSymlink(Path sym).
    • compareTo

      int compareTo(org.apache.hadoop.fs.FileStatus stat)
      See FileStatus.compareTo(FileStatus).
    • setNamespace

      void setNamespace(String namespace)
    • getNamespace

      String getNamespace()
    • convert

      static org.apache.hadoop.fs.permission.FsPermission convert(boolean isdir, boolean symlink, org.apache.hadoop.fs.permission.FsPermission p, Set<HdfsFileStatus.Flags> f)
      Set redundant flags for compatibility with existing applications.
    • convert

      static Set<org.apache.hadoop.fs.FileStatus.AttrFlags> convert(Set<HdfsFileStatus.Flags> flags)