org.apache.hadoop.fs
Class LocalFileSystem

java.lang.Object
  extended by org.apache.hadoop.conf.Configured
      extended by org.apache.hadoop.fs.FileSystem
          extended by org.apache.hadoop.fs.FilterFileSystem
              extended by org.apache.hadoop.fs.ChecksumFileSystem
                  extended by org.apache.hadoop.fs.LocalFileSystem
All Implemented Interfaces:
Closeable, Configurable

public class LocalFileSystem
extends ChecksumFileSystem

Implement the FileSystem API for the checksumed local filesystem.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.hadoop.fs.FileSystem
FileSystem.Statistics
 
Field Summary
 
Fields inherited from class org.apache.hadoop.fs.FilterFileSystem
fs
 
Fields inherited from class org.apache.hadoop.fs.FileSystem
FS_DEFAULT_NAME_KEY, LOG, statistics
 
Constructor Summary
LocalFileSystem()
           
LocalFileSystem(FileSystem rawLocalFileSystem)
           
 
Method Summary
 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.
 boolean exists(Path f)
          Get file status.
 FileSystem getRaw()
           
 File pathToFile(Path path)
          Convert a path to a File.
 boolean reportChecksumFailure(Path p, FSDataInputStream in, long inPos, FSDataInputStream sums, long sumsPos)
          Moves files to a bad file directory on the same device, so that their storage will not be reused.
 
Methods inherited from class org.apache.hadoop.fs.ChecksumFileSystem
append, completeLocalOutput, copyToLocalFile, create, createNonRecursive, delete, getApproxChkSumLength, getBytesPerSum, getChecksumFile, getChecksumFileLength, getChecksumLength, getRawFileSystem, isChecksumFile, listStatus, mkdirs, open, rename, setConf, setReplication, setVerifyChecksum, startLocalOutput
 
Methods inherited from class org.apache.hadoop.fs.FilterFileSystem
checkPath, close, delete, getCanonicalServiceName, getConf, getDefaultBlockSize, getDefaultReplication, getFileBlockLocations, getFileChecksum, getFileStatus, getHomeDirectory, getName, getUri, getWorkingDirectory, initialize, makeQualified, mkdirs, setOwner, setPermission, setWorkingDirectory
 
Methods inherited from class org.apache.hadoop.fs.FileSystem
addFileSystemForTesting, append, append, clearStatistics, closeAll, closeAllForUGI, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, deleteOnExit, get, get, get, getAllStatistics, getBlockSize, getCanonicalUri, getContentSummary, getDefaultPort, getDefaultUri, getDelegationToken, getLength, getLocal, getNamed, getReplication, getStatistics, getStatistics, getUsed, globStatus, globStatus, isDirectory, isFile, listStatus, listStatus, listStatus, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, open, printStatistics, processDeleteOnExit, setDefaultUri, setDefaultUri, setTimes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalFileSystem

public LocalFileSystem()

LocalFileSystem

public LocalFileSystem(FileSystem rawLocalFileSystem)
Method Detail

getRaw

public FileSystem getRaw()

exists

public boolean exists(Path f)
               throws IOException
Get file status.

Overrides:
exists in class FileSystem
Parameters:
f - source file
Throws:
IOException

pathToFile

public File pathToFile(Path path)
Convert a path to a File.


copyFromLocalFile

public void copyFromLocalFile(boolean delSrc,
                              Path src,
                              Path dst)
                       throws IOException
Description copied from class: FilterFileSystem
The src file is on the local disk. Add it to FS at the given dst name. delSrc indicates if the source should be removed

Overrides:
copyFromLocalFile in class ChecksumFileSystem
Throws:
IOException

copyToLocalFile

public void copyToLocalFile(boolean delSrc,
                            Path src,
                            Path dst)
                     throws IOException
Description copied from class: ChecksumFileSystem
The src file is under FS, and the dst is on the local disk. Copy it from FS control to the local dst name.

Overrides:
copyToLocalFile in class ChecksumFileSystem
Throws:
IOException

reportChecksumFailure

public boolean reportChecksumFailure(Path p,
                                     FSDataInputStream in,
                                     long inPos,
                                     FSDataInputStream sums,
                                     long sumsPos)
Moves files to a bad file directory on the same device, so that their storage will not be reused.

Overrides:
reportChecksumFailure in class ChecksumFileSystem
Parameters:
p - the file name containing the error
in - the stream open on the file
inPos - the position of the beginning of the bad data in the file
sums - the stream open on the checksum file
sumsPos - the position of the beginning of the bad data in the checksum file
Returns:
if retry is neccessary


Copyright © 2009 The Apache Software Foundation