@Internal public class ContinuousFileReaderOperator<OUT> extends AbstractStreamOperator<OUT> implements OneInputStreamOperator<TimestampedFileInputSplit,OUT>, OutputTypeConfigurable<OUT>
splits received from the preceding
ContinuousFileMonitoringFunction. Contrary to the ContinuousFileMonitoringFunction
which has a parallelism of 1, this operator can have DOP > 1.
As soon as a split descriptor is received, it is put in a queue, and have another thread read the actual data of the split. This architecture allows the separation of the reading thread from the one emitting the checkpoint barriers, thus removing any potential back-pressure.
AbstractStreamOperator.CountingOutput<OUT>chainingStrategy, config, latencyStats, metrics, output, timeServiceManager| 构造器和说明 |
|---|
ContinuousFileReaderOperator(org.apache.flink.api.common.io.FileInputFormat<OUT> format) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
This method is called after all records have been added to the operators via the methods
OneInputStreamOperator.processElement(StreamRecord), or
TwoInputStreamOperator.processElement1(StreamRecord) and
TwoInputStreamOperator.processElement2(StreamRecord). |
void |
dispose()
This method is called at the very end of the operator's life, both in the case of a successful
completion of the operation, and in the case of a failure and canceling.
|
void |
initializeState(org.apache.flink.runtime.state.StateInitializationContext context)
Stream operators with state which can be restored need to override this hook method.
|
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g. state initialization.
|
void |
processElement(StreamRecord<TimestampedFileInputSplit> element)
Processes one element that arrived at this operator.
|
void |
processWatermark(Watermark mark)
Processes a
Watermark. |
void |
setOutputType(org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo,
org.apache.flink.api.common.ExecutionConfig executionConfig)
Is called by the
org.apache.flink.streaming.api.graph.StreamGraph#addOperator(Integer, String, StreamOperator, TypeInformation, TypeInformation, String)
method when the StreamGraph is generated. |
void |
snapshotState(org.apache.flink.runtime.state.StateSnapshotContext context)
Stream operators with state, which want to participate in a snapshot need to override this hook method.
|
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getUserCodeClassloader, initializeState, notifyCheckpointComplete, numEventTimeTimers, numProcessingTimeTimers, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setup, snapshotStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprocessLatencyMarkergetChainingStrategy, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, snapshotStategetCurrentKey, setCurrentKeypublic ContinuousFileReaderOperator(org.apache.flink.api.common.io.FileInputFormat<OUT> format)
public void setOutputType(org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outTypeInfo, org.apache.flink.api.common.ExecutionConfig executionConfig)
OutputTypeConfigurableorg.apache.flink.streaming.api.graph.StreamGraph#addOperator(Integer, String, StreamOperator, TypeInformation, TypeInformation, String)
method when the StreamGraph is generated. The
method is called with the output TypeInformation which is also used for the
StreamTask output serializer.setOutputType 在接口中 OutputTypeConfigurable<OUT>outTypeInfo - Output type information of the StreamTaskexecutionConfig - Execution configurationpublic void initializeState(org.apache.flink.runtime.state.StateInitializationContext context)
throws Exception
AbstractStreamOperatorinitializeState 在类中 AbstractStreamOperator<OUT>context - context that allows to register different states.Exceptionpublic void open()
throws Exception
AbstractStreamOperatorThe default implementation does nothing.
open 在接口中 StreamOperator<OUT>open 在类中 AbstractStreamOperator<OUT>Exception - An exception in this method causes the operator to fail.public void processElement(StreamRecord<TimestampedFileInputSplit> element) throws Exception
OneInputStreamOperatorprocessElement 在接口中 OneInputStreamOperator<TimestampedFileInputSplit,OUT>Exceptionpublic void processWatermark(Watermark mark) throws Exception
OneInputStreamOperatorWatermark.
This method is guaranteed to not be called concurrently with other methods of the operator.processWatermark 在接口中 OneInputStreamOperator<TimestampedFileInputSplit,OUT>processWatermark 在类中 AbstractStreamOperator<OUT>ExceptionWatermarkpublic void dispose()
throws Exception
AbstractStreamOperatorThis method is expected to make a thorough effort to release all resources that the operator has acquired.
dispose 在接口中 StreamOperator<OUT>dispose 在接口中 org.apache.flink.util.Disposabledispose 在类中 AbstractStreamOperator<OUT>Exceptionpublic void close()
throws Exception
AbstractStreamOperatorOneInputStreamOperator.processElement(StreamRecord), or
TwoInputStreamOperator.processElement1(StreamRecord) and
TwoInputStreamOperator.processElement2(StreamRecord).
The method is expected to flush all remaining buffered data. Exceptions during this flushing of buffered should be propagated, in order to cause the operation to be recognized asa failed, because the last data items are not processed properly.
close 在接口中 StreamOperator<OUT>close 在类中 AbstractStreamOperator<OUT>Exception - An exception in this method causes the operator to fail.public void snapshotState(org.apache.flink.runtime.state.StateSnapshotContext context)
throws Exception
AbstractStreamOperatorsnapshotState 在类中 AbstractStreamOperator<OUT>context - context that provides information and means required for taking a snapshotExceptionCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.