OUT - Type of the output elementsSRC - Type of the source function of this stream source operator@Internal public class StreamSource<OUT,SRC extends SourceFunction<OUT>> extends AbstractUdfStreamOperator<OUT,SRC>
StreamOperator for streaming sources.userFunctionchainingStrategy, config, latencyStats, LOG, metrics, output, processingTimeService| 构造器和说明 |
|---|
StreamSource(SRC sourceFunction) |
StreamSource(SRC sourceFunction,
boolean emitProgressiveWatermarks) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel() |
void |
close()
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.
|
boolean |
emitsProgressiveWatermarks() |
protected boolean |
isCanceledOrStopped()
Checks whether the source has been canceled or stopped.
|
protected void |
markCanceledOrStopped()
Marks this source as canceled or stopped.
|
void |
run(Object lockingObject,
OperatorChain<?,?> operatorChain) |
void |
run(Object lockingObject,
Output<StreamRecord<OUT>> collector,
OperatorChain<?,?> operatorChain) |
void |
stop() |
finish, getUserFunction, getUserFunctionParameters, initializeState, notifyCheckpointAborted, notifyCheckpointComplete, open, setOutputType, setup, snapshotStategetChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, isUsingCustomRawKeyedState, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, registerCounterOnOutput, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, snapshotStatepublic StreamSource(SRC sourceFunction, boolean emitProgressiveWatermarks)
public StreamSource(SRC sourceFunction)
@VisibleForTesting public boolean emitsProgressiveWatermarks()
public void run(Object lockingObject, OperatorChain<?,?> operatorChain) throws Exception
Exceptionpublic void run(Object lockingObject, Output<StreamRecord<OUT>> collector, OperatorChain<?,?> operatorChain) throws Exception
Exceptionpublic void close()
throws Exception
StreamOperatorThis method is expected to make a thorough effort to release all resources that the operator has acquired.
NOTE:It can not emit any records! If you need to emit records at the end of
processing, do so in the StreamOperator.finish() method.
close 在接口中 StreamOperator<OUT>close 在类中 AbstractUdfStreamOperator<OUT,SRC extends SourceFunction<OUT>>Exceptionpublic void stop()
public void cancel()
protected void markCanceledOrStopped()
This indicates that any exit of the run(Object, Output, OperatorChain) method
cannot be interpreted as the result of a finite source.
protected boolean isCanceledOrStopped()
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.