public static class KafkaIO.Write<K,V> extends KafkaIO.TypedWrite<K,V>
PTransform to write to a Kafka topic. See KafkaIO for more
information on usage and configuration.keyCoder, producerConfig, producerFactoryFnOpt, topic, valueCodername| Modifier and Type | Method and Description |
|---|---|
KafkaIO.Write<K,V> |
updateProducerProperties(Map<String,Object> configUpdates) |
KafkaIO.Write<K,V> |
withBootstrapServers(String bootstrapServers)
Returns a new
KafkaIO.Write transform with Kafka producer pointing to
bootstrapServers. |
<KeyT> KafkaIO.Write<KeyT,V> |
withKeyCoder(Coder<KeyT> keyCoder)
Returns a new
KafkaIO.Write with Coder for serializing key (if any) to bytes. |
KafkaIO.Write<K,V> |
withTopic(String topic)
Returns a new
KafkaIO.Write transform that write to given topic. |
<ValueT> KafkaIO.Write<K,ValueT> |
withValueCoder(Coder<ValueT> valueCoder)
Returns a new
KafkaIO.Write with Coder for serializing value to bytes. |
apply, validate, values, withProducerFactoryFngetDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, populateDisplayData, toStringpublic KafkaIO.Write<K,V> withBootstrapServers(String bootstrapServers)
KafkaIO.Write transform with Kafka producer pointing to
bootstrapServers.public KafkaIO.Write<K,V> withTopic(String topic)
KafkaIO.Write transform that write to given topic.public <KeyT> KafkaIO.Write<KeyT,V> withKeyCoder(Coder<KeyT> keyCoder)
KafkaIO.Write with Coder for serializing key (if any) to bytes.
A key is optional while writing to Kafka. Note when a key is set, its hash is used to
determine partition in Kafka (see ProducerRecord for more details).public <ValueT> KafkaIO.Write<K,ValueT> withValueCoder(Coder<ValueT> valueCoder)
KafkaIO.Write with Coder for serializing value to bytes.Copyright © 2016 The Apache Software Foundation. All rights reserved.