Package org.apache.pinot.spi.stream
Interface StreamDataProducer
-
public interface StreamDataProducerStreamDataProducer is the interface for stream data sources. E.g. KafkaDataProducer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classStreamDataProducer.RowWithKeyHelper class so the key and payload can be easily tied together instead of using a pair The class is intended for StreamDataProducer only
-
Method Summary
Modifier and Type Method Description voidclose()voidinit(Properties props)voidproduce(String topic, byte[] payload)voidproduce(String topic, byte[] key, byte[] payload)default voidproduce(String topic, byte[] key, byte[] payload, GenericRow headers)default voidproduceBatch(String topic, List<byte[]> rows)Allows the producer to optimize for a batched write.default voidproduceKeyedBatch(String topic, List<StreamDataProducer.RowWithKey> payloadWithKey)default voidproduceKeyedBatch(String topic, List<StreamDataProducer.RowWithKey> payloadWithKey, boolean includeHeaders)Allows the producer to optimize for a batched write.
-
-
-
Method Detail
-
init
void init(Properties props)
-
produce
void produce(String topic, byte[] payload)
-
produce
void produce(String topic, byte[] key, byte[] payload)
-
produce
default void produce(String topic, byte[] key, byte[] payload, GenericRow headers)
-
close
void close()
-
produceBatch
default void produceBatch(String topic, List<byte[]> rows)
Allows the producer to optimize for a batched write. This will help increase throughput in some cases- Parameters:
topic- the topic of the outputrows- the rows
-
produceKeyedBatch
default void produceKeyedBatch(String topic, List<StreamDataProducer.RowWithKey> payloadWithKey, boolean includeHeaders)
Allows the producer to optimize for a batched write. This will help increase throughput in some cases- Parameters:
topic- the topic of the outputpayloadWithKey- the payload rows with key
-
produceKeyedBatch
default void produceKeyedBatch(String topic, List<StreamDataProducer.RowWithKey> payloadWithKey)
-
-