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
KafkaSpoutConfig defines the required configuration to connect a consumer to a consumer group, as well as the subscribing topics.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static enum
This enum controls when the tuple with theConsumerRecord
for an offset is marked as processed, i.e. when the offset can be committed to Kafka. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final long
static final KafkaSpoutConfig.ProcessingGuarantee
static final KafkaSpoutRetryService
static final KafkaTupleListener
static final org.slf4j.Logger
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
ConstructorDescriptionKafkaSpoutConfig
(KafkaSpoutConfig.Builder<K, V> builder) Creates a new KafkaSpoutConfig using a Builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic KafkaSpoutConfig.Builder<String,
String> Factory method that creates a Builder with String key/value deserializers.static KafkaSpoutConfig.Builder<String,
String> Factory method that creates a Builder with String key/value deserializers.static KafkaSpoutConfig.Builder<String,
String> Factory method that creates a Builder with String key/value deserializers.int
int
long
boolean
boolean
toString()
Methods inherited from class org.apache.storm.kafka.spout.internal.CommonKafkaSpoutConfig
getFirstPollOffsetStrategy, getKafkaProps, getPartitionRefreshPeriodMs, getPollTimeoutMs, getStartTimeStamp, getTopicFilter, getTopicPartitioner, getTranslator
-
Field Details
-
DEFAULT_OFFSET_COMMIT_PERIOD_MS
public static final long DEFAULT_OFFSET_COMMIT_PERIOD_MS- See Also:
-
DEFAULT_MAX_RETRIES
public static final int DEFAULT_MAX_RETRIES- See Also:
-
DEFAULT_MAX_UNCOMMITTED_OFFSETS
public static final int DEFAULT_MAX_UNCOMMITTED_OFFSETS- See Also:
-
DEFAULT_RETRY_SERVICE
-
DEFAULT_PROCESSING_GUARANTEE
-
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:
-
-
Constructor Details
-
KafkaSpoutConfig
Creates a new KafkaSpoutConfig using a Builder.- Parameters:
builder
- The Builder to construct the KafkaSpoutConfig from
-
-
Method Details
-
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
-
isTupleTrackingEnforced
public boolean isTupleTrackingEnforced() -
getConsumerGroupId
-
getMaxUncommittedOffsets
public int getMaxUncommittedOffsets() -
getRetryService
-
getTupleListener
-
isEmitNullTuples
public boolean isEmitNullTuples() -
getMetricsTimeBucketSizeInSecs
public int getMetricsTimeBucketSizeInSecs() -
toString
- Overrides:
toString
in classCommonKafkaSpoutConfig<K,
V>
-