K
- The type of the key.OUT
- The type of the output of the KeyedStateReaderFunction
.@Internal public class KeyedStateInputFormat<K,N,OUT> extends RichInputFormat<OUT,KeyGroupRangeInputSplit>
Constructor and Description |
---|
KeyedStateInputFormat(OperatorState operatorState,
StateBackend stateBackend,
Configuration configuration,
StateReaderOperator<?,K,N,OUT> operator)
Creates an input format for reading partitioned state from an operator in a savepoint.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Method that marks the end of the life-cycle of an input split.
|
void |
configure(Configuration parameters)
Configures this input format.
|
KeyGroupRangeInputSplit[] |
createInputSplits(int minNumSplits)
Creates the different splits of the input that can be processed in parallel.
|
InputSplitAssigner |
getInputSplitAssigner(KeyGroupRangeInputSplit[] inputSplits)
Gets the type of the input splits that are processed by this input format.
|
BaseStatistics |
getStatistics(BaseStatistics cachedStatistics)
Gets the basic statistics from the input described by this format.
|
OUT |
nextRecord(OUT reuse)
Reads the next record from the input.
|
void |
open(KeyGroupRangeInputSplit split)
Opens a parallel instance of the input format to work on a split.
|
void |
openInputFormat()
Opens this InputFormat instance.
|
boolean |
reachedEnd()
Method used to check if the end of the input is reached.
|
closeInputFormat, getRuntimeContext, setRuntimeContext
public KeyedStateInputFormat(OperatorState operatorState, StateBackend stateBackend, Configuration configuration, StateReaderOperator<?,K,N,OUT> operator)
operatorState
- The state to be queried.stateBackend
- The state backed used to snapshot the operator.configuration
- The underlying Flink configuration used to configure the state backend.public void configure(Configuration parameters)
InputFormat
This method is always called first on a newly instantiated input format.
parameters
- The configuration with all parameters (note: not the Flink config but the TaskConfig).public InputSplitAssigner getInputSplitAssigner(KeyGroupRangeInputSplit[] inputSplits)
InputFormat
public BaseStatistics getStatistics(BaseStatistics cachedStatistics)
InputFormat
When this method is called, the input format it guaranteed to be configured.
cachedStatistics
- The statistics that were cached. May be null.public KeyGroupRangeInputSplit[] createInputSplits(int minNumSplits) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be configured.
minNumSplits
- The minimum desired number of splits. If fewer are created, some parallel
instances may remain idle.IOException
- Thrown, when the creation of the splits was erroneous.public void openInputFormat()
RichInputFormat
openInputFormat
in class RichInputFormat<OUT,KeyGroupRangeInputSplit>
InputFormat
public void open(KeyGroupRangeInputSplit split) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be configured.
split
- The split to be opened.IOException
- Thrown, if the spit could not be opened due to an I/O problem.public void close() throws IOException
InputFormat
When this method is called, the input format it guaranteed to be opened.
IOException
- Thrown, if the input could not be closed properly.public boolean reachedEnd()
InputFormat
When this method is called, the input format it guaranteed to be opened.
public OUT nextRecord(OUT reuse) throws IOException
InputFormat
When this method is called, the input format it guaranteed to be opened.
reuse
- Object that may be reused.IOException
- Thrown, if an I/O error occurred.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.