Package org.apache.flink.runtime.fs.hdfs
Class HadoopFileStatus
- java.lang.Object
-
- org.apache.flink.runtime.fs.hdfs.HadoopFileStatus
-
- All Implemented Interfaces:
FileStatus
- Direct Known Subclasses:
LocatedHadoopFileStatus
public class HadoopFileStatus extends Object implements FileStatus
Concrete implementation of theFileStatus
interface for the Hadoop Distributed File System.
-
-
Constructor Summary
Constructors Constructor Description HadoopFileStatus(org.apache.hadoop.fs.FileStatus fileStatus)
Creates a new file status from an HDFS file status.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HadoopFileStatus
fromHadoopStatus(org.apache.hadoop.fs.FileStatus fileStatus)
Creates a newHadoopFileStatus
from Hadoop'sFileStatus
.long
getAccessTime()
Get the access time of the file.long
getBlockSize()
Get the block size of the file.org.apache.hadoop.fs.FileStatus
getInternalFileStatus()
long
getLen()
Return the length of this file.long
getModificationTime()
Get the modification time of the file.Path
getPath()
Returns the corresponding Path to the FileStatus.short
getReplication()
Get the replication factor of a file.boolean
isDir()
Checks if this object represents a directory.
-
-
-
Method Detail
-
getLen
public long getLen()
Description copied from interface:FileStatus
Return the length of this file.- Specified by:
getLen
in interfaceFileStatus
- Returns:
- the length of this file
-
getBlockSize
public long getBlockSize()
Description copied from interface:FileStatus
Get the block size of the file.- Specified by:
getBlockSize
in interfaceFileStatus
- Returns:
- the number of bytes
-
getAccessTime
public long getAccessTime()
Description copied from interface:FileStatus
Get the access time of the file.- Specified by:
getAccessTime
in interfaceFileStatus
- Returns:
- the access time of file in milliseconds since January 1, 1970 UTC.
-
getModificationTime
public long getModificationTime()
Description copied from interface:FileStatus
Get the modification time of the file.- Specified by:
getModificationTime
in interfaceFileStatus
- Returns:
- the modification time of file in milliseconds since January 1, 1970 UTC.
-
getReplication
public short getReplication()
Description copied from interface:FileStatus
Get the replication factor of a file.- Specified by:
getReplication
in interfaceFileStatus
- Returns:
- the replication factor of a file.
-
getPath
public Path getPath()
Description copied from interface:FileStatus
Returns the corresponding Path to the FileStatus.- Specified by:
getPath
in interfaceFileStatus
- Returns:
- the corresponding Path to the FileStatus
-
isDir
public boolean isDir()
Description copied from interface:FileStatus
Checks if this object represents a directory.- Specified by:
isDir
in interfaceFileStatus
- Returns:
true
if this is a directory,false
otherwise
-
getInternalFileStatus
public org.apache.hadoop.fs.FileStatus getInternalFileStatus()
-
fromHadoopStatus
public static HadoopFileStatus fromHadoopStatus(org.apache.hadoop.fs.FileStatus fileStatus)
Creates a newHadoopFileStatus
from Hadoop'sFileStatus
. If Hadoop's file status is located, i.e., it contains block information, then this method returns an implementation of Flink'sLocatedFileStatus
.
-
-