T
- The type of the elements in this stream.@Public public class SingleOutputStreamOperator<T> extends DataStream<T>
SingleOutputStreamOperator
represents a user defined transformation
applied on a DataStream
with one predefined output type.environment, transformation
Modifier | Constructor and Description |
---|---|
protected |
SingleOutputStreamOperator(StreamExecutionEnvironment environment,
StreamTransformation<T> transformation) |
Modifier and Type | Method and Description |
---|---|
SingleOutputStreamOperator<T> |
disableChaining()
Turns off chaining for this operator so thread co-location will not be
used as an optimization.
|
String |
getName()
Gets the name of the current data stream.
|
SingleOutputStreamOperator<T> |
name(String name)
Sets the name of the current data stream.
|
SingleOutputStreamOperator<T> |
returns(Class<T> typeClass)
Adds a type information hint about the return type of this operator.
|
SingleOutputStreamOperator<T> |
returns(String typeInfoString)
Deprecated.
Please use
returns(Class) or returns(TypeHint) instead. |
SingleOutputStreamOperator<T> |
returns(TypeHint<T> typeHint)
Adds a type information hint about the return type of this operator.
|
SingleOutputStreamOperator<T> |
returns(TypeInformation<T> typeInfo)
Adds a type information hint about the return type of this operator.
|
SingleOutputStreamOperator<T> |
setBufferTimeout(long timeoutMillis)
Sets the maximum time frequency (ms) for the flushing of the output
buffer.
|
protected DataStream<T> |
setConnectionType(StreamPartitioner<T> partitioner)
Internal function for setting the partitioner for the DataStream
|
SingleOutputStreamOperator<T> |
setParallelism(int parallelism)
Sets the parallelism for this operator.
|
SingleOutputStreamOperator<T> |
slotSharingGroup(String slotSharingGroup)
Sets the slot sharing group of this operation.
|
SingleOutputStreamOperator<T> |
startNewChain()
Starts a new task chain beginning at this operator.
|
SingleOutputStreamOperator<T> |
uid(String uid)
Sets an ID for this operator.
|
addSink, assignTimestamps, assignTimestampsAndWatermarks, assignTimestampsAndWatermarks, broadcast, clean, coGroup, connect, countWindowAll, countWindowAll, filter, flatMap, forward, getExecutionConfig, getExecutionEnvironment, getId, getParallelism, getTransformation, getType, global, iterate, iterate, join, keyBy, keyBy, keyBy, map, partitionCustom, partitionCustom, partitionCustom, print, printToErr, project, rebalance, rescale, shuffle, split, timeWindowAll, timeWindowAll, transform, union, windowAll, writeAsCsv, writeAsCsv, writeAsCsv, writeAsText, writeAsText, writeToSocket, writeUsingOutputFormat
protected SingleOutputStreamOperator(StreamExecutionEnvironment environment, StreamTransformation<T> transformation)
public String getName()
public SingleOutputStreamOperator<T> name(String name)
@PublicEvolving public SingleOutputStreamOperator<T> uid(String uid)
The specified ID is used to assign the same operator ID across job submissions (for example when starting a job from a savepoint).
Important: this ID needs to be unique per transformation and job. Otherwise, job submission will fail.
uid
- The unique user-specified ID of this transformation.public SingleOutputStreamOperator<T> setParallelism(int parallelism)
parallelism
- The parallelism for this operator.public SingleOutputStreamOperator<T> setBufferTimeout(long timeoutMillis)
timeoutMillis
- The maximum time between two output flushes.@PublicEvolving public SingleOutputStreamOperator<T> disableChaining()
Chaining can be turned off for the whole
job by StreamExecutionEnvironment.disableOperatorChaining()
however it is not advised for performance considerations.
@PublicEvolving public SingleOutputStreamOperator<T> startNewChain()
public SingleOutputStreamOperator<T> returns(Class<T> typeClass)
Classes can be used as type hints for non-generic types (classes without generic parameters),
but not for generic types like for example Tuples. For those generic types, please
use the returns(TypeHint)
method.
typeClass
- The class of the returned data type.public SingleOutputStreamOperator<T> returns(TypeHint<T> typeHint)
Use this method the following way:
DataStream<Tuple2<String, Double>> result =
stream.flatMap(new FunctionWithNonInferrableReturnType())
.returns(new TypeHint<Tuple2<String, Double>>(){});
typeHint
- The type hint for the returned data type.public SingleOutputStreamOperator<T> returns(TypeInformation<T> typeInfo)
In most cases, the methods returns(Class)
and returns(TypeHint)
are preferable.
typeInfo
- type information as a return type hint@Deprecated @PublicEvolving public SingleOutputStreamOperator<T> returns(String typeInfoString)
returns(Class)
or returns(TypeHint)
instead.Type hints are important in cases where the Java compiler throws away generic type information necessary for efficient execution.
This method takes a type information string that will be parsed. A type information string can contain the following types:
Integer
, String
, etc.
Integer[]
,
String[]
, etc.
Tuple1<TYPE0>
,
Tuple2<TYPE0, TYPE1>
, etc.org.my.MyPojo<myFieldName=TYPE0,myFieldName2=TYPE1>
, etc.java.lang.Class
, etc.
org.my.CustomClass[]
,
org.my.CustomClass$StaticInnerClass[]
, etc.
DoubleValue
,
StringValue
, IntegerValue
, etc.Tuple2<TYPE0,TYPE1>[], etc.
Writable<org.my.CustomWritable>
Enum<org.my.CustomEnum>
"Tuple2<String,Tuple2<Integer,org.my.MyJob$Pojo<word=String>>>"
typeInfoString
- type information string to be parsedprotected DataStream<T> setConnectionType(StreamPartitioner<T> partitioner)
DataStream
setConnectionType
in class DataStream<T>
partitioner
- Partitioner to set.@PublicEvolving public SingleOutputStreamOperator<T> slotSharingGroup(String slotSharingGroup)
Operations inherit the slot sharing group of input operations if all input operations are in the same slot sharing group and no slot sharing group was explicitly specified.
Initially an operation is in the default slot sharing group. An operation can be put into
the default group explicitly by setting the slot sharing group to "default"
.
slotSharingGroup
- The slot sharing group name.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.