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.userFunction
chainingStrategy, config, latencyStats, LOG, metrics, output, processingTimeService
Constructor and Description |
---|
StreamSource(SRC sourceFunction) |
StreamSource(SRC sourceFunction,
boolean emitProgressiveWatermarks) |
Modifier and Type | Method and Description |
---|---|
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, snapshotState
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, isUsingCustomRawKeyedState, prepareSnapshotPreBarrier, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasKeyContext
public StreamSource(SRC sourceFunction, boolean emitProgressiveWatermarks)
public StreamSource(SRC sourceFunction)
@VisibleForTesting public boolean emitsProgressiveWatermarks()
public void run(Object lockingObject, OperatorChain<?,?> operatorChain) throws Exception
Exception
public void run(Object lockingObject, Output<StreamRecord<OUT>> collector, OperatorChain<?,?> operatorChain) throws Exception
Exception
public void close() throws Exception
StreamOperator
This 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
in interface StreamOperator<OUT>
close
in class AbstractUdfStreamOperator<OUT,SRC extends SourceFunction<OUT>>
Exception
public 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–2024 The Apache Software Foundation. All rights reserved.