LocalFileSystem (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs, class: LocalFileSystem

Package org.apache.hadoop.fs

# Class LocalFileSystem

java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.FilterFileSystem
org.apache.hadoop.fs.ChecksumFileSystem
org.apache.hadoop.fs.LocalFileSystem

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`, `Configurable`, `BulkDeleteSource`, `org.apache.hadoop.fs.PathCapabilities`, `org.apache.hadoop.security.token.DelegationTokenIssuer`

@Public @Stable public class LocalFileSystem extends ChecksumFileSystem
Implement the FileSystem API for the checksumed local filesystem.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.hadoop.fs.FileSystem

  `org.apache.hadoop.fs.FileSystem.DirectoryEntries, org.apache.hadoop.fs.FileSystem.DirListingIterator<T extends FileStatus>, org.apache.hadoop.fs.FileSystem.Statistics`

- ## Field Summary

  ### Fields inherited from class org.apache.hadoop.fs.FilterFileSystem

  `fs, swapScheme`

  ### Fields inherited from class org.apache.hadoop.fs.FileSystem

  `DEFAULT_FS, FS_DEFAULT_NAME_KEY, LOG, SHUTDOWN_HOOK_PRIORITY, statistics, TRASH_PREFIX, USER_HOME_PREFIX`

  ### Fields inherited from interface org.apache.hadoop.security.token.DelegationTokenIssuer

  `TOKEN_LOG`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LocalFileSystem()`
  `LocalFileSystem(FileSystem rawLocalFileSystem)`

- ## Method Summary

  Modifier and Type
  Method
  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)`
  See `FileContext.createSymlink(Path, Path, boolean)`.
  `FileStatus`
  `getFileLinkStatus(Path f)`
  See `FileContext.getFileLinkStatus(Path)`.
  `Path`
  `getLinkTarget(Path f)`
  See `FileContext.getLinkTarget(Path)`.
  `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()`
  See `AbstractFileSystem.supportsSymlinks()`.

  ### Methods inherited from class org.apache.hadoop.fs.ChecksumFileSystem

  `append, appendFile, completeLocalOutput, concat, copyToLocalFile, create, create, createFile, createNonRecursive, createNonRecursive, delete, getApproxChkSumLength, getBytesPerSum, getChecksumFile, getChecksumFileLength, getChecksumLength, getRawFileSystem, getVerifyChecksum, hasPathCapability, isChecksumFile, listLocatedStatus, listStatus, listStatusIterator, mkdirs, modifyAclEntries, open, openFile, openFileWithOptions, removeAcl, removeAclEntries, removeDefaultAcl, rename, setAcl, setConf, setOwner, setPermission, setReplication, setVerifyChecksum, setWriteChecksum, startLocalOutput, truncate`

  ### Methods inherited from class org.apache.hadoop.fs.FilterFileSystem

  `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`

  ### Methods inherited from class org.apache.hadoop.fs.FileSystem

  `append, append, append, append, areSymlinksEnabled, cancelDeleteOnExit, clearStatistics, closeAll, closeAllForUGI, copyFromLocalFile, copyToLocalFile, copyToLocalFile, create, create, create, create, create, create, create, create, create, create, create, createBulkDelete, createDataInputStreamBuilder, createDataInputStreamBuilder, createDataOutputStreamBuilder, createMultipartUploader, createNewFile, createNonRecursive, createSnapshot, delete, deleteOnExit, enableSymlinks, exists, fixRelativePart, get, get, get, getAdditionalTokenIssuers, getAllStatistics, getBlockSize, getCanonicalServiceName, getContentSummary, getDefaultPort, getDefaultUri, getDelegationToken, getFileBlockLocations, getFileSystemClass, getFSofPath, getGlobalStorageStatistics, getLength, getLocal, getName, getNamed, getPathHandle, getQuotaUsage, getReplication, getStatistics, getStatistics, getStatus, getStorageStatistics, globStatus, globStatus, isDirectory, isFile, listFiles, listStatus, listStatus, listStatus, listStatusBatch, mkdirs, moveFromLocalFile, moveFromLocalFile, moveToLocalFile, newInstance, newInstance, newInstance, newInstanceLocal, open, open, primitiveMkdir, printStatistics, processDeleteOnExit, setDefaultUri, setDefaultUri, setQuota, setQuotaByStorageType`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.hadoop.security.token.DelegationTokenIssuer

  `addDelegationTokens`

- ## Constructor Details

  - ### LocalFileSystem

    public LocalFileSystem()

  - ### LocalFileSystem

    public LocalFileSystem(FileSystem rawLocalFileSystem)

- ## Method Details

  - ### initialize

    public void initialize(URI name, Configuration conf) throws IOException
    Description copied from class: `FilterFileSystem`
    Called after a new FileSystem instance is constructed.
    Overrides:
      `initialize` in class `FilterFileSystem`
    Parameters:
      `name` - a uri whose authority section names the host, port, etc. for this FileSystem
      `conf` - the configuration
    Throws:
      `IOException` - on any failure to initialize this instance.

  - ### getScheme

    public String getScheme()
    Return the protocol scheme for the FileSystem.

    Overrides:
      `getScheme` in class `FileSystem`
    Returns:
      `file`

  - ### getRaw

    public FileSystem getRaw()

  - ### pathToFile

    public File pathToFile(Path path)
    Convert a path to a File.
    Parameters:
      `path` - the path.
    Returns:
      file.

  - ### copyFromLocalFile

    public void copyFromLocalFile(boolean delSrc, Path src, Path dst) throws IOException
    Description copied from class: `FilterFileSystem`
    The src file is on the local disk. Add it to FS at the given dst name. delSrc indicates if the source should be removed
    Overrides:
      `copyFromLocalFile` in class `ChecksumFileSystem`
    Parameters:
      `delSrc` - whether to delete the src
      `src` - path
      `dst` - path
    Throws:
      `IOException` - IO failure.

  - ### copyToLocalFile

    public void copyToLocalFile(boolean delSrc, Path src, Path dst) throws IOException
    Description copied from class: `ChecksumFileSystem`
    The src file is under FS, and the dst is on the local disk. Copy it from FS control to the local dst name.
    Overrides:
      `copyToLocalFile` in class `ChecksumFileSystem`
    Parameters:
      `delSrc` - whether to delete the src
      `src` - path src file in the remote filesystem
      `dst` - path local destination
    Throws:
      `IOException` - IO failure

  - ### reportChecksumFailure

    public 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.
    Overrides:
      `reportChecksumFailure` in class `ChecksumFileSystem`
    Parameters:
      `p` - the file name containing the error
      `in` - the stream open on the file
      `inPos` - the position of the beginning of the bad data in the file
      `sums` - the stream open on the checksum file
      `sumsPos` - the position of the beginning of the bad data in the checksum file
    Returns:
      if retry is necessary

  - ### supportsSymlinks

    public boolean supportsSymlinks()
    Description copied from class: `FileSystem`
    See `AbstractFileSystem.supportsSymlinks()`.
    Overrides:
      `supportsSymlinks` in class `FilterFileSystem`
    Returns:
      if support symlinkls true, not false.

  - ### createSymlink

    public void createSymlink(Path target, Path link, boolean createParent) throws IOException
    Description copied from class: `FileSystem`
    See `FileContext.createSymlink(Path, Path, boolean)`.
    Overrides:
      `createSymlink` in class `FilterFileSystem`
    Parameters:
      `target` - target path.
      `link` - link.
      `createParent` - create parent.
    Throws:
      `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.

  - ### getFileLinkStatus

    public FileStatus getFileLinkStatus(Path f) throws IOException
    Description copied from class: `FileSystem`
    See `FileContext.getFileLinkStatus(Path)`.
    Overrides:
      `getFileLinkStatus` in class `FilterFileSystem`
    Parameters:
      `f` - the path.
    Returns:
      file status
    Throws:
      `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.

  - ### getLinkTarget

    public Path getLinkTarget(Path f) throws IOException
    Description copied from class: `FileSystem`
    See `FileContext.getLinkTarget(Path)`.
    Overrides:
      `getLinkTarget` in class `FilterFileSystem`
    Parameters:
      `f` - the path.
    Returns:
      the path.
    Throws:
      `IOException` - IO failure.