@InterfaceAudience.Public @InterfaceStability.Stable public class LocalFileSystem extends ChecksumFileSystem
fs, swapScheme
DEFAULT_FS, FS_DEFAULT_NAME_KEY, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX, USER_HOME_PREFIX
Constructor and Description |
---|
LocalFileSystem() |
LocalFileSystem(FileSystem rawLocalFileSystem) |
Modifier and Type | Method and Description |
---|---|
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 |
createSymlink(Path target,
Path link,
boolean createParent)
|
FileStatus |
getFileLinkStatus(Path f)
|
Path |
getLinkTarget(Path f)
|
FileSystem |
getRaw() |
String |
getScheme()
Return the protocol scheme for the FileSystem.
|
void |
initialize(URI name,
Configuration conf)
Called after a new FileSystem instance is constructed.
|
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.
|
boolean |
supportsSymlinks()
|
append, appendFile, completeLocalOutput, concat, copyToLocalFile, create, create, createFile, createNonRecursive, createNonRecursive, delete, getApproxChkSumLength, getBytesPerSum, getChecksumFile, getChecksumFileLength, getChecksumLength, getRawFileSystem, hasPathCapability, isChecksumFile, listLocatedStatus, listStatus, listStatusIterator, mkdirs, modifyAclEntries, open, openFile, openFileWithOptions, removeAcl, removeAclEntries, removeDefaultAcl, rename, setAcl, setConf, setOwner, setPermission, setReplication, setVerifyChecksum, setWriteChecksum, startLocalOutput, truncate
access, canonicalizeUri, checkPath, close, copyFromLocalFile, copyFromLocalFile, createPathHandle, createSnapshot, deleteSnapshot, getAclStatus, getAllStoragePolicies, getCanonicalUri, getChildFileSystems, getConf, getDefaultBlockSize, getDefaultBlockSize, getDefaultReplication, getDefaultReplication, getEnclosingRoot, getFileBlockLocations, getFileChecksum, getFileChecksum, getFileStatus, getHomeDirectory, getInitialWorkingDirectory, getServerDefaults, getServerDefaults, getStatus, getStoragePolicy, getTrashRoot, getTrashRoots, getUri, getUsed, getUsed, getWorkingDirectory, getXAttr, getXAttrs, getXAttrs, listCorruptFileBlocks, listLocatedStatus, listXAttrs, makeQualified, mkdirs, msync, open, openFile, openFileWithOptions, primitiveCreate, primitiveMkdir, removeXAttr, rename, renameSnapshot, resolveLink, resolvePath, satisfyStoragePolicy, setStoragePolicy, setTimes, setWorkingDirectory, setXAttr, setXAttr, unsetStoragePolicy
append, append, append, append, areSymlinksEnabled, cancelDeleteOnExit, clearStatistics, closeAll, closeAllForUGI, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, createBulkDelete, createDataOutputStreamBuilder, createMultipartUploader, createNewFile, createNonRecursive, createSnapshot, delete, deleteOnExit, enableSymlinks, exists, fixRelativePart, get, get, get, getAllStatistics, getBlockSize, getCanonicalServiceName, getContentSummary, getDefaultPort, getDefaultUri, getFileBlockLocations, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getLength, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, getReplication, getStatistics, getStatistics, getStatus, getStorageStatistics, globStatus, globStatus, isDirectory, isFile, listFiles, listStatus, listStatus, listStatus, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, open, primitiveMkdir, printStatistics, processDeleteOnExit, setDefaultUri, setDefaultUri, setQuota, setQuotaByStorageType
public LocalFileSystem()
public LocalFileSystem(FileSystem rawLocalFileSystem)
public void initialize(URI name, Configuration conf) throws IOException
FilterFileSystem
initialize
in class FilterFileSystem
name
- a uri whose authority section names the host, port, etc.
for this FileSystemconf
- the configurationIOException
- on any failure to initialize this instance.public String getScheme()
getScheme
in class FileSystem
file
public FileSystem getRaw()
public File pathToFile(Path path)
path
- the path.public void copyFromLocalFile(boolean delSrc, Path src, Path dst) throws IOException
FilterFileSystem
copyFromLocalFile
in class ChecksumFileSystem
delSrc
- whether to delete the srcsrc
- pathdst
- pathIOException
- IO failure.public void copyToLocalFile(boolean delSrc, Path src, Path dst) throws IOException
ChecksumFileSystem
copyToLocalFile
in class ChecksumFileSystem
delSrc
- whether to delete the srcsrc
- path src file in the remote filesystemdst
- path local destinationIOException
- IO failurepublic boolean reportChecksumFailure(Path p, FSDataInputStream in, long inPos, FSDataInputStream sums, long sumsPos)
reportChecksumFailure
in class ChecksumFileSystem
p
- 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 boolean supportsSymlinks()
FileSystem
supportsSymlinks
in class FilterFileSystem
public void createSymlink(Path target, Path link, boolean createParent) throws IOException
FileSystem
createSymlink
in class FilterFileSystem
target
- target path.link
- link.createParent
- create parent.AccessControlException
- if access is denied.FileAlreadyExistsException
- when the path does not exist.FileNotFoundException
- when the path does not exist.ParentNotDirectoryException
- if the parent path of dest is not
a directory.UnsupportedFileSystemException
- if there was no known implementation
for the scheme.IOException
- raised on errors performing I/O.public FileStatus getFileLinkStatus(Path f) throws IOException
FileSystem
getFileLinkStatus
in class FilterFileSystem
f
- the path.AccessControlException
- if access is denied.FileNotFoundException
- when the path does not exist.IOException
- raised on errors performing I/O.UnsupportedFileSystemException
- if there was no known implementation
for the scheme.public Path getLinkTarget(Path f) throws IOException
FileSystem
getLinkTarget
in class FilterFileSystem
f
- the path.IOException
- IO failure.Copyright © 2024 Apache Software Foundation. All rights reserved.