Package alluxio.underfs
Class UfsFileStatus
- java.lang.Object
-
- alluxio.underfs.UfsStatus
-
- alluxio.underfs.UfsFileStatus
-
@NotThreadSafe public class UfsFileStatus extends UfsStatus
Information about a file inUnderFileSystem
.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INVALID_CONTENT_HASH
protected long
mBlockSize
protected java.lang.String
mContentHash
protected long
mContentLength
static long
UNKNOWN_BLOCK_SIZE
-
Fields inherited from class alluxio.underfs.UfsStatus
mGroup, mIsDirectory, mLastModifiedTimeMs, mMode, mName, mOwner, mXAttr
-
-
Constructor Summary
Constructors Constructor Description UfsFileStatus(UfsFileStatus status)
Creates a new instance ofUfsFileStatus
as a copy.UfsFileStatus(java.lang.String name, java.lang.String contentHash, long contentLength, java.lang.Long lastModifiedTimeMs, java.lang.String owner, java.lang.String group, short mode)
Deprecated.as of 2.1.0, use#UfsFileStatus(String, String, long, long, String, String, short, long)
.UfsFileStatus(java.lang.String name, java.lang.String contentHash, long contentLength, java.lang.Long lastModifiedTimeMs, java.lang.String owner, java.lang.String group, short mode, long blockSize)
Creates new instance ofUfsFileStatus
without any extended attributes.UfsFileStatus(java.lang.String name, java.lang.String contentHash, long contentLength, java.lang.Long lastModifiedTimeMs, java.lang.String owner, java.lang.String group, short mode, java.util.Map<java.lang.String,byte[]> xAttr)
Deprecated.as of 2.1.0, use#UfsFileStatus(String, String, long, long, String, String, short, Map, long)
UfsFileStatus(java.lang.String name, java.lang.String contentHash, long contentLength, java.lang.Long lastModifiedTimeMs, java.lang.String owner, java.lang.String group, short mode, java.util.Map<java.lang.String,byte[]> xAttr, long blockSize)
Creates new instance ofUfsFileStatus
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UfsFileStatus
copy()
Create a copy ofUfsStatus
.long
getBlockSize()
java.lang.String
getContentHash()
long
getContentLength()
Get the content size in bytes.java.lang.String
toString()
-
Methods inherited from class alluxio.underfs.UfsStatus
convertToNames, equals, getGroup, getLastModifiedTime, getMode, getName, getOwner, getXAttr, hashCode, isDirectory, isFile, setName, toStringHelper
-
-
-
-
Field Detail
-
INVALID_CONTENT_HASH
public static final java.lang.String INVALID_CONTENT_HASH
- See Also:
- Constant Field Values
-
UNKNOWN_BLOCK_SIZE
public static final long UNKNOWN_BLOCK_SIZE
- See Also:
- Constant Field Values
-
mContentHash
protected final java.lang.String mContentHash
-
mContentLength
protected final long mContentLength
-
mBlockSize
protected final long mBlockSize
-
-
Constructor Detail
-
UfsFileStatus
public UfsFileStatus(java.lang.String name, java.lang.String contentHash, long contentLength, @Nullable java.lang.Long lastModifiedTimeMs, java.lang.String owner, java.lang.String group, short mode, @Nullable java.util.Map<java.lang.String,byte[]> xAttr, long blockSize)
Creates new instance ofUfsFileStatus
.- Parameters:
name
- relative path of filecontentHash
- hash of the file contentscontentLength
- in byteslastModifiedTimeMs
- UTC timeowner
- of the filegroup
- of the filemode
- of the filexAttr
- extended attributes, if anyblockSize
- blocksize, -1 if unknown
-
UfsFileStatus
public UfsFileStatus(java.lang.String name, java.lang.String contentHash, long contentLength, @Nullable java.lang.Long lastModifiedTimeMs, java.lang.String owner, java.lang.String group, short mode, long blockSize)
Creates new instance ofUfsFileStatus
without any extended attributes.- Parameters:
name
- relative path of filecontentHash
- hash of the file contentscontentLength
- in byteslastModifiedTimeMs
- UTC timeowner
- of the filegroup
- of the filemode
- of the fileblockSize
- blocksize, -1 if unknown
-
UfsFileStatus
@Deprecated public UfsFileStatus(java.lang.String name, java.lang.String contentHash, long contentLength, @Nullable java.lang.Long lastModifiedTimeMs, java.lang.String owner, java.lang.String group, short mode, @Nullable java.util.Map<java.lang.String,byte[]> xAttr)
Deprecated.as of 2.1.0, use#UfsFileStatus(String, String, long, long, String, String, short, Map, long)
Creates new instance ofUfsFileStatus
.- Parameters:
name
- relative path of filecontentHash
- hash of the file contentscontentLength
- in byteslastModifiedTimeMs
- UTC timeowner
- of the filegroup
- of the filemode
- of the filexAttr
- extended attributes, if any
-
UfsFileStatus
@Deprecated public UfsFileStatus(java.lang.String name, java.lang.String contentHash, long contentLength, @Nullable java.lang.Long lastModifiedTimeMs, java.lang.String owner, java.lang.String group, short mode)
Deprecated.as of 2.1.0, use#UfsFileStatus(String, String, long, long, String, String, short, long)
.Creates a new instance ofUfsFileStatus
without any extended attributes.- Parameters:
name
- relative path of filecontentHash
- hash of the file contentscontentLength
- in byteslastModifiedTimeMs
- UTC timeowner
- of the filegroup
- of the filemode
- of the file
-
UfsFileStatus
public UfsFileStatus(UfsFileStatus status)
Creates a new instance ofUfsFileStatus
as a copy.- Parameters:
status
- file information to copy
-
-
Method Detail
-
copy
public UfsFileStatus copy()
Description copied from class:UfsStatus
Create a copy ofUfsStatus
.
-
getContentHash
public java.lang.String getContentHash()
- Returns:
- the hash of the file contents
-
getContentLength
public long getContentLength()
Get the content size in bytes.- Returns:
- file size in bytes
-
getBlockSize
public long getBlockSize()
- Returns:
- the block size in bytes, -1 if unknown
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-