S - Return type on the FSBuilder.build() call.B - type of builder itself.FSBuilder<S,B>FSDataOutputStreamBuilder, FutureDataInputStreamBuilderImpl, MultipartUploaderBuilderImpl@Public @Unstable public abstract class AbstractFSBuilderImpl<S,B extends FSBuilder<S,B>> extends java.lang.Object implements FSBuilder<S,B>
.opt("fs.s3a.open.option.caching", true)
.opt("fs.option.openfile.read.policy", "random, adaptive")
.opt("fs.s3a.open.option.etag", "9fe4c37c25b")
.optLong("fs.option.openfile.length", 1_500_000_000_000)
.must("fs.option.openfile.buffer.size", 256_000)
.mustLong("fs.option.openfile.split.start", 256_000_000)
.mustLong("fs.option.openfile.split.end", 512_000_000)
.build();
Configuration keys declared in an opt() may be ignored by
a builder which does not recognise them.
Configuration keys declared in a must() function set must
be understood by the implementation or a
IllegalArgumentException will be thrown.| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
UNKNOWN_MANDATORY_KEY |
| Modifier | Constructor | Description |
|---|---|---|
protected |
AbstractFSBuilderImpl(java.util.Optional<Path> optionalPath,
java.util.Optional<PathHandle> optionalPathHandle) |
Constructor with both optional path and path handle.
|
protected |
AbstractFSBuilderImpl(Path path) |
|
protected |
AbstractFSBuilderImpl(PathHandle pathHandle) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Set<java.lang.String> |
getMandatoryKeys() |
Get all the keys that are set as mandatory keys.
|
java.util.Set<java.lang.String> |
getOptionalKeys() |
Get all the keys that are set as optional keys.
|
java.util.Optional<Path> |
getOptionalPath() |
Get the optional path; may be empty.
|
java.util.Optional<PathHandle> |
getOptionalPathHandle() |
Get the optional path handle; may be empty.
|
Configuration |
getOptions() |
Get the mutable option configuration.
|
Path |
getPath() |
Get the path: only valid if constructed with a path.
|
PathHandle |
getPathHandle() |
Get the PathHandle: only valid if constructed with a PathHandle.
|
B |
getThisBuilder() |
Get the cast builder.
|
B |
must(java.lang.String key,
boolean value) |
Set mandatory boolean option.
|
B |
must(java.lang.String key,
double value) |
Set mandatory long option, despite passing in a floating
point value.
|
B |
must(java.lang.String key,
float value) |
This parameter is converted to a long and passed
to
FSBuilder.mustLong(String, long) -all
decimal precision is lost. |
B |
must(java.lang.String key,
int value) |
Set mandatory int option.
|
B |
must(java.lang.String key,
long value) |
Set mandatory long option.
|
B |
must(java.lang.String key,
java.lang.String value) |
Set mandatory option to the Builder.
|
B |
must(java.lang.String key,
java.lang.String... values) |
Set a string array as mandatory option.
|
B |
mustDouble(java.lang.String key,
double value) |
Set optional double parameter for the Builder.
|
B |
mustLong(java.lang.String key,
long value) |
Set mandatory long parameter for the Builder.
|
B |
opt(java.lang.String key,
boolean value) |
Set optional boolean parameter for the Builder.
|
B |
opt(java.lang.String key,
double value) |
Set optional double parameter for the Builder.
|
B |
opt(java.lang.String key,
float value) |
Set optional float parameter for the Builder.
|
B |
opt(java.lang.String key,
int value) |
Set optional int parameter for the Builder.
|
B |
opt(java.lang.String key,
long value) |
Set optional long parameter for the Builder.
|
B |
opt(java.lang.String key,
java.lang.String value) |
Set optional Builder parameter.
|
B |
opt(java.lang.String key,
java.lang.String... values) |
Set an array of string values as optional parameter for the Builder.
|
B |
optDouble(java.lang.String key,
double value) |
Set optional double parameter for the Builder.
|
B |
optLong(java.lang.String key,
long value) |
Set optional long parameter for the Builder.
|
protected void |
rejectUnknownMandatoryKeys(java.util.Collection<java.lang.String> knownKeys,
java.lang.String extraErrorText) |
Reject a configuration if one or more mandatory keys are
not in the set of mandatory keys.
|
static void |
rejectUnknownMandatoryKeys(java.util.Set<java.lang.String> mandatory,
java.util.Collection<java.lang.String> knownKeys,
java.lang.String extraErrorText) |
Reject a configuration if one or more mandatory keys are
not in the set of mandatory keys.
|
public static final java.lang.String UNKNOWN_MANDATORY_KEY
protected AbstractFSBuilderImpl(@Nonnull
java.util.Optional<Path> optionalPath,
@Nonnull
java.util.Optional<PathHandle> optionalPathHandle)
optionalPath - a path or emptyoptionalPathHandle - a path handle/emptyjava.lang.IllegalArgumentException - if both parameters are set.protected AbstractFSBuilderImpl(@Nonnull
Path path)
protected AbstractFSBuilderImpl(@Nonnull
PathHandle pathHandle)
public B getThisBuilder()
public java.util.Optional<Path> getOptionalPath()
public Path getPath()
java.util.NoSuchElementException - if the field is empty.public java.util.Optional<PathHandle> getOptionalPathHandle()
public PathHandle getPathHandle()
java.util.NoSuchElementException - if the field is empty.public B opt(@Nonnull java.lang.String key, @Nonnull java.lang.String value)
public B opt(@Nonnull java.lang.String key, boolean value)
public B opt(@Nonnull java.lang.String key, int value)
public B opt(@Nonnull java.lang.String key, long value)
FSBuilderpublic B optLong(@Nonnull java.lang.String key, long value)
FSBuilderpublic B opt(@Nonnull java.lang.String key, float value)
public B opt(@Nonnull java.lang.String key, double value)
public B optDouble(@Nonnull java.lang.String key, double value)
public B opt(@Nonnull java.lang.String key, @Nonnull java.lang.String... values)
public B must(@Nonnull java.lang.String key, @Nonnull java.lang.String value)
FileSystem,
the client should expect FSBuilder.build() throws IllegalArgumentException.public B must(@Nonnull java.lang.String key, boolean value)
public B mustLong(@Nonnull java.lang.String key, long value)
FSBuilderpublic B mustDouble(@Nonnull java.lang.String key, double value)
mustDouble in interface FSBuilder<S,B extends FSBuilder<S,B>>key - key.value - value.opt(String, String)public B must(@Nonnull java.lang.String key, int value)
public B must(@Nonnull java.lang.String key, long value)
FSBuilderpublic B must(@Nonnull java.lang.String key, float value)
FSBuilderFSBuilder.mustLong(String, long) -all
decimal precision is lost.public B must(@Nonnull java.lang.String key, double value)
FSBuilderpublic B must(@Nonnull java.lang.String key, @Nonnull java.lang.String... values)
public Configuration getOptions()
public java.util.Set<java.lang.String> getMandatoryKeys()
public java.util.Set<java.lang.String> getOptionalKeys()
protected void rejectUnknownMandatoryKeys(java.util.Collection<java.lang.String> knownKeys,
java.lang.String extraErrorText)
throws java.lang.IllegalArgumentException
knownKeys - a possibly empty collection of known keysextraErrorText - extra error text to include.java.lang.IllegalArgumentException - if any key is unknown.public static void rejectUnknownMandatoryKeys(java.util.Set<java.lang.String> mandatory,
java.util.Collection<java.lang.String> knownKeys,
java.lang.String extraErrorText)
throws java.lang.IllegalArgumentException
mandatory - the set of mandatory keysknownKeys - a possibly empty collection of known keysextraErrorText - extra error text to include.java.lang.IllegalArgumentException - if any key is unknown.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.