Class BatchOptions

java.lang.Object
org.redisson.api.BatchOptions

public final class BatchOptions extends Object
Configuration for Batch object.
Author:
Nikita Koksharov
  • Method Details

    • 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 - value
      unit - 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 interval
      retryIntervalUnit - 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 - slaves amount for synchronization
      timeout - synchronization timeout
      unit - 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:
    • getExecutionMode

      public BatchOptions.ExecutionMode getExecutionMode()
    • toString

      public String toString()
      Overrides:
      toString in class Object