title: How I can close Apache Kafka connector task?
body: <p>Now i'm working with Apache Kafka and have task:
  We have some csv-files in directory, it's a mini-batch files, each file is about 25-30 mb. All i need - parse file and put it to kafka.</p>
  
  <p>As I can see, Kafka have some interesting thing like Connector.</p>
  
  <p>I can create Source-Connector and SourceTask, but i don't understand one thing:
  when i handle file, how i can stop or delete my task?</p>
  
  <p>For example i have dummy connector:</p>
  
  <pre><code>public class DummySourceConnector extends SourceConnector {
  private static final Logger logger = LogManager.getLogger();
  
  @Override
  public String version() {
      logger.info("version");
  
      return "1";
  }
  
  @Override
  public ConfigDef config() {
      logger.info("config");
  
      return null;
  }
  
  @Override
  public Class&lt;? extends Task&gt; taskClass() {
      return DummySourceTask.class;
  }
  
  @Override
  public void start(Map&lt;String, String&gt; props) {
      logger.info("start {}", props);
  }
  
  @Override
  public void stop() {
      logger.info("stop");
  }
  
  @Override
  public List&lt;Map&lt;String, String&gt;&gt; taskConfigs(int maxTasks) {
      logger.info("taskConfigs {}", maxTasks);
  
      return ImmutableList.of(ImmutableMap.of("key", "value"));
  }
  </code></pre>
  
  <p>And Task:</p>
  
  <pre><code>public class DummySourceTask extends SourceTask {
  private static final Logger logger = LogManager.getLogger();
  
  private long offset = 0;
  
  @Override
  public String version() {
      logger.info("version");
  
      return "1";
  }
  
  @Override
  public void start(Map&lt;String, String&gt; props) {
      logger.info("start {}", props);
  }
  
  
  @Override
  public List&lt;SourceRecord&gt; poll() throws InterruptedException {
      Thread.sleep(3000);
  
      final String value = "Offset " + offset++ + " Timestamp " + Instant.now().toString();
  
      logger.info("poll value {}", value);
  
      return ImmutableList.of(new SourceRecord(
              ImmutableMap.of("partition", 0),
              ImmutableMap.of("offset", offset),
              "topic-dummy",
              SchemaBuilder.STRING_SCHEMA,
              value
      ));
  }
  
  public void stop() {
      logger.info("stop");
  }
  </code></pre>
  
  <p>But how i can close my task when it's all done?
  Or maybe you can help me with another idea for this task.</p>
  
  <p>Thanx for your help!</p>