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
ConstructorsModifierConstructorDescriptionprotectedFutureDataInputStreamBuilderImpl(FileContext fc, Path path) Construct from aFileContext.protectedFutureDataInputStreamBuilderImpl(FileSystem fileSystem, Path path) Constructor.FutureDataInputStreamBuilderImpl(FileSystem fileSystem, PathHandle pathHandle) Constructor with PathHandle. -
Method Summary
Modifier and TypeMethodDescriptionbufferSize(int bufSize) Set the size of the buffer to be used.builder()Get the builder.protected intprotected FileSystemgetFS()protected FileStatusGet any status set inwithFileStatus(FileStatus).Get the cast builder.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, rejectUnknownMandatoryKeysMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, optLongMethods inherited from interface org.apache.hadoop.fs.FutureDataInputStreamBuilder
build
-
Constructor Details
-
FutureDataInputStreamBuilderImpl
protected FutureDataInputStreamBuilderImpl(@Nonnull FileContext fc, @Nonnull Path path) throws IOException Construct from aFileContext.- Parameters:
fc- FileContextpath- path.- Throws:
IOException- failure
-
FutureDataInputStreamBuilderImpl
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
-
getBufferSize
protected int getBufferSize() -
bufferSize
Set the size of the buffer to be used.- Parameters:
bufSize- buffer size.- Returns:
- 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
Description copied from class:AbstractFSBuilderImplGet the cast builder.- Overrides:
getThisBuilderin classAbstractFSBuilderImpl<CompletableFuture<FSDataInputStream>,FutureDataInputStreamBuilder> - Returns:
- this object, typecast
-
withFileStatus
Description copied from interface:FutureDataInputStreamBuilderA FileStatus may be provided to the open request. It is up to the implementation whether to use this or not.- Specified by:
withFileStatusin interfaceFutureDataInputStreamBuilder- Parameters:
st- status: may be null- Returns:
- the builder.
-
getStatus
Get any status set inwithFileStatus(FileStatus).- Returns:
- a status value or null.
-