Interface Batcher

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

public interface Batcher
extends AutoCloseable
The basic interface which all batchers must implement.
Version:
2.0
Author:
Nicklas
See Also:
Developer documentation: Batch operations
Last modified
$Date: 2018-12-12 15:41:10 +0100 (on, 12 dec 2018) $
  • Method Summary

    Modifier and Type Method Description
    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 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 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.
      Specified by:
      close in interface AutoCloseable
      Throws:
      BaseException - If there is an error
      See Also:
      isClosed(), flush()