Class FileSystemLinkResolver<T>

java.lang.Object
org.apache.hadoop.fs.FileSystemLinkResolver<T>

@Private @Evolving public abstract class FileSystemLinkResolver<T> extends Object
FileSystem-specific class used to operate on and resolve symlinks in a path. Operation can potentially span multiple FileSystems.
See Also:
  • Constructor Details

    • FileSystemLinkResolver

      public FileSystemLinkResolver()
  • Method Details

    • doCall

      public abstract T doCall(Path p) throws IOException, UnresolvedLinkException
      FileSystem subclass-specific implementation of superclass method. Overridden on instantiation to perform the actual method call, which throws an UnresolvedLinkException if called on an unresolved Path.
      Parameters:
      p - Path on which to perform an operation
      Returns:
      Generic type returned by operation
      Throws:
      IOException - raised on errors performing I/O.
      UnresolvedLinkException - unresolved link exception.
    • next

      public abstract T next(FileSystem fs, Path p) throws IOException
      Calls the abstract FileSystem call equivalent to the specialized subclass implementation in doCall(Path). This is used when retrying the call with a newly resolved Path and corresponding new FileSystem.
      Parameters:
      fs - FileSystem with which to retry call
      p - Resolved Target of path
      Returns:
      Generic type determined by implementation
      Throws:
      IOException - raised on errors performing I/O.
    • resolve

      public T resolve(FileSystem filesys, Path path) throws IOException
      Attempt calling overridden doCall(Path) method with specified FileSystem and Path. If the call fails with an UnresolvedLinkException, it will try to resolve the path and retry the call by calling next(FileSystem, Path).
      Parameters:
      filesys - FileSystem with which to try call
      path - Path with which to try call
      Returns:
      Generic type determined by implementation
      Throws:
      IOException - raised on errors performing I/O.