public interface TransactionContext
Modifier and Type | Method and Description |
---|---|
void |
abortTransaction()
Requests a transaction abort after the next batch of records from
SourceTask.poll() . |
void |
abortTransaction(SourceRecord record)
Requests a transaction abort after a source record is processed.
|
void |
commitTransaction()
Request a transaction commit after the next batch of records from
SourceTask.poll()
is processed. |
void |
commitTransaction(SourceRecord record)
Request a transaction commit after a source record is processed.
|
void commitTransaction()
SourceTask.poll()
is processed.void commitTransaction(SourceRecord record)
If a task requests that the last record in a batch that it returns from SourceTask.poll()
be committed by invoking this method, and also requests that that same batch be aborted by
invoking abortTransaction()
, the record-based operation (in this case, committing
the transaction) will take precedence.
record
- the record to commit the transaction after; may not be null.void abortTransaction()
SourceTask.poll()
. All of
the records in that transaction will be discarded and will not appear in a committed transaction.
However, offsets for that transaction will still be committed so than the records in that transaction
are not reprocessed. If the data should instead be reprocessed, the task should not invoke this method
and should instead throw an exception.void abortTransaction(SourceRecord record)
If a task requests that the last record in a batch that it returns from SourceTask.poll()
be aborted by invoking this method, and also requests that that same batch be committed by
invoking commitTransaction()
, the record-based operation (in this case, aborting
the transaction) will take precedence.
record
- the record to abort the transaction after; may not be null.