Class ExampleSourceTask

java.lang.Object
org.apache.kafka.connect.source.SourceTask
io.aiven.commons.kafka.connector.source.AbstractSourceTask
io.aiven.commons.kafka.connector.source.impl.ExampleSourceTask
All Implemented Interfaces:
org.apache.kafka.connect.connector.Task

public class ExampleSourceTask extends AbstractSourceTask
An example implementation of the Source task.
  • Constructor Details

    • ExampleSourceTask

      public ExampleSourceTask()
      Constructor.
  • Method Details

    • getIterator

      protected EvolvingSourceRecordIterator getIterator(SourceCommonConfig config)
      Description copied from class: AbstractSourceTask
      Gets the iterator of SourceRecords. The iterator that SourceRecords are extracted from for a poll event. When this iterator runs out of records it should attempt to reset and read more records from the backend on the next hasNext() call. In this way it should detect when new data has been added to the backend and continue processing.

      This method should handle any backend exception that can be retried. Any runtime exceptions that are thrown when this iterator executes may cause the task to abort.

      Specified by:
      getIterator in class AbstractSourceTask
      Parameters:
      config - the SourceCommonConfig instance.
      Returns:
      The iterator of SourceRecords.
    • configure

      protected SourceCommonConfig configure(Map<String,String> props, OffsetManager offsetManager)
      Description copied from class: AbstractSourceTask
      Called by AbstractSourceTask.start(java.util.Map<java.lang.String, java.lang.String>) to allows the concrete implementation to configure itself based on properties.
      Specified by:
      configure in class AbstractSourceTask
      Parameters:
      props - The properties to use for configuration.
      offsetManager - the OffsetManager to use.
      Returns:
      A SourceCommonConfig based configuration.
    • closeResources

      protected void closeResources()
      Description copied from class: AbstractSourceTask
      Close any resources the source has open. Called when stopping.
      Specified by:
      closeResources in class AbstractSourceTask
    • version

      public String version()