@InterfaceAudience.Public @InterfaceStability.Evolving public interface BatchSource<T> extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
discover(Consumer<byte[]> taskEater)
Discovery phase of a connector.
|
void |
open(Map<String,Object> config,
SourceContext context)
Open connector with configuration.
|
void |
prepare(byte[] task)
Called when a new task appears for this connector instance.
|
Record<T> |
readNext()
Read data and return a record.
|
closevoid open(Map<String,Object> config, SourceContext context) throws Exception
config - config that's supplied for sourcecontext - environment where the source connector is runningException - IO type exceptions when opening a connectorvoid discover(Consumer<byte[]> taskEater) throws Exception
taskEater - function to notify the framework about the new task received.Exception - during discovervoid prepare(byte[] task)
throws Exception
task - the serialized representation of the taskExceptionCopyright © 2017–2022 Apache Software Foundation. All rights reserved.