public final class HadoopFileSystem
extends org.apache.flink.core.fs.FileSystem
implements org.apache.flink.core.fs.HadoopFileSystemWrapper
FileSystem
base class for the Hadoop File System. The
class is a wrapper class which encapsulated the original Hadoop HDFS API.
If no file system class is specified, the wrapper will automatically load the Hadoop
distributed file system (HDFS).Constructor and Description |
---|
HadoopFileSystem(Class<? extends org.apache.hadoop.fs.FileSystem> fsClass)
Creates a new DistributedFileSystem object to access HDFS
|
Modifier and Type | Method and Description |
---|---|
HadoopDataOutputStream |
create(org.apache.flink.core.fs.Path f,
boolean overwrite) |
HadoopDataOutputStream |
create(org.apache.flink.core.fs.Path f,
boolean overwrite,
int bufferSize,
short replication,
long blockSize) |
boolean |
delete(org.apache.flink.core.fs.Path f,
boolean recursive) |
long |
getDefaultBlockSize() |
org.apache.flink.core.fs.BlockLocation[] |
getFileBlockLocations(org.apache.flink.core.fs.FileStatus file,
long start,
long len) |
org.apache.flink.core.fs.FileStatus |
getFileStatus(org.apache.flink.core.fs.Path f) |
static org.apache.hadoop.conf.Configuration |
getHadoopConfiguration()
Returns a new Hadoop Configuration object using the path to the hadoop conf configured
in the main configuration (flink-conf.yaml).
|
org.apache.hadoop.fs.FileSystem |
getHadoopFileSystem()
Gets the underlying Hadoop FileSystem.
|
Class<?> |
getHadoopWrapperClassNameForFileSystem(String scheme) |
org.apache.flink.core.fs.Path |
getHomeDirectory() |
URI |
getUri() |
org.apache.flink.core.fs.Path |
getWorkingDirectory() |
void |
initialize(URI path) |
boolean |
isDistributedFS() |
org.apache.flink.core.fs.FileStatus[] |
listStatus(org.apache.flink.core.fs.Path f) |
boolean |
mkdirs(org.apache.flink.core.fs.Path f) |
HadoopDataInputStream |
open(org.apache.flink.core.fs.Path f) |
HadoopDataInputStream |
open(org.apache.flink.core.fs.Path f,
int bufferSize) |
boolean |
rename(org.apache.flink.core.fs.Path src,
org.apache.flink.core.fs.Path dst) |
public HadoopFileSystem(Class<? extends org.apache.hadoop.fs.FileSystem> fsClass) throws IOException
IOException
- throw if the required HDFS classes cannot be instantiatedpublic static org.apache.hadoop.conf.Configuration getHadoopConfiguration()
public org.apache.flink.core.fs.Path getWorkingDirectory()
getWorkingDirectory
in class org.apache.flink.core.fs.FileSystem
public org.apache.flink.core.fs.Path getHomeDirectory()
getHomeDirectory
in class org.apache.flink.core.fs.FileSystem
public URI getUri()
getUri
in class org.apache.flink.core.fs.FileSystem
public org.apache.hadoop.fs.FileSystem getHadoopFileSystem()
public void initialize(URI path) throws IOException
initialize
in class org.apache.flink.core.fs.FileSystem
IOException
public org.apache.flink.core.fs.FileStatus getFileStatus(org.apache.flink.core.fs.Path f) throws IOException
getFileStatus
in class org.apache.flink.core.fs.FileSystem
IOException
public org.apache.flink.core.fs.BlockLocation[] getFileBlockLocations(org.apache.flink.core.fs.FileStatus file, long start, long len) throws IOException
getFileBlockLocations
in class org.apache.flink.core.fs.FileSystem
IOException
public HadoopDataInputStream open(org.apache.flink.core.fs.Path f, int bufferSize) throws IOException
open
in class org.apache.flink.core.fs.FileSystem
IOException
public HadoopDataInputStream open(org.apache.flink.core.fs.Path f) throws IOException
open
in class org.apache.flink.core.fs.FileSystem
IOException
public HadoopDataOutputStream create(org.apache.flink.core.fs.Path f, boolean overwrite, int bufferSize, short replication, long blockSize) throws IOException
create
in class org.apache.flink.core.fs.FileSystem
IOException
public HadoopDataOutputStream create(org.apache.flink.core.fs.Path f, boolean overwrite) throws IOException
create
in class org.apache.flink.core.fs.FileSystem
IOException
public boolean delete(org.apache.flink.core.fs.Path f, boolean recursive) throws IOException
delete
in class org.apache.flink.core.fs.FileSystem
IOException
public org.apache.flink.core.fs.FileStatus[] listStatus(org.apache.flink.core.fs.Path f) throws IOException
listStatus
in class org.apache.flink.core.fs.FileSystem
IOException
public boolean mkdirs(org.apache.flink.core.fs.Path f) throws IOException
mkdirs
in class org.apache.flink.core.fs.FileSystem
IOException
public boolean rename(org.apache.flink.core.fs.Path src, org.apache.flink.core.fs.Path dst) throws IOException
rename
in class org.apache.flink.core.fs.FileSystem
IOException
public long getDefaultBlockSize()
getDefaultBlockSize
in class org.apache.flink.core.fs.FileSystem
public boolean isDistributedFS()
isDistributedFS
in class org.apache.flink.core.fs.FileSystem
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.