S - The type of input split.T - The type of the channel state to be checkpointed / included in the snapshot.@PublicEvolving
public interface CheckpointableInputFormat<S extends InputSplit,T extends Serializable>
InputFormats that allow checkpointing/restoring their state.| Modifier and Type | Method and Description |
|---|---|
T |
getCurrentState()
Returns the split currently being read, along with its current state.
|
void |
reopen(S split,
T state)
Restores the state of a parallel instance reading from an
InputFormat. |
T getCurrentState() throws IOException
IOException - Thrown if the creation of the state object failed.void reopen(S split, T state) throws IOException
InputFormat.
This is necessary when recovering from a task failure. When this method is called,
the input format it guaranteed to be configured.
NOTE: The caller has to make sure that the provided split is the one to whom
the state belongs.split - The split to be opened.state - The state from which to start from. This can contain the offset,
but also other data, depending on the input format.IOExceptionCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.