Class TailCutLayer
java.lang.Object
org.apache.opendal.Layer
org.apache.opendal.layer.TailCutLayer
Cancels slow calls using an adaptive deadline based on recent successful calls.
Once enough samples are available, the layer multiplies the configured latency percentile by the
safety factor and clamps the result to the configured deadline range. A cancelled call returns a
temporary
OpenDALException with code OpenDALException.Code.Unexpected.
Each call to AsyncOperator.layer(Layer) with this layer creates an independent latency
history. Use AsyncOperator.duplicate() on the returned handle to share latency statistics
across handles. Add this layer before RetryLayer so retries can handle cancellations.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfigures the latency history and adaptive deadline. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a layer with percentile 95, a safety factor of 1.3, a 60-second window, 200 minimum samples, and deadlines between 500 milliseconds and 30 seconds. -
Method Summary
-
Constructor Details
-
TailCutLayer
public TailCutLayer()Creates a layer with percentile 95, a safety factor of 1.3, a 60-second window, 200 minimum samples, and deadlines between 500 milliseconds and 30 seconds.
-
-
Method Details
-
builder
Returns a builder initialized with the default settings.- Returns:
- a new builder
-
layer
-