[ https://issues.apache.org/jira/browse/KAFKA-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15323112#comment-15323112 ]
Randall Hauch commented on KAFKA-3813: -------------------------------------- The current API defines {{ConnectorContext}} interface and uses it when initializing {{SourceConnector}} and {{SinkConnector}} instances, and there is no specialization of {{ConnectorContext}}. There seem to be (at least) two approaches to implementing this improvement: # Add {{SourceConnectorContext}} and {{SinkConnectorContext}} specializations of the {{ConnectorContext}}, add a {{offsetStorageReader()}} method to {{SourceConnectorContext}}, and change the rest of the Kafka Connect framework to use these. This would likely be a breaking change, but it would distinguish between the contexts for source and sink connectors, allowing the contexts to evolve differently for different kinds of connectors. # Add {{offsetStorageReader()}} to {{ConnectorContext}}. This does add a method and would be byte-code compatible, and thus would be far less invasive and more straightforward. Thoughts? > Let SourceConnector implementations access the offset reader > ------------------------------------------------------------ > > Key: KAFKA-3813 > URL: https://issues.apache.org/jira/browse/KAFKA-3813 > Project: Kafka > Issue Type: Improvement > Components: KafkaConnect > Affects Versions: 0.10.0.0 > Reporter: Randall Hauch > Assignee: Ewen Cheslack-Postava > > When a source connector is started, having access to the > {{OffsetStorageReader}} would allow it to more intelligently configure its > tasks based upon the stored offsets. (Currently only the {{SourceTask}} > implementations can access the offset reader (via the {{SourceTaskContext}}), > but the {{SourceConnector}} does not have access to the offset reader.) > Of course, accessing the stored offsets is not likely to be useful for sink > connectors. -- This message was sent by Atlassian JIRA (v6.3.4#6332)