Package org.apache.hadoop.fs.impl
Class FsLinkResolution<T>
java.lang.Object
org.apache.hadoop.fs.FSLinkResolver<T>
org.apache.hadoop.fs.impl.FsLinkResolution<T>
- Type Parameters:
T- type of the returned value.
Class to allow Lambda expressions to be used in
FileContext
link resolution.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThe signature of the function to invoke. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an instance with the given function. -
Method Summary
Modifier and TypeMethodDescriptionnext(AbstractFileSystem fs, Path p) Generic helper function overridden on instantiation to perform a specific operation on the given file system using the given path which may result in an UnresolvedLinkException.static <T> Tresolve(FileContext fileContext, Path path, FsLinkResolution.FsLinkResolutionFunction<T> fn) Apply the given function to the resolved path under the the supplied FileContext.Methods inherited from class org.apache.hadoop.fs.FSLinkResolver
qualifySymlinkTarget, resolve
-
Constructor Details
-
FsLinkResolution
Construct an instance with the given function.- Parameters:
fn- function to invoke.
-
-
Method Details
-
next
Description copied from class:FSLinkResolverGeneric helper function overridden on instantiation to perform a specific operation on the given file system using the given path which may result in an UnresolvedLinkException.- Specified by:
nextin classFSLinkResolver<T>- Parameters:
fs- AbstractFileSystem to perform the operation on.p- Path given the file system.- Returns:
- Generic type determined by the specific implementation.
- Throws:
UnresolvedLinkException- If symbolic linkpathcould not be resolvedIOException- an I/O error occurred
-
resolve
public static <T> T resolve(FileContext fileContext, Path path, FsLinkResolution.FsLinkResolutionFunction<T> fn) throws UnresolvedLinkException, IOException Apply the given function to the resolved path under the the supplied FileContext.- Type Parameters:
T- return type.- Parameters:
fileContext- file context to resolve underpath- path to resolvefn- function to invoke- Returns:
- the return value of the function as revoked against the resolved path.
- Throws:
UnresolvedLinkException- link resolution failureIOException- other IO failure.
-