ListCheckpointed
and CheckpointedFunction
instead,
as illustrated in the example above.@Deprecated @PublicEvolving public interface CheckpointedAsynchronously<T extends Serializable> extends Checkpointed<T>
Checkpointed
interface, but gives the Flink framework the option to
perform the checkpoint asynchronously. Note that asynchronous checkpointing for
this interface has not been implemented.
ListCheckpointed
and works
as shown in the example below. Please refer to the JavaDocs of ListCheckpointed
for
a more detailed description of how to use the new interface.
public class ExampleFunction<T> implements MapFunction<T, T>, ListCheckpointed<Integer> {
private int count;
public List<Integer> snapshotState(long checkpointId, long timestamp) throws Exception {
return Collections.singletonList(this.count);
}
public void restoreState(List<Integer> state) throws Exception {
this.value = state.isEmpty() ? 0 : state.get(0);
}
public T map(T value) {
count++;
return value;
}
}
snapshotState
restoreState
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.