Package com.influxdb.client
Class WriteOptions
java.lang.Object
com.influxdb.client.WriteOptions
- All Implemented Interfaces:
WriteApi.RetryOptions
WriteOptions are used to configure writes the data point into InfluxDB 2.x.
The default setting use the batching configured to (consistent with Telegraf):
- batchSize = 1000
- flushInterval = 1000 ms
- retryInterval = 5000 ms
- jitterInterval = 0
- bufferLimit = 10_000
The default backpressure strategy is BackpressureOverflowStrategy.DROP_OLDEST
.
- Author:
- Jakub Bednar (bednar@github) (21/09/2018 10:11)
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final WriteOptions
Default configuration with values that are consistent with Telegraf. -
Method Summary
Modifier and TypeMethodDescriptionstatic WriteOptions.Builder
builder()
Creates a builder instance.io.reactivex.rxjava3.core.BackpressureOverflowStrategy
int
int
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.io.reactivex.rxjava3.core.Scheduler
-
Field Details
-
DEFAULT_BATCH_SIZE
public static final int DEFAULT_BATCH_SIZE- See Also:
-
DEFAULT_FLUSH_INTERVAL
public static final int DEFAULT_FLUSH_INTERVAL- See Also:
-
DEFAULT_JITTER_INTERVAL
public static final int DEFAULT_JITTER_INTERVAL- See Also:
-
DEFAULT_RETRY_INTERVAL
public static final int DEFAULT_RETRY_INTERVAL- See Also:
-
DEFAULT_MAX_RETRIES
public static final int DEFAULT_MAX_RETRIES- See Also:
-
DEFAULT_MAX_RETRY_DELAY
public static final int DEFAULT_MAX_RETRY_DELAY- See Also:
-
DEFAULT_MAX_RETRY_TIME
public static final int DEFAULT_MAX_RETRY_TIME- See Also:
-
DEFAULT_EXPONENTIAL_BASE
public static final int DEFAULT_EXPONENTIAL_BASE- See Also:
-
DEFAULT_BUFFER_LIMIT
public static final int DEFAULT_BUFFER_LIMIT- See Also:
-
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:
-
getBufferLimit
public int getBufferLimit()- Returns:
- Maximum number of points stored in the retry buffer.
- See Also:
-
getWriteScheduler
@Nonnull public io.reactivex.rxjava3.core.Scheduler getWriteScheduler()- Returns:
- The scheduler which is used for write data points.
- See Also:
-
getBackpressureStrategy
@Nonnull public io.reactivex.rxjava3.core.BackpressureOverflowStrategy getBackpressureStrategy()- Returns:
- the strategy to deal with buffer overflow when using onBackpressureBuffer
- See Also:
-
builder
Creates a builder instance.- Returns:
- a builder
-