Class ConcurrentLimitLayer.ConcurrentLimitLayerBuilder
java.lang.Object
org.apache.opendal.layer.ConcurrentLimitLayer.ConcurrentLimitLayerBuilder
- Enclosing class:
ConcurrentLimitLayer
Configures optional limits for reads, writes, lists, and HTTP requests.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a concurrent limit layer with the configured limits.httpPermits(long httpPermits) Sets an independent limit for HTTP requests.listPermits(long listPermits) Sets a dedicated limit for lists.readPermits(long readPermits) Sets a dedicated limit for reads.writePermits(long writePermits) Sets a dedicated limit for writes.
-
Method Details
-
readPermits
Sets a dedicated limit for reads. Reads use the shared limit by default.- Parameters:
readPermits- the number of read permits- Returns:
- this builder
- Throws:
IllegalArgumentException- if the permit count is not positive
-
writePermits
Sets a dedicated limit for writes. Writes use the shared limit by default.- Parameters:
writePermits- the number of write permits- Returns:
- this builder
- Throws:
IllegalArgumentException- if the permit count is not positive
-
listPermits
Sets a dedicated limit for lists. Lists use the shared limit by default.- Parameters:
listPermits- the number of list permits- Returns:
- this builder
- Throws:
IllegalArgumentException- if the permit count is not positive
-
httpPermits
Sets an independent limit for HTTP requests. By default this layer adds no HTTP limit.- Parameters:
httpPermits- the number of HTTP request permits- Returns:
- this builder
- Throws:
IllegalArgumentException- if the permit count is not positive
-
build
Builds a concurrent limit layer with the configured limits.- Returns:
- a new concurrent limit layer
-