public class BatchOptions extends Object
Modifier and Type | Method and Description |
---|---|
BatchOptions |
atomic()
Switches batch to atomic mode.
|
static BatchOptions |
defaults() |
long |
getResponseTimeout() |
int |
getRetryAttempts() |
long |
getRetryInterval() |
int |
getSyncSlaves() |
long |
getSyncTimeout() |
boolean |
isAtomic() |
boolean |
isSkipResult() |
BatchOptions |
responseTimeout(long timeout,
TimeUnit unit)
Defines timeout for Redis response.
|
BatchOptions |
retryAttempts(int retryAttempts)
Defines attempts amount to send Redis commands batch
if it hasn't been sent already.
|
BatchOptions |
retryInterval(long retryInterval,
TimeUnit retryIntervalUnit)
Defines time interval for each attempt to send Redis commands batch
if it hasn't been sent already.
|
BatchOptions |
skipResult()
Inform Redis not to send reply.
|
BatchOptions |
syncSlaves(int slaves,
long timeout,
TimeUnit unit)
Synchronize write operations execution within defined timeout
across specified amount of Redis slave nodes.
|
public static BatchOptions defaults()
public long getResponseTimeout()
public BatchOptions responseTimeout(long timeout, TimeUnit unit)
Default is 3000 milliseconds
timeout
- valueunit
- valuepublic int getRetryAttempts()
public BatchOptions retryAttempts(int retryAttempts)
Default is 3 attempts
retryAttempts
- valuepublic long getRetryInterval()
public BatchOptions retryInterval(long retryInterval, TimeUnit retryIntervalUnit)
Default is 1500 milliseconds
retryInterval
- - time intervalretryIntervalUnit
- - time interval unitpublic BatchOptions syncSlaves(int slaves, long timeout, TimeUnit unit)
NOTE: Redis 3.0+ required
slaves
- - synchronization timeouttimeout
- - synchronization timeoutunit
- - synchronization timeout time unitpublic long getSyncTimeout()
public int getSyncSlaves()
public BatchOptions atomic()
Please note, that in cluster mode all objects should be on the same cluster slot. https://github.com/antirez/redis/issues/3682
public boolean isAtomic()
public BatchOptions skipResult()
NOTE: Redis 3.2+ required
public boolean isSkipResult()
Copyright © 2014–2018 The Redisson Project. All rights reserved.