Class WriteOptionsReactive.Builder

java.lang.Object
com.influxdb.client.reactive.WriteOptionsReactive.Builder
Enclosing class:
WriteOptionsReactive

@NotThreadSafe public static class WriteOptionsReactive.Builder extends Object
A builder for WriteOptionsReactive.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • batchSize

      @Nonnull public WriteOptionsReactive.Builder batchSize(int batchSize)
      Set the number of data point to collect in batch.

      If you set the batchSize to '0' the batching is disabled - whole upstream is written in one batch.

      Parameters:
      batchSize - the number of data point to collect in batch
      Returns:
      this
    • flushInterval

      @Nonnull public WriteOptionsReactive.Builder flushInterval(int flushInterval)
      Set the time to wait at most (milliseconds).
      Parameters:
      flushInterval - the time to wait at most (milliseconds).
      Returns:
      this
    • jitterInterval

      @Nonnull public WriteOptionsReactive.Builder jitterInterval(int jitterInterval)
      Jitters the batch flush interval by a random amount. This is primarily to avoid large write spikes for users running a large number of client instances. ie, a jitter of 5s and flush duration 10s means flushes will happen every 10-15s.
      Parameters:
      jitterInterval - (milliseconds)
      Returns:
      this
    • retryInterval

      @Nonnull public WriteOptionsReactive.Builder retryInterval(int retryInterval)
      Set the the time to wait before retry unsuccessful write (milliseconds).

      The retry interval is used when the InfluxDB server does not specify "Retry-After" header.
      Retry-After: A non-negative decimal integer indicating the seconds to delay after the response is received.
      Parameters:
      retryInterval - the time to wait before retry unsuccessful write
      Returns:
      this
    • maxRetries

      @Nonnull public WriteOptionsReactive.Builder maxRetries(int maxRetries)
      The number of max retries when write fails.

      If you set the maxRetries to '0' the retry strategy is disabled - the error is immediately propagate to upstream.

      Parameters:
      maxRetries - number of max retries
      Returns:
      this
    • maxRetryDelay

      @Nonnull public WriteOptionsReactive.Builder maxRetryDelay(int maxRetryDelay)
      The maximum delay between each retry attempt in milliseconds.
      Parameters:
      maxRetryDelay - maximum delay
      Returns:
      this
    • maxRetryTime

      @Nonnull public WriteOptionsReactive.Builder maxRetryTime(int maxRetryTime)
      The maximum total retry timeout in milliseconds.
      Parameters:
      maxRetryTime - maximum timout
      Returns:
      this
    • exponentialBase

      @Nonnull public WriteOptionsReactive.Builder exponentialBase(int exponentialBase)
      The base for the exponential retry delay.
      Parameters:
      exponentialBase - exponential base
      Returns:
      this
    • computationScheduler

      @Nonnull public WriteOptionsReactive.Builder computationScheduler(@Nonnull io.reactivex.rxjava3.core.Scheduler computationScheduler)
      Set the scheduler which is used for computational work. Default value is Schedulers.computation().
      Parameters:
      computationScheduler - the scheduler which is used for computational work.
      Returns:
      this
    • build

      @Nonnull public WriteOptionsReactive build()
      Build an instance of WriteOptions.
      Returns:
      WriteOptions