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

Package org.apache.hadoop.fs.impl

# Class FutureDataInputStreamBuilderImpl

java.lang.Object
org.apache.hadoop.fs.impl.AbstractFSBuilderImpl<CompletableFuture<FSDataInputStream>,FutureDataInputStreamBuilder>
org.apache.hadoop.fs.impl.FutureDataInputStreamBuilderImpl

All Implemented Interfaces:
  `FSBuilder<CompletableFuture<FSDataInputStream>,FutureDataInputStreamBuilder>`, `FutureDataInputStreamBuilder`

@Public @Unstable public abstract class FutureDataInputStreamBuilderImpl extends AbstractFSBuilderImpl<CompletableFuture<FSDataInputStream>,FutureDataInputStreamBuilder> implements FutureDataInputStreamBuilder
Builder for input streams and subclasses whose return value is actually a completable future: this allows for better asynchronous operation. To be more generic, `AbstractFSBuilderImpl.opt(String, int)` and `AbstractFSBuilderImpl.must(String, int)` variants provide implementation-agnostic way to customize the builder. Each FS-specific builder implementation can interpret the FS-specific options accordingly, for example: If the option is not related to the file system, the option will be ignored. If the option is must, but not supported/known by the file system, an `IllegalArgumentException` will be thrown.

- ## Field Summary

  ### Fields inherited from class org.apache.hadoop.fs.impl.AbstractFSBuilderImpl

  `UNKNOWN_MANDATORY_KEY`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `FutureDataInputStreamBuilderImpl(FileContext fc, Path path)`
  Construct from a `FileContext`.
  `protected`
  `FutureDataInputStreamBuilderImpl(FileSystem fileSystem, Path path)`
  Constructor.
  ``
  `FutureDataInputStreamBuilderImpl(FileSystem fileSystem, PathHandle pathHandle)`
  Constructor with PathHandle.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `FutureDataInputStreamBuilder`
  `bufferSize(int bufSize)`
  Set the size of the buffer to be used.
  `FutureDataInputStreamBuilder`
  `builder()`
  Get the builder.
  `protected int`
  `getBufferSize()`
  `protected FileSystem`
  `getFS()`
  `protected FileStatus`
  `getStatus()`
  Get any status set in `withFileStatus(FileStatus)`.
  `FutureDataInputStreamBuilder`
  `getThisBuilder()`
  Get the cast builder.
  `FutureDataInputStreamBuilder`
  `withFileStatus(FileStatus st)`
  A FileStatus may be provided to the open request.

  ### Methods inherited from class org.apache.hadoop.fs.impl.AbstractFSBuilderImpl

  `getMandatoryKeys, getOptionalKeys, getOptionalPath, getOptionalPathHandle, getOptions, getPath, getPathHandle, must, must, must, must, must, must, must, mustDouble, mustLong, opt, opt, opt, opt, opt, opt, opt, optDouble, optLong, rejectUnknownMandatoryKeys, rejectUnknownMandatoryKeys`

  ### 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.fs.FSBuilder

  `must, must, must, must, must, must, must, mustDouble, mustLong, opt, opt, opt, opt, opt, opt, opt, optDouble, optLong`

  ### Methods inherited from interface org.apache.hadoop.fs.FutureDataInputStreamBuilder

  `build`

- ## Constructor Details

  - ### FutureDataInputStreamBuilderImpl

    protected FutureDataInputStreamBuilderImpl(@Nonnull FileContext fc, @Nonnull Path path) throws IOException
    Construct from a `FileContext`.
    Parameters:
      `fc` - FileContext
      `path` - path.
    Throws:
      `IOException` - failure

  - ### FutureDataInputStreamBuilderImpl

    protected FutureDataInputStreamBuilderImpl(@Nonnull FileSystem fileSystem, @Nonnull Path path)
    Constructor.
    Parameters:
      `fileSystem` - owner FS.
      `path` - path

  - ### FutureDataInputStreamBuilderImpl

    public FutureDataInputStreamBuilderImpl(@Nonnull FileSystem fileSystem, @Nonnull PathHandle pathHandle)
    Constructor with PathHandle.
    Parameters:
      `fileSystem` - owner FS.
      `pathHandle` - path handle

- ## Method Details

  - ### getFS

    protected FileSystem getFS()

  - ### getBufferSize

    protected int getBufferSize()

  - ### bufferSize

    public FutureDataInputStreamBuilder bufferSize(int bufSize)
    Set the size of the buffer to be used.
    Parameters:
      `bufSize` - buffer size.
    Returns:
      FutureDataInputStreamBuilder.

  - ### builder

    public FutureDataInputStreamBuilder builder()
    Get the builder. This must be used after the constructor has been invoked to create the actual builder: it allows for subclasses to do things after construction.
    Returns:
      FutureDataInputStreamBuilder.

  - ### getThisBuilder

    public FutureDataInputStreamBuilder getThisBuilder()
    Description copied from class: `AbstractFSBuilderImpl`
    Get the cast builder.
    Overrides:
      `getThisBuilder` in class `AbstractFSBuilderImpl<CompletableFuture<FSDataInputStream>,FutureDataInputStreamBuilder>`
    Returns:
      this object, typecast

  - ### withFileStatus

    public FutureDataInputStreamBuilder withFileStatus(@Nullable FileStatus st)
    Description copied from interface: `FutureDataInputStreamBuilder`
    A FileStatus may be provided to the open request. It is up to the implementation whether to use this or not.
    Specified by:
      `withFileStatus` in interface `FutureDataInputStreamBuilder`
    Parameters:
      `st` - status: may be null
    Returns:
      the builder.

  - ### getStatus

    protected FileStatus getStatus()
    Get any status set in `withFileStatus(FileStatus)`.
    Returns:
      a status value or null.