Class HedgeLayer.HedgeLayerBuilder
java.lang.Object
org.apache.opendal.layer.HedgeLayer.HedgeLayerBuilder
- Enclosing class:
HedgeLayer
Builds a hedge layer with optional per-operation delays.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the shared delay between attempts.maxHedges(int maxHedges) Sets the maximum number of additional attempts per request.Overrides the delay between attempts to open or read a byte range.Overrides the delay between stat attempts.
-
Constructor Details
-
HedgeLayerBuilder
public HedgeLayerBuilder()
-
-
Method Details
-
delay
Sets the shared delay between attempts. Zero requests the shortest delay.- Parameters:
delay- the shared delay- Returns:
- this builder
- Throws:
IllegalArgumentException- if the delay is null, negative, or exceedsLong.MAX_VALUEnanoseconds
-
statDelay
Overrides the delay between stat attempts.- Parameters:
statDelay- the stat delay- Returns:
- this builder
- Throws:
IllegalArgumentException- if the delay is null, negative, or exceedsLong.MAX_VALUEnanoseconds
-
readDelay
Overrides the delay between attempts to open or read a byte range.- Parameters:
readDelay- the read delay- Returns:
- this builder
- Throws:
IllegalArgumentException- if the delay is null, negative, or exceedsLong.MAX_VALUEnanoseconds
-
maxHedges
Sets the maximum number of additional attempts per request. Zero disables hedging.- Parameters:
maxHedges- the maximum number of additional attempts- Returns:
- this builder
- Throws:
IllegalArgumentException- if the maximum is negative
-