|
|||||||||||
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 |
completeLocalInput(File localFile)
Called when we're all done writing to the target. |
void |
completeLocalOutput(File fsWorkingFile,
File tmpLocalFile)
Called when we're all done writing to the target. |
void |
copyFromLocalFile(File src,
File dst)
The src file is on the local disk. |
void |
copyToLocalFile(File src,
File dst)
The src file is under FS2, and the dst is on the local disk. |
FSOutputStream |
createRaw(File f,
boolean overwrite)
Opens an OutputStream at the indicated File. |
boolean |
deleteRaw(File f)
Deletes File |
boolean |
exists(File f)
Check if exists |
long |
getBlockSize()
Return the number of bytes that large input files should be optimally be split into to minimize i/o time. |
String[][] |
getFileCacheHints(File f,
long start,
long len)
Return 1x1 'localhost' cell if the file exists. |
long |
getLength(File f)
The number of bytes in a file. |
String |
getName()
Returns a name for this filesystem, suitable to pass to FileSystem.getNamed(String,Configuration) . |
File |
getWorkingDirectory()
Get the current working directory for the given file system |
boolean |
isAbsolute(File f)
True iff the named path is absolute. |
boolean |
isDirectory(File f)
True iff the named path is a directory. |
File[] |
listFilesRaw(File f)
List files in a directory. |
void |
lock(File f,
boolean shared)
Obtain a lock on the given File |
void |
mkdirs(File f)
Make the given file and all non-existent parents into directories. |
void |
moveFromLocalFile(File src,
File dst)
The src file is on the local disk. |
FSInputStream |
openRaw(File f)
Opens an InputStream for the indicated File, whether local or via DFS. |
void |
release(File f)
Release the lock |
boolean |
renameRaw(File src,
File dst)
Renames File src to File dst. |
void |
reportChecksumFailure(File f,
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. |
void |
setWorkingDirectory(File new_dir)
Set the working directory to the given directory. |
File |
startLocalInput(File fsInputFile,
File tmpLocalFile)
Returns a local File that the user can read from. |
File |
startLocalOutput(File fsOutputFile,
File tmpLocalFile)
Returns a local File that the user can write output to. |
String |
toString()
|
Methods inherited from class org.apache.hadoop.fs.FileSystem |
create, create, createNewFile, delete, get, getChecksumFile, getNamed, isChecksumFile, isFile, listFiles, listFiles, open, open, parseArgs, rename |
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(File 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 FSInputStream openRaw(File f) throws IOException
FileSystem
openRaw
in class FileSystem
IOException
public FSOutputStream createRaw(File f, boolean overwrite) 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.
IOException
public boolean renameRaw(File src, File dst) throws IOException
FileSystem
renameRaw
in class FileSystem
IOException
public boolean deleteRaw(File f) throws IOException
FileSystem
deleteRaw
in class FileSystem
IOException
public boolean exists(File f) throws IOException
FileSystem
exists
in class FileSystem
IOException
public boolean isDirectory(File f) throws IOException
FileSystem
isDirectory
in class FileSystem
IOException
public boolean isAbsolute(File f)
FileSystem
isAbsolute
in class FileSystem
public long getLength(File f) throws IOException
FileSystem
getLength
in class FileSystem
IOException
public File[] listFilesRaw(File f) throws IOException
FileSystem
listFilesRaw
in class FileSystem
IOException
public void mkdirs(File f) throws IOException
FileSystem
mkdirs
in class FileSystem
IOException
public void setWorkingDirectory(File new_dir)
setWorkingDirectory
in class FileSystem
new_dir
- public File getWorkingDirectory()
FileSystem
getWorkingDirectory
in class FileSystem
public void lock(File f, boolean shared) throws IOException
FileSystem
lock
in class FileSystem
IOException
public void release(File f) throws IOException
FileSystem
release
in class FileSystem
IOException
public void moveFromLocalFile(File src, File dst) throws IOException
FileSystem
moveFromLocalFile
in class FileSystem
IOException
public void copyFromLocalFile(File src, File dst) throws IOException
FileSystem
copyFromLocalFile
in class FileSystem
IOException
public void copyToLocalFile(File src, File dst) throws IOException
FileSystem
copyToLocalFile
in class FileSystem
IOException
public File startLocalOutput(File fsOutputFile, File tmpLocalFile) throws IOException
FileSystem
startLocalOutput
in class FileSystem
IOException
public void completeLocalOutput(File fsWorkingFile, File tmpLocalFile) throws IOException
FileSystem
completeLocalOutput
in class FileSystem
IOException
public File startLocalInput(File fsInputFile, File tmpLocalFile) throws IOException
FileSystem
startLocalInput
in class FileSystem
IOException
public void completeLocalInput(File localFile) throws IOException
FileSystem
completeLocalInput
in class FileSystem
IOException
public void close() throws IOException
FileSystem
close
in class FileSystem
IOException
public String toString()
public void reportChecksumFailure(File f, FSInputStream in, long start, long length, int crc)
reportChecksumFailure
in class FileSystem
f
- 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 getBlockSize()
FileSystem
getBlockSize
in class FileSystem
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |