Class Client2CallOptions

java.lang.Object
org.voltdb.client.Client2CallOptions

public class Client2CallOptions extends Object
Container for per-call options for a Client2 VoltDB client. A Client2CallOptions can be used with callProcedureAsync or callProcedureSync to pass in override options for specific calls.

Using a single options class helps avoid combinatorial explosion of options.

Options not explicity set will assume the values set up when the client was configured. VoltDB recommends using Client2Config to set values that will remain unchanged for the life of the client, with this Client2CallOptions class being used only when variance between calls is needed.

See Also:
  • Constructor Details

    • Client2CallOptions

      public Client2CallOptions()
      The constructor. All options are initialized to their configured or default values, as appropriate.
  • Method Details

    • clientTimeout

      public Client2CallOptions clientTimeout(long timeout, TimeUnit unit)
      Sets the client-side timeout for a procedure call. A zero or negative value means there is no limit.

      If a call has received no response from VoltDB in the specified time, it will be completed with a timeout error.

      Parameters:
      timeout - the timeout interval
      unit - the units in which the timeout was expressed
      Returns:
      this
    • queryTimeout

      public Client2CallOptions queryTimeout(long timeout, TimeUnit unit)
      Sets the server-side query timeout for a read-only procedure call or batch of procedure calls. This has no effect on read-write transactions. A zero or negative value means there is no limit.

      This timeout may override the value specified for querytimeout in the systemsettings element of the VoltDB cluster configuration file. Admin privilege is required to set a timeout longer than the global value.

      Parameters:
      timeout - the timeout interval
      unit - the units in which the timeout was expressed
      Returns:
      this
    • requestPriority

      public Client2CallOptions requestPriority(int prio)
      Sets the request priority for a procedure call.

      The valid priority range is from Client2Config.HIGHEST_PRIORITY to Client2Config.LOWEST_PRIORITY, inclusive. Higher priorities have lower numerical values.

      Parameters:
      prio - priority
      Returns:
      this