K
- The type of the keys in the BroadcastState
.V
- The type of the values in the BroadcastState
.@Internal public class BroadcastStateInputFormat<K,V> extends RichInputFormat<OT,OperatorStateInputSplit>
BroadcastState
.Constructor and Description |
---|
BroadcastStateInputFormat(OperatorState operatorState,
Configuration configuration,
StateBackend backend,
MapStateDescriptor<K,V> descriptor,
ExecutionConfig executionConfig)
Creates an input format for reading broadcast 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.
|
OperatorStateInputSplit[] |
createInputSplits(int minNumSplits)
Computes the input splits.
|
protected Iterable<Tuple2<K,V>> |
getElements(OperatorStateBackend restoredBackend) |
InputSplitAssigner |
getInputSplitAssigner(OperatorStateInputSplit[] inputSplits)
Returns the assigner for the input splits.
|
BaseStatistics |
getStatistics(BaseStatistics cachedStatistics)
Gets the basic statistics from the input described by this format.
|
OT |
nextRecord(OT reuse)
Reads the next record from the input.
|
void |
open(OperatorStateInputSplit split)
Opens a parallel instance of the input format to work on a split.
|
boolean |
reachedEnd()
Method used to check if the end of the input is reached.
|
closeInputFormat, getRuntimeContext, openInputFormat, setRuntimeContext
public BroadcastStateInputFormat(OperatorState operatorState, Configuration configuration, @Nullable StateBackend backend, MapStateDescriptor<K,V> descriptor, ExecutionConfig executionConfig) throws IOException
operatorState
- The state to be queried.configuration
- The cluster configuration for restoring the backend.backend
- The state backend used to restore the state.descriptor
- The descriptor for this state, providing a name and serializer.IOException
protected final Iterable<Tuple2<K,V>> getElements(OperatorStateBackend restoredBackend) throws Exception
Exception
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 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 InputSplitAssigner getInputSplitAssigner(OperatorStateInputSplit[] inputSplits)
InputSplitSource
public OperatorStateInputSplit[] createInputSplits(int minNumSplits)
InputSplitSource
minNumSplits
- Number of minimal input splits, as a hint.public void open(OperatorStateInputSplit 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()
InputFormat
When this method is called, the input format it guaranteed to be opened.
public boolean reachedEnd()
InputFormat
When this method is called, the input format it guaranteed to be opened.
public OT nextRecord(OT reuse)
InputFormat
When this method is called, the input format it guaranteed to be opened.
reuse
- Object that may be reused.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.