public class KafkaSpoutConfig<K,V> extends Object implements Serializable
KafkaSpoutConfig defines the required configuration to connect a consumer to a consumer group, as well as the subscribing topics
Modifier and Type | Class and Description |
---|---|
static class |
KafkaSpoutConfig.Builder<K,V> |
static class |
KafkaSpoutConfig.FirstPollOffsetStrategy
Defines how the
KafkaSpout seeks the offset to be used in the first poll to Kafka upon topology deployment. |
static class |
KafkaSpoutConfig.ProcessingGuarantee
This enum controls when the tuple with the
ConsumerRecord for an offset is marked as processed, i.e. |
Modifier and Type | Field and Description |
---|---|
static KafkaSpoutConfig.FirstPollOffsetStrategy |
DEFAULT_FIRST_POLL_OFFSET_STRATEGY |
static int |
DEFAULT_MAX_RETRIES |
static int |
DEFAULT_MAX_UNCOMMITTED_OFFSETS |
static int |
DEFAULT_METRICS_TIME_BUCKET_SIZE_SECONDS |
static long |
DEFAULT_OFFSET_COMMIT_PERIOD_MS |
static long |
DEFAULT_PARTITION_REFRESH_PERIOD_MS |
static long |
DEFAULT_POLL_TIMEOUT_MS |
static KafkaSpoutConfig.ProcessingGuarantee |
DEFAULT_PROCESSING_GUARANTEE |
static KafkaSpoutRetryService |
DEFAULT_RETRY_SERVICE |
static KafkaTupleListener |
DEFAULT_TUPLE_LISTENER |
Constructor and Description |
---|
KafkaSpoutConfig(KafkaSpoutConfig.Builder<K,V> builder)
Creates a new KafkaSpoutConfig using a Builder.
|
Modifier and Type | Method and Description |
---|---|
static KafkaSpoutConfig.Builder<String,String> |
builder(String bootstrapServers,
Collection<String> topics)
Factory method that creates a Builder with String key/value deserializers.
|
static KafkaSpoutConfig.Builder<String,String> |
builder(String bootstrapServers,
Pattern topics)
Factory method that creates a Builder with String key/value deserializers.
|
static KafkaSpoutConfig.Builder<String,String> |
builder(String bootstrapServers,
String... topics)
Factory method that creates a Builder with String key/value deserializers.
|
String |
getConsumerGroupId() |
KafkaSpoutConfig.FirstPollOffsetStrategy |
getFirstPollOffsetStrategy() |
Map<String,Object> |
getKafkaProps()
Gets the properties that will be passed to the KafkaConsumer.
|
org.apache.kafka.common.serialization.Deserializer<K> |
getKeyDeserializer()
Deprecated.
Please use
getKafkaProps() and look up the entry for ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG instead |
int |
getMaxUncommittedOffsets() |
int |
getMetricsTimeBucketSizeInSecs() |
long |
getOffsetsCommitPeriodMs() |
long |
getPartitionRefreshPeriodMs() |
long |
getPollTimeoutMs() |
KafkaSpoutConfig.ProcessingGuarantee |
getProcessingGuarantee() |
KafkaSpoutRetryService |
getRetryService() |
Subscription |
getSubscription() |
RecordTranslator<K,V> |
getTranslator() |
KafkaTupleListener |
getTupleListener() |
org.apache.kafka.common.serialization.Deserializer<V> |
getValueDeserializer()
Deprecated.
Please use
getKafkaProps() and look up the entry for ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG instead |
boolean |
isConsumerAutoCommitMode()
Deprecated.
Use
getProcessingGuarantee() instead. |
boolean |
isEmitNullTuples() |
boolean |
isTupleTrackingEnforced() |
String |
toString() |
public static final long DEFAULT_POLL_TIMEOUT_MS
public static final long DEFAULT_OFFSET_COMMIT_PERIOD_MS
public static final int DEFAULT_MAX_RETRIES
public static final int DEFAULT_MAX_UNCOMMITTED_OFFSETS
public static final long DEFAULT_PARTITION_REFRESH_PERIOD_MS
public static final KafkaSpoutConfig.FirstPollOffsetStrategy DEFAULT_FIRST_POLL_OFFSET_STRATEGY
public static final KafkaSpoutRetryService DEFAULT_RETRY_SERVICE
public static final KafkaSpoutConfig.ProcessingGuarantee DEFAULT_PROCESSING_GUARANTEE
public static final KafkaTupleListener DEFAULT_TUPLE_LISTENER
public static final int DEFAULT_METRICS_TIME_BUCKET_SIZE_SECONDS
public KafkaSpoutConfig(KafkaSpoutConfig.Builder<K,V> builder)
Creates a new KafkaSpoutConfig using a Builder.
builder
- The Builder to construct the KafkaSpoutConfig frompublic static KafkaSpoutConfig.Builder<String,String> builder(String bootstrapServers, String... topics)
Factory method that creates a Builder with String key/value deserializers.
bootstrapServers
- The bootstrap servers for the consumertopics
- The topics to subscribe topublic static KafkaSpoutConfig.Builder<String,String> builder(String bootstrapServers, Collection<String> topics)
Factory method that creates a Builder with String key/value deserializers.
bootstrapServers
- The bootstrap servers for the consumertopics
- The topics to subscribe topublic static KafkaSpoutConfig.Builder<String,String> builder(String bootstrapServers, Pattern topics)
Factory method that creates a Builder with String key/value deserializers.
bootstrapServers
- The bootstrap servers for the consumertopics
- The topic pattern to subscribe topublic Map<String,Object> getKafkaProps()
Gets the properties that will be passed to the KafkaConsumer.
@Deprecated public org.apache.kafka.common.serialization.Deserializer<K> getKeyDeserializer()
getKafkaProps()
and look up the entry for ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG
instead@Deprecated public org.apache.kafka.common.serialization.Deserializer<V> getValueDeserializer()
getKafkaProps()
and look up the entry for ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG
insteadpublic Subscription getSubscription()
public RecordTranslator<K,V> getTranslator()
public long getPollTimeoutMs()
public long getOffsetsCommitPeriodMs()
@Deprecated public boolean isConsumerAutoCommitMode()
getProcessingGuarantee()
instead.public KafkaSpoutConfig.ProcessingGuarantee getProcessingGuarantee()
public boolean isTupleTrackingEnforced()
public String getConsumerGroupId()
public KafkaSpoutConfig.FirstPollOffsetStrategy getFirstPollOffsetStrategy()
public int getMaxUncommittedOffsets()
public KafkaSpoutRetryService getRetryService()
public KafkaTupleListener getTupleListener()
public long getPartitionRefreshPeriodMs()
public boolean isEmitNullTuples()
public int getMetricsTimeBucketSizeInSecs()
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.