Package org.apache.flink.client.program
Class DefaultPackagedProgramRetriever
- java.lang.Object
-
- org.apache.flink.client.program.DefaultPackagedProgramRetriever
-
- All Implemented Interfaces:
PackagedProgramRetriever
public class DefaultPackagedProgramRetriever extends Object implements PackagedProgramRetriever
PackageProgramRetrieverImplis the default implementation ofPackagedProgramRetrieverthat can either retrieve aPackagedProgramfrom a specific jar, some provided user classpath or the system classpath.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultPackagedProgramRetrievercreate(File userLibDir, File jarFile, String jobClassName, String[] programArgs, org.apache.flink.configuration.Configuration configuration)Creates aPackageProgramRetrieverImplwith the given parameters.static DefaultPackagedProgramRetrievercreate(File userLibDir, String jobClassName, String[] programArgs, org.apache.flink.configuration.Configuration configuration)Creates aPackageProgramRetrieverImplwith the given parameters.PackagedProgramgetPackagedProgram()Retrieve thePackagedProgram.
-
-
-
Method Detail
-
create
public static DefaultPackagedProgramRetriever create(@Nullable File userLibDir, @Nullable String jobClassName, String[] programArgs, org.apache.flink.configuration.Configuration configuration) throws org.apache.flink.util.FlinkException
Creates aPackageProgramRetrieverImplwith the given parameters.- Parameters:
userLibDir- The user library directory that is used for generating the user classpath if specified. The system classpath is used if not specified.jobClassName- The job class that will be used if specified. The classpath is used to detect any main class if not specified.programArgs- The program arguments.configuration- The Flink configuration for the given job.- Returns:
- The
PackageProgramRetrieverImplthat can be used to create aPackagedPrograminstance. - Throws:
org.apache.flink.util.FlinkException- If something goes wrong during instantiation.
-
create
public static DefaultPackagedProgramRetriever create(@Nullable File userLibDir, @Nullable File jarFile, @Nullable String jobClassName, String[] programArgs, org.apache.flink.configuration.Configuration configuration) throws org.apache.flink.util.FlinkException
Creates aPackageProgramRetrieverImplwith the given parameters.- Parameters:
userLibDir- The user library directory that is used for generating the user classpath if specified. The system classpath is used if not specified.jarFile- The jar archive expected to contain the job class included;nullif the job class is on the system classpath.jobClassName- The job class to use; ifnullthe user classpath (or, if not set, the system classpath) will be scanned for possible main class.programArgs- The program arguments.configuration- The Flink configuration for the given job.- Returns:
- The
PackageProgramRetrieverImplthat can be used to create aPackagedPrograminstance. - Throws:
org.apache.flink.util.FlinkException- If something goes wrong during instantiation.
-
getPackagedProgram
public PackagedProgram getPackagedProgram() throws org.apache.flink.util.FlinkException
Description copied from interface:PackagedProgramRetrieverRetrieve thePackagedProgram.- Specified by:
getPackagedProgramin interfacePackagedProgramRetriever- Returns:
- the retrieved
PackagedProgram. - Throws:
org.apache.flink.util.FlinkException- if thePackagedProgramcould not be retrieved
-
-