Package org.apache.storm.kafka.spout
Class KafkaSpoutConfig<K,V>
- java.lang.Object
-
- org.apache.storm.kafka.spout.internal.CommonKafkaSpoutConfig<K,V>
-
- org.apache.storm.kafka.spout.KafkaSpoutConfig<K,V>
-
- All Implemented Interfaces:
Serializable
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.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KafkaSpoutConfig.Builder<K,V>
static class
KafkaSpoutConfig.ProcessingGuarantee
This enum controls when the tuple with theConsumerRecord
for an offset is marked as processed, i.e.
-
Field Summary
Fields Modifier and Type Field 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
-
Fields inherited from class org.apache.storm.kafka.spout.internal.CommonKafkaSpoutConfig
DEFAULT_FIRST_POLL_OFFSET_STRATEGY, DEFAULT_PARTITION_REFRESH_PERIOD_MS, DEFAULT_POLL_TIMEOUT_MS, DEFAULT_START_TS
-
-
Constructor Summary
Constructors Constructor Description KafkaSpoutConfig(KafkaSpoutConfig.Builder<K,V> builder)
Creates a new KafkaSpoutConfig using a Builder.
-
Method Summary
-
Methods inherited from class org.apache.storm.kafka.spout.internal.CommonKafkaSpoutConfig
getFirstPollOffsetStrategy, getKafkaProps, getPartitionRefreshPeriodMs, getPollTimeoutMs, getStartTimeStamp, getTopicFilter, getTopicPartitioner, getTranslator
-
-
-
-
Field Detail
-
DEFAULT_OFFSET_COMMIT_PERIOD_MS
public static final long DEFAULT_OFFSET_COMMIT_PERIOD_MS
- See Also:
- Constant Field Values
-
DEFAULT_MAX_RETRIES
public static final int DEFAULT_MAX_RETRIES
- See Also:
- Constant Field Values
-
DEFAULT_MAX_UNCOMMITTED_OFFSETS
public static final int DEFAULT_MAX_UNCOMMITTED_OFFSETS
- See Also:
- Constant Field Values
-
DEFAULT_RETRY_SERVICE
public static final KafkaSpoutRetryService DEFAULT_RETRY_SERVICE
-
DEFAULT_PROCESSING_GUARANTEE
public static final KafkaSpoutConfig.ProcessingGuarantee DEFAULT_PROCESSING_GUARANTEE
-
DEFAULT_TUPLE_LISTENER
public static final KafkaTupleListener DEFAULT_TUPLE_LISTENER
-
LOG
public static final org.slf4j.Logger LOG
-
DEFAULT_METRICS_TIME_BUCKET_SIZE_SECONDS
public static final int DEFAULT_METRICS_TIME_BUCKET_SIZE_SECONDS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
KafkaSpoutConfig
public KafkaSpoutConfig(KafkaSpoutConfig.Builder<K,V> builder)
Creates a new KafkaSpoutConfig using a Builder.- Parameters:
builder
- The Builder to construct the KafkaSpoutConfig from
-
-
Method Detail
-
builder
public static KafkaSpoutConfig.Builder<String,String> builder(String bootstrapServers, String... topics)
Factory method that creates a Builder with String key/value deserializers.- Parameters:
bootstrapServers
- The bootstrap servers for the consumertopics
- The topics to subscribe to- Returns:
- The new builder
-
builder
public static KafkaSpoutConfig.Builder<String,String> builder(String bootstrapServers, Set<String> topics)
Factory method that creates a Builder with String key/value deserializers.- Parameters:
bootstrapServers
- The bootstrap servers for the consumertopics
- The topics to subscribe to- Returns:
- The new builder
-
builder
public static KafkaSpoutConfig.Builder<String,String> builder(String bootstrapServers, Pattern topics)
Factory method that creates a Builder with String key/value deserializers.- Parameters:
bootstrapServers
- The bootstrap servers for the consumertopics
- The topic pattern to subscribe to- Returns:
- The new builder
-
getOffsetsCommitPeriodMs
public long getOffsetsCommitPeriodMs()
-
getProcessingGuarantee
public KafkaSpoutConfig.ProcessingGuarantee getProcessingGuarantee()
-
isTupleTrackingEnforced
public boolean isTupleTrackingEnforced()
-
getConsumerGroupId
public String getConsumerGroupId()
-
setConsumerGroupId
public void setConsumerGroupId(String groupId)
-
getMaxUncommittedOffsets
public int getMaxUncommittedOffsets()
-
getRetryService
public KafkaSpoutRetryService getRetryService()
-
getTupleListener
public KafkaTupleListener getTupleListener()
-
isEmitNullTuples
public boolean isEmitNullTuples()
-
getMetricsTimeBucketSizeInSecs
public int getMetricsTimeBucketSizeInSecs()
-
toString
public String toString()
- Overrides:
toString
in classCommonKafkaSpoutConfig<K,V>
-
-