Class PythonDependencyInfo


  • @Internal
    public final class PythonDependencyInfo
    extends Object
    PythonDependencyInfo contains the information of third-party dependencies.
    • Constructor Detail

      • PythonDependencyInfo

        public PythonDependencyInfo​(@Nonnull
                                    Map<String,​String> pythonFiles,
                                    @Nullable
                                    String requirementsFilePath,
                                    @Nullable
                                    String requirementsCacheDir,
                                    @Nonnull
                                    Map<String,​String> archives,
                                    @Nonnull
                                    String pythonExec)
      • PythonDependencyInfo

        public PythonDependencyInfo​(@Nonnull
                                    Map<String,​String> pythonFiles,
                                    @Nullable
                                    String requirementsFilePath,
                                    @Nullable
                                    String requirementsCacheDir,
                                    @Nonnull
                                    Map<String,​String> archives,
                                    @Nonnull
                                    String pythonExec,
                                    @Nonnull
                                    String executionMode,
                                    @Nullable
                                    String pythonPath)
    • Method Detail

      • getRequirementsFilePath

        public Optional<String> getRequirementsFilePath()
      • getRequirementsCacheDir

        public Optional<String> getRequirementsCacheDir()
      • getPythonExec

        public String getPythonExec()
      • getExecutionMode

        public String getExecutionMode()
      • create

        public static PythonDependencyInfo create​(org.apache.flink.configuration.ReadableConfig config,
                                                  org.apache.flink.api.common.cache.DistributedCache distributedCache)
        Creates PythonDependencyInfo from GlobalJobParameters and DistributedCache.
        Parameters:
        config - The config.
        distributedCache - The DistributedCache object of current task.
        Returns:
        The PythonDependencyInfo object that contains whole information of python dependency.
      • isPythonExecFromArchives

        public boolean isPythonExecFromArchives()
        Checks whether the configured python executable path is located within one of the shipped archives.

        This is determined by comparing the first path component of the python executable (the base directory) against the target directory names of all registered archives.

        Returns:
        true if the python executable's base directory matches an archive target directory