package io.confluent.connect.jdbc.sink;

import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.connect.connector.Task;
import org.apache.kafka.connect.sink.SinkConnector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import io.confluent.connect.jdbc.sink.config.JdbcSinkConfig;

public final class JdbcSinkConnector extends SinkConnector {
  private static final Logger logger = LoggerFactory.getLogger(JdbcSinkConnector.class);

  private Map<String, String> configProps = null;

  public Class<? extends Task> taskClass() {
    return JdbcSinkTask.class;
  }

  @Override
  public List<Map<String, String>> taskConfigs(int maxTasks) {
    logger.info("Setting task configurations for {} workers.");
    final List<Map<String, String>> configs = new ArrayList<>(maxTasks);
    for (int i = 0; i < maxTasks; ++i) {
      configs.add(configProps);
    }
    return configs;
  }

  @Override
  public void start(Map<String, String> props) {
    configProps = props;
  }

  @Override
  public void stop() {
  }

  @Override
  public ConfigDef config() {
    return JdbcSinkConfig.getConfigDef();
  }

  @Override
  public String version() {
    return getClass().getPackage().getImplementationVersion();
  }
}

package io.confluent.connect.jdbc.sink;

import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.connect.connector.Task;
import org.apache.kafka.connect.sink.SinkConnector;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import io.confluent.connect.jdbc.sink.config.JdbcSinkConfig;

public final class JdbcSinkConnector extends SinkConnector {
  private static final Logger logger = LoggerFactory.getLogger(JdbcSinkConnector.class);

  private Map<String, String> configProps = null;

  public Class<? extends Task> taskClass() {
    return JdbcSinkTask.class;
  }

  @Override
  public List<Map<String, String>> taskConfigs(int maxTasks) {
    logger.info("Setting task configurations for {} workers.", maxTasks);
    final List<Map<String, String>> configs = new ArrayList<>(maxTasks);
    for (int i = 0; i < maxTasks; ++i) {
      configs.add(configProps);
    }
    return configs;
  }

  @Override
  public void start(Map<String, String> props) {
    configProps = props;
  }

  @Override
  public void stop() {
  }

  @Override
  public ConfigDef config() {
    return JdbcSinkConfig.getConfigDef();
  }

  @Override
  public String version() {
    return getClass().getPackage().getImplementationVersion();
  }
}

fix log statement bug from f51db34b17f599712c4bd6e1ab1d6958a9f314a0