Package org.apache.kafka.connect.tools
Class MockConnector
java.lang.Object
org.apache.kafka.connect.connector.Connector
org.apache.kafka.connect.tools.MockConnector
- All Implemented Interfaces:
- Versioned
This connector provides support for mocking certain connector behaviors. For example,
 this can be used to simulate connector or task failures. It works by passing a "mock mode"
 through configuration from the system test. New mock behavior can be implemented either
 in the connector or in the task by providing a new mode implementation.
 
At the moment, this connector only supports a single task and shares configuration between the connector and its tasks.
- See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionconfig()Define the configuration for the 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.version()Get the version of this component.Methods inherited from class org.apache.kafka.connect.connector.Connectorinitialize, initialize, reconfigure, validate
- 
Field Details- 
MOCK_MODE_KEY- See Also:
 
- 
DELAY_MS_KEY- See Also:
 
- 
CONNECTOR_FAILURE- See Also:
 
- 
TASK_FAILURE- See Also:
 
- 
DEFAULT_FAILURE_DELAY_MSpublic static final long DEFAULT_FAILURE_DELAY_MS- See Also:
 
 
- 
- 
Constructor Details- 
MockConnectorpublic MockConnector()
 
- 
- 
Method Details- 
versionDescription copied from interface:VersionedGet the version of this component.- Returns:
- the version, formatted as a String. The version may not be nullor empty.
 
- 
startDescription 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.
- 
taskClassDescription copied from class:ConnectorReturns theTaskimplementation for this Connector.
- 
taskConfigsDescription copied from class:ConnectorReturns a set of configurations for Tasks based on the current configuration, producing at mostmaxTasksconfigurations.- Specified by:
- taskConfigsin class- Connector
- Parameters:
- maxTasks- maximum number of configurations to generate
- Returns:
- configurations for Tasks
 
- 
stoppublic void stop()Description copied from class:ConnectorStop this connector.
- 
configDescription copied from class:ConnectorDefine the configuration for the connector.
 
-