Class PythonDependencyUtils


  • @Internal
    public class PythonDependencyUtils
    extends Object
    Utility class for Python dependency management. The dependencies will be registered at the distributed cache.
    • Constructor Detail

      • PythonDependencyUtils

        public PythonDependencyUtils()
    • Method Detail

      • getArchiveTargetDirName

        public static String getArchiveTargetDirName​(String archiveValue)
        Extracts the target directory name from an archive value string.

        The archive value may contain a PARAM_DELIMITER separator. If present, the format is "originalFileName#targetDirName" and the target directory name is the part after the delimiter. Otherwise, the entire value is used as the target directory name.

        Parameters:
        archiveValue - the archive value string, e.g. "venv.zip#venv" or "venv"
        Returns:
        the target directory name
      • configurePythonDependencies

        public static org.apache.flink.configuration.Configuration configurePythonDependencies​(org.apache.flink.configuration.ReadableConfig config)
        Adds python dependencies to registered cache file list according to given configuration and returns a new configuration which contains the metadata of the registered python dependencies.
        Parameters:
        config - The configuration which contains python dependency configuration.
        Returns:
        A new configuration which contains the metadata of the registered python dependencies.
      • parsePythonDependencyConfiguration

        public static org.apache.flink.configuration.Configuration parsePythonDependencyConfiguration​(org.apache.commons.cli.CommandLine commandLine)
      • merge

        public static void merge​(org.apache.flink.configuration.Configuration config,
                                 org.apache.flink.configuration.Configuration pythonConfiguration)