Package org.apache.flink.runtime.fs.hdfs
Class HadoopFileSystem
- java.lang.Object
-
- org.apache.flink.core.fs.FileSystem
-
- org.apache.flink.runtime.fs.hdfs.HadoopFileSystem
-
- All Implemented Interfaces:
org.apache.flink.core.fs.IFileSystem
public class HadoopFileSystem extends org.apache.flink.core.fs.FileSystemAFileSystemthat wraps anHadoop File System.
-
-
Constructor Summary
Constructors Constructor Description HadoopFileSystem(org.apache.hadoop.fs.FileSystem hadoopFileSystem)Wraps the given Hadoop File System object as a Flink File System object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HadoopDataOutputStreamcreate(org.apache.flink.core.fs.Path f, boolean overwrite, int bufferSize, short replication, long blockSize)HadoopDataOutputStreamcreate(org.apache.flink.core.fs.Path f, org.apache.flink.core.fs.FileSystem.WriteMode overwrite)org.apache.flink.core.fs.RecoverableWritercreateRecoverableWriter()org.apache.flink.core.fs.RecoverableWritercreateRecoverableWriter(Map<String,String> conf)booleandelete(org.apache.flink.core.fs.Path f, boolean recursive)booleanexists(org.apache.flink.core.fs.Path f)longgetDefaultBlockSize()org.apache.flink.core.fs.BlockLocation[]getFileBlockLocations(org.apache.flink.core.fs.FileStatus file, long start, long len)org.apache.flink.core.fs.FileStatusgetFileStatus(org.apache.flink.core.fs.Path f)org.apache.hadoop.fs.FileSystemgetHadoopFileSystem()Gets the underlying Hadoop FileSystem.org.apache.flink.core.fs.PathgetHomeDirectory()URIgetUri()org.apache.flink.core.fs.PathgetWorkingDirectory()booleanisDistributedFS()org.apache.flink.core.fs.FileStatus[]listStatus(org.apache.flink.core.fs.Path f)booleanmkdirs(org.apache.flink.core.fs.Path f)HadoopDataInputStreamopen(org.apache.flink.core.fs.Path f)HadoopDataInputStreamopen(org.apache.flink.core.fs.Path f, int bufferSize)booleanrename(org.apache.flink.core.fs.Path src, org.apache.flink.core.fs.Path dst)static org.apache.hadoop.fs.PathtoHadoopPath(org.apache.flink.core.fs.Path path)-
Methods inherited from class org.apache.flink.core.fs.FileSystem
create, get, getDefaultFsUri, getLocalFileSystem, getUnguardedFileSystem, initialize, initialize, initOutPathDistFS, initOutPathLocalFS
-
-
-
-
Constructor Detail
-
HadoopFileSystem
public HadoopFileSystem(org.apache.hadoop.fs.FileSystem hadoopFileSystem)
Wraps the given Hadoop File System object as a Flink File System object. The given Hadoop file system object is expected to be initialized already.- Parameters:
hadoopFileSystem- The Hadoop FileSystem that will be used under the hood.
-
-
Method Detail
-
getHadoopFileSystem
public org.apache.hadoop.fs.FileSystem getHadoopFileSystem()
Gets the underlying Hadoop FileSystem.- Returns:
- The underlying Hadoop FileSystem.
-
getWorkingDirectory
public org.apache.flink.core.fs.Path getWorkingDirectory()
- Specified by:
getWorkingDirectoryin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
getWorkingDirectoryin classorg.apache.flink.core.fs.FileSystem
-
getHomeDirectory
public org.apache.flink.core.fs.Path getHomeDirectory()
- Specified by:
getHomeDirectoryin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
getHomeDirectoryin classorg.apache.flink.core.fs.FileSystem
-
getUri
public URI getUri()
- Specified by:
getUriin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
getUriin classorg.apache.flink.core.fs.FileSystem
-
getFileStatus
public org.apache.flink.core.fs.FileStatus getFileStatus(org.apache.flink.core.fs.Path f) throws IOException- Specified by:
getFileStatusin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
getFileStatusin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
getFileBlockLocations
public org.apache.flink.core.fs.BlockLocation[] getFileBlockLocations(org.apache.flink.core.fs.FileStatus file, long start, long len) throws IOException- Specified by:
getFileBlockLocationsin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
getFileBlockLocationsin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
open
public HadoopDataInputStream open(org.apache.flink.core.fs.Path f, int bufferSize) throws IOException
- Specified by:
openin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
openin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
open
public HadoopDataInputStream open(org.apache.flink.core.fs.Path f) throws IOException
- Specified by:
openin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
openin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
create
public HadoopDataOutputStream create(org.apache.flink.core.fs.Path f, boolean overwrite, int bufferSize, short replication, long blockSize) throws IOException
- Overrides:
createin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
create
public HadoopDataOutputStream create(org.apache.flink.core.fs.Path f, org.apache.flink.core.fs.FileSystem.WriteMode overwrite) throws IOException
- Specified by:
createin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
createin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
delete
public boolean delete(org.apache.flink.core.fs.Path f, boolean recursive) throws IOException- Specified by:
deletein interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
deletein classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
exists
public boolean exists(org.apache.flink.core.fs.Path f) throws IOException- Specified by:
existsin interfaceorg.apache.flink.core.fs.IFileSystem- Overrides:
existsin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
listStatus
public org.apache.flink.core.fs.FileStatus[] listStatus(org.apache.flink.core.fs.Path f) throws IOException- Specified by:
listStatusin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
listStatusin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
mkdirs
public boolean mkdirs(org.apache.flink.core.fs.Path f) throws IOException- Specified by:
mkdirsin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
mkdirsin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
rename
public boolean rename(org.apache.flink.core.fs.Path src, org.apache.flink.core.fs.Path dst) throws IOException- Specified by:
renamein interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
renamein classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
getDefaultBlockSize
public long getDefaultBlockSize()
- Overrides:
getDefaultBlockSizein classorg.apache.flink.core.fs.FileSystem
-
isDistributedFS
public boolean isDistributedFS()
- Specified by:
isDistributedFSin interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
isDistributedFSin classorg.apache.flink.core.fs.FileSystem
-
createRecoverableWriter
public org.apache.flink.core.fs.RecoverableWriter createRecoverableWriter() throws IOException- Specified by:
createRecoverableWriterin interfaceorg.apache.flink.core.fs.IFileSystem- Overrides:
createRecoverableWriterin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
createRecoverableWriter
public org.apache.flink.core.fs.RecoverableWriter createRecoverableWriter(Map<String,String> conf) throws IOException
- Specified by:
createRecoverableWriterin interfaceorg.apache.flink.core.fs.IFileSystem- Overrides:
createRecoverableWriterin classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
toHadoopPath
public static org.apache.hadoop.fs.Path toHadoopPath(org.apache.flink.core.fs.Path path)
-
-