Package org.redisson.api
Class BatchOptions
- java.lang.Object
-
- org.redisson.api.BatchOptions
-
public final class BatchOptions extends Object
Configuration for Batch object.- Author:
- Nikita Koksharov
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBatchOptions.ExecutionMode
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BatchOptionsdefaults()BatchOptionsexecutionMode(BatchOptions.ExecutionMode executionMode)Sets execution mode.BatchOptions.ExecutionModegetExecutionMode()longgetResponseTimeout()intgetRetryAttempts()longgetRetryInterval()intgetSyncSlaves()longgetSyncTimeout()booleanisSkipResult()BatchOptionsresponseTimeout(long timeout, TimeUnit unit)Defines timeout for Redis response.BatchOptionsretryAttempts(int retryAttempts)Defines attempts amount to send Redis commands batch if it hasn't been sent already.BatchOptionsretryInterval(long retryInterval, TimeUnit retryIntervalUnit)Defines time interval for each attempt to send Redis commands batch if it hasn't been sent already.BatchOptionsskipResult()Inform Redis not to send reply.BatchOptionssyncSlaves(int slaves, long timeout, TimeUnit unit)Synchronize write operations execution within defined timeout across specified amount of Redis slave nodes.StringtoString()
-
-
-
Method Detail
-
defaults
public static BatchOptions defaults()
-
getResponseTimeout
public long getResponseTimeout()
-
responseTimeout
public BatchOptions responseTimeout(long timeout, TimeUnit unit)
Defines timeout for Redis response. Starts to countdown when Redis command has been successfully sent.Default is
3000 milliseconds- Parameters:
timeout- valueunit- value- Returns:
- self instance
-
getRetryAttempts
public int getRetryAttempts()
-
retryAttempts
public BatchOptions retryAttempts(int retryAttempts)
Defines attempts amount to send Redis commands batch if it hasn't been sent already.Default is
3 attempts- Parameters:
retryAttempts- value- Returns:
- self instance
-
getRetryInterval
public long getRetryInterval()
-
retryInterval
public BatchOptions retryInterval(long retryInterval, TimeUnit retryIntervalUnit)
Defines time interval for each attempt to send Redis commands batch if it hasn't been sent already.Default is
1500 milliseconds- Parameters:
retryInterval- - time intervalretryIntervalUnit- - time interval unit- Returns:
- self instance
-
syncSlaves
public BatchOptions syncSlaves(int slaves, long timeout, TimeUnit unit)
Synchronize write operations execution within defined timeout across specified amount of Redis slave nodes.NOTE: Redis 3.0+ required
- Parameters:
slaves- - synchronization timeouttimeout- - synchronization timeoutunit- - synchronization timeout time unit- Returns:
- self instance
-
getSyncTimeout
public long getSyncTimeout()
-
getSyncSlaves
public int getSyncSlaves()
-
skipResult
public BatchOptions skipResult()
Inform Redis not to send reply. This allows to save network traffic for commands with batch with big response.NOTE: Redis 3.2+ required
- Returns:
- self instance
-
isSkipResult
public boolean isSkipResult()
-
executionMode
public BatchOptions executionMode(BatchOptions.ExecutionMode executionMode)
Sets execution mode.- Parameters:
executionMode- - batch execution mode- Returns:
- self instance
- See Also:
BatchOptions.ExecutionMode
-
getExecutionMode
public BatchOptions.ExecutionMode getExecutionMode()
-
-