|
|||||||||||
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.LocalFileSystem
Implement the FileSystem API for the native filesystem.
Field Summary |
Fields inherited from class org.apache.hadoop.fs.FileSystem |
LOG |
Constructor Summary | |
LocalFileSystem(Configuration conf)
Construct a local filesystem client. |
Method Summary | |
void |
close()
No more filesystem operations are needed. |
void |
completeLocalOutput(Path fsWorkingFile,
Path tmpLocalFile)
Called when we're all done writing to the target. |
void |
copyFromLocalFile(Path src,
Path dst)
The src file is on the local disk. |
void |
copyToLocalFile(Path src,
Path dst)
The src file is under FS, and the dst is on the local disk. |
FSOutputStream |
createRaw(Path f,
boolean overwrite,
short replication,
long blockSize)
Opens an OutputStream at the indicated Path. |
boolean |
deleteRaw(Path p)
Deletes Path |
boolean |
exists(Path f)
Check if exists. |
long |
getBlockSize(Path filename)
Get the size for a particular file. |
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 1x1 'localhost' cell if the file exists. |
long |
getLength(Path f)
The number of bytes in a file. |
String |
getName()
Returns a name for this filesystem, suitable to pass to FileSystem.getNamed(String,Configuration) . |
short |
getReplication(Path f)
Replication is not supported for the local file system. |
Path |
getWorkingDirectory()
Get the current working directory for the given file system |
boolean |
isDirectory(Path f)
True iff the named path is a directory. |
Path[] |
listPathsRaw(Path f)
List files in a directory. |
void |
lock(Path p,
boolean shared)
Obtain a lock on the given Path |
boolean |
mkdirs(Path f)
Creates the specified directory hierarchy. |
void |
moveFromLocalFile(Path src,
Path dst)
The src file is on the local disk. |
FSInputStream |
openRaw(Path f)
Opens an InputStream for the indicated Path, whether local or via DFS. |
File |
pathToFile(Path path)
Convert a path to a File. |
void |
release(Path p)
Release the lock |
boolean |
renameRaw(Path src,
Path dst)
Renames Path src to Path dst. |
void |
reportChecksumFailure(Path p,
FSInputStream in,
long start,
long length,
int crc)
Moves files to a bad file directory on the same device, so that their storage will not be reused. |
boolean |
setReplicationRaw(Path src,
short replication)
Set replication for an existing file. |
void |
setWorkingDirectory(Path newDir)
Set the working directory to the given directory. |
Path |
startLocalOutput(Path fsOutputFile,
Path tmpLocalFile)
Returns a local File that the user can write output to. |
String |
toString()
|
Methods inherited from class org.apache.hadoop.fs.FileSystem |
completeLocalOutput, create, create, create, create, create, createNewFile, createNewFile, delete, delete, exists, get, getChecksumFile, getLength, getNamed, isChecksumFile, isDirectory, isFile, isFile, listFiles, listFiles, listPaths, listPaths, lock, mkdirs, open, open, open, parseArgs, release, rename, rename, setReplication, startLocalOutput |
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, wait, wait, wait |
Constructor Detail |
public LocalFileSystem(Configuration conf) throws IOException
Method Detail |
public String[][] getFileCacheHints(Path f, long start, long len) throws IOException
getFileCacheHints
in class FileSystem
IOException
public String getName()
FileSystem
FileSystem.getNamed(String,Configuration)
.
getName
in class FileSystem
public File pathToFile(Path path)
public FSInputStream openRaw(Path f) throws IOException
FileSystem
openRaw
in class FileSystem
IOException
public FSOutputStream createRaw(Path f, boolean overwrite, short replication, long blockSize) throws IOException
FileSystem
createRaw
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.replication
- required block replication for the file.
IOException
public short getReplication(Path f) throws IOException
getReplication
in class FileSystem
f
- file name
IOException
public boolean setReplicationRaw(Path src, short replication) throws IOException
FileSystem
setReplicationRaw
in class FileSystem
src
- file namereplication
- new replication
IOException
public boolean renameRaw(Path src, Path dst) throws IOException
FileSystem
renameRaw
in class FileSystem
IOException
public boolean deleteRaw(Path p) throws IOException
FileSystem
deleteRaw
in class FileSystem
IOException
public boolean exists(Path f) throws IOException
FileSystem
exists
in class FileSystem
IOException
public boolean isDirectory(Path f) throws IOException
FileSystem
isDirectory
in class FileSystem
IOException
public long getLength(Path f) throws IOException
FileSystem
getLength
in class FileSystem
IOException
public Path[] listPathsRaw(Path f) throws IOException
FileSystem
listPathsRaw
in class FileSystem
IOException
public boolean mkdirs(Path f) throws IOException
mkdirs
in class FileSystem
IOException
public void setWorkingDirectory(Path newDir)
setWorkingDirectory
in class FileSystem
newDir
- public Path getWorkingDirectory()
FileSystem
getWorkingDirectory
in class FileSystem
public void lock(Path p, boolean shared) throws IOException
FileSystem
lock
in class FileSystem
IOException
public void release(Path p) throws IOException
FileSystem
release
in class FileSystem
IOException
public void moveFromLocalFile(Path src, Path dst) throws IOException
FileSystem
moveFromLocalFile
in class FileSystem
IOException
public void copyFromLocalFile(Path src, Path dst) throws IOException
FileSystem
copyFromLocalFile
in class FileSystem
IOException
public void copyToLocalFile(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 fsWorkingFile, Path tmpLocalFile) throws IOException
FileSystem
completeLocalOutput
in class FileSystem
IOException
public void close() throws IOException
FileSystem
close
in class FileSystem
IOException
public String toString()
public void reportChecksumFailure(Path p, FSInputStream in, long start, long length, int crc)
reportChecksumFailure
in class FileSystem
p
- the file name containing the errorin
- the stream open on the filestart
- the position of the beginning of the bad data in the filelength
- the length of the bad data in the filecrc
- the expected CRC32 of the datapublic long getDefaultBlockSize()
FileSystem
getDefaultBlockSize
in class FileSystem
public long getBlockSize(Path filename)
FileSystem
getBlockSize
in class FileSystem
filename
- the filename
public short getDefaultReplication()
FileSystem
getDefaultReplication
in class FileSystem
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |