public class CheckPointState extends Object
CheckpointSpout
. The state transitions are as follows.
ROLLBACK(tx2) <------------- PREPARE(tx2) COMMIT(tx2) COMMITTED(tx1)-------------> PREPARING(tx2) --------------> COMMITTING(tx2) -----------------> COMMITTED (tx2)
During recovery, if a previous transaction is in PREPARING state, it is rolled back since all bolts in the topology might not have prepared (saved) the data for commit. If the previous transaction is in COMMITTING state, it is rolled forward (committed) since some bolts might have already committed the data.
During normal flow, the state transitions from PREPARING to COMMITTING to COMMITTED. In case of failures the prepare/commit operation is retried.
Modifier and Type | Class and Description |
---|---|
static class |
CheckPointState.Action |
static class |
CheckPointState.State |
Constructor and Description |
---|
CheckPointState() |
CheckPointState(long txid,
CheckPointState.State state) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
CheckPointState.State |
getState() |
long |
getTxid() |
int |
hashCode() |
CheckPointState.Action |
nextAction(boolean recovering)
Get the next action to perform based on this checkpoint state.
|
CheckPointState |
nextState(boolean recovering)
Get the next state based on this checkpoint state.
|
String |
toString() |
public CheckPointState(long txid, CheckPointState.State state)
public CheckPointState()
public long getTxid()
public CheckPointState.State getState()
public CheckPointState nextState(boolean recovering)
recovering
- if in recovering phasepublic CheckPointState.Action nextAction(boolean recovering)
recovering
- if in recovering phaseCopyright © 2023 The Apache Software Foundation. All rights reserved.