Enum Class KafkaStreams.State
- All Implemented Interfaces:
Serializable, Comparable<KafkaStreams.State>, Constable
- Enclosing class:
KafkaStreams
Kafka Streams states are the possible state that a Kafka Streams instance can be in.
An instance must only be in one state at a time.
The expected state transition with the following defined states is:
+--------------+
+<----- | Created (0) |
| +-----+--------+
| |
| v
| +----+--+------+
| | Re- |
+<----- | Balancing (1)| -------->+
| +-----+-+------+ |
| | ^ |
| v | |
| +--------------+ v
| | Running (2) | -------->+
| +------+-------+ |
| | |
| v |
| +------+-------+ +----+-------+
+-----> | Pending | | Pending |
| Shutdown (3) | | Error (5) |
+------+-------+ +-----+------+
| |
v v
+------+-------+ +-----+--------+
| Not | | Error (6) |
| Running (4) | +--------------+
+--------------+
Note the following:
- RUNNING state will transit to REBALANCING if any of its threads is in PARTITION_REVOKED or PARTITIONS_ASSIGNED state
- REBALANCING state will transit to RUNNING if all of its threads are in RUNNING state (Note: a thread transits to RUNNING state, if all active tasks got restored are ready for processing. Standby tasks are not considered.)
- Any state except NOT_RUNNING, PENDING_ERROR or ERROR can go to PENDING_SHUTDOWN (whenever close is called)
- PENDING_SHUTDOWN and PENDING_ERROR are transitory states where the Streams application gracefully closes its existing resources before transitioning into their corresponding terminal states. These states are not recoverable, and only a restart would get an application back to the RUNNING state.
- Of special importance: If the global stream thread dies, or all stream threads die (or both) then the instance will be in the ERROR state. The user will not need to close it.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanbooleanbooleanbooleanbooleanisValidTransition(KafkaStreams.State newState) static KafkaStreams.StateReturns the enum constant of this class with the specified name.static KafkaStreams.State[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
CREATED
-
REBALANCING
-
RUNNING
-
PENDING_SHUTDOWN
-
NOT_RUNNING
-
PENDING_ERROR
-
ERROR
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
hasNotStarted
public boolean hasNotStarted() -
isRunningOrRebalancing
public boolean isRunningOrRebalancing() -
isShuttingDown
public boolean isShuttingDown() -
hasCompletedShutdown
public boolean hasCompletedShutdown() -
hasStartedOrFinishedShuttingDown
public boolean hasStartedOrFinishedShuttingDown() -
isValidTransition
-