Package glide.api.models.commands.batch
Class ClusterBatchOptions
- java.lang.Object
-
- glide.api.models.commands.batch.BaseBatchOptions
-
- glide.api.models.commands.batch.ClusterBatchOptions
-
public class ClusterBatchOptions extends BaseBatchOptions
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClusterBatchOptions.ClusterBatchOptionsBuilder<C extends ClusterBatchOptions,B extends ClusterBatchOptions.ClusterBatchOptionsBuilder<C,B>>-
Nested classes/interfaces inherited from class glide.api.models.commands.batch.BaseBatchOptions
BaseBatchOptions.BaseBatchOptionsBuilder<C extends BaseBatchOptions,B extends BaseBatchOptions.BaseBatchOptionsBuilder<C,B>>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedClusterBatchOptions(ClusterBatchOptions.ClusterBatchOptionsBuilder<?,?> b)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClusterBatchOptions.ClusterBatchOptionsBuilder<?,?>builder()ClusterBatchRetryStrategygetRetryStrategy()⚠️ Please seeClusterBatchRetryStrategyand read carefully before enabling these options.RequestRoutingConfiguration.SingleNodeRoutegetRoute()Configures single-node routing for the batch request.java.lang.StringtoString()-
Methods inherited from class glide.api.models.commands.batch.BaseBatchOptions
getTimeout
-
-
-
-
Constructor Detail
-
ClusterBatchOptions
protected ClusterBatchOptions(ClusterBatchOptions.ClusterBatchOptionsBuilder<?,?> b)
-
-
Method Detail
-
builder
public static ClusterBatchOptions.ClusterBatchOptionsBuilder<?,?> builder()
-
getRoute
public RequestRoutingConfiguration.SingleNodeRoute getRoute()
Configures single-node routing for the batch request. The client will send the batch to the specified node defined byroute.If a redirection error occurs:
- For Atomic Batches (Transactions), the entire transaction will be redirected.
- For Non-Atomic Batches (Pipelines), only the commands that encountered redirection errors will be redirected.
-
getRetryStrategy
public ClusterBatchRetryStrategy getRetryStrategy()
⚠️ Please seeClusterBatchRetryStrategyand read carefully before enabling these options.Defines the retry strategy for handling cluster batch request failures.
This strategy determines whether failed commands should be retried, potentially impacting execution order.
- If
retryServerErroristrue, retriable errors (e.g., TRYAGAIN) will trigger a retry. - If
retryConnectionErroristrue, connection failures will trigger a retry.
Warnings:
- Retrying server errors may cause commands targeting the same slot to execute out of order.
- Retrying connection errors may lead to duplicate executions, as it is unclear which commands have already been processed.
Note: Currently, retry strategies are supported only for non-atomic batches.
Recommendation: It is recommended to increase the timeout in
BaseBatchOptions#timeoutwhen enabling these strategies.Default: Both
retryServerErrorandretryConnectionErrorare set tofalse. - If
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-