Interface Controller


public interface Controller
Controls various aspect of the exporting process.
  • Method Summary

    Modifier and Type
    Method
    Description
    Optional<byte[]>
    Read arbitrary metadata of the exporter that was stored previously by using the exporter controller.
    Schedules a cancellable to be ran after has expired.
    void
    Signals to the broker that the exporter has successfully exported all records up to and including the record at .
    void
    updateLastExportedRecordPosition(long position, byte[] metadata)
    Signals to the broker that the exporter has successfully exported all records up to and including the record at .
  • Method Details

    • updateLastExportedRecordPosition

      void updateLastExportedRecordPosition(long position)
      Signals to the broker that the exporter has successfully exported all records up to and including the record at .
      Parameters:
      position - the latest successfully exported record position
    • updateLastExportedRecordPosition

      void updateLastExportedRecordPosition(long position, byte[] metadata)
      Signals to the broker that the exporter has successfully exported all records up to and including the record at . Optionally, the exporter can provide arbitrary metadata that is stored in the broker and can be retrieved when the exporter opens. The metadata is stored only if the given position is greater than the previous exporter position.
      Parameters:
      position - the latest successfully exported record position
      metadata - arbitrary metadata for the exporter (can be null)
    • scheduleCancellableTask

      ScheduledTask scheduleCancellableTask(Duration delay, Runnable task)
      Schedules a cancellable to be ran after has expired.
      Parameters:
      delay - time to wait until the task is ran
      task - the task to run
      Returns:
      cancellable task.
    • readMetadata

      Optional<byte[]> readMetadata()
      Read arbitrary metadata of the exporter that was stored previously by using the exporter controller.
      Returns:
      the restored metadata, or Optional.empty() if no metadata exist