Package net.sf.basedb.core
Interface Batcher
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractBatcher
,AnnotationBatcher
,BasicBatcher
,FeatureBatcher
,FilterBatcher
,MappingBatcher
,PositionBatcher
,PositionExtraValueBatcher
,RawDataBatcher
,ReporterBatcher
,ReporterCloneBatcher
,SpotBatcher
,SpotExtraValueBatcher
The basic interface which all batchers must implement.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2018-12-12 15:41:10 +0100 (on, 12 dec 2018) $
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Flush the batcher and close it.void
flush()
Flush the batcher and send all remaining items in memory to the database.int
Get the current batch size of the batcher.boolean
isClosed()
Check if the batcher has been closed or not.void
setBatchSize
(int batchSize) Sets the batch size.
-
Method Details
-
getBatchSize
int getBatchSize()Get the current batch size of the batcher. The batch size indicates how many individual items a batcher is caching in memory before they are automatically flushed to the database.- Returns:
- The current batch size, or 0 if automatic flushing is turned of
-
setBatchSize
void setBatchSize(int batchSize) Sets the batch size. The batch size indicates how many individual items a batcher is caching in memory before they are automatically flushed to the database.- Parameters:
batchSize
- Size of the batch, or 0 to disable automatic flushing
-
isClosed
boolean isClosed()Check if the batcher has been closed or not. A closed batcher will not accept any more data for insert, update or delete. Note! A batcher that uses an underlyingDbControl
to connect to the database will automatically be closed when theDbControl
is closed.- Returns:
- TRUE if the batcher is closed, FALSE otherwise
- See Also:
-
flush
Flush the batcher and send all remaining items in memory to the database.- Throws:
BaseException
- If there is an error- See Also:
-
close
Flush the batcher and close it. A closed batcher will not accept any more data for insert, update or delete. Note! A batcher that uses an underlyingDbControl
to connect to the database will automatically be closed when theDbControl
is closed.- Specified by:
close
in interfaceAutoCloseable
- Throws:
BaseException
- If there is an error- See Also:
-