Class KafkaFragment.Setter

Enclosing class:
KafkaFragment

public static final class KafkaFragment.Setter extends AbstractFragmentSetter<KafkaFragment.Setter>
The setter class to set options in a data map for the configuration.
  • 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

      public KafkaFragment.Setter offsetFlushInterval(Duration interval)
      Sets the offset commit flush interval.
      Parameters:
      interval - the interval between flushes.
      Returns:
      this.
    • offsetTimeout

      public KafkaFragment.Setter offsetTimeout(Duration interval)
      Sets the offset commit timeout.
      Parameters:
      interval - the interval between commit timeouts.
      Returns:
      this.
    • name

      public KafkaFragment.Setter name(String name)
      Globally unique name to use for this connector.
      Parameters:
      name - Globally unique name to use for this connector.
      Returns:
      this
    • pluginDiscovery

      public KafkaFragment.Setter pluginDiscovery(KafkaFragment.PluginDiscovery pluginDiscovery)
      Sets the plugin discovery strategy.
      Parameters:
      pluginDiscovery - the plugin discovery strategy.
      Returns:
      this
    • tasksMax

      public KafkaFragment.Setter tasksMax(int tasksMax)
      Sets the maximum number of tasks for the connector.
      Parameters:
      tasksMax - the maximum number of tasks.
      Returns:
      this
    • transforms

      public KafkaFragment.Setter transforms(String transforms)
      Sets the list of transforms
      Parameters:
      transforms - a comma separated list of transforms.
      Returns:
      this
    • bootstrapServers

      public KafkaFragment.Setter bootstrapServers(String bootstrapServers)
      Sets the bootstrap servers.
      Parameters:
      bootstrapServers - the bootstrap servers.
      Returns:
      this
    • taskShutdownTimeout

      public KafkaFragment.Setter taskShutdownTimeout(Duration timeout)
      Sets the task shutdown timeout.
      Parameters:
      timeout - the timeout.
      Returns:
      this
    • listeners

      public KafkaFragment.Setter listeners(String listeners)
      Sets the configuration listeners.
      Parameters:
      listeners - a comma separated string of configuration listeners.
      Returns:
      this
    • listeners

      public KafkaFragment.Setter listeners(String... listeners)
      Sets the configuration listeners.
      Parameters:
      listeners - an array of configuration listeners.
      Returns:
      this
    • advertisedHostName

      public KafkaFragment.Setter advertisedHostName(String hostName)
      Sets the advertised host name.
      Parameters:
      hostName - the advertised host name
      Returns:
      this
    • advertisedHostPort

      public KafkaFragment.Setter advertisedHostPort(int port)
      Sets the advertised host port.
      Parameters:
      port - the advertised host port.
      Returns:
    • advertisedListenerProtocol

      public KafkaFragment.Setter advertisedListenerProtocol(String protocol)
      Sets the advertised listener protocol.
      Parameters:
      protocol - HTTP or HTTPS
      Returns:
      this
    • accessControlAllowOrigin

      public KafkaFragment.Setter accessControlAllowOrigin(String origin)
      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

      public KafkaFragment.Setter accessControlAllowMethods(String methods)
      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

      public KafkaFragment.Setter pluginPath(String 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

      public KafkaFragment.Setter pluginPath(String... 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

      public KafkaFragment.Setter metricsSampleWindow(Duration window)
      Sets the metrics sample window size.
      Parameters:
      window - the time for each window.
      Returns:
      this
    • metricsSampleCount

      public KafkaFragment.Setter metricsSampleCount(int count)
      The number of samples maintained to compute metrics.
      Parameters:
      count - the number of samples.
      Returns:
      this.
    • metricsRecordingLevel

      public KafkaFragment.Setter metricsRecordingLevel(int level)
      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 the MetricsReporter 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