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> implements StreamOperator<OUT>, AsyncExceptionChecker
StreamOperator
for streaming sources.Modifier and Type | Class and Description |
---|---|
static class |
StreamSource.AutomaticWatermarkContext<T>
SourceFunction.SourceContext to be used for sources with automatic timestamps
and watermark emission. |
static class |
StreamSource.ManualWatermarkContext<T>
A SourceContext for event time.
|
static class |
StreamSource.NonTimestampContext<T>
A source context that attached
-1 as a timestamp to all records, and that
does not forward watermarks. |
AbstractStreamOperator.CountingOutput
userFunction
chainingStrategy, LOG, metrics, output
Constructor and Description |
---|
StreamSource(SRC sourceFunction) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
checkAsyncException()
Checks whether any asynchronous thread (checkpoint trigger, timer, watermark generator, ...)
has caused an exception.
|
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) |
void |
run(Object lockingObject,
Output<StreamRecord<OUT>> collector) |
close, dispose, getUserFunction, getUserFunctionParameters, notifyOfCompletedCheckpoint, open, restoreState, setOutputType, setup, snapshotOperatorState
getChainingStrategy, getContainingTask, getCurrentProcessingTime, getExecutionConfig, getMetricGroup, getOperatorConfig, getOperatorName, getPartitionedState, getPartitionedState, getRuntimeContext, getStateBackend, getUserCodeClassloader, registerTimer, setChainingStrategy, setKeyContext, setKeyContextElement1, setKeyContextElement2
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, dispose, getChainingStrategy, getMetricGroup, notifyOfCompletedCheckpoint, open, restoreState, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setup, snapshotOperatorState
public StreamSource(SRC sourceFunction)
public void run(Object lockingObject, Output<StreamRecord<OUT>> collector) throws Exception
Exception
public void cancel()
protected void markCanceledOrStopped()
This indicates that any exit of the run(Object, Output)
method
cannot be interpreted as the result of a finite source.
protected boolean isCanceledOrStopped()
public void checkAsyncException()
checkAsyncException
in interface AsyncExceptionChecker
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.