public class KafkaSpoutConfig<K,V> extends CommonKafkaSpoutConfig<K,V>
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.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 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 KafkaSpoutConfig.ProcessingGuarantee |
DEFAULT_PROCESSING_GUARANTEE |
static KafkaSpoutRetryService |
DEFAULT_RETRY_SERVICE |
static KafkaTupleListener |
DEFAULT_TUPLE_LISTENER |
static org.slf4j.Logger |
LOG |
DEFAULT_FIRST_POLL_OFFSET_STRATEGY, DEFAULT_PARTITION_REFRESH_PERIOD_MS, DEFAULT_POLL_TIMEOUT_MS, DEFAULT_START_TS
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,
Pattern topics)
Factory method that creates a Builder with String key/value deserializers.
|
static KafkaSpoutConfig.Builder<String,String> |
builder(String bootstrapServers,
Set<String> 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() |
int |
getMaxUncommittedOffsets() |
int |
getMetricsTimeBucketSizeInSecs() |
long |
getOffsetsCommitPeriodMs() |
KafkaSpoutConfig.ProcessingGuarantee |
getProcessingGuarantee() |
KafkaSpoutRetryService |
getRetryService() |
KafkaTupleListener |
getTupleListener() |
boolean |
isEmitNullTuples() |
boolean |
isTupleTrackingEnforced() |
String |
toString() |
getFirstPollOffsetStrategy, getKafkaProps, getPartitionRefreshPeriodMs, getPollTimeoutMs, getStartTimeStamp, getTopicFilter, getTopicPartitioner, getTranslator
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 KafkaSpoutRetryService DEFAULT_RETRY_SERVICE
public static final KafkaSpoutConfig.ProcessingGuarantee DEFAULT_PROCESSING_GUARANTEE
public static final KafkaTupleListener DEFAULT_TUPLE_LISTENER
public static final org.slf4j.Logger LOG
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, Set<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 long getOffsetsCommitPeriodMs()
public KafkaSpoutConfig.ProcessingGuarantee getProcessingGuarantee()
public boolean isTupleTrackingEnforced()
public String getConsumerGroupId()
public int getMaxUncommittedOffsets()
public KafkaSpoutRetryService getRetryService()
public KafkaTupleListener getTupleListener()
public boolean isEmitNullTuples()
public int getMetricsTimeBucketSizeInSecs()
public String toString()
toString
in class CommonKafkaSpoutConfig<K,V>
Copyright © 2020 The Apache Software Foundation. All rights reserved.