public abstract class ChecksumFileSystem extends FilterFileSystem
FileSystem.StatisticsfsFS_DEFAULT_NAME_KEY, LOG, statistics| 构造器和说明 |
|---|
ChecksumFileSystem(FileSystem fs) |
| 限定符和类型 | 方法和说明 |
|---|---|
FSDataOutputStream |
append(Path f,
int bufferSize,
Progressable progress)
Append to an existing file (optional operation).
|
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,
FsPermission permission,
boolean overwrite,
int bufferSize,
short replication,
long blockSize,
Progressable progress)
Opens an FSDataOutputStream at the indicated Path with write-progress
reporting.
|
FSDataOutputStream |
createNonRecursive(Path f,
FsPermission permission,
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,
boolean recursive)
Implement the delete(Path, boolean) in checksum
file system.
|
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.
|
static long |
getChecksumLength(long size,
int bytesPerSum)
Calculated the length of the checksum file in bytes.
|
FileSystem |
getRawFileSystem()
get the raw file system
|
static boolean |
isChecksumFile(Path file)
Return true iff file is a checksum file name.
|
FileStatus[] |
listStatus(Path f)
List the statuses of the files/directories in the given path if the path is
a directory.
|
boolean |
mkdirs(Path f)
Call
FileSystem.mkdirs(Path, FsPermission) with default permission. |
FSDataInputStream |
open(Path f,
int bufferSize)
Opens an FSDataInputStream at the indicated Path.
|
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.
|
void |
setConf(Configuration conf)
Set the configuration to be used by this object.
|
boolean |
setReplication(Path src,
short replication)
Set replication for an existing file.
|
void |
setVerifyChecksum(boolean verifyChecksum)
Set whether to verify checksum.
|
Path |
startLocalOutput(Path fsOutputFile,
Path tmpLocalFile)
Returns a local File that the user can write output to.
|
checkPath, close, concat, delete, getCanonicalServiceName, getConf, getDefaultBlockSize, getDefaultReplication, getFileBlockLocations, getFileChecksum, getFileStatus, getHomeDirectory, getName, getUri, getWorkingDirectory, initialize, makeQualified, mkdirs, setOwner, setPermission, setWorkingDirectoryaddFileSystemForTesting, append, append, clearStatistics, closeAll, closeAllForUGI, copyFromLocalFile, copyFromLocalFile, copyFromLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, createNewFile, createNonRecursive, deleteOnExit, exists, get, get, get, getAllStatistics, getBlockSize, getCacheSize, getCanonicalUri, getContentSummary, getDefaultBlockSize, getDefaultPort, getDefaultReplication, 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, setTimespublic ChecksumFileSystem(FileSystem fs)
public static double getApproxChkSumLength(long size)
public void setConf(Configuration conf)
ConfigurablesetConf 在接口中 ConfigurablesetConf 在类中 Configuredpublic void setVerifyChecksum(boolean verifyChecksum)
setVerifyChecksum 在类中 FilterFileSystempublic 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 在类中 FilterFileSystemf - the file name to openbufferSize - the size of the buffer to be used.IOExceptionpublic FSDataOutputStream append(Path f, int bufferSize, Progressable progress) throws IOException
append 在类中 FilterFileSystemf - the existing file to be appended.bufferSize - the size of the buffer to be used.progress - for reporting progress if it is not null.IOExceptionpublic static long getChecksumLength(long size,
int bytesPerSum)
size - the length of the data file in bytesbytesPerSum - the number of bytes in a checksum blockpublic FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
create 在类中 FilterFileSystemf - 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.IOExceptionFileSystem.setPermission(Path, FsPermission)public FSDataOutputStream createNonRecursive(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException
createNonRecursive 在类中 FileSystemf - 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.IOExceptionFileSystem.setPermission(Path, FsPermission)public boolean setReplication(Path src, short replication) throws IOException
setReplication 在类中 FilterFileSystemsrc - file namereplication - new replicationIOExceptionpublic boolean rename(Path src, Path dst) throws IOException
rename 在类中 FilterFileSystemIOExceptionpublic boolean delete(Path f, boolean recursive) throws IOException
delete 在类中 FilterFileSystemf - the path to delete.recursive - if path is a directory and set to
true, the directory is deleted else throws an exception. In
case of a file the recursive can be set to either true or false.IOExceptionpublic FileStatus[] listStatus(Path f) throws IOException
listStatus 在类中 FilterFileSystemf - given pathIOExceptionpublic boolean mkdirs(Path f) throws IOException
FileSystemFileSystem.mkdirs(Path, FsPermission) with default permission.mkdirs 在类中 FileSystemIOExceptionpublic void copyFromLocalFile(boolean delSrc,
Path src,
Path dst)
throws IOException
FilterFileSystemcopyFromLocalFile 在类中 FilterFileSystemIOExceptionpublic void copyToLocalFile(boolean delSrc,
Path src,
Path dst)
throws IOException
copyToLocalFile 在类中 FilterFileSystemIOExceptionpublic void copyToLocalFile(Path src, Path dst, boolean copyCrc) throws IOException
IOExceptionpublic Path startLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
FilterFileSystemstartLocalOutput 在类中 FilterFileSystemIOExceptionpublic void completeLocalOutput(Path fsOutputFile, Path tmpLocalFile) throws IOException
FilterFileSystemcompleteLocalOutput 在类中 FilterFileSystemIOExceptionpublic 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 fileCopyright © 2009 The Apache Software Foundation