|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.conf.Configured
org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.kfs.KosmosFileSystem
public class KosmosFileSystem
A FileSystem backed by KFS.
Field Summary |
---|
Fields inherited from class org.apache.hadoop.fs.FileSystem |
---|
LOG |
Constructor Summary | |
---|---|
KosmosFileSystem()
|
Method Summary | |
---|---|
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 file,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
Progressable progress)
Opens an FSDataOutputStream at the indicated Path with write-progress reporting. |
boolean |
delete(Path path)
Delete a file |
boolean |
exists(Path path)
Check if exists. |
long |
getContentLength(Path path)
Return the number of bytes of the given path If f is a file, return the size of the file; If f is a directory, return the size of the directory tree |
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 null if the file doesn't exist; otherwise, get the locations of the various chunks of the file file from KFS. |
FileStatus |
getFileStatus(Path path)
|
long |
getLength(Path path)
Deprecated. |
String |
getName()
Deprecated. |
short |
getReplication(Path path)
Deprecated. |
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 uri,
Configuration conf)
Called after a new FileSystem instance is constructed. |
boolean |
isDirectory(Path path)
Deprecated. |
boolean |
isFile(Path path)
Deprecated. |
Path[] |
listPaths(Path path)
List files in a directory. |
FileStatus[] |
listStatus(Path path)
|
void |
lock(Path path,
boolean shared)
Deprecated. |
boolean |
mkdirs(Path path)
Make the given file and all non-existent parents into directories. |
FSDataInputStream |
open(Path path,
int bufferSize)
Opens an FSDataInputStream at the indicated Path. |
void |
release(Path path)
Deprecated. |
boolean |
rename(Path src,
Path dst)
Renames Path src to Path dst. |
boolean |
setReplication(Path path,
short replication)
Set replication for an existing file. |
void |
setWorkingDirectory(Path dir)
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 |
---|
checkPath, close, closeAll, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, createNewFile, get, get, getBlockSize, getLocal, getNamed, getUsed, globPaths, globPaths, listPaths, listPaths, listPaths, makeQualified, moveFromLocalFile, moveToLocalFile, open, parseArgs |
Methods inherited from class org.apache.hadoop.conf.Configured |
---|
getConf, setConf |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KosmosFileSystem()
Method Detail |
---|
public URI getUri()
FileSystem
getUri
in class FileSystem
public void initialize(URI uri, Configuration conf) throws IOException
FileSystem
initialize
in class FileSystem
uri
- a uri whose authority section names the host, port, etc.
for this FileSystemconf
- the configuration
IOException
@Deprecated public String getName()
getName
in class FileSystem
public Path getWorkingDirectory()
FileSystem
getWorkingDirectory
in class FileSystem
public void setWorkingDirectory(Path dir)
FileSystem
setWorkingDirectory
in class FileSystem
public boolean exists(Path path) throws IOException
FileSystem
exists
in class FileSystem
path
- source file
IOException
public boolean mkdirs(Path path) throws IOException
FileSystem
mkdirs
in class FileSystem
IOException
@Deprecated public boolean isDirectory(Path path) throws IOException
isDirectory
in class FileSystem
IOException
@Deprecated public boolean isFile(Path path) throws IOException
FileSystem
isFile
in class FileSystem
IOException
public long getContentLength(Path path) throws IOException
FileSystem
getContentLength
in class FileSystem
IOException
public FileStatus[] listStatus(Path path) throws IOException
listStatus
in class FileSystem
IOException
public FileStatus getFileStatus(Path path) throws IOException
getFileStatus
in class FileSystem
IOException
public Path[] listPaths(Path path) throws IOException
FileSystem
listPaths
in class FileSystem
IOException
public FSDataOutputStream create(Path file, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
FileSystem
create
in class FileSystem
file
- 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 FSDataInputStream open(Path path, int bufferSize) throws IOException
FileSystem
open
in class FileSystem
path
- the file name to openbufferSize
- the size of the buffer to be used.
IOException
public boolean rename(Path src, Path dst) throws IOException
FileSystem
rename
in class FileSystem
IOException
public boolean delete(Path path) throws IOException
FileSystem
delete
in class FileSystem
IOException
@Deprecated public long getLength(Path path) throws IOException
getLength
in class FileSystem
IOException
@Deprecated public short getReplication(Path path) throws IOException
FileSystem
getReplication
in class FileSystem
path
- file name
IOException
public short getDefaultReplication()
FileSystem
getDefaultReplication
in class FileSystem
public boolean setReplication(Path path, short replication) throws IOException
FileSystem
setReplication
in class FileSystem
path
- file namereplication
- new replication
IOException
public long getDefaultBlockSize()
FileSystem
getDefaultBlockSize
in class FileSystem
@Deprecated public void lock(Path path, boolean shared) throws IOException
IOException
@Deprecated public void release(Path path) throws IOException
IOException
public String[][] getFileCacheHints(Path f, long start, long len) throws IOException
getFileCacheHints
in class FileSystem
IOException
public void copyFromLocalFile(boolean delSrc, Path src, Path dst) throws IOException
FileSystem
copyFromLocalFile
in class FileSystem
IOException
public void copyToLocalFile(boolean delSrc, Path src, Path dst) throws IOException
FileSystem
copyToLocalFile
in class FileSystem
IOException
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
FileSystem
startLocalOutput
in class FileSystem
IOException
public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
FileSystem
completeLocalOutput
in class FileSystem
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |