PathCapabilitiesLocalFs@Private @Evolving public abstract class ChecksumFs extends FilterFs
statistics| Constructor | Description |
|---|---|
ChecksumFs(AbstractFileSystem theFs) |
| Modifier and Type | Method | Description |
|---|---|---|
FSDataOutputStream |
createInternal(Path f,
java.util.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.
|
RemoteIterator<LocatedFileStatus> |
listLocatedStatus(Path f) |
The specification of this method matches that of
FileContext.listLocatedStatus(Path) except that Path f
must be for this file system. |
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.
|
void |
renameInternal(Path src,
Path dst,
boolean overwrite) |
The specification of this method matches that of
FileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system. |
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.
|
boolean |
truncate(Path f,
long newLength) |
The specification of this method matches that of
FileContext.truncate(Path, long) except that Path f must be for
this file system. |
access, checkPath, createMultipartUploader, createSnapshot, createSymlink, deleteSnapshot, getAclStatus, getAllStoragePolicies, getCanonicalServiceName, getDelegationTokens, getEnclosingRoot, getFileBlockLocations, getFileChecksum, getFileLinkStatus, getFileStatus, getFsStatus, getFsStatus, getHomeDirectory, getInitialWorkingDirectory, getLinkTarget, getMyFs, getServerDefaults, getServerDefaults, getStatistics, getStoragePolicy, getUri, getUriDefaultPort, getUriPath, getXAttr, getXAttrs, getXAttrs, hasPathCapability, isValidName, listCorruptFileBlocks, listXAttrs, makeQualified, mkdir, modifyAclEntries, msync, open, openFileWithOptions, removeAcl, removeAclEntries, removeDefaultAcl, removeXAttr, renameSnapshot, resolvePath, satisfyStoragePolicy, setAcl, setOwner, setPermission, setStoragePolicy, setTimes, setXAttr, setXAttr, supportsSymlinks, unsetStoragePolicycheckScheme, clearStatistics, create, createFileSystem, equals, get, getAllStatistics, getStatistics, hashCode, listStatusIterator, methodNotSupported, printStatistics, renamepublic ChecksumFs(AbstractFileSystem theFs) throws java.io.IOException, java.net.URISyntaxException
java.io.IOExceptionjava.net.URISyntaxExceptionpublic static double getApproxChkSumLength(long size)
public void setVerifyChecksum(boolean inVerifyChecksum)
setVerifyChecksum in class FilterFsinVerifyChecksum - verify check sum flag.public AbstractFileSystem getRawFs()
public Path getChecksumFile(Path file)
file - the file path.public static boolean isChecksumFile(Path file)
file - the file path.public long getChecksumFileLength(Path file, long fileSize)
file - the file path.fileSize - file size.public int getBytesPerSum()
public boolean truncate(Path f, long newLength) throws java.io.IOException
AbstractFileSystemFileContext.truncate(Path, long) except that Path f must be for
this file system.truncate in class FilterFsf - the path.newLength - new length.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public FSDataInputStream open(Path f, int bufferSize) throws java.io.IOException, UnresolvedLinkException
open in class FilterFsf - the file name to openbufferSize - the size of the buffer to be used.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.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, java.util.EnumSet<CreateFlag> createFlag, FsPermission absolutePermission, int bufferSize, short replication, long blockSize, Progressable progress, Options.ChecksumOpt checksumOpt, boolean createParent) throws java.io.IOException
AbstractFileSystemAbstractFileSystem.create(Path, EnumSet, Options.CreateOpts...) except that the opts
have been declared explicitly.createInternal in class FilterFsf - the path.createFlag - create flag.absolutePermission - absolute permission.bufferSize - buffer size.replication - replications.blockSize - block size.progress - progress.checksumOpt - check sum opt.createParent - create parent.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.ParentNotDirectoryException - parent not directory exception.UnsupportedFileSystemException - unsupported filesystem exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean setReplication(Path src, short replication) throws java.io.IOException, UnresolvedLinkException
setReplication in class FilterFssrc - file namereplication - new replicationjava.io.IOException - if an I/O error occurs.UnresolvedLinkException - unresolved link exception.public void renameInternal(Path src, Path dst) throws java.io.IOException, UnresolvedLinkException
renameInternal in class FilterFssrc - src.dst - dst.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.ParentNotDirectoryException - parent not directory exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public void renameInternal(Path src, Path dst, boolean overwrite) throws AccessControlException, FileAlreadyExistsException, java.io.FileNotFoundException, ParentNotDirectoryException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.rename(Path, Path, Options.Rename...) except that Path
f must be for this file system.renameInternal in class FilterFssrc - src.dst - dst.overwrite - overwrite flag.AccessControlException - access control exception.FileAlreadyExistsException - file already exists exception.java.io.FileNotFoundException - file not found exception.ParentNotDirectoryException - parent not directory exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public boolean delete(Path f, boolean recursive) throws java.io.IOException, UnresolvedLinkException
delete in class FilterFsf - the path.recursive - recursive flag.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.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 java.io.IOException, UnresolvedLinkException
AbstractFileSystemFileContext.Util.listStatus(Path) except that Path f must be
for this file system.listStatus in class FilterFsf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.public RemoteIterator<LocatedFileStatus> listLocatedStatus(Path f) throws AccessControlException, java.io.FileNotFoundException, UnresolvedLinkException, java.io.IOException
AbstractFileSystemFileContext.listLocatedStatus(Path) except that Path f
must be for this file system.
In HDFS implementation, the BlockLocation of returned LocatedFileStatus
will have different formats for replicated and erasure coded file. Please
refer to FileSystem.getFileBlockLocations(FileStatus, long, long)
for more details.listLocatedStatus in class FilterFsf - the path.AccessControlException - access control exception.java.io.FileNotFoundException - file not found exception.UnresolvedLinkException - unresolved link exception.java.io.IOException - raised on errors performing I/O.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.