Package org.apache.kafka.connect.tools
Class MockSinkConnector
java.lang.Object
org.apache.kafka.connect.connector.Connector
org.apache.kafka.connect.sink.SinkConnector
org.apache.kafka.connect.tools.MockSinkConnector
- All Implemented Interfaces:
Versioned
Mock sink implementation which delegates to
MockConnector.-
Field Summary
Fields inherited from class org.apache.kafka.connect.sink.SinkConnector
TOPICS_CONFIG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfig()Define the configuration for the connector.voidInitialize this connector, using the provided ConnectorContext to notify the runtime of input configuration changes.voidinitialize(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.voidreconfigure(Map<String, String> props) Reconfigure this Connector.voidStart this Connector.voidstop()Stop this connector.Returns theTaskimplementation for this Connector.taskConfigs(int maxTasks) Returns a set of configurations for Tasks based on the current configuration, producing at mostmaxTasksconfigurations.Validate the connector configuration values against configuration definitions.version()Get the version of this component.Methods inherited from class org.apache.kafka.connect.sink.SinkConnector
alterOffsets
-
Constructor Details
-
MockSinkConnector
public MockSinkConnector()
-
-
Method Details
-
initialize
Description copied from class:ConnectorInitialize this connector, using the provided ConnectorContext to notify the runtime of input configuration changes.- Overrides:
initializein classConnector- Parameters:
ctx- context object used to interact with the Kafka Connect runtime
-
initialize
Description copied from class: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.
- Overrides:
initializein classConnector- Parameters:
ctx- 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 assignments
-
reconfigure
Description copied from class:ConnectorReconfigure this Connector. Most implementations will not override this, using the default implementation that callsConnector.stop()followed byConnector.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.- Overrides:
reconfigurein classConnector- Parameters:
props- new configuration settings
-
validate
Description copied from class:ConnectorValidate the connector configuration values against configuration definitions. -
version
Description copied from interface:VersionedGet the version of this component.- Returns:
- the version, formatted as a String. The version may not be
nullor empty.
-
start
Description copied from class:ConnectorStart this Connector. This method will only be called on a clean Connector, i.e. it has either just been instantiated and initialized orConnector.stop()has been invoked. -
taskClass
Description copied from class:ConnectorReturns theTaskimplementation for this Connector. -
taskConfigs
Description copied from class:ConnectorReturns a set of configurations for Tasks based on the current configuration, producing at mostmaxTasksconfigurations.- Specified by:
taskConfigsin classConnector- Parameters:
maxTasks- maximum number of configurations to generate- Returns:
- configurations for Tasks
-
stop
public void stop()Description copied from class:ConnectorStop this connector. -
config
Description copied from class:ConnectorDefine the configuration for the connector.
-