Skip to content

Commit

Permalink
Add a note about the expectation of idempotency to the Javadoc for So…
Browse files Browse the repository at this point in the history
…urceConnector::alterOffsets and SinkConnector::alterOffsets
  • Loading branch information
yashmayya committed Jun 23, 2023
1 parent a53487a commit 4ebe51f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -54,6 +54,10 @@ protected SinkConnectorContext context() {
* User requests to alter/reset offsets will be handled by the Connect runtime and will be reflected in the offsets
* for this connector's consumer group.
* <p>
* Note that altering / resetting offsets is expected to be an idempotent operation and this method should be able
* to handle being called more than once with the same arguments (which could occur if a user retries the request
* due to a failure in altering the consumer group offsets, for example).
* <p>
* Similar to {@link #validate(Map) validate}, this method may be called by the runtime before the
* {@link #start(Map) start} method is invoked.
*
Expand Down
Expand Up @@ -85,6 +85,10 @@ public ConnectorTransactionBoundaries canDefineTransactionBoundaries(Map<String,
* returned by any {@link org.apache.kafka.connect.storage.OffsetStorageReader OffsetStorageReader instances}
* provided to this connector and its tasks.
* <p>
* Note that altering / resetting offsets is expected to be an idempotent operation and this method should be able
* to handle being called more than once with the same arguments (which could occur if a user retries the request
* due to a failure in writing the new offsets to the offsets store, for example).
* <p>
* Similar to {@link #validate(Map) validate}, this method may be called by the runtime before the
* {@link #start(Map) start} method is invoked.
*
Expand Down

0 comments on commit 4ebe51f

Please sign in to comment.