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.FileSystem
A
FileSystem that wraps an Hadoop File System.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.core.fs.FileSystem
org.apache.flink.core.fs.FileSystem.FSKey, org.apache.flink.core.fs.FileSystem.WriteMode -
Constructor Summary
ConstructorsConstructorDescriptionHadoopFileSystem(org.apache.hadoop.fs.FileSystem hadoopFileSystem) Wraps the given Hadoop File System object as a Flink File System object. -
Method Summary
Modifier and TypeMethodDescriptioncreate(org.apache.flink.core.fs.Path f, boolean overwrite, int bufferSize, short replication, long blockSize) create(org.apache.flink.core.fs.Path f, org.apache.flink.core.fs.FileSystem.WriteMode overwrite) org.apache.flink.core.fs.RecoverableWriterorg.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) longorg.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.FileSystemGets the underlying Hadoop FileSystem.org.apache.flink.core.fs.PathgetUri()org.apache.flink.core.fs.Pathbooleanorg.apache.flink.core.fs.FileStatus[]listStatus(org.apache.flink.core.fs.Path f) booleanmkdirs(org.apache.flink.core.fs.Path f) open(org.apache.flink.core.fs.Path f) open(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, initOutPathLocalFSMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.core.fs.IFileSystem
canCopyPaths
-
Constructor Details
-
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 Details
-
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
- 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
- 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
- Specified by:
deletein interfaceorg.apache.flink.core.fs.IFileSystem- Specified by:
deletein classorg.apache.flink.core.fs.FileSystem- Throws:
IOException
-
exists
- 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
- 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
- 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)
-