Class GlobalStreamThread
- java.lang.Object
-
- java.lang.Thread
-
- org.apache.kafka.streams.processor.internals.GlobalStreamThread
-
- All Implemented Interfaces:
java.lang.Runnable
public class GlobalStreamThread extends java.lang.ThreadThis is the thread responsible for keeping all Global State Stores updated. It delegates most of the responsibility to the internal class StateConsumer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGlobalStreamThread.StateThe states that the global stream thread can be in
-
Constructor Summary
Constructors Constructor Description GlobalStreamThread(ProcessorTopology topology, StreamsConfig config, org.apache.kafka.clients.consumer.Consumer<byte[],byte[]> globalConsumer, StateDirectory stateDirectory, long cacheSizeBytes, StreamsMetricsImpl streamsMetrics, org.apache.kafka.common.utils.Time time, java.lang.String threadClientId, StateRestoreListener stateRestoreListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<org.apache.kafka.common.MetricName,org.apache.kafka.common.Metric>consumerMetrics()voidrun()voidsetStateListener(StreamThread.StateListener listener)Set theStreamThread.StateListenerto be notified when state changes.voidshutdown()voidstart()GlobalStreamThread.Statestate()booleanstillRunning()-
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, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
GlobalStreamThread
public GlobalStreamThread(ProcessorTopology topology, StreamsConfig config, org.apache.kafka.clients.consumer.Consumer<byte[],byte[]> globalConsumer, StateDirectory stateDirectory, long cacheSizeBytes, StreamsMetricsImpl streamsMetrics, org.apache.kafka.common.utils.Time time, java.lang.String threadClientId, StateRestoreListener stateRestoreListener)
-
-
Method Detail
-
setStateListener
public void setStateListener(StreamThread.StateListener listener)
Set theStreamThread.StateListenerto be notified when state changes. Note this API is internal to Kafka Streams and is not intended to be used by an external application.
-
state
public GlobalStreamThread.State state()
- Returns:
- The state this instance is in
-
stillRunning
public boolean stillRunning()
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
start
public void start()
- Overrides:
startin classjava.lang.Thread
-
shutdown
public void shutdown()
-
consumerMetrics
public java.util.Map<org.apache.kafka.common.MetricName,org.apache.kafka.common.Metric> consumerMetrics()
-
-