Package org.apache.hadoop.hdfs.protocol
Class HdfsFileStatus.Builder
java.lang.Object
org.apache.hadoop.hdfs.protocol.HdfsFileStatus.Builder
- Enclosing interface:
- HdfsFileStatus
Builder class for HdfsFileStatus instances. Note default values for
parameters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionatime(long atime) Set the access time of this entity (default = 0).blocksize(long blocksize) Set the blocksize of this entity (default = 0).build()children(int childrenNum) Set the number of children for this entity (default = 0).ecPolicy(ErasureCodingPolicy ecPolicy) Set the erasure coding policy for this entity (default = null).feInfo(org.apache.hadoop.fs.FileEncryptionInfo feInfo) Set the encryption info for this entity (default = null).fileId(long fileId) Set the fileId for this entity (default = -1).flags(EnumSet<HdfsFileStatus.Flags> flags) SetHdfsFileStatus.Flagsfor this entity (default =EnumSet.noneOf(Class)).Set the group for this entity (default = null).isdir(boolean isdir) Set the isDir flag for the entity (default = false).length(long length) Set the length of the entity (default = 0).locations(LocatedBlocks locations) Set the block locations for this entity (default = null).mtime(long mtime) Set the modification time of this entity (default = 0).Set the owner for this entity (default = null).path(byte[] path) Set path bytes for this entity (default =HdfsFileStatus.EMPTY_NAME).perm(org.apache.hadoop.fs.permission.FsPermission permission) Set the permission mask of this entity (default = null).replication(int replication) Set the replication of this entity (default = 0).storagePolicy(byte storagePolicy) Set the storage policy for this entity (default =HdfsConstants.BLOCK_STORAGE_POLICY_ID_UNSPECIFIED).symlink(byte[] symlink) Set symlink bytes for this entity (default = null).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
length
Set the length of the entity (default = 0).- Parameters:
length- Entity length- Returns:
- This Builder instance
-
isdir
Set the isDir flag for the entity (default = false).- Parameters:
isdir- True if the referent is a directory.- Returns:
- This Builder instance
-
replication
Set the replication of this entity (default = 0).- Parameters:
replication- Number of replicas- Returns:
- This Builder instance
-
blocksize
Set the blocksize of this entity (default = 0).- Parameters:
blocksize- Target, default blocksize- Returns:
- This Builder instance
-
mtime
Set the modification time of this entity (default = 0).- Parameters:
mtime- Last modified time- Returns:
- This Builder instance
-
atime
Set the access time of this entity (default = 0).- Parameters:
atime- Last accessed time- Returns:
- This Builder instance
-
perm
Set the permission mask of this entity (default = null).- Parameters:
permission- Permission bitmask- Returns:
- This Builder instance
-
flags
SetHdfsFileStatus.Flagsfor this entity (default =EnumSet.noneOf(Class)).- Parameters:
flags- Flags- Returns:
- This builder instance
-
owner
Set the owner for this entity (default = null).- Parameters:
owner- Owner- Returns:
- This Builder instance
-
group
Set the group for this entity (default = null).- Parameters:
group- Group- Returns:
- This Builder instance
-
symlink
Set symlink bytes for this entity (default = null).- Parameters:
symlink- Symlink bytes (seeDFSUtilClient.bytes2String(byte[]))- Returns:
- This Builder instance
-
path
Set path bytes for this entity (default =HdfsFileStatus.EMPTY_NAME).- Parameters:
path- Path bytes (seeHdfsFileStatus.makeQualified(URI, Path)).- Returns:
- This Builder instance
-
fileId
Set the fileId for this entity (default = -1).- Parameters:
fileId- FileId- Returns:
- This Builder instance
-
children
Set the number of children for this entity (default = 0).- Parameters:
childrenNum- Number of children- Returns:
- This Builder instance
-
feInfo
Set the encryption info for this entity (default = null).- Parameters:
feInfo- Encryption info- Returns:
- This Builder instance
-
storagePolicy
Set the storage policy for this entity (default =HdfsConstants.BLOCK_STORAGE_POLICY_ID_UNSPECIFIED).- Parameters:
storagePolicy- Storage policy- Returns:
- This Builder instance
-
ecPolicy
Set the erasure coding policy for this entity (default = null).- Parameters:
ecPolicy- Erasure coding policy- Returns:
- This Builder instance
-
locations
Set the block locations for this entity (default = null).- Parameters:
locations- HDFS locations (seeHdfsLocatedFileStatus.makeQualifiedLocated(URI, Path))- Returns:
- This Builder instance
-
build
- Returns:
- An
HdfsFileStatusinstance from these parameters.
-