Interface StreamOperatorFactory<OUT>
-
- Type Parameters:
OUT- The output type of the operator
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
CoordinatedOperatorFactory<OUT>,InputFormatOperatorFactory<OUT>,OneInputStreamOperatorFactory<IN,OUT>,OutputFormatOperatorFactory<IN,OUT>,TwoInputStreamOperatorFactory<IN1,IN2,OUT>,UdfStreamOperatorFactory<OUT>,YieldingOperatorFactory<OUT>
- All Known Implementing Classes:
AbstractStreamOperatorFactory,CollectSinkOperatorFactory,CommitterOperatorFactory,ContinuousFileReaderOperatorFactory,EvictingWindowOperatorFactory,SimpleInputFormatOperatorFactory,SimpleOperatorFactory,SimpleOutputFormatOperatorFactory,SimpleUdfStreamOperatorFactory,SinkWriterOperatorFactory,SourceOperatorFactory,TimestampsAndWatermarksOperatorFactory,WindowOperatorFactory
@PublicEvolving public interface StreamOperatorFactory<OUT> extends Serializable
A factory to createStreamOperator.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T extends StreamOperator<OUT>>
TcreateStreamOperator(StreamOperatorParameters<OUT> parameters)Create the operator.ChainingStrategygetChainingStrategy()Get the chaining strategy of operator factory.default OperatorAttributesgetOperatorAttributes()Is called to get the OperatorAttributes of the operator.Class<? extends StreamOperator>getStreamOperatorClass(ClassLoader classLoader)Returns the runtime class of the stream operator.default booleanisInputTypeConfigurable()If the stream operator need to be configured with the data type they will operate on.default booleanisLegacySource()default booleanisOutputTypeConfigurable()If the stream operator need access to the output type information atStreamGraphgeneration.default booleanisStreamSource()Is this factory forStreamSource.voidsetChainingStrategy(ChainingStrategy strategy)Set the chaining strategy for operator factory.default voidsetInputType(org.apache.flink.api.common.typeinfo.TypeInformation<?> type, org.apache.flink.api.common.ExecutionConfig executionConfig)Is called by theStreamGraph.addOperator(java.lang.Integer, java.lang.String, java.lang.String, org.apache.flink.streaming.api.operators.StreamOperatorFactory<OUT>, org.apache.flink.api.common.typeinfo.TypeInformation<IN>, org.apache.flink.api.common.typeinfo.TypeInformation<OUT>, java.lang.String)method when theStreamGraphis generated.default voidsetOutputType(org.apache.flink.api.common.typeinfo.TypeInformation<OUT> type, org.apache.flink.api.common.ExecutionConfig executionConfig)Is called by theStreamGraph.addOperator(java.lang.Integer, java.lang.String, java.lang.String, org.apache.flink.streaming.api.operators.StreamOperatorFactory<OUT>, org.apache.flink.api.common.typeinfo.TypeInformation<IN>, org.apache.flink.api.common.typeinfo.TypeInformation<OUT>, java.lang.String)method when theStreamGraphis generated.
-
-
-
Method Detail
-
createStreamOperator
<T extends StreamOperator<OUT>> T createStreamOperator(StreamOperatorParameters<OUT> parameters)
Create the operator. Sets access to the context and the output.
-
setChainingStrategy
void setChainingStrategy(ChainingStrategy strategy)
Set the chaining strategy for operator factory.
-
getChainingStrategy
ChainingStrategy getChainingStrategy()
Get the chaining strategy of operator factory.
-
isStreamSource
default boolean isStreamSource()
Is this factory forStreamSource.
-
isLegacySource
default boolean isLegacySource()
-
isOutputTypeConfigurable
default boolean isOutputTypeConfigurable()
If the stream operator need access to the output type information atStreamGraphgeneration. This can be useful for cases where the output type is specified by the returns method and, thus, after the stream operator has been created.
-
setOutputType
default void setOutputType(org.apache.flink.api.common.typeinfo.TypeInformation<OUT> type, org.apache.flink.api.common.ExecutionConfig executionConfig)
Is called by theStreamGraph.addOperator(java.lang.Integer, java.lang.String, java.lang.String, org.apache.flink.streaming.api.operators.StreamOperatorFactory<OUT>, org.apache.flink.api.common.typeinfo.TypeInformation<IN>, org.apache.flink.api.common.typeinfo.TypeInformation<OUT>, java.lang.String)method when theStreamGraphis generated. The method is called with the outputTypeInformationwhich is also used for theStreamTaskoutput serializer.- Parameters:
type- Output type information of theStreamTaskexecutionConfig- Execution configuration
-
isInputTypeConfigurable
default boolean isInputTypeConfigurable()
If the stream operator need to be configured with the data type they will operate on.
-
setInputType
default void setInputType(org.apache.flink.api.common.typeinfo.TypeInformation<?> type, org.apache.flink.api.common.ExecutionConfig executionConfig)Is called by theStreamGraph.addOperator(java.lang.Integer, java.lang.String, java.lang.String, org.apache.flink.streaming.api.operators.StreamOperatorFactory<OUT>, org.apache.flink.api.common.typeinfo.TypeInformation<IN>, org.apache.flink.api.common.typeinfo.TypeInformation<OUT>, java.lang.String)method when theStreamGraphis generated.- Parameters:
type- The data type of the input.executionConfig- The execution config for this parallel execution.
-
getStreamOperatorClass
Class<? extends StreamOperator> getStreamOperatorClass(ClassLoader classLoader)
Returns the runtime class of the stream operator.
-
getOperatorAttributes
@Experimental default OperatorAttributes getOperatorAttributes()
Is called to get the OperatorAttributes of the operator. OperatorAttributes can inform the frame to optimize the job performance.- Returns:
- OperatorAttributes of the operator.
-
-