public class MockSourceTask extends SourceTask
SourceTask.TransactionBoundary
context, TRANSACTION_BOUNDARY_CONFIG
Constructor and Description |
---|
MockSourceTask() |
Modifier and Type | Method and Description |
---|---|
List<SourceRecord> |
poll()
Poll this source task for new records.
|
void |
start(Map<String,String> config)
Start the Task.
|
void |
stop()
Signal this SourceTask to stop.
|
String |
version()
Get the version of this task.
|
commit, commitRecord, commitRecord, initialize
public String version()
Task
Connector
class's version.public void start(Map<String,String> config)
SourceTask
start
in interface Task
start
in class SourceTask
config
- initial configurationpublic List<SourceRecord> poll()
SourceTask
null
) in
order for the task to transition to the PAUSED
state if requested to do so.
The task will be stopped
on a separate thread, and when that happens
this method is expected to unblock, quickly finish up any remaining processing, and
return.
poll
in class SourceTask
public void stop()
SourceTask
SourceTask.poll()
and
SourceTask.commit()
.
For example, if a task uses a Selector
to receive data over the network, this method
could set a flag that will force SourceTask.poll()
to exit immediately and invoke
wakeup()
to interrupt any ongoing requests.
stop
in interface Task
stop
in class SourceTask