Package org.apache.flink.state.api
Class ExistingSavepoint
- java.lang.Object
-
- org.apache.flink.state.api.WritableSavepoint<ExistingSavepoint>
-
- org.apache.flink.state.api.ExistingSavepoint
-
@PublicEvolving @Deprecated public class ExistingSavepoint extends WritableSavepoint<ExistingSavepoint>
Deprecated.For creating a new savepoint, useSavepointWriterand the data stream api under batch execution. For reading a savepoint, useSavepointReaderand 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 operatorBroadcastStatefrom aSavepoint.<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 operatorBroadcastStatefrom aSavepointwhen a custom serializer was used; e.g., a different serializer than the one returned byTypeInformation#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 aSavepoint.<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 aSavepoint.<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 operatorListStatefrom aSavepoint.<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 operatorListStatefrom aSavepointwhen a custom serializer was used; e.g., a different serializer than the one returned byTypeInformation#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 operatorUnionStatefrom aSavepoint.<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 operatorUnionStatefrom aSavepointwhen a custom serializer was used; e.g., a different serializer than the one returned byTypeInformation#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 aSavepoint.<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 aSavepoint.-
Methods inherited from class org.apache.flink.state.api.WritableSavepoint
removeOperator, withConfiguration, withOperator, write
-
-
-
-
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 operatorListStatefrom aSavepoint.- 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
DataSetrepresenting 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 operatorListStatefrom aSavepointwhen a custom serializer was used; e.g., a different serializer than the one returned byTypeInformation#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
DataSetrepresenting 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 operatorUnionStatefrom aSavepoint.- 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
DataSetrepresenting 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 operatorUnionStatefrom aSavepointwhen a custom serializer was used; e.g., a different serializer than the one returned byTypeInformation#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
DataSetrepresenting 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 operatorBroadcastStatefrom aSavepoint.- 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
DataSetof 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 operatorBroadcastStatefrom aSavepointwhen a custom serializer was used; e.g., a different serializer than the one returned byTypeInformation#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
DataSetof 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 aSavepoint.- 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- TheKeyedStateReaderFunctionthat is called for each key in state.- Returns:
- A
DataSetof 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 aSavepoint.- 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- TheKeyedStateReaderFunctionthat 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
DataSetof 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 aSavepoint. This method supports reading from any type of window.- Parameters:
assigner- TheWindowAssignerused 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 aSavepoint. This method supports reading from any type of window.- Parameters:
windowSerializer- The serializer used for the window type.- Returns:
- A
WindowReader.
-
-