Interface IStatefulComponent<K extends Serializable,​V extends Serializable>

    • Method Detail

      • initState

        void initState​(State<K,​V> state)
        Initializes the state of the function or operator to that of a previous checkpoint. This method is invoked when a component is executed as part of a recovery run. In case there was prior state associated with the component, the state will be empty. Stateful Spouts/Bolts are expected to hold on to the state variable to save their internal state

        Note that initialState() is called before open() or prepare().

        Parameters:
        state - the previously saved state of the component.
      • preSave

        void preSave​(String checkpointId)
        This is a hook for the component to perform some actions just before the framework saves its state.
        Parameters:
        checkpointId - the ID of the checkpoint