Class KafkaFragment.Setter
java.lang.Object
io.aiven.kafka.connect.common.config.AbstractFragmentSetter<KafkaFragment.Setter>
io.aiven.kafka.connect.common.config.KafkaFragment.Setter
- Enclosing class:
- KafkaFragment
The setter class to set options in a data map for the configuration.
-
Field Summary
Fields inherited from class io.aiven.kafka.connect.common.config.AbstractFragmentSetter
self
-
Method Summary
Modifier and TypeMethodDescriptionaccessControlAllowMethods
(String methods) Sets the methods supported for cross origin requests by setting the Access-Control-Allow-Methods header.accessControlAllowOrigin
(String origin) Sets the aAccess-Control-Allow-Origin header to for REST API requests.advertisedHostName
(String hostName) Sets the advertised host name.advertisedHostPort
(int port) Sets the advertised host port.advertisedListenerProtocol
(String protocol) Sets the advertised listener protocol.bootstrapServers
(String bootstrapServers) Sets the bootstrap servers.THe class for the connector.headerConverter
(Class<? extends org.apache.kafka.connect.storage.Converter> header) Sets the header converter.keyConverter
(Class<? extends org.apache.kafka.connect.storage.Converter> converter) Sets the key converter.Sets the configuration listeners.Sets the configuration listeners.metricReporterClasses
(Class<? extends org.apache.kafka.common.metrics.MetricsReporter>... reporterClasses) A list of classes to use as metrics reporters.metricsRecordingLevel
(int level) The highest recording level for metrics.metricsSampleCount
(int count) The number of samples maintained to compute metrics.metricsSampleWindow
(Duration window) Sets the metrics sample window size.Globally unique name to use for this connector.offsetFlushInterval
(Duration interval) Sets the offset commit flush interval.offsetTimeout
(Duration interval) Sets the offset commit timeout.pluginDiscovery
(KafkaFragment.PluginDiscovery pluginDiscovery) Sets the plugin discovery strategy.pluginPath
(String pluginPath) Sets the list of paths separated by commas (,) that contain plugins (connectors, converters, transformations).pluginPath
(String... pluginPath) Sets the list of paths that contain plugins (connectors, converters, transformations).taskShutdownTimeout
(Duration timeout) Sets the task shutdown timeout.tasksMax
(int tasksMax) Sets the maximum number of tasks for the connector.transforms
(String transforms) Sets the list of transformsvalueConverter
(Class<? extends org.apache.kafka.connect.storage.Converter> converter) Sets the value converter.
-
Method Details
-
connector
public KafkaFragment.Setter connector(Class<? extends org.apache.kafka.connect.connector.Connector> connectorClass) THe class for the connector.- Parameters:
connectorClass
- the class for the connector.- Returns:
- this
-
keyConverter
public KafkaFragment.Setter keyConverter(Class<? extends org.apache.kafka.connect.storage.Converter> converter) Sets the key converter.- Parameters:
converter
- the Key converter class.- Returns:
- this
-
valueConverter
public KafkaFragment.Setter valueConverter(Class<? extends org.apache.kafka.connect.storage.Converter> converter) Sets the value converter.- Parameters:
converter
- the value converter class.- Returns:
- this
-
headerConverter
public KafkaFragment.Setter headerConverter(Class<? extends org.apache.kafka.connect.storage.Converter> header) Sets the header converter.- Parameters:
header
- the header converter class.- Returns:
- this.
-
offsetFlushInterval
Sets the offset commit flush interval.- Parameters:
interval
- the interval between flushes.- Returns:
- this.
-
offsetTimeout
Sets the offset commit timeout.- Parameters:
interval
- the interval between commit timeouts.- Returns:
- this.
-
name
Globally unique name to use for this connector.- Parameters:
name
- Globally unique name to use for this connector.- Returns:
- this
-
pluginDiscovery
Sets the plugin discovery strategy.- Parameters:
pluginDiscovery
- the plugin discovery strategy.- Returns:
- this
-
tasksMax
Sets the maximum number of tasks for the connector.- Parameters:
tasksMax
- the maximum number of tasks.- Returns:
- this
-
transforms
Sets the list of transforms- Parameters:
transforms
- a comma separated list of transforms.- Returns:
- this
-
bootstrapServers
Sets the bootstrap servers.- Parameters:
bootstrapServers
- the bootstrap servers.- Returns:
- this
-
taskShutdownTimeout
Sets the task shutdown timeout.- Parameters:
timeout
- the timeout.- Returns:
- this
-
listeners
Sets the configuration listeners.- Parameters:
listeners
- a comma separated string of configuration listeners.- Returns:
- this
-
listeners
Sets the configuration listeners.- Parameters:
listeners
- an array of configuration listeners.- Returns:
- this
-
advertisedHostName
Sets the advertised host name.- Parameters:
hostName
- the advertised host name- Returns:
- this
-
advertisedHostPort
Sets the advertised host port.- Parameters:
port
- the advertised host port.- Returns:
-
advertisedListenerProtocol
Sets the advertised listener protocol.- Parameters:
protocol
- HTTP or HTTPS- Returns:
- this
-
accessControlAllowOrigin
Sets the aAccess-Control-Allow-Origin header to for REST API requests. To enable cross-origin access, set this to the domain of the application that should be permitted to access the API, or '*' to allow access from any domain. The default value only allows access from the domain of the REST API.- Parameters:
origin
- the orgin to allow- Returns:
- this
-
accessControlAllowMethods
Sets the methods supported for cross origin requests by setting the Access-Control-Allow-Methods header. The default value of the Access-Control-Allow-Methods header allows cross-origin requests for GET, POST and HEAD.- Parameters:
methods
- A list of methods to allow.- Returns:
- this
-
pluginPath
Sets the list of paths separated by commas (,) that contain plugins (connectors, converters, transformations). Example: "/usr/local/share/java,/usr/local/share/kafka/plugins,/opt/connectors"- Parameters:
pluginPath
- the list of paths.- Returns:
- this
- See Also:
-
pluginPath
Sets the list of paths that contain plugins (connectors, converters, transformations). The list should consist of top level directories that include any combination of:- directories immediately containing jars with plugins and their dependencies
- uber-jars with plugins and their dependencies
- directories immediately containing the package directory structure of classes of plugins and their dependencies
Note: symlinks will be followed to discover dependencies or plugins.
- Parameters:
pluginPath
- the list of paths to to search,.- Returns:
- this.
-
metricsSampleWindow
Sets the metrics sample window size.- Parameters:
window
- the time for each window.- Returns:
- this
-
metricsSampleCount
The number of samples maintained to compute metrics.- Parameters:
count
- the number of samples.- Returns:
- this.
-
metricsRecordingLevel
The highest recording level for metrics.- Parameters:
level
- the recording level- Returns:
- this.
-
metricReporterClasses
public KafkaFragment.Setter metricReporterClasses(Class<? extends org.apache.kafka.common.metrics.MetricsReporter>... reporterClasses) A list of classes to use as metrics reporters. Implementing theMetricsReporter
interface allows plugging in classes that will be notified of new metric creation. The JmxReporter is always included to register JMX statistics.- Parameters:
reporterClasses
- the classes to use.- Returns:
- this
-