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.AbstractStreamOperator.CountingOutput<OUT>
userFunction
chainingStrategy, config, latencyStats, LOG, metrics, output, timeServiceManager
Constructor and Description |
---|
StreamSource(SRC sourceFunction) |
Modifier and Type | Method and Description |
---|---|
void |
advanceToEndOfEventTime() |
void |
cancel() |
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) . |
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,
StreamStatusMaintainer streamStatusMaintainer,
OperatorChain<?,?> operatorChain) |
void |
run(Object lockingObject,
StreamStatusMaintainer streamStatusMaintainer,
Output<StreamRecord<OUT>> collector,
OperatorChain<?,?> operatorChain) |
dispose, getUserFunction, getUserFunctionParameters, initializeState, notifyCheckpointComplete, open, setOutputType, setup, snapshotState
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getUserCodeClassloader, initializeState, numEventTimeTimers, numProcessingTimeTimers, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, snapshotState
public StreamSource(SRC sourceFunction)
public void run(Object lockingObject, StreamStatusMaintainer streamStatusMaintainer, OperatorChain<?,?> operatorChain) throws Exception
Exception
public void run(Object lockingObject, StreamStatusMaintainer streamStatusMaintainer, Output<StreamRecord<OUT>> collector, OperatorChain<?,?> operatorChain) throws Exception
Exception
public void advanceToEndOfEventTime()
public void close() throws Exception
AbstractStreamOperator
OneInputStreamOperator.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
in interface StreamOperator<OUT>
close
in class AbstractUdfStreamOperator<OUT,SRC extends SourceFunction<OUT>>
Exception
- An exception in this method causes the operator to fail.public void cancel()
protected void markCanceledOrStopped()
This indicates that any exit of the #run(Object, StreamStatusMaintainer, Output)
method
cannot be interpreted as the result of a finite source.
protected boolean isCanceledOrStopped()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.