Package alluxio.underfs
Class UfsStatus
- java.lang.Object
-
- alluxio.underfs.UfsStatus
-
- Direct Known Subclasses:
UfsDirectoryStatus
,UfsFileStatus
@NotThreadSafe public abstract class UfsStatus extends java.lang.Object
Information about a file or a directory in the under file system. Listing contents in aUnderFileSystem
returns entries of this class.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
mGroup
protected boolean
mIsDirectory
protected java.lang.Long
mLastModifiedTimeMs
Last modified epoch time in ms, or null if it is not available.protected short
mMode
protected java.lang.String
mName
protected java.lang.String
mOwner
protected java.util.Map<java.lang.String,byte[]>
mXAttr
-
Constructor Summary
Constructors Modifier Constructor Description protected
UfsStatus(UfsStatus status)
Creates a new instance ofUfsStatus
as a copy.protected
UfsStatus(java.lang.String name, boolean isDirectory, java.lang.String owner, java.lang.String group, short mode, java.lang.Long lastModifiedTimeMs, java.util.Map<java.lang.String,byte[]> xAttrs)
Creates new instance ofUfsStatus
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.lang.String[]
convertToNames(UfsStatus[] children)
Converts an array of UFS file status to a listing result where each element in the array is a file or directory name.abstract UfsStatus
copy()
Create a copy ofUfsStatus
.boolean
equals(java.lang.Object o)
java.lang.String
getGroup()
Gets the group of the given path.java.lang.Long
getLastModifiedTime()
Gets the UTC time of when the indicated path was modified recently in ms, or null if the last modified time is not available.short
getMode()
Gets the mode of the given path in short format, e.g 0700.java.lang.String
getName()
java.lang.String
getOwner()
Gets the owner of the given path.java.util.Map<java.lang.String,byte[]>
getXAttr()
Returns the extended attributes from the Ufs, if any.int
hashCode()
boolean
isDirectory()
boolean
isFile()
UfsStatus
setName(java.lang.String name)
Set the name of file or directory.protected com.google.common.base.MoreObjects.ToStringHelper
toStringHelper()
-
-
-
Field Detail
-
mIsDirectory
protected final boolean mIsDirectory
-
mLastModifiedTimeMs
protected final java.lang.Long mLastModifiedTimeMs
Last modified epoch time in ms, or null if it is not available.
-
mName
protected java.lang.String mName
-
mOwner
protected final java.lang.String mOwner
-
mGroup
protected final java.lang.String mGroup
-
mMode
protected final short mMode
-
mXAttr
protected final java.util.Map<java.lang.String,byte[]> mXAttr
-
-
Constructor Detail
-
UfsStatus
protected UfsStatus(java.lang.String name, boolean isDirectory, java.lang.String owner, java.lang.String group, short mode, @Nullable java.lang.Long lastModifiedTimeMs, @Nullable java.util.Map<java.lang.String,byte[]> xAttrs)
Creates new instance ofUfsStatus
.- Parameters:
name
- relative path of file or directoryisDirectory
- whether the path is a directoryowner
- of the filegroup
- of the filemode
- of the filelastModifiedTimeMs
- last modified epoch time in ms, or null if it is not availablexAttrs
- any extended attributes on the inode
-
-
Method Detail
-
convertToNames
@Nullable public static java.lang.String[] convertToNames(UfsStatus[] children)
Converts an array of UFS file status to a listing result where each element in the array is a file or directory name.- Parameters:
children
- array of listing statuses- Returns:
- array of file or directory names, or null if the input is null
-
isDirectory
public boolean isDirectory()
- Returns:
- true, if the path is a directory
-
isFile
public boolean isFile()
- Returns:
- true, if the path is a file
-
getGroup
public java.lang.String getGroup()
Gets the group of the given path.- Returns:
- the group of the file
-
getLastModifiedTime
@Nullable public java.lang.Long getLastModifiedTime()
Gets the UTC time of when the indicated path was modified recently in ms, or null if the last modified time is not available.- Returns:
- modification time in milliseconds
-
getMode
public short getMode()
Gets the mode of the given path in short format, e.g 0700.- Returns:
- the mode of the file
-
getName
public java.lang.String getName()
- Returns:
- name of file or directory
-
getOwner
public java.lang.String getOwner()
Gets the owner of the given path.- Returns:
- the owner of the path
-
getXAttr
@Nullable public java.util.Map<java.lang.String,byte[]> getXAttr()
Returns the extended attributes from the Ufs, if any.- Returns:
- a map of the extended attributes. If none, the map will be empty
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
setName
public UfsStatus setName(java.lang.String name)
Set the name of file or directory.- Parameters:
name
- of entry- Returns:
- this object
-
toStringHelper
protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-