Interface BatchWriter<T extends PersistentData>
- Type Parameters:
T
- the type ofPersistentData
to be written
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractSink.SinkWriter
A writer interface for writing batches of data to a data store / sink.
Implementations of this interface should be thread-safe and should properly handle multiple concurrent writers.
-
Method Summary
Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
queueData
Queues data for writing.- Parameters:
data
- the data to be written- Returns:
- true if this queueing operation resulted in all data being flushed (due to batching)
- Throws:
Exception
- if an error occurs while queueing the data
-
queueData
Queues a list of data for writing.- Parameters:
data
- the list of data to be written- Returns:
- true if this queueing operation resulted in all data being flushed (due to batching)
- Throws:
Exception
- if an error occurs while queueing the data
-
flush
Flushes any buffered data to the underlying storage.- Throws:
Exception
- if an error occurs while flushing the data
-
setBatchSize
void setBatchSize(int batchSize) Sets the batch size for writing.- Parameters:
batchSize
- the new batch size
-