public static final class BatchProcessor.Builder extends Object
Modifier and Type | Method and Description |
---|---|
BatchProcessor.Builder |
actions(int maxActions)
The number of actions after which a batchwrite must be performed.
|
BatchProcessor.Builder |
bufferLimit(int bufferLimit)
A buffer for failed writes so that the writes will be retried later on.
|
BatchProcessor |
build()
Create the BatchProcessor.
|
BatchProcessor.Builder |
consistencyLevel(InfluxDB.ConsistencyLevel consistencyLevel)
Consistency level for batch write.
|
BatchProcessor.Builder |
dropActionsOnQueueExhaustion(boolean dropActionsOnQueueExhaustion)
To define the behaviour when the action queue exhausts.
|
BatchProcessor.Builder |
droppedActionHandler(Consumer<Point> handler)
A callback to be used when an actions are dropped on action queue exhaustion.
|
BatchProcessor.Builder |
exceptionHandler(BiConsumer<Iterable<Point>,Throwable> handler)
A callback to be used when an error occurs during a batchwrite.
|
BatchProcessor.Builder |
interval(int flushInterval,
int jitterInterval,
TimeUnit unit)
The interval at which at least should issued a write.
|
BatchProcessor.Builder |
interval(int interval,
TimeUnit unit)
The interval at which at least should issued a write.
|
BatchProcessor.Builder |
precision(TimeUnit precision)
Set the time precision to use for the batch.
|
BatchProcessor.Builder |
threadFactory(ThreadFactory threadFactory) |
public Builder(InfluxDB influxDB)
influxDB
- is mandatory.public BatchProcessor.Builder threadFactory(ThreadFactory threadFactory)
threadFactory
- is optional.public BatchProcessor.Builder actions(int maxActions)
maxActions
- number of Points written after which a write must happen.public BatchProcessor.Builder interval(int interval, TimeUnit unit)
interval
- the intervalunit
- the TimeUnit of the intervalpublic BatchProcessor.Builder interval(int flushInterval, int jitterInterval, TimeUnit unit)
flushInterval
- the flush intervaljitterInterval
- the flush jitter intervalunit
- the TimeUnit of the intervalpublic BatchProcessor.Builder bufferLimit(int bufferLimit)
bufferLimit
- maximum number of points stored in the bufferpublic BatchProcessor.Builder exceptionHandler(BiConsumer<Iterable<Point>,Throwable> handler)
handler
- the handlerpublic BatchProcessor.Builder dropActionsOnQueueExhaustion(boolean dropActionsOnQueueExhaustion)
InfluxDB.write(Point)
will be blocked till the space in the queue is created.
true means that the newer actions being written to the queue will dropped and
BatchProcessor.droppedActionHandler
will be called.dropActionsOnQueueExhaustion
- the dropActionsOnQueueExhaustionpublic BatchProcessor.Builder droppedActionHandler(Consumer<Point> handler)
handler
- the handlerpublic BatchProcessor.Builder consistencyLevel(InfluxDB.ConsistencyLevel consistencyLevel)
consistencyLevel
- the consistencyLevelpublic BatchProcessor.Builder precision(TimeUnit precision)
precision
- the precisionpublic BatchProcessor build()
Copyright © 2020. All rights reserved.