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, setStartTimeStamppublic Builder(String bootstrapServers, TopicFilter topicFilter, ManualPartitioner topicPartitioner)
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)
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)
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)
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)
tupleListener - the tuple listenerpublic KafkaSpoutConfig.Builder<K,V> setEmitNullTuples(boolean emitNullTuples)
emitNullTuples - sets if null tuples should or not be emitted downstreampublic KafkaSpoutConfig.Builder<K,V> setProcessingGuarantee(KafkaSpoutConfig.ProcessingGuarantee processingGuarantee)
KafkaSpoutConfig.ProcessingGuarantee.processingGuarantee - The processing guarantee the spout should offer.public KafkaSpoutConfig.Builder<K,V> setTupleTrackingEnforced(boolean tupleTrackingEnforced)
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)
metricsTimeBucketSizeInSecs - time in secondspublic KafkaSpoutConfig<K,V> build()
build in class CommonKafkaSpoutConfig.Builder<K,V,KafkaSpoutConfig.Builder<K,V>>Copyright © 2023 The Apache Software Foundation. All rights reserved.