public class PythonSinkFunction extends AbstractPythonUDF<SinkFunction<org.python.core.PyObject>> implements SinkFunction<org.python.core.PyObject>
PythonSinkFunction
is a thin wrapper layer over a Python UDF SinkFunction
.
It receives a SinkFunction
as an input and keeps it internally in a serialized form.
It is then delivered, as part of the job graph, up to the TaskManager, then it is opened and becomes
a sort of mediator to the Python UDF SinkFunction
.
This function is used internally by the Python thin wrapper layer over the streaming data functionality
SinkFunction.Context<T>
fun, log
Constructor and Description |
---|
PythonSinkFunction(SinkFunction<org.python.core.PyObject> fun) |
Modifier and Type | Method and Description |
---|---|
void |
invoke(org.python.core.PyObject value,
SinkFunction.Context context)
Writes the given value to the sink.
|
close, open
getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invoke
public PythonSinkFunction(SinkFunction<org.python.core.PyObject> fun) throws IOException
IOException
public void invoke(org.python.core.PyObject value, SinkFunction.Context context) throws Exception
SinkFunction
You have to override this method when implementing a SinkFunction
, this is a
default
method for backward compatibility with the old-style method only.
invoke
in interface SinkFunction<org.python.core.PyObject>
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.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.