org.apache.ignite.stream.kafka.connect

## Class IgniteSinkTask

- java.lang.Object
- - org.apache.kafka.connect.sink.SinkTask
  - - org.apache.ignite.stream.kafka.connect.IgniteSinkTask

- All Implemented Interfaces:
    org.apache.kafka.connect.connector.Task

      public class IgniteSinkTask
      extends org.apache.kafka.connect.sink.SinkTask

  Task to consume sequences of SinkRecords and write data to grid.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `IgniteSinkTask.StreamerContext` Streamer context initializing grid and data streamer instances on demand.

  - ### Field Summary

    - ### Fields inherited from class org.apache.kafka.connect.sink.SinkTask

      `context, TOPICS_CONFIG, TOPICS_REGEX_CONFIG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IgniteSinkTask()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `flush(Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets)` Pushes buffered data to grid.
    `void` | `put(Collection<org.apache.kafka.connect.sink.SinkRecord> records)` Buffers records.
    `protected static void` | `setStopped(boolean stopped)` Used by unit test to avoid restart node and valid state of the `stopped` flag.
    `void` | `start(Map<String,String> props)` Initializes grid client from configPath.
    `void` | `stop()` Stops the grid client.
    `String` | `version()`

    - ### Methods inherited from class org.apache.kafka.connect.sink.SinkTask

      `close, initialize, onPartitionsAssigned, onPartitionsRevoked, open, preCommit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### IgniteSinkTask

          public IgniteSinkTask()

  - ### Method Detail

    - #### version

          public String version()

    - #### start

          public void start(Map<String,String> props)

      Initializes grid client from configPath.
      Specified by:
        `start` in interface `org.apache.kafka.connect.connector.Task`
      Specified by:
        `start` in class `org.apache.kafka.connect.sink.SinkTask`
      Parameters:
        `props` - Task properties.

    - #### put

          public void put(Collection<org.apache.kafka.connect.sink.SinkRecord> records)

      Buffers records.
      Specified by:
        `put` in class `org.apache.kafka.connect.sink.SinkTask`
      Parameters:
        `records` - Records to inject into grid.

    - #### flush

          public void flush(Map<org.apache.kafka.common.TopicPartition,org.apache.kafka.clients.consumer.OffsetAndMetadata> offsets)

      Pushes buffered data to grid. Flush interval is configured by worker configurations.
      Overrides:
        `flush` in class `org.apache.kafka.connect.sink.SinkTask`
      Parameters:
        `offsets` - Offset information.

    - #### stop

          public void stop()

      Stops the grid client.
      Specified by:
        `stop` in interface `org.apache.kafka.connect.connector.Task`
      Specified by:
        `stop` in class `org.apache.kafka.connect.sink.SinkTask`

    - #### setStopped

          protected static void setStopped(boolean stopped)

      Used by unit test to avoid restart node and valid state of the `stopped` flag.
      Parameters:
        `stopped` - Stopped flag.

2020 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.9.0
Release Date | : October 15 2020