Package com.influxdb.client.reactive
Class WriteOptionsReactive.Builder
java.lang.Object
com.influxdb.client.reactive.WriteOptionsReactive.Builder
- Enclosing class:
WriteOptionsReactive
A builder for
WriteOptionsReactive
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbatchSize
(int batchSize) Set the number of data point to collect in batch.build()
Build an instance of WriteOptions.computationScheduler
(io.reactivex.rxjava3.core.Scheduler computationScheduler) Set the scheduler which is used for computational work.exponentialBase
(int exponentialBase) The base for the exponential retry delay.flushInterval
(int flushInterval) Set the time to wait at most (milliseconds).jitterInterval
(int jitterInterval) Jitters the batch flush interval by a random amount.maxRetries
(int maxRetries) The number of max retries when write fails.maxRetryDelay
(int maxRetryDelay) The maximum delay between each retry attempt in milliseconds.maxRetryTime
(int maxRetryTime) The maximum total retry timeout in milliseconds.retryInterval
(int retryInterval) Set the the time to wait before retry unsuccessful write (milliseconds).
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
Set the time to wait at most (milliseconds).- Parameters:
flushInterval
- the time to wait at most (milliseconds).- Returns:
this
-
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
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
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
The maximum delay between each retry attempt in milliseconds.- Parameters:
maxRetryDelay
- maximum delay- Returns:
this
-
maxRetryTime
The maximum total retry timeout in milliseconds.- Parameters:
maxRetryTime
- maximum timout- Returns:
this
-
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 isSchedulers.computation()
.- Parameters:
computationScheduler
- the scheduler which is used for computational work.- Returns:
this
-
build
Build an instance of WriteOptions.- Returns:
WriteOptions
-