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
PackageProgramRetrieverImpl
is the default implementation ofPackagedProgramRetriever
that can either retrieve aPackagedProgram
from 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 DefaultPackagedProgramRetriever
create(File userLibDir, File jarFile, String jobClassName, String[] programArgs, Configuration configuration)
static DefaultPackagedProgramRetriever
create(File userLibDir, File jarFile, Collection<File> userArtifacts, String jobClassName, String[] programArgs, Configuration configuration)
Creates aPackageProgramRetrieverImpl
with the given parameters.static DefaultPackagedProgramRetriever
create(File userLibDir, String jobClassName, String[] programArgs, Configuration configuration)
PackagedProgram
getPackagedProgram()
Retrieve thePackagedProgram
.
-
-
-
Method Detail
-
create
public static DefaultPackagedProgramRetriever create(@Nullable File userLibDir, @Nullable String jobClassName, String[] programArgs, Configuration configuration) throws FlinkException
- Throws:
FlinkException
-
create
public static DefaultPackagedProgramRetriever create(@Nullable File userLibDir, @Nullable File jarFile, @Nullable String jobClassName, String[] programArgs, Configuration configuration) throws FlinkException
- Throws:
FlinkException
-
create
public static DefaultPackagedProgramRetriever create(@Nullable File userLibDir, @Nullable File jarFile, @Nullable Collection<File> userArtifacts, @Nullable String jobClassName, String[] programArgs, Configuration configuration) throws FlinkException
Creates aPackageProgramRetrieverImpl
with 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;null
if the job class is on the system classpath.userArtifacts
- The user artifacts that should be added to the user classpath if specified.jobClassName
- The job class to use; ifnull
the 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
PackageProgramRetrieverImpl
that can be used to create aPackagedProgram
instance. - Throws:
FlinkException
- If something goes wrong during instantiation.
-
getPackagedProgram
public PackagedProgram getPackagedProgram() throws FlinkException
Description copied from interface:PackagedProgramRetriever
Retrieve thePackagedProgram
.- Specified by:
getPackagedProgram
in interfacePackagedProgramRetriever
- Returns:
- the retrieved
PackagedProgram
. - Throws:
FlinkException
- if thePackagedProgram
could not be retrieved
-
-