Package org.apache.flink.client.python
Interface PythonFunctionFactory
-
- All Known Implementing Classes:
PythonFunctionFactoryImpl
public interface PythonFunctionFactoryThe factory which creates the PythonFunction objects from given module name and object name.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classPythonFunctionFactory.CacheKeyThe cache key.
-
Field Summary
Fields Modifier and Type Field Description static ScheduledExecutorServiceCACHE_CLEANUP_EXECUTOR_SERVICEstatic AtomicReference<Boolean>CACHE_CLEANUP_EXECUTOR_SERVICE_STARTEDstatic org.apache.flink.shaded.guava32.com.google.common.cache.LoadingCache<PythonFunctionFactory.CacheKey,PythonFunctionFactory>PYTHON_FUNCTION_FACTORY_CACHE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static PythonFunctionFactorycreatePythonFunctionFactory(org.apache.flink.configuration.ReadableConfig config)static voidensureCacheCleanupExecutorServiceStarted()org.apache.flink.table.functions.python.PythonFunctiongetPythonFunction(String moduleName, String objectName)Returns PythonFunction according to moduleName and objectName.static org.apache.flink.table.functions.python.PythonFunctiongetPythonFunction(String fullyQualifiedName, org.apache.flink.configuration.ReadableConfig config, ClassLoader classLoader)Returns PythonFunction according to the fully qualified name of the Python UDF i.e ${moduleName}.
-
-
-
Field Detail
-
CACHE_CLEANUP_EXECUTOR_SERVICE
static final ScheduledExecutorService CACHE_CLEANUP_EXECUTOR_SERVICE
-
CACHE_CLEANUP_EXECUTOR_SERVICE_STARTED
static final AtomicReference<Boolean> CACHE_CLEANUP_EXECUTOR_SERVICE_STARTED
-
PYTHON_FUNCTION_FACTORY_CACHE
static final org.apache.flink.shaded.guava32.com.google.common.cache.LoadingCache<PythonFunctionFactory.CacheKey,PythonFunctionFactory> PYTHON_FUNCTION_FACTORY_CACHE
-
-
Method Detail
-
getPythonFunction
org.apache.flink.table.functions.python.PythonFunction getPythonFunction(String moduleName, String objectName)
Returns PythonFunction according to moduleName and objectName.- Parameters:
moduleName- The module name of the Python UDF.objectName- The function name / class name of the Python UDF.- Returns:
- The PythonFunction object which represents the Python UDF.
-
getPythonFunction
static org.apache.flink.table.functions.python.PythonFunction getPythonFunction(String fullyQualifiedName, org.apache.flink.configuration.ReadableConfig config, ClassLoader classLoader) throws ExecutionException
Returns PythonFunction according to the fully qualified name of the Python UDF i.e ${moduleName}.${functionName} or ${moduleName}.${className}.- Parameters:
fullyQualifiedName- The fully qualified name of the Python UDF.config- The configuration of python dependencies.classLoader- The classloader which is used to identify different jobs.- Returns:
- The PythonFunction object which represents the Python UDF.
- Throws:
ExecutionException
-
ensureCacheCleanupExecutorServiceStarted
static void ensureCacheCleanupExecutorServiceStarted()
-
createPythonFunctionFactory
static PythonFunctionFactory createPythonFunctionFactory(org.apache.flink.configuration.ReadableConfig config) throws ExecutionException, InterruptedException, IOException
-
-