2.17.2: 2011-06-17

net.sf.basedb.core
Interface Batcher

All Known Implementing Classes:
AbstractBatcher, BasicBatcher, FeatureBatcher, FilterBatcher, MappingBatcher, PositionBatcher, PositionExtraValueBatcher, RawDataBatcher, ReporterBatcher, SpotBatcher, SpotExtraValueBatcher

public interface Batcher

The basic interface which all batchers must implement.

Version:
2.0
Author:
Nicklas
See Also:
Batch processing overview
Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Method Summary
 void close()
          Flush the batcher and close it.
 void flush()
          Flush the batcher and send all remaining items in memory to the database.
 int getBatchSize()
          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 Detail

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 underlying DbControl to connect to the database will automatically be closed when the DbControl is closed.

Returns:
TRUE if the batcher is closed, FALSE otherwise
See Also:
close()

flush

void flush()
           throws BaseException
Flush the batcher and send all remaining items in memory to the database.

Throws:
BaseException - If there is an error
See Also:
close()

close

void close()
           throws BaseException
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 underlying DbControl to connect to the database will automatically be closed when the DbControl is closed.

Throws:
BaseException - If there is an error
See Also:
isClosed(), flush()

2.17.2: 2011-06-17