Package org.apache.hadoop.fs
Class Options.HandleOpt
java.lang.Object
org.apache.hadoop.fs.Options.HandleOpt
- Direct Known Subclasses:
Options.HandleOpt.Data,Options.HandleOpt.Location
- Enclosing class:
- Options
Options for creating
PathHandle references.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classOption storing standard constraints on data.static classOption storing standard constraints on location. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Options.HandleOpt.Datachanged(boolean allow) static Options.HandleOpt[]content()Handle is valid iff the content of the referent is the same.static Options.HandleOpt[]exact()Handle is valid iff the referent is neither moved nor changed.static <T extends Options.HandleOpt>
Optional<T>getOpt(Class<T> c, Options.HandleOpt... opt) Utility method to extract a HandleOpt from the set provided.static Options.HandleOpt.Locationmoved(boolean allow) static Options.HandleOpt[]path()Handle is valid iff the referent is unmoved in the namespace.static Options.HandleOpt[]Handle is valid iff the referent exists in the namespace.static Function<FileStatus,PathHandle> resolve(BiFunction<FileStatus, Options.HandleOpt[], PathHandle> fsr, Options.HandleOpt... opt) Utility function for partial evaluation ofFileStatusinstances to a fixed set of handle options.static Function<FileStatus,PathHandle> resolve(FileSystem fs, Options.HandleOpt... opt) Utility function for mappingFileSystem.getPathHandle(org.apache.hadoop.fs.FileStatus, org.apache.hadoop.fs.Options.HandleOpt...)to a fixed set of handle options.
-
Constructor Details
-
HandleOpt
protected HandleOpt()
-
-
Method Details
-
resolve
Utility function for mappingFileSystem.getPathHandle(org.apache.hadoop.fs.FileStatus, org.apache.hadoop.fs.Options.HandleOpt...)to a fixed set of handle options.- Parameters:
fs- Target filesystemopt- Options to bind in partially evaluated function- Returns:
- Function reference with options fixed
-
resolve
public static Function<FileStatus,PathHandle> resolve(BiFunction<FileStatus, Options.HandleOpt[], PathHandle> fsr, Options.HandleOpt... opt) Utility function for partial evaluation ofFileStatusinstances to a fixed set of handle options.- Parameters:
fsr- Function referenceopt- Options to associate withFileStatusinstances to producePathHandleinstances.- Returns:
- Function reference with options fixed
-
exact
Handle is valid iff the referent is neither moved nor changed. Equivalent to changed(false), moved(false).- Returns:
- Options requiring that the content and location of the entity be unchanged between calls.
-
content
Handle is valid iff the content of the referent is the same. Equivalent to changed(false), moved(true).- Returns:
- Options requiring that the content of the entity is unchanged, but it may be at a different location.
-
path
Handle is valid iff the referent is unmoved in the namespace. Equivalent to changed(true), moved(false).- Returns:
- Options requiring that the referent exist in the same location, but its content may have changed.
-
reference
Handle is valid iff the referent exists in the namespace. Equivalent to changed(true), moved(true).- Returns:
- Options requiring that the implementation resolve a reference to this entity regardless of changes to content or location.
-
changed
- Parameters:
allow- If true, resolve references to this entity even if it has been modified.- Returns:
- Handle option encoding parameter.
-
moved
- Parameters:
allow- If true, resolve references to this entity anywhere in the namespace.- Returns:
- Handle option encoding parameter.
-
getOpt
public static <T extends Options.HandleOpt> Optional<T> getOpt(Class<T> c, Options.HandleOpt... opt) Utility method to extract a HandleOpt from the set provided.- Type Parameters:
T- Type constraint for exact match- Parameters:
c- Target classopt- List of options- Returns:
- An option assignable from the specified type or null if either opt is null or a suitable match is not found.
- Throws:
IllegalArgumentException- If more than one matching type is found.
-