Class TopicPartitionChannel.StreamingBuffer

  • Enclosing class:
    TopicPartitionChannel

    protected class TopicPartitionChannel.StreamingBuffer
    extends PartitionBuffer<net.snowflake.ingest.utils.Pair<List<Map<String,​Object>>,​List<Long>>>
    A buffer which holds the rows before calling insertRows API. It implements the PartitionBuffer class which has all common fields about a buffer.

    This buffer is a bit different from Snowpipe Buffer. In StreamingBuffer we buffer incoming records from Kafka and once threshold has reached, we would call insertRows API to insert into Snowflake.

    We would transform kafka records to Snowflake understood records (In JSON format) just before calling insertRows API.

    • Method Detail

      • insert

        public void insert​(org.apache.kafka.connect.sink.SinkRecord kafkaSinkRecord)
        Description copied from class: PartitionBuffer
        Inserts the row into Buffer.
        Specified by:
        insert in class PartitionBuffer<net.snowflake.ingest.utils.Pair<List<Map<String,​Object>>,​List<Long>>>
        Parameters:
        kafkaSinkRecord - the record which kafka sends to KC. We also convert the record to a format which is understood by Snowflake Table
      • getSinkRecord

        public org.apache.kafka.connect.sink.SinkRecord getSinkRecord​(long idx)