Class KafkaConsumerThread<T>
- java.lang.Object
-
- java.lang.Thread
-
- org.apache.flink.streaming.connectors.kafka.internals.KafkaConsumerThread<T>
-
- All Implemented Interfaces:
Runnable
@Internal @Deprecated public class KafkaConsumerThread<T> extends Thread
Deprecated.The thread the runs theKafkaConsumer, connecting to the brokers and polling records. The thread pushes the data into aHandoverto be picked up by the fetcher that will deserialize and emit the records.IMPORTANT: This thread must not be interrupted when attempting to shut it down. The Kafka consumer code was found to not always handle interrupts well, and to even deadlock in certain situations.
Implementation Note: This code is written to be reusable in later versions of the KafkaConsumer. Because Kafka is not maintaining binary compatibility, we use a "call bridge" as an indirection to the KafkaConsumer calls that change signature.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description KafkaConsumerThread(org.slf4j.Logger log, Handover handover, Properties kafkaProperties, ClosableBlockingQueue<KafkaTopicPartitionState<T,org.apache.kafka.common.TopicPartition>> unassignedPartitionsQueue, String threadName, long pollTimeout, boolean useMetrics, org.apache.flink.metrics.MetricGroup consumerMetricGroup, org.apache.flink.metrics.MetricGroup subtaskMetricGroup)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidrun()Deprecated.voidshutdown()Deprecated.Shuts this thread down, waking up the thread gracefully if blocked (without Thread.interrupt() calls).-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
KafkaConsumerThread
public KafkaConsumerThread(org.slf4j.Logger log, Handover handover, Properties kafkaProperties, ClosableBlockingQueue<KafkaTopicPartitionState<T,org.apache.kafka.common.TopicPartition>> unassignedPartitionsQueue, String threadName, long pollTimeout, boolean useMetrics, org.apache.flink.metrics.MetricGroup consumerMetricGroup, org.apache.flink.metrics.MetricGroup subtaskMetricGroup)Deprecated.
-
-