Package org.apache.hadoop.fs
Interface FSBuilder<S,B extends FSBuilder<S,B>>
- Type Parameters:
S- Return type on thebuild()call.B- type of builder itself.
- All Known Subinterfaces:
FutureDataInputStreamBuilder
- All Known Implementing Classes:
AbstractFSBuilderImpl,FSDataOutputStreamBuilder,FutureDataInputStreamBuilderImpl,MultipartUploaderBuilderImpl
@Public
@Unstable
public interface FSBuilder<S,B extends FSBuilder<S,B>>
The base interface which various FileSystem FileContext Builder
interfaces can extend, and which underlying implementations
will then implement.
HADOOP-16202 expanded the opt() and must() arguments with
operator overloading, but HADOOP-18724 identified mapping problems:
passing a long value in to opt() could end up invoking
opt(string, double), which could then trigger parse failures.
To fix this without forcing existing code to break/be recompiled.
- A new method to explicitly set a long value is added:
optLong(String, long) - A new method to explicitly set a double value is added:
optLong(String, long) -
All of
opt(String, long),opt(String, float)andopt(String, double)invokeoptLong(String, long). -
The same changes have been applied to
must()methods.
opt(String, String)
or must(String, String) as appropriate.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Instantiate the object which was being built.default BSet mandatory boolean option.default BDeprecated.default BDeprecated.default BSet mandatory int option.default BDeprecated.Set mandatory option to the Builder.Set a string array as mandatory option.default BmustDouble(String key, double value) Set mandatory double parameter for the Builder.default BSet mandatory long parameter for the Builder.default BSet optional boolean parameter for the Builder.default BDeprecated.default BDeprecated.default BSet optional int parameter for the Builder.default BDeprecated.useoptLong(String, long)where possible.Set optional Builder parameter.Set an array of string values as optional parameter for the Builder.default BSet optional double parameter for the Builder.default BSet optional long parameter for the Builder.
-
Method Details
-
opt
Set optional Builder parameter.- Parameters:
key- key.value- value.- Returns:
- generic type B.
-
opt
Set optional boolean parameter for the Builder.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
opt
Set optional int parameter for the Builder.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
opt
Deprecated.This parameter is converted to a long and passed tooptLong(String, long)-all decimal precision is lost.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
opt
Deprecated.useoptLong(String, long)where possible.Set optional long parameter for the Builder.- Parameters:
key- key.value- value.- Returns:
- generic type B.
-
opt
Deprecated.Pass an optional double parameter for the Builder. This parameter is converted to a long and passed tooptLong(String, long)-all decimal precision is lost.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
opt
Set an array of string values as optional parameter for the Builder.- Parameters:
key- key.values- values.- Returns:
- generic type B.
- See Also:
-
optLong
Set optional long parameter for the Builder.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
optDouble
Set optional double parameter for the Builder.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
must
Set mandatory option to the Builder. If the option is not supported or unavailable, the client should expectbuild()throws IllegalArgumentException.- Parameters:
key- key.value- value.- Returns:
- generic type B.
-
must
Set mandatory boolean option.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
must
Set mandatory int option.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
must
Deprecated.usemustDouble(String, double)to set floating point.This parameter is converted to a long and passed tomustLong(String, long)-all decimal precision is lost.- Parameters:
key- key.value- value.- Returns:
- generic type B.
-
must
Deprecated.Set mandatory long option.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
must
Deprecated.Set mandatory long option, despite passing in a floating point value.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
must
Set a string array as mandatory option.- Parameters:
key- key.values- values.- Returns:
- generic type B.
- See Also:
-
mustLong
Set mandatory long parameter for the Builder.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
mustDouble
Set mandatory double parameter for the Builder.- Parameters:
key- key.value- value.- Returns:
- generic type B.
- See Also:
-
build
Instantiate the object which was being built.- 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.
-
mustDouble(String, double)to set floating point.