Class CommonKafkaSpoutConfig.Builder<K,V,T extends CommonKafkaSpoutConfig.Builder<K,V,T>>    
java.lang.Object
org.apache.storm.kafka.spout.internal.CommonKafkaSpoutConfig.Builder<K,V,T>  
- Direct Known Subclasses:
- KafkaSpoutConfig.Builder,- KafkaTridentSpoutConfig.Builder
- Enclosing class:
- CommonKafkaSpoutConfig<K,V> 
public abstract static class CommonKafkaSpoutConfig.Builder<K,V,T extends CommonKafkaSpoutConfig.Builder<K,V,T>>    
extends Object
- 
Constructor SummaryConstructorsConstructorDescriptionBuilder(String bootstrapServers, TopicFilter topicFilter, ManualPartitioner topicPartitioner) Create a KafkaSpoutConfig builder with default property values and no key/value deserializers.
- 
Method SummaryModifier and TypeMethodDescriptionabstract CommonKafkaSpoutConfig<K,V> build()setFirstPollOffsetStrategy(FirstPollOffsetStrategy firstPollOffsetStrategy) Sets the offset used by the Kafka spout in the first poll to Kafka broker upon process start.setPartitionRefreshPeriodMs(long partitionRefreshPeriodMs) Sets partition refresh period in milliseconds.setPollTimeoutMs(long pollTimeoutMs) Specifies the time, in milliseconds, spent waiting in poll if data is not available.Set aKafkaConsumerproperty.Set multipleKafkaConsumerproperties.setProp(Properties props) Set multipleKafkaConsumerproperties.setRecordTranslator(Func<org.apache.kafka.clients.consumer.ConsumerRecord<K, V>, List<Object>> func, Fields fields) Configure a translator with tuples to be emitted on the default stream.setRecordTranslator(Func<org.apache.kafka.clients.consumer.ConsumerRecord<K, V>, List<Object>> func, Fields fields, String stream) Configure a translator with tuples to be emitted to a given stream.setRecordTranslator(RecordTranslator<K, V> translator) setStartTimeStamp(long startTimeStamp) Specifies the startTimeStamp if the first poll strategy is TIMESTAMP or UNCOMMITTED_TIMESTAMP.
- 
Constructor Details- 
Builder
- 
Builder
- 
Builder
- 
Builderpublic Builder(String bootstrapServers, TopicFilter topicFilter, ManualPartitioner topicPartitioner) Create a KafkaSpoutConfig builder with default property values and no key/value deserializers.- Parameters:
- bootstrapServers- The bootstrap servers the consumer will use
- topicFilter- The topic filter defining which topics and partitions the spout will read
- topicPartitioner- The topic partitioner defining which topics and partitions are assinged to each spout task
 
 
- 
- 
Method Details- 
setPropSet aKafkaConsumerproperty.
- 
setPropSet multipleKafkaConsumerproperties.
- 
setPropSet multipleKafkaConsumerproperties.
- 
setPollTimeoutMsSpecifies the time, in milliseconds, spent waiting in poll if data is not available. Default is 200ms.- Parameters:
- pollTimeoutMs- time in ms
 
- 
setFirstPollOffsetStrategySets the offset used by the Kafka spout in the first poll to Kafka broker upon process start. Please refer to to the documentation inFirstPollOffsetStrategy- Parameters:
- firstPollOffsetStrategy- Offset used by Kafka spout first poll
 
- 
setRecordTranslator
- 
setRecordTranslatorpublic T setRecordTranslator(Func<org.apache.kafka.clients.consumer.ConsumerRecord<K, V>, List<Object>> func, Fields fields) Configure a translator with tuples to be emitted on the default stream.- Parameters:
- func- extracts and turns a Kafka ConsumerRecord into a list of objects to be emitted
- fields- the names of the fields extracted
- Returns:
- this to be able to chain configuration
 
- 
setRecordTranslatorpublic T setRecordTranslator(Func<org.apache.kafka.clients.consumer.ConsumerRecord<K, V>, List<Object>> func, Fields fields, String stream) Configure a translator with tuples to be emitted to a given stream.- Parameters:
- func- extracts and turns a Kafka ConsumerRecord into a list of objects to be emitted
- fields- the names of the fields extracted
- stream- the stream to emit the tuples on
- Returns:
- this to be able to chain configuration
 
- 
setPartitionRefreshPeriodMsSets partition refresh period in milliseconds. This is how often Kafka will be polled to check for new topics and/or new partitions.- Parameters:
- partitionRefreshPeriodMs- time in milliseconds
- Returns:
- the builder (this)
 
- 
setStartTimeStampSpecifies the startTimeStamp if the first poll strategy is TIMESTAMP or UNCOMMITTED_TIMESTAMP.- Parameters:
- startTimeStamp- time in ms
 
- 
getKafkaProps
- 
build
 
-