Package org.apache.hadoop.hdfs.protocol
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 ClassesModifier and TypeInterfaceDescriptionstatic classBuilder class for HdfsFileStatus instances.static enumSet of features potentially active on an instance. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(org.apache.hadoop.fs.FileStatus stat) SeeFileStatus.compareTo(FileStatus).static org.apache.hadoop.fs.permission.FsPermissionconvert(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>convert(Set<HdfsFileStatus.Flags> flags) longSeeFileStatus.getAccessTime().longSeeFileStatus.getBlockSize().intGet the erasure coding policy if it's set.org.apache.hadoop.fs.FileEncryptionInfoGet metadata for encryption, if present.longInode ID for this entity, if a file.default StringgetFullName(String parent) Get the string representation of the full path name.default org.apache.hadoop.fs.PathgetFullPath(org.apache.hadoop.fs.Path parent) Get the full path.getGroup()SeeFileStatus.getGroup().longgetLen()SeeFileStatus.getLen().default StringGet the string representation of the local name.byte[]Get the Java UTF8 representation of the local name.longSeeFileStatus.getModificationTime().getOwner()SeeFileStatus.getOwner().org.apache.hadoop.fs.PathgetPath()SeeFileStatus.getPath().org.apache.hadoop.fs.permission.FsPermissionSeeFileStatus.getPermission().shortSeeFileStatus.getReplication().byteorg.apache.hadoop.fs.PathSeeFileStatus.getSymlink().byte[]Opaque referant for the symlink, to be resolved at the client.booleanhasAcl()SeeFileStatus.hasAcl().booleanisDir()SeeFileStatus.isDir().booleanSeeFileStatus.isDirectory().default booleanCheck if the local name is empty.booleanSeeFileStatus.isEncrypted().booleanSeeFileStatus.isErasureCoded().booleanisFile()SeeFileStatus.isFile().booleanSeeFileStatus.isSnapshotEnabled().booleanSeeFileStatus.isSymlink().default org.apache.hadoop.fs.FileStatusmakeQualified(URI defaultUri, org.apache.hadoop.fs.Path parent) Resolve the short name of the Path given the URI, parent provided.voidSeeFileStatus.setGroup(String).voidsetNamespace(String namespace) voidSeeFileStatus.setOwner(String).voidsetPath(org.apache.hadoop.fs.Path p) SeeFileStatus.setPath(Path).voidsetPermission(org.apache.hadoop.fs.permission.FsPermission permission) SeeFileStatus.setPermission(FsPermission).voidsetSymlink(org.apache.hadoop.fs.Path sym) SeeFileStatus.setSymlink(Path sym).Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface java.io.ObjectInputValidation
validateObjectMethods 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
FileEncryptionInfofor 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
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
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()SeeFileStatus.getPath(). -
setPath
void setPath(org.apache.hadoop.fs.Path p) SeeFileStatus.setPath(Path). -
getLen
long getLen()SeeFileStatus.getLen(). -
isFile
boolean isFile()SeeFileStatus.isFile(). -
isDirectory
boolean isDirectory()SeeFileStatus.isDirectory(). -
isDir
boolean isDir()SeeFileStatus.isDir(). -
isSymlink
boolean isSymlink()SeeFileStatus.isSymlink(). -
getBlockSize
long getBlockSize()SeeFileStatus.getBlockSize(). -
getReplication
short getReplication()SeeFileStatus.getReplication(). -
getModificationTime
long getModificationTime()SeeFileStatus.getModificationTime(). -
getAccessTime
long getAccessTime()SeeFileStatus.getAccessTime(). -
getPermission
org.apache.hadoop.fs.permission.FsPermission getPermission()SeeFileStatus.getPermission(). -
setPermission
void setPermission(org.apache.hadoop.fs.permission.FsPermission permission) SeeFileStatus.setPermission(FsPermission). -
getOwner
String getOwner()SeeFileStatus.getOwner(). -
setOwner
SeeFileStatus.setOwner(String). -
getGroup
String getGroup()SeeFileStatus.getGroup(). -
setGroup
SeeFileStatus.setGroup(String). -
hasAcl
boolean hasAcl()SeeFileStatus.hasAcl(). -
isEncrypted
boolean isEncrypted()SeeFileStatus.isEncrypted(). -
isErasureCoded
boolean isErasureCoded()SeeFileStatus.isErasureCoded(). -
isSnapshotEnabled
boolean isSnapshotEnabled()SeeFileStatus.isSnapshotEnabled(). -
getSymlink
SeeFileStatus.getSymlink().- Throws:
IOException
-
setSymlink
void setSymlink(org.apache.hadoop.fs.Path sym) SeeFileStatus.setSymlink(Path sym). -
compareTo
int compareTo(org.apache.hadoop.fs.FileStatus stat) SeeFileStatus.compareTo(FileStatus). -
setNamespace
-
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
-