public static class KafkaSpoutConfig.Builder<K,V> extends CommonKafkaSpoutConfig.Builder<K,V,KafkaSpoutConfig.Builder<K,V>>
Constructor and Description |
---|
Builder(String bootstrapServers,
Pattern topics) |
Builder(String bootstrapServers,
Set<String> topics) |
Builder(String bootstrapServers,
String... topics) |
Builder(String bootstrapServers,
TopicFilter topicFilter,
ManualPartitioner topicPartitioner)
Create a KafkaSpoutConfig builder with default property values and no key/value deserializers.
|
Modifier and Type | Method and Description |
---|---|
KafkaSpoutConfig<K,V> |
build() |
KafkaSpoutConfig.Builder<K,V> |
setEmitNullTuples(boolean emitNullTuples)
Specifies if the spout should emit null tuples to the component downstream, or rather not emit and directly ack them.
|
KafkaSpoutConfig.Builder<K,V> |
setMaxUncommittedOffsets(int maxUncommittedOffsets)
Defines the max number of polled offsets (records) that can be pending commit, before another poll can take place.
|
KafkaSpoutConfig.Builder<K,V> |
setMetricsTimeBucketSizeInSecs(int metricsTimeBucketSizeInSecs)
The time period that metrics data in bucketed into.
|
KafkaSpoutConfig.Builder<K,V> |
setOffsetCommitPeriodMs(long offsetCommitPeriodMs)
Specifies the period, in milliseconds, the offset commit task is periodically called.
|
KafkaSpoutConfig.Builder<K,V> |
setProcessingGuarantee(KafkaSpoutConfig.ProcessingGuarantee processingGuarantee)
Specifies which processing guarantee the spout should offer.
|
KafkaSpoutConfig.Builder<K,V> |
setRetry(KafkaSpoutRetryService retryService)
Sets the retry service for the spout to use.
|
KafkaSpoutConfig.Builder<K,V> |
setTupleListener(KafkaTupleListener tupleListener)
Sets the tuple listener for the spout to use.
|
KafkaSpoutConfig.Builder<K,V> |
setTupleTrackingEnforced(boolean tupleTrackingEnforced)
Specifies whether the spout should require Storm to track emitted tuples when using a
KafkaSpoutConfig.ProcessingGuarantee other than KafkaSpoutConfig.ProcessingGuarantee.AT_LEAST_ONCE . |
getKafkaProps, setFirstPollOffsetStrategy, setPartitionRefreshPeriodMs, setPollTimeoutMs, setProp, setProp, setProp, setRecordTranslator, setRecordTranslator, setRecordTranslator, setStartTimeStamp
public Builder(String bootstrapServers, TopicFilter topicFilter, ManualPartitioner topicPartitioner)
Create a KafkaSpoutConfig builder with default property values and no key/value deserializers.
bootstrapServers
- The bootstrap servers the consumer will usetopicFilter
- The topic filter defining which topics and partitions the spout will readtopicPartitioner
- The topic partitioner defining which topics and partitions are assinged to each spout taskpublic KafkaSpoutConfig.Builder<K,V> setOffsetCommitPeriodMs(long offsetCommitPeriodMs)
Specifies the period, in milliseconds, the offset commit task is periodically called. Default is 15s.
This setting only has an effect if the configured KafkaSpoutConfig.ProcessingGuarantee
is KafkaSpoutConfig.ProcessingGuarantee.AT_LEAST_ONCE
or KafkaSpoutConfig.ProcessingGuarantee.NO_GUARANTEE
.
offsetCommitPeriodMs
- time in mspublic KafkaSpoutConfig.Builder<K,V> setMaxUncommittedOffsets(int maxUncommittedOffsets)
Defines the max number of polled offsets (records) that can be pending commit, before another poll can take place. Once this limit is reached, no more offsets (records) can be polled until the next successful commit(s) sets the number of pending offsets below the threshold. The default is KafkaSpoutConfig.DEFAULT_MAX_UNCOMMITTED_OFFSETS
. This limit is per partition and may in some cases be exceeded, but each partition cannot exceed this limit by more than maxPollRecords - 1.
This setting only has an effect if the configured KafkaSpoutConfig.ProcessingGuarantee
is KafkaSpoutConfig.ProcessingGuarantee.AT_LEAST_ONCE
.
maxUncommittedOffsets
- max number of records that can be be pending commitpublic KafkaSpoutConfig.Builder<K,V> setRetry(KafkaSpoutRetryService retryService)
Sets the retry service for the spout to use.
This setting only has an effect if the configured KafkaSpoutConfig.ProcessingGuarantee
is KafkaSpoutConfig.ProcessingGuarantee.AT_LEAST_ONCE
.
retryService
- the new retry servicepublic KafkaSpoutConfig.Builder<K,V> setTupleListener(KafkaTupleListener tupleListener)
Sets the tuple listener for the spout to use.
tupleListener
- the tuple listenerpublic KafkaSpoutConfig.Builder<K,V> setEmitNullTuples(boolean emitNullTuples)
Specifies if the spout should emit null tuples to the component downstream, or rather not emit and directly ack them. By default this parameter is set to false, which means that null tuples are not emitted.
emitNullTuples
- sets if null tuples should or not be emitted downstreampublic KafkaSpoutConfig.Builder<K,V> setProcessingGuarantee(KafkaSpoutConfig.ProcessingGuarantee processingGuarantee)
Specifies which processing guarantee the spout should offer. Refer to the documentation for KafkaSpoutConfig.ProcessingGuarantee
.
processingGuarantee
- The processing guarantee the spout should offer.public KafkaSpoutConfig.Builder<K,V> setTupleTrackingEnforced(boolean tupleTrackingEnforced)
Specifies whether the spout should require Storm to track emitted tuples when using a KafkaSpoutConfig.ProcessingGuarantee
other than KafkaSpoutConfig.ProcessingGuarantee.AT_LEAST_ONCE
. The spout will always track emitted tuples when offering at-least-once guarantees regardless of this setting. This setting is false by default.
Enabling tracking can be useful even in cases where reliability is not a concern, because it allows Config.TOPOLOGY_MAX_SPOUT_PENDING
to have an effect, and enables some spout metrics (e.g. complete-latency) that would otherwise be disabled.
tupleTrackingEnforced
- true if Storm should track emitted tuples, false otherwisepublic KafkaSpoutConfig.Builder<K,V> setMetricsTimeBucketSizeInSecs(int metricsTimeBucketSizeInSecs)
The time period that metrics data in bucketed into.
metricsTimeBucketSizeInSecs
- time in secondspublic KafkaSpoutConfig<K,V> build()
build
in class CommonKafkaSpoutConfig.Builder<K,V,KafkaSpoutConfig.Builder<K,V>>
Copyright © 2019 The Apache Software Foundation. All rights reserved.