public final class BatchOptions
extends java.lang.Object
implements java.lang.Cloneable
InfluxDB.enableBatch(BatchOptions)| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BATCH_ACTIONS_LIMIT |
static int |
DEFAULT_BATCH_INTERVAL_DURATION |
static int |
DEFAULT_BUFFER_LIMIT |
static int |
DEFAULT_JITTER_INTERVAL_DURATION |
static java.util.concurrent.TimeUnit |
DEFAULT_PRECISION |
static BatchOptions |
DEFAULTS
Default batch options.
|
| Modifier and Type | Method and Description |
|---|---|
BatchOptions |
actions(int actions) |
BatchOptions |
bufferLimit(int bufferLimit)
The client maintains a buffer for failed writes so that the writes will be retried later on.
|
BatchOptions |
consistency(InfluxDB.ConsistencyLevel consistency) |
BatchOptions |
exceptionHandler(java.util.function.BiConsumer<java.lang.Iterable<Point>,java.lang.Throwable> exceptionHandler) |
BatchOptions |
flushDuration(int flushDuration) |
int |
getActions() |
int |
getBufferLimit() |
InfluxDB.ConsistencyLevel |
getConsistency() |
java.util.function.BiConsumer<java.lang.Iterable<Point>,java.lang.Throwable> |
getExceptionHandler() |
int |
getFlushDuration() |
int |
getJitterDuration() |
java.util.concurrent.TimeUnit |
getPrecision() |
java.util.concurrent.ThreadFactory |
getThreadFactory() |
BatchOptions |
jitterDuration(int jitterDuration)
Jitters the batch flush interval by a random amount.
|
BatchOptions |
precision(java.util.concurrent.TimeUnit precision)
Set the time precision to use for the whole batch.
|
BatchOptions |
threadFactory(java.util.concurrent.ThreadFactory threadFactory) |
public static final int DEFAULT_BATCH_ACTIONS_LIMIT
public static final int DEFAULT_BATCH_INTERVAL_DURATION
public static final int DEFAULT_JITTER_INTERVAL_DURATION
public static final int DEFAULT_BUFFER_LIMIT
public static final java.util.concurrent.TimeUnit DEFAULT_PRECISION
public static final BatchOptions DEFAULTS
public BatchOptions actions(int actions)
actions - the number of actions to collectpublic BatchOptions flushDuration(int flushDuration)
flushDuration - the time to wait at most (milliseconds).public BatchOptions jitterDuration(int jitterDuration)
jitterDuration - (milliseconds)public BatchOptions bufferLimit(int bufferLimit)
getActions()bufferLimit - maximum number of points stored in the retry bufferpublic BatchOptions threadFactory(java.util.concurrent.ThreadFactory threadFactory)
threadFactory - a ThreadFactory instance to be usedpublic BatchOptions exceptionHandler(java.util.function.BiConsumer<java.lang.Iterable<Point>,java.lang.Throwable> exceptionHandler)
exceptionHandler - a consumer function to handle asynchronous errorspublic BatchOptions consistency(InfluxDB.ConsistencyLevel consistency)
consistency - cluster consistency setting (how many nodes have to store data points
to treat a write as a success)public BatchOptions precision(java.util.concurrent.TimeUnit precision)
TimeUnit.NANOSECONDS.precision - sets the precision to usepublic int getActions()
public int getFlushDuration()
public int getJitterDuration()
public int getBufferLimit()
bufferLimit(int)public java.util.concurrent.ThreadFactory getThreadFactory()
public java.util.function.BiConsumer<java.lang.Iterable<Point>,java.lang.Throwable> getExceptionHandler()
public InfluxDB.ConsistencyLevel getConsistency()
public java.util.concurrent.TimeUnit getPrecision()
Data In Motion GmbH all rights reserved