All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.jaredpetersen.kafkaconnectarangodb.sink.ArangoDbSinkConnector Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package io.github.jaredpetersen.kafkaconnectarangodb.sink;

import io.github.jaredpetersen.kafkaconnectarangodb.sink.config.ArangoDbSinkConfig;
import io.github.jaredpetersen.kafkaconnectarangodb.util.PropertiesLoader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.kafka.common.config.ConfigDef;
import org.apache.kafka.connect.connector.Task;
import org.apache.kafka.connect.sink.SinkConnector;


/**
 * Entry point for Kafka Connect ArangoDB Sink.
 */
public class ArangoDbSinkConnector extends SinkConnector {
  private Map config;

  @Override
  public final String version() {
    return PropertiesLoader.load().getProperty("version");
  }

  @Override
  public final void start(final Map props) {
    this.config = props;
  }

  @Override
  public final Class taskClass() {
    return ArangoDbSinkTask.class;
  }

  @Override
  public final List> taskConfigs(final int maxTasks) {
    List> taskConfigs = new ArrayList<>(maxTasks);

    for (int configIndex = 0; configIndex < maxTasks; ++configIndex) {
      taskConfigs.add(this.config);
    }

    return taskConfigs;
  }

  @Override
  public final void stop() {
    // Do nothing
  }

  @Override
  public final ConfigDef config() {
    return ArangoDbSinkConfig.CONFIG_DEF;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy