Class AbstractSink.SinkWriter

java.lang.Object
com.inductiveautomation.ignition.gateway.storeforward.sinks.AbstractSink.SinkWriter
All Implemented Interfaces:
BatchWriter<T>, AutoCloseable
Enclosing class:
AbstractSink<T extends PersistentData>

protected class AbstractSink.SinkWriter extends Object implements BatchWriter<T>
  • Constructor Details

    • SinkWriter

      public SinkWriter(int batchSize)
  • Method Details

    • setBatchSize

      public void setBatchSize(int batchSize)
      Description copied from interface: BatchWriter
      Sets the batch size for writing.
      Specified by:
      setBatchSize in interface BatchWriter<T extends PersistentData>
      Parameters:
      batchSize - the new batch size
    • queueData

      public boolean queueData(T data) throws Exception
      Description copied from interface: BatchWriter
      Queues data for writing.
      Specified by:
      queueData in interface BatchWriter<T extends PersistentData>
      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

      public boolean queueData(List<T> data) throws Exception
      Description copied from interface: BatchWriter
      Queues a list of data for writing.
      Specified by:
      queueData in interface BatchWriter<T extends PersistentData>
      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

      public void flush() throws Exception
      Description copied from interface: BatchWriter
      Flushes any buffered data to the underlying storage.
      Specified by:
      flush in interface BatchWriter<T extends PersistentData>
      Throws:
      Exception - if an error occurs while flushing the data
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception