Class TimeoutLayer.TimeoutLayerBuilder
java.lang.Object
org.apache.opendal.layer.TimeoutLayer.TimeoutLayerBuilder
- Enclosing class:
TimeoutLayer
Configures the default and per-operation timeouts for a timeout layer.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a timeout layer with the configured timeouts.Sets the default timeout for individual I/O calls and concurrent I/O tasks.operationTimeout(TimeoutLayer.Operation operation, Duration timeout) Overrides the default timeout for the specified operation.Sets the default timeout for control operations such as stat.
-
Method Details
-
timeout
Sets the default timeout for control operations such as stat.- Parameters:
timeout- the timeout for control operations- Returns:
- this builder
- Throws:
NullPointerException- if the timeout is nullIllegalArgumentException- if the duration is negative or exceedsLong.MAX_VALUEnanoseconds
-
ioTimeout
Sets the default timeout for individual I/O calls and concurrent I/O tasks.- Parameters:
ioTimeout- the timeout for individual I/O calls and tasks- Returns:
- this builder
- Throws:
NullPointerException- if the timeout is nullIllegalArgumentException- if the duration is negative or exceedsLong.MAX_VALUEnanoseconds
-
operationTimeout
public TimeoutLayer.TimeoutLayerBuilder operationTimeout(TimeoutLayer.Operation operation, Duration timeout) Overrides the default timeout for the specified operation. SeeTimeoutLayer.withOperationTimeout(Operation, Duration)for timeout semantics. Each call replaces the previous override for that operation.- Parameters:
operation- the operation whose timeout to overridetimeout- the timeout, which may be zero- Returns:
- this builder
- Throws:
NullPointerException- if either argument is nullIllegalArgumentException- if the duration is negative or exceedsLong.MAX_VALUEnanoseconds
-
build
Builds a timeout layer with the configured timeouts.- Returns:
- a new timeout layer
-