public class MockSourceConnector extends SourceConnector
MockConnector.| Constructor and Description |
|---|
MockSourceConnector() |
| Modifier and Type | Method and Description |
|---|---|
ConfigDef |
config()
Define the configuration for the connector.
|
void |
initialize(ConnectorContext ctx)
Initialize this connector, using the provided ConnectorContext to notify the runtime of
input configuration changes.
|
void |
initialize(ConnectorContext ctx,
List<Map<String,String>> taskConfigs)
Initialize this connector, using the provided ConnectorContext to notify the runtime of
input configuration changes and using the provided set of Task configurations.
|
void |
reconfigure(Map<String,String> props)
Reconfigure this Connector.
|
void |
start(Map<String,String> props)
Start this Connector.
|
void |
stop()
Stop this connector.
|
Class<? extends Task> |
taskClass()
Returns the
Task implementation for this Connector. |
List<Map<String,String>> |
taskConfigs(int maxTasks)
Returns a set of configurations for Tasks based on the current configuration,
producing at most
maxTasks configurations. |
Config |
validate(Map<String,String> connectorConfigs)
Validate the connector configuration values against configuration definitions.
|
String |
version()
Get the version of this component.
|
alterOffsets, canDefineTransactionBoundaries, context, exactlyOnceSupportpublic void initialize(ConnectorContext ctx)
Connectorinitialize in class Connectorctx - context object used to interact with the Kafka Connect runtimepublic void initialize(ConnectorContext ctx, List<Map<String,String>> taskConfigs)
ConnectorInitialize this connector, using the provided ConnectorContext to notify the runtime of input configuration changes and using the provided set of Task configurations. This version is only used to recover from failures.
The default implementation ignores the provided Task configurations. During recovery, Kafka Connect will request an updated set of configurations and update the running Tasks appropriately. However, Connectors should implement special handling of this case if it will avoid unnecessary changes to running Tasks.
initialize in class Connectorctx - context object used to interact with the Kafka Connect runtimetaskConfigs - existing task configurations, which may be used when generating new task configs to avoid
churn in partition to task assignmentspublic void reconfigure(Map<String,String> props)
ConnectorConnector.stop() followed by Connector.start(Map).
Implementations only need to override this if they want to handle this process more
efficiently, e.g. without shutting down network connections to the external system.reconfigure in class Connectorprops - new configuration settingspublic Config validate(Map<String,String> connectorConfigs)
Connectorpublic String version()
Versionednull or empty.public void start(Map<String,String> props)
ConnectorConnector.stop() has been invoked.public Class<? extends Task> taskClass()
ConnectorTask implementation for this Connector.public List<Map<String,String>> taskConfigs(int maxTasks)
ConnectormaxTasks configurations.taskConfigs in class ConnectormaxTasks - maximum number of configurations to generatepublic void stop()
Connector