|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.conf.Configured org.apache.hadoop.fs.FileSystem org.apache.hadoop.fs.FilterFileSystem
public class FilterFileSystem
A FilterFileSystem
contains
some other file system, which it uses as
its basic file system, possibly transforming
the data along the way or providing additional
functionality. The class FilterFileSystem
itself simply overrides all methods of
FileSystem
with versions that
pass all requests to the contained file
system. Subclasses of FilterFileSystem
may further override some of these methods
and may also provide additional methods
and fields.
Field Summary | |
---|---|
protected FileSystem |
fs
|
Fields inherited from class org.apache.hadoop.fs.FileSystem |
---|
LOG |
Constructor Summary | |
---|---|
FilterFileSystem(FileSystem fs)
|
Method Summary | |
---|---|
protected void |
checkPath(Path path)
Check that a Path belongs to this FileSystem. |
void |
close()
No more filesystem operations are needed. |
void |
completeLocalOutput(Path fsOutputFile,
Path tmpLocalFile)
Called when we're all done writing to the target. |
void |
copyFromLocalFile(boolean delSrc,
Path src,
Path dst)
The src file is on the local disk. |
void |
copyToLocalFile(boolean delSrc,
Path src,
Path dst)
The src file is under FS, and the dst is on the local disk. |
FSDataOutputStream |
create(Path f,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
Progressable progress)
Opens an FSDataOutputStream at the indicated Path with write-progress reporting. |
boolean |
delete(Path f)
Delete a file |
boolean |
exists(Path f)
Check if exists. |
long |
getBlockSize(Path f)
Get the block size for a particular file. |
Configuration |
getConf()
Return the configuration used by this object. |
long |
getDefaultBlockSize()
Return the number of bytes that large input files should be optimally be split into to minimize i/o time. |
short |
getDefaultReplication()
Get the default replication. |
String[][] |
getFileCacheHints(Path f,
long start,
long len)
Return a 2D array of size 1x1 or greater, containing hostnames where portions of the given file can be found. |
long |
getLength(Path f)
The number of bytes in a file. |
String |
getName()
Deprecated. call #getUri() instead. |
short |
getReplication(Path src)
Get replication. |
URI |
getUri()
Returns a URI whose scheme and authority identify this FileSystem. |
Path |
getWorkingDirectory()
Get the current working directory for the given file system |
void |
initialize(URI name,
Configuration conf)
Called after a new FileSystem instance is constructed. |
boolean |
isDirectory(Path f)
True iff the named path is a directory. |
Path[] |
listPaths(Path f)
List files in a directory. |
void |
lock(Path f,
boolean shared)
Deprecated. FS does not support file locks anymore. |
Path |
makeQualified(Path path)
Make sure that a path specifies a FileSystem. |
boolean |
mkdirs(Path f)
Make the given file and all non-existent parents into directories. |
FSDataInputStream |
open(Path f,
int bufferSize)
Opens an FSDataInputStream at the indicated Path. |
void |
release(Path f)
Deprecated. FS does not support file locks anymore. |
boolean |
rename(Path src,
Path dst)
Renames Path src to Path dst. |
boolean |
setReplication(Path src,
short replication)
Set replication for an existing file. |
void |
setWorkingDirectory(Path newDir)
Set the current working directory for the given file system. |
Path |
startLocalOutput(Path fsOutputFile,
Path tmpLocalFile)
Returns a local File that the user can write output to. |
Methods inherited from class org.apache.hadoop.fs.FileSystem |
---|
closeAll, copyFromLocalFile, copyToLocalFile, create, create, create, create, create, create, create, createNewFile, get, get, getContentLength, getLocal, getNamed, getUsed, globPaths, globPaths, isFile, listPaths, listPaths, listPaths, moveFromLocalFile, moveToLocalFile, open, parseArgs |
Methods inherited from class org.apache.hadoop.conf.Configured |
---|
setConf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FileSystem fs
Constructor Detail |
---|
public FilterFileSystem(FileSystem fs)
Method Detail |
---|
public void initialize(URI name, Configuration conf) throws IOException
initialize
in class FileSystem
name
- a uri whose authority section names the host, port, etc.
for this FileSystemconf
- the configuration
IOException
public URI getUri()
getUri
in class FileSystem
public String getName()
getName
in class FileSystem
public Path makeQualified(Path path)
makeQualified
in class FileSystem
protected void checkPath(Path path)
checkPath
in class FileSystem
public String[][] getFileCacheHints(Path f, long start, long len) throws IOException
getFileCacheHints
in class FileSystem
IOException
public FSDataInputStream open(Path f, int bufferSize) throws IOException
open
in class FileSystem
f
- the file name to openbufferSize
- the size of the buffer to be used.
IOException
public FSDataOutputStream create(Path f, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
create
in class FileSystem
f
- the file name to openoverwrite
- if a file with this name already exists, then if true,
the file will be overwritten, and if false an error will be thrown.bufferSize
- the size of the buffer to be used.replication
- required block replication for the file.
IOException
public short getReplication(Path src) throws IOException
getReplication
in class FileSystem
src
- file name
IOException
public boolean setReplication(Path src, short replication) throws IOException
setReplication
in class FileSystem
src
- file namereplication
- new replication
IOException
public boolean rename(Path src, Path dst) throws IOException
rename
in class FileSystem
IOException
public boolean delete(Path f) throws IOException
delete
in class FileSystem
IOException
public boolean exists(Path f) throws IOException
exists
in class FileSystem
f
- source file
IOException
public boolean isDirectory(Path f) throws IOException
isDirectory
in class FileSystem
IOException
public long getLength(Path f) throws IOException
getLength
in class FileSystem
IOException
public Path[] listPaths(Path f) throws IOException
listPaths
in class FileSystem
IOException
public void setWorkingDirectory(Path newDir)
setWorkingDirectory
in class FileSystem
newDir
- public Path getWorkingDirectory()
getWorkingDirectory
in class FileSystem
public boolean mkdirs(Path f) throws IOException
mkdirs
in class FileSystem
IOException
@Deprecated public void lock(Path f, boolean shared) throws IOException
lock
in class FileSystem
IOException
@Deprecated public void release(Path f) throws IOException
release
in class FileSystem
IOException
public void copyFromLocalFile(boolean delSrc, Path src, Path dst) throws IOException
copyFromLocalFile
in class FileSystem
IOException
public void copyToLocalFile(boolean delSrc, Path src, Path dst) throws IOException
copyToLocalFile
in class FileSystem
IOException
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
startLocalOutput
in class FileSystem
IOException
public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
completeLocalOutput
in class FileSystem
IOException
public long getBlockSize(Path f) throws IOException
getBlockSize
in class FileSystem
f
- the filename
IOException
public long getDefaultBlockSize()
getDefaultBlockSize
in class FileSystem
public short getDefaultReplication()
getDefaultReplication
in class FileSystem
public Configuration getConf()
Configurable
getConf
in interface Configurable
getConf
in class Configured
public void close() throws IOException
FileSystem
close
in class FileSystem
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |