Class ExistingSavepoint


  • @PublicEvolving
    @Deprecated
    public class ExistingSavepoint
    extends WritableSavepoint<ExistingSavepoint>
    Deprecated.
    For creating a new savepoint, use SavepointWriter and the data stream api under batch execution. For reading a savepoint, use SavepointReader and the data stream api under batch execution.
    An existing savepoint. This class provides the entry points for reading previous existing operator states in savepoints. Operator states can be removed from and added to the set of existing operator states, and eventually, written to distributed storage as a new savepoint.

    New savepoints written using this class are based on the previous existing savepoint. This means that for existing operators that remain untouched, the new savepoint only contains a shallow copy of pointers to state data that resides in the previous existing savepoint paths. This means that both savepoints share state and one cannot be deleted without corrupting the other!

    See Also:
    SavepointReader, SavepointWriter
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      <K,​V>
      org.apache.flink.api.java.operators.DataSource<org.apache.flink.api.java.tuple.Tuple2<K,​V>>
      readBroadcastState​(String uid, String name, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyTypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<V> valueTypeInfo)
      Deprecated.
      Read operator BroadcastState from a Savepoint.
      <K,​V>
      org.apache.flink.api.java.operators.DataSource<org.apache.flink.api.java.tuple.Tuple2<K,​V>>
      readBroadcastState​(String uid, String name, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyTypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<V> valueTypeInfo, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)
      Deprecated.
      Read operator BroadcastState from a Savepoint when a custom serializer was used; e.g., a different serializer than the one returned by TypeInformation#createSerializer.
      <K,​OUT>
      org.apache.flink.api.java.operators.DataSource<OUT>
      readKeyedState​(String uid, KeyedStateReaderFunction<K,​OUT> function)
      Deprecated.
      Read keyed state from an operator in a Savepoint.
      <K,​OUT>
      org.apache.flink.api.java.operators.DataSource<OUT>
      readKeyedState​(String uid, KeyedStateReaderFunction<K,​OUT> function, org.apache.flink.api.common.typeinfo.TypeInformation<K> keyTypeInfo, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo)
      Deprecated.
      Read keyed state from an operator in a Savepoint.
      <T> org.apache.flink.api.java.operators.DataSource<T> readListState​(String uid, String name, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)
      Deprecated.
      Read operator ListState from a Savepoint.
      <T> org.apache.flink.api.java.operators.DataSource<T> readListState​(String uid, String name, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
      Deprecated.
      Read operator ListState from a Savepoint when a custom serializer was used; e.g., a different serializer than the one returned by TypeInformation#createSerializer.
      <T> org.apache.flink.api.java.operators.DataSource<T> readUnionState​(String uid, String name, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)
      Deprecated.
      Read operator UnionState from a Savepoint.
      <T> org.apache.flink.api.java.operators.DataSource<T> readUnionState​(String uid, String name, org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
      Deprecated.
      Read operator UnionState from a Savepoint when a custom serializer was used; e.g., a different serializer than the one returned by TypeInformation#createSerializer.
      <W extends org.apache.flink.streaming.api.windowing.windows.Window>
      WindowReader<W>
      window​(org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer)
      Deprecated.
      Read window state from an operator in a Savepoint.
      <W extends org.apache.flink.streaming.api.windowing.windows.Window>
      WindowReader<W>
      window​(org.apache.flink.streaming.api.windowing.assigners.WindowAssigner<?,​W> assigner)
      Deprecated.
      Read window state from an operator in a Savepoint.
    • Method Detail

      • readListState

        public <T> org.apache.flink.api.java.operators.DataSource<T> readListState​(String uid,
                                                                                   String name,
                                                                                   org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)
                                                                            throws IOException
        Deprecated.
        Read operator ListState from a Savepoint.
        Type Parameters:
        T - The type of the values that are in the list state.
        Parameters:
        uid - The uid of the operator.
        name - The (unique) name for the state.
        typeInfo - The type of the elements in the state.
        Returns:
        A DataSet representing the elements in state.
        Throws:
        IOException - If the savepoint path is invalid or the uid does not exist.
      • readListState

        public <T> org.apache.flink.api.java.operators.DataSource<T> readListState​(String uid,
                                                                                   String name,
                                                                                   org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo,
                                                                                   org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
                                                                            throws IOException
        Deprecated.
        Read operator ListState from a Savepoint when a custom serializer was used; e.g., a different serializer than the one returned by TypeInformation#createSerializer.
        Type Parameters:
        T - The type of the values that are in the list state.
        Parameters:
        uid - The uid of the operator.
        name - The (unique) name for the state.
        typeInfo - The type of the elements in the state.
        serializer - The serializer used to write the elements into state.
        Returns:
        A DataSet representing the elements in state.
        Throws:
        IOException - If the savepoint path is invalid or the uid does not exist.
      • readUnionState

        public <T> org.apache.flink.api.java.operators.DataSource<T> readUnionState​(String uid,
                                                                                    String name,
                                                                                    org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo)
                                                                             throws IOException
        Deprecated.
        Read operator UnionState from a Savepoint.
        Type Parameters:
        T - The type of the values that are in the union state.
        Parameters:
        uid - The uid of the operator.
        name - The (unique) name for the state.
        typeInfo - The type of the elements in the state.
        Returns:
        A DataSet representing the elements in state.
        Throws:
        IOException - If the savepoint path is invalid or the uid does not exist.
      • readUnionState

        public <T> org.apache.flink.api.java.operators.DataSource<T> readUnionState​(String uid,
                                                                                    String name,
                                                                                    org.apache.flink.api.common.typeinfo.TypeInformation<T> typeInfo,
                                                                                    org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer)
                                                                             throws IOException
        Deprecated.
        Read operator UnionState from a Savepoint when a custom serializer was used; e.g., a different serializer than the one returned by TypeInformation#createSerializer.
        Type Parameters:
        T - The type of the values that are in the union state.
        Parameters:
        uid - The uid of the operator.
        name - The (unique) name for the state.
        typeInfo - The type of the elements in the state.
        serializer - The serializer used to write the elements into state.
        Returns:
        A DataSet representing the elements in state.
        Throws:
        IOException - If the savepoint path is invalid or the uid does not exist.
      • readBroadcastState

        public <K,​V> org.apache.flink.api.java.operators.DataSource<org.apache.flink.api.java.tuple.Tuple2<K,​V>> readBroadcastState​(String uid,
                                                                                                                                                String name,
                                                                                                                                                org.apache.flink.api.common.typeinfo.TypeInformation<K> keyTypeInfo,
                                                                                                                                                org.apache.flink.api.common.typeinfo.TypeInformation<V> valueTypeInfo)
                                                                                                                                         throws IOException
        Deprecated.
        Read operator BroadcastState from a Savepoint.
        Type Parameters:
        K - The type of keys in state.
        V - The type of values in state.
        Parameters:
        uid - The uid of the operator.
        name - The (unique) name for the state.
        keyTypeInfo - The type information for the keys in the state.
        valueTypeInfo - The type information for the values in the state.
        Returns:
        A DataSet of key-value pairs from state.
        Throws:
        IOException - If the savepoint does not contain the specified uid.
      • readBroadcastState

        public <K,​V> org.apache.flink.api.java.operators.DataSource<org.apache.flink.api.java.tuple.Tuple2<K,​V>> readBroadcastState​(String uid,
                                                                                                                                                String name,
                                                                                                                                                org.apache.flink.api.common.typeinfo.TypeInformation<K> keyTypeInfo,
                                                                                                                                                org.apache.flink.api.common.typeinfo.TypeInformation<V> valueTypeInfo,
                                                                                                                                                org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
                                                                                                                                                org.apache.flink.api.common.typeutils.TypeSerializer<V> valueSerializer)
                                                                                                                                         throws IOException
        Deprecated.
        Read operator BroadcastState from a Savepoint when a custom serializer was used; e.g., a different serializer than the one returned by TypeInformation#createSerializer.
        Type Parameters:
        K - The type of keys in state.
        V - The type of values in state.
        Parameters:
        uid - The uid of the operator.
        name - The (unique) name for the state.
        keyTypeInfo - The type information for the keys in the state.
        valueTypeInfo - The type information for the values in the state.
        keySerializer - The type serializer used to write keys into the state.
        valueSerializer - The type serializer used to write values into the state.
        Returns:
        A DataSet of key-value pairs from state.
        Throws:
        IOException - If the savepoint path is invalid or the uid does not exist.
      • readKeyedState

        public <K,​OUT> org.apache.flink.api.java.operators.DataSource<OUT> readKeyedState​(String uid,
                                                                                                KeyedStateReaderFunction<K,​OUT> function)
                                                                                         throws IOException
        Deprecated.
        Read keyed state from an operator in a Savepoint.
        Type Parameters:
        K - The type of the key in state.
        OUT - The output type of the transform function.
        Parameters:
        uid - The uid of the operator.
        function - The KeyedStateReaderFunction that is called for each key in state.
        Returns:
        A DataSet of objects read from keyed state.
        Throws:
        IOException - If the savepoint does not contain operator state with the given uid.
      • readKeyedState

        public <K,​OUT> org.apache.flink.api.java.operators.DataSource<OUT> readKeyedState​(String uid,
                                                                                                KeyedStateReaderFunction<K,​OUT> function,
                                                                                                org.apache.flink.api.common.typeinfo.TypeInformation<K> keyTypeInfo,
                                                                                                org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo)
                                                                                         throws IOException
        Deprecated.
        Read keyed state from an operator in a Savepoint.
        Type Parameters:
        K - The type of the key in state.
        OUT - The output type of the transform function.
        Parameters:
        uid - The uid of the operator.
        function - The KeyedStateReaderFunction that is called for each key in state.
        keyTypeInfo - The type information of the key in state.
        outTypeInfo - The type information of the output of the transform reader function.
        Returns:
        A DataSet of objects read from keyed state.
        Throws:
        IOException - If the savepoint does not contain operator state with the given uid.
      • window

        public <W extends org.apache.flink.streaming.api.windowing.windows.Window> WindowReader<W> window​(org.apache.flink.streaming.api.windowing.assigners.WindowAssigner<?,​W> assigner)
        Deprecated.
        Read window state from an operator in a Savepoint. This method supports reading from any type of window.
        Parameters:
        assigner - The WindowAssigner used to write out the operator.
        Returns:
        A WindowReader.
      • window

        public <W extends org.apache.flink.streaming.api.windowing.windows.Window> WindowReader<W> window​(org.apache.flink.api.common.typeutils.TypeSerializer<W> windowSerializer)
        Deprecated.
        Read window state from an operator in a Savepoint. This method supports reading from any type of window.
        Parameters:
        windowSerializer - The serializer used for the window type.
        Returns:
        A WindowReader.