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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description net.snowflake.ingest.utils.Pair<List<Map<String,Object>>,List<Long>>getData()Get all rows and their offsets.org.apache.kafka.connect.sink.SinkRecordgetSinkRecord(long idx)List<org.apache.kafka.connect.sink.SinkRecord>getSinkRecords()TODO:SNOW-552576 Avoid extra memory in buffer.voidinsert(org.apache.kafka.connect.sink.SinkRecord kafkaSinkRecord)Inserts the row into Buffer.-
Methods inherited from class com.snowflake.kafka.connector.internal.PartitionBuffer
getBufferSizeBytes, getFirstOffset, getLastOffset, getNumOfRecords, isEmpty, setBufferSizeBytes, setFirstOffset, setLastOffset, setNumOfRecords, toString
-
-
-
-
Method Detail
-
insert
public void insert(org.apache.kafka.connect.sink.SinkRecord kafkaSinkRecord)
Description copied from class:PartitionBufferInserts the row into Buffer.
-
getData
public net.snowflake.ingest.utils.Pair<List<Map<String,Object>>,List<Long>> getData()
Get all rows and their offsets. Each map corresponds to one row whose keys are column names and values are corresponding data in that column.This goes over through all buffered kafka records and transforms into JsonSchema and JsonNode Check
TopicPartitionChannel.handleNativeRecord(SinkRecord, boolean)
-
getSinkRecords
public List<org.apache.kafka.connect.sink.SinkRecord> getSinkRecords()
Description copied from class:PartitionBufferTODO:SNOW-552576 Avoid extra memory in buffer.- Specified by:
getSinkRecordsin classPartitionBuffer<net.snowflake.ingest.utils.Pair<List<Map<String,Object>>,List<Long>>>- Returns:
- the sinkrecords corresponding to this buffer
-
getSinkRecord
public org.apache.kafka.connect.sink.SinkRecord getSinkRecord(long idx)
-
-