Class ConcurrentLimitLayer

java.lang.Object
org.apache.opendal.Layer
org.apache.opendal.layer.ConcurrentLimitLayer

public class ConcurrentLimitLayer extends Layer
Limits concurrent storage operations. Operations without a dedicated limit share the default permits. Reads, writes, and lists with dedicated limits use their own permits, so total storage operation concurrency can exceed the default limit.

The optional HTTP request limit applies independently of the storage operation limits. Each application of this layer creates its own set of permits.

See Also:
  • Constructor Details

    • ConcurrentLimitLayer

      public ConcurrentLimitLayer(long permits)
      Creates a layer with one limit shared by all storage operations.
      Parameters:
      permits - the number of shared storage operation permits
      Throws:
      IllegalArgumentException - if the permit count is not positive
  • Method Details

    • builder

      public static ConcurrentLimitLayer.ConcurrentLimitLayerBuilder builder(long permits)
      Creates a builder for configuring dedicated storage operation and HTTP request limits.
      Parameters:
      permits - the number of permits shared by operations without a dedicated limit
      Returns:
      a new builder
      Throws:
      IllegalArgumentException - if the permit count is not positive
    • layer

      protected long layer(long nativeOp)
      Specified by:
      layer in class Layer