Package org.influxdb.impl
Class BatchProcessor.Builder
java.lang.Object
org.influxdb.impl.BatchProcessor.Builder
- Enclosing class:
- BatchProcessor
public static final class BatchProcessor.Builder extends Object
The Builder to create a BatchProcessor instance.
-
Constructor Summary
-
Method Summary
Modifier and Type Method 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)
-
Constructor Details
-
Builder
- Parameters:
influxDB
- is mandatory.
-
-
Method Details
-
threadFactory
- Parameters:
threadFactory
- is optional.- Returns:
- this Builder to use it fluent
-
actions
The number of actions after which a batchwrite must be performed.- Parameters:
maxActions
- number of Points written after which a write must happen.- Returns:
- this Builder to use it fluent
-
interval
The interval at which at least should issued a write.- Parameters:
interval
- the intervalunit
- the TimeUnit of the interval- Returns:
- this Builder to use it fluent
-
interval
The interval at which at least should issued a write.- Parameters:
flushInterval
- the flush intervaljitterInterval
- the flush jitter intervalunit
- the TimeUnit of the interval- Returns:
- this Builder to use it fluent
-
bufferLimit
A buffer for failed writes so that the writes will be retried later on. When the buffer is full and new points are written, oldest entries in the buffer are lost.- Parameters:
bufferLimit
- maximum number of points stored in the buffer- Returns:
- this Builder to use it fluent
-
exceptionHandler
A callback to be used when an error occurs during a batchwrite.- Parameters:
handler
- the handler- Returns:
- this Builder to use it fluent
-
dropActionsOnQueueExhaustion
To define the behaviour when the action queue exhausts. If unspecified, will default to false which means that theInfluxDB.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 andBatchProcessor.droppedActionHandler
will be called.- Parameters:
dropActionsOnQueueExhaustion
- the dropActionsOnQueueExhaustion- Returns:
- this Builder to use it fluent
-
droppedActionHandler
A callback to be used when an actions are dropped on action queue exhaustion.- Parameters:
handler
- the handler- Returns:
- this Builder to use it fluent
-
consistencyLevel
Consistency level for batch write.- Parameters:
consistencyLevel
- the consistencyLevel- Returns:
- this Builder to use it fluent
-
precision
Set the time precision to use for the batch.- Parameters:
precision
- the precision- Returns:
- this Builder to use it fluent
-
build
Create the BatchProcessor.- Returns:
- the BatchProcessor instance.
-