public class PythonFunction extends Object implements Function
Python worker can use information in this class to create a function object.
If this object is constructed from serialized python function, python worker can deserialize it to create python function directly. If this object is constructed from moduleName and className/functionName, python worker will use `importlib` to load python function.
If the python data stream api is invoked from python, `function` will be not null.
If the python data stream api is invoked from java, `moduleName` and `functionName` will be not null.
| Modifier and Type | Class and Description |
|---|---|
static class |
PythonFunction.FunctionInterface |
| Constructor and Description |
|---|
PythonFunction(byte[] function)
Create a
PythonFunction from a serialized streaming python function. |
PythonFunction(String moduleName,
String functionName)
Create a
PythonFunction from a moduleName and streaming function name. |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getFunction() |
String |
getFunctionInterface() |
String |
getFunctionName() |
String |
getModuleName() |
void |
setFunctionInterface(PythonFunction.FunctionInterface functionInterface) |
String |
toSimpleString() |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitloadCheckpoint, saveCheckpointpublic PythonFunction(byte[] function)
PythonFunction from a serialized streaming python function.function - serialized streaming python function from python driver.public PythonFunction(String moduleName, String functionName)
PythonFunction from a moduleName and streaming function name.moduleName - module name of streaming function.functionName - function name of streaming function. functionName is the name
of a
python function, or class name of subclass of `ray.streaming.function.`public void setFunctionInterface(PythonFunction.FunctionInterface functionInterface)
public byte[] getFunction()
public String getModuleName()
public String getFunctionName()
public String getFunctionInterface()
public String toSimpleString()
Copyright © 2020. All rights reserved.