Class CollectSink<IN>
- java.lang.Object
-
- org.apache.flink.api.common.functions.AbstractRichFunction
-
- org.apache.flink.streaming.api.functions.sink.legacy.RichSinkFunction<IN>
-
- org.apache.flink.streaming.experimental.CollectSink<IN>
-
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.functions.RichFunction,org.apache.flink.streaming.api.functions.sink.legacy.SinkFunction<IN>
@Experimental public class CollectSink<IN> extends org.apache.flink.streaming.api.functions.sink.legacy.RichSinkFunction<IN>A specialized data sink to be used by DataStreamUtils.collect().This experimental class is relocated from flink-streaming-contrib. Please see package-info.java for more information.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CollectSink(InetAddress hostIp, int port, org.apache.flink.api.common.typeutils.TypeSerializer<IN> serializer)Creates a CollectSink that will send the data to the specified host.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the connection with the Socket server.voidinvoke(IN value, org.apache.flink.streaming.api.functions.sink.legacy.SinkFunction.Context context)voidopen(org.apache.flink.api.common.functions.OpenContext openContext)Initialize the connection with the Socket in the server.-
Methods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
-
-
-
-
Constructor Detail
-
CollectSink
public CollectSink(InetAddress hostIp, int port, org.apache.flink.api.common.typeutils.TypeSerializer<IN> serializer)
Creates a CollectSink that will send the data to the specified host.- Parameters:
hostIp- IP address of the Socket server.port- Port of the Socket server.serializer- A serializer for the data.
-
-
Method Detail
-
invoke
public void invoke(IN value, org.apache.flink.streaming.api.functions.sink.legacy.SinkFunction.Context context) throws Exception
- Throws:
Exception
-
open
public void open(org.apache.flink.api.common.functions.OpenContext openContext) throws ExceptionInitialize the connection with the Socket in the server.- Specified by:
openin interfaceorg.apache.flink.api.common.functions.RichFunction- Overrides:
openin classorg.apache.flink.api.common.functions.AbstractRichFunction- Parameters:
openContext- the context.- Throws:
Exception
-
-