@InterfaceAudience.Private @InterfaceStability.Evolving public abstract class ChecksumFs extends FilterFs
statistics
Constructor and Description |
---|
ChecksumFs(AbstractFileSystem theFs) |
Modifier and Type | Method and Description |
---|---|
FSDataOutputStream |
createInternal(Path f,
EnumSet<CreateFlag> createFlag,
FsPermission absolutePermission,
int bufferSize,
short replication,
long blockSize,
Progressable progress,
Options.ChecksumOpt checksumOpt,
boolean createParent)
The specification of this method matches that of
AbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
have been declared explicitly. |
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.
|
AbstractFileSystem |
getRawFs()
get the raw file system.
|
static boolean |
isChecksumFile(Path file)
Return true iff file is a checksum file name.
|
FileStatus[] |
listStatus(Path f)
The specification of this method matches that of
FileContext.Util.listStatus(Path) except that Path f must be
for this file system. |
FSDataInputStream |
open(Path f,
int bufferSize)
Opens an FSDataInputStream at the indicated Path.
|
void |
renameInternal(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.
|
void |
setVerifyChecksum(boolean inVerifyChecksum)
Set whether to verify checksum.
|
checkPath, createSymlink, getCanonicalServiceName, getDelegationTokens, getFileBlockLocations, getFileChecksum, getFileLinkStatus, getFileStatus, getFsStatus, getFsStatus, getHomeDirectory, getInitialWorkingDirectory, getLinkTarget, getMyFs, getServerDefaults, getStatistics, getUri, getUriDefaultPort, getUriPath, isValidName, listCorruptFileBlocks, makeQualified, mkdir, open, renameInternal, resolvePath, setOwner, setPermission, setTimes, supportsSymlinks
checkScheme, clearStatistics, create, createFileSystem, equals, get, getAllStatistics, getStatistics, hashCode, listLocatedStatus, listStatusIterator, printStatistics, rename
public ChecksumFs(AbstractFileSystem theFs) throws IOException, URISyntaxException
IOException
URISyntaxException
public static double getApproxChkSumLength(long size)
public void setVerifyChecksum(boolean inVerifyChecksum)
setVerifyChecksum
in class FilterFs
public AbstractFileSystem getRawFs()
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, UnresolvedLinkException
open
in class FilterFs
f
- the file name to openbufferSize
- the size of the buffer to be used.IOException
UnresolvedLinkException
public 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 createInternal(Path f, EnumSet<CreateFlag> createFlag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, Options.ChecksumOpt checksumOpt, boolean createParent) throws IOException
AbstractFileSystem
AbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...)
except that the opts
have been declared explicitly.createInternal
in class FilterFs
IOException
public boolean setReplication(Path src, short replication) throws IOException, UnresolvedLinkException
setReplication
in class FilterFs
src
- file namereplication
- new replicationIOException
UnresolvedLinkException
public void renameInternal(Path src, Path dst) throws IOException, UnresolvedLinkException
renameInternal
in class FilterFs
IOException
UnresolvedLinkException
public boolean delete(Path f, boolean recursive) throws IOException, UnresolvedLinkException
delete
in class FilterFs
IOException
UnresolvedLinkException
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 filepublic FileStatus[] listStatus(Path f) throws IOException, UnresolvedLinkException
AbstractFileSystem
FileContext.Util.listStatus(Path)
except that Path f must be
for this file system.listStatus
in class FilterFs
IOException
UnresolvedLinkException
Copyright © 2013 Apache Software Foundation. All rights reserved.