@Experimental public class CollectSink<IN> extends RichSinkFunction<IN>
This experimental class is relocated from flink-streaming-contrib. Please see package-info.java for more information.
SinkFunction.Context| Constructor and 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.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection with the Socket server.
|
void |
invoke(IN value,
SinkFunction.Context context)
Writes the given value to the sink.
|
void |
open(org.apache.flink.api.common.functions.OpenContext openContext)
Initialize the connection with the Socket in the server.
|
getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfinish, invoke, writeWatermarkpublic CollectSink(InetAddress hostIp, int port, org.apache.flink.api.common.typeutils.TypeSerializer<IN> serializer)
hostIp - IP address of the Socket server.port - Port of the Socket server.serializer - A serializer for the data.public void invoke(IN value, SinkFunction.Context context) throws Exception
SinkFunctionYou have to override this method when implementing a SinkFunction, this is a
default method for backward compatibility with the old-style method only.
value - The input record.context - Additional context about the input record.Exception - This method may throw exceptions. Throwing an exception will cause the
operation to fail and may trigger recovery.public void open(org.apache.flink.api.common.functions.OpenContext openContext)
throws Exception
openContext - the context.ExceptionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.