Package org.apache.hadoop.fs
Interface FutureDataInputStreamBuilder
- All Superinterfaces:
FSBuilder<CompletableFuture<FSDataInputStream>,FutureDataInputStreamBuilder>
- All Known Implementing Classes:
FutureDataInputStreamBuilderImpl
@Public
@Unstable
public interface FutureDataInputStreamBuilder
extends FSBuilder<CompletableFuture<FSDataInputStream>,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,
FSBuilder.opt(String, int) and FSBuilder.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.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Instantiate the object which was being built.default FutureDataInputStreamBuilderwithFileStatus(FileStatus status) A FileStatus may be provided to the open request.
-
Method Details
-
build
CompletableFuture<FSDataInputStream> build() throws IllegalArgumentException, UnsupportedOperationException, IOExceptionDescription copied from interface:FSBuilderInstantiate the object which was being built.- Specified by:
buildin interfaceFSBuilder<CompletableFuture<FSDataInputStream>,FutureDataInputStreamBuilder> - Returns:
- generic type S.
- Throws:
IllegalArgumentException- if the parameters are not valid.UnsupportedOperationException- if the filesystem does not support the specific operation.IOException- on filesystem IO errors.
-
withFileStatus
A FileStatus may be provided to the open request. It is up to the implementation whether to use this or not.- Parameters:
status- status: may be null- Returns:
- the builder.
-