Package com.influxdb.client.reactive
Class WriteOptionsReactive
java.lang.Object
com.influxdb.client.reactive.WriteOptionsReactive
- All Implemented Interfaces:
WriteApi.RetryOptions
The configuration for
WriteReactiveApi
.
Example:
WriteOptionsReactive writeOptions = WriteOptionsReactive.builder() .batchSize(10_000) .flushInterval(500) .jitterInterval(1_000) .retryInterval(2_000) .maxRetries(5) .maxRetryDelay(250_123) .maxRetryTime(500_000) .exponentialBase(2) .computationScheduler(Schedulers.newThread()) .build();
- Author:
- Jakub Bednar (05/08/2021 9:13)
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final WriteOptionsReactive
Default configuration with values that are consistent with Telegraf. -
Method Summary
Modifier and TypeMethodDescriptionstatic WriteOptionsReactive.Builder
builder()
Creates a builder instance.int
io.reactivex.rxjava3.core.Scheduler
int
The base for the exponential retry delay.int
int
Jitters the batch flush interval by a random amount.int
The number of max retries when write fails.int
The maximum delay between each retry attempt in milliseconds.int
The maximum total retry timeout in milliseconds.int
The retry interval is used when the InfluxDB server does not specify "Retry-After" header.
-
Field Details
-
DEFAULTS
Default configuration with values that are consistent with Telegraf.
-
-
Method Details
-
getBatchSize
public int getBatchSize()- Returns:
- the number of data point to collect in batch
- See Also:
-
getFlushInterval
public int getFlushInterval()- Returns:
- the time to wait at most (milliseconds)
- See Also:
-
getJitterInterval
public int getJitterInterval()Description copied from interface:WriteApi.RetryOptions
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.- Specified by:
getJitterInterval
in interfaceWriteApi.RetryOptions
- Returns:
- batch flush jitter interval value (milliseconds)
- See Also:
-
getRetryInterval
public int getRetryInterval()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.- Specified by:
getRetryInterval
in interfaceWriteApi.RetryOptions
- Returns:
- the time to wait before retry unsuccessful write (milliseconds)
- See Also:
-
getMaxRetries
public int getMaxRetries()The number of max retries when write fails.- Specified by:
getMaxRetries
in interfaceWriteApi.RetryOptions
- Returns:
- number of max retries
- See Also:
-
getMaxRetryDelay
public int getMaxRetryDelay()The maximum delay between each retry attempt in milliseconds.- Specified by:
getMaxRetryDelay
in interfaceWriteApi.RetryOptions
- Returns:
- maximum delay
- See Also:
-
getMaxRetryTime
public int getMaxRetryTime()The maximum total retry timeout in milliseconds.- Returns:
- maximum delay
- See Also:
-
getExponentialBase
public int getExponentialBase()The base for the exponential retry delay.The next delay is computed as: retryInterval * exponentialBase^(attempts-1) + random(jitterInterval)
- Specified by:
getExponentialBase
in interfaceWriteApi.RetryOptions
- Returns:
- exponential base
- See Also:
-
getComputationScheduler
@Nonnull public io.reactivex.rxjava3.core.Scheduler getComputationScheduler()- Returns:
- The scheduler which is used for computational work.
- See Also:
-
builder
Creates a builder instance.- Returns:
- a builder
-