|
||||||||||
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 org.apache.hadoop.fs.ChecksumFileSystem
public abstract class ChecksumFileSystem
Abstract Checksumed FileSystem. It provide a basice implementation of a Checksumed FileSystem, which creates a checksum file for each raw file. It generates & verifies checksums at the client side.
Field Summary |
---|
Fields inherited from class org.apache.hadoop.fs.FilterFileSystem |
---|
fs |
Fields inherited from class org.apache.hadoop.fs.FileSystem |
---|
LOG |
Constructor Summary | |
---|---|
ChecksumFileSystem(FileSystem fs)
|
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. |
void |
copyToLocalFile(Path src,
Path dst,
boolean copyCrc)
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)
Get rid of Path f, whether a true file or dir. |
static double |
getApproxChkSumLength(long size)
|
int |
getBytesPerSum()
Return the bytes Per Checksum |
Path |
getChecksumFile(Path file)
Return the name of the checksum file associated with a file. |
long |
getChecksumFileLength(Path file,
long fileSize)
Return the length of the checksum file given the size of the actual file. |
FileSystem |
getRawFileSystem()
get the raw file system |
static boolean |
isChecksumFile(Path file)
Return true iff file is a checksum file name. |
Path[] |
listPaths(Path f)
Filter raw files in the given path using the default checksum filter. |
Path[] |
listPaths(Path[] files)
Filter raw files in the given pathes using the default checksum filter. |
void |
lock(Path f,
boolean shared)
Obtain a lock on the given Path |
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)
Release the lock |
boolean |
rename(Path src,
Path dst)
Rename files/dirs |
boolean |
reportChecksumFailure(Path f,
FSDataInputStream in,
long inPos,
FSDataInputStream sums,
long sumsPos)
Report a checksum error to the file system. |
boolean |
setReplication(Path src,
short replication)
Set replication for an existing file. |
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.FilterFileSystem |
---|
checkPath, close, exists, getBlockSize, getConf, getDefaultBlockSize, getDefaultReplication, getFileCacheHints, getLength, getName, getReplication, getUri, getWorkingDirectory, initialize, isDirectory, makeQualified, setWorkingDirectory |
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, 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 |
Constructor Detail |
---|
public ChecksumFileSystem(FileSystem fs)
Method Detail |
---|
public static double getApproxChkSumLength(long size)
public FileSystem getRawFileSystem()
public Path getChecksumFile(Path file)
public static boolean isChecksumFile(Path file)
public long getChecksumFileLength(Path file, long fileSize)
public int getBytesPerSum()
public FSDataInputStream open(Path f, int bufferSize) throws IOException
open
in class FilterFileSystem
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 FilterFileSystem
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 boolean setReplication(Path src, short replication) throws IOException
setReplication
in class FilterFileSystem
src
- file namereplication
- new replication
IOException
public boolean rename(Path src, Path dst) throws IOException
rename
in class FilterFileSystem
IOException
public boolean delete(Path f) throws IOException
delete
in class FilterFileSystem
IOException
public Path[] listPaths(Path[] files) throws IOException
listPaths
in class FileSystem
files
- a list of paths
IOException
public Path[] listPaths(Path f) throws IOException
listPaths
in class FilterFileSystem
f
- source path
IOException
public boolean mkdirs(Path f) throws IOException
FilterFileSystem
mkdirs
in class FilterFileSystem
IOException
public void lock(Path f, boolean shared) throws IOException
FilterFileSystem
lock
in class FilterFileSystem
IOException
public void release(Path f) throws IOException
FilterFileSystem
release
in class FilterFileSystem
IOException
public void copyFromLocalFile(boolean delSrc, Path src, Path dst) throws IOException
FilterFileSystem
copyFromLocalFile
in class FilterFileSystem
IOException
public void copyToLocalFile(boolean delSrc, Path src, Path dst) throws IOException
copyToLocalFile
in class FilterFileSystem
IOException
public void copyToLocalFile(Path src, Path dst, boolean copyCrc) throws IOException
IOException
public Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
FilterFileSystem
startLocalOutput
in class FilterFileSystem
IOException
public void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
FilterFileSystem
completeLocalOutput
in class FilterFileSystem
IOException
public boolean reportChecksumFailure(Path f, FSDataInputStream in, long inPos, FSDataInputStream sums, long sumsPos)
f
- the file name containing the errorin
- the stream open on the fileinPos
- the position of the beginning of the bad data in the filesums
- the stream open on the checksum filesumsPos
- the position of the beginning of the bad data in the checksum file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |