org.apache.storm.spout

## Class CheckPointState

- java.lang.Object
- - org.apache.storm.spout.CheckPointState

-     public class CheckPointState
      extends Object

  Captures the current state of the transaction in `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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CheckPointState.Action`
    `static class` | `CheckPointState.State`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CheckPointState()`
    `CheckPointState(long txid, CheckPointState.State state)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### CheckPointState

          public CheckPointState(long txid,
                                 CheckPointState.State state)

    - #### CheckPointState

          public CheckPointState()

  - ### Method Detail

    - #### getTxid

          public long getTxid()

    - #### getState

          public CheckPointState.State getState()

    - #### nextState

          public CheckPointState nextState(boolean recovering)

      Get the next state based on this checkpoint state.

      Parameters:
        `recovering` - if in recovering phase
      Returns:
        the next checkpoint state based on this state.

    - #### nextAction

          public CheckPointState.Action nextAction(boolean recovering)

      Get the next action to perform based on this checkpoint state.

      Parameters:
        `recovering` - if in recovering phase
      Returns:
        the next action to perform based on this state

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019 The Apache Software Foundation. All rights reserved.