Class Options.HandleOpt

java.lang.Object
org.apache.hadoop.fs.Options.HandleOpt
Direct Known Subclasses:
Options.HandleOpt.Data, Options.HandleOpt.Location
Enclosing class:
Options

public static class Options.HandleOpt extends Object
Options for creating PathHandle references.
  • Constructor Details

    • HandleOpt

      protected HandleOpt()
  • Method Details

    • resolve

      public static Function<FileStatus,PathHandle> resolve(FileSystem fs, Options.HandleOpt... opt)
      Parameters:
      fs - Target filesystem
      opt - Options to bind in partially evaluated function
      Returns:
      Function reference with options fixed
    • resolve

      Utility function for partial evaluation of FileStatus instances to a fixed set of handle options.
      Parameters:
      fsr - Function reference
      opt - Options to associate with FileStatus instances to produce PathHandle instances.
      Returns:
      Function reference with options fixed
    • exact

      public static Options.HandleOpt[] 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

      public static Options.HandleOpt[] 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

      public static Options.HandleOpt[] 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

      public static Options.HandleOpt[] 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

      public static Options.HandleOpt.Data changed(boolean allow)
      Parameters:
      allow - If true, resolve references to this entity even if it has been modified.
      Returns:
      Handle option encoding parameter.
    • moved

      public static Options.HandleOpt.Location moved(boolean allow)
      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 class
      opt - 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.