Enum GlobalStreamThread.State
- java.lang.Object
-
- java.lang.Enum<GlobalStreamThread.State>
-
- org.apache.kafka.streams.processor.internals.GlobalStreamThread.State
-
- All Implemented Interfaces:
Serializable
,Comparable<GlobalStreamThread.State>
,ThreadStateTransitionValidator
- Enclosing class:
- GlobalStreamThread
public static enum GlobalStreamThread.State extends Enum<GlobalStreamThread.State> implements ThreadStateTransitionValidator
The states that the global stream thread can be in+-------------+ +<--- | Created (0) | | +-----+-------+ | | | v | +-----+-------+ +<--- | Running (1) | | +-----+-------+ | | | v | +-----+-------+ +---> | Pending | | Shutdown (2)| +-----+-------+ | v +-----+-------+ | Dead (3) | +-------------+
Note the following:- Any state can go to PENDING_SHUTDOWN. That is because streams can be closed at any time.
- State PENDING_SHUTDOWN may want to transit itself. In this case we will forbid the transition but will not treat as an error.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CREATED
DEAD
PENDING_SHUTDOWN
RUNNING
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isRunning()
boolean
isValidTransition(ThreadStateTransitionValidator newState)
static GlobalStreamThread.State
valueOf(String name)
Returns the enum constant of this type with the specified name.static GlobalStreamThread.State[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
CREATED
public static final GlobalStreamThread.State CREATED
-
RUNNING
public static final GlobalStreamThread.State RUNNING
-
PENDING_SHUTDOWN
public static final GlobalStreamThread.State PENDING_SHUTDOWN
-
DEAD
public static final GlobalStreamThread.State DEAD
-
-
Method Detail
-
values
public static GlobalStreamThread.State[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GlobalStreamThread.State c : GlobalStreamThread.State.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GlobalStreamThread.State valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
isRunning
public boolean isRunning()
-
isValidTransition
public boolean isValidTransition(ThreadStateTransitionValidator newState)
- Specified by:
isValidTransition
in interfaceThreadStateTransitionValidator
-
-