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,
ExecutionConfig executionConfig)
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)
Computes the input splits.
|
InputSplitAssigner |
getInputSplitAssigner(KeyGroupRangeInputSplit[] inputSplits)
Returns the assigner for the input splits.
|
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, @Nullable StateBackend stateBackend, Configuration configuration, StateReaderOperator<?,K,N,OUT> operator, ExecutionConfig executionConfig) throws IOException
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.IOException
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)
InputSplitSource
public BaseStatistics getStatistics(BaseStatistics cachedStatistics)
InputFormat
When this method is called, the input format is guaranteed to be configured.
cachedStatistics
- The statistics that were cached. May be null.public KeyGroupRangeInputSplit[] createInputSplits(int minNumSplits) throws IOException
InputSplitSource
minNumSplits
- Number of minimal input splits, as a hint.IOException
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–2024 The Apache Software Foundation. All rights reserved.