Package org.apache.flink.client.program
Class PackagedProgram
java.lang.Object
org.apache.flink.client.program.PackagedProgram
- All Implemented Interfaces:
AutoCloseable
This class encapsulates represents a program, packaged in a jar file. It supplies functionality
to extract nested libraries, search for the program entry point, and extract a program plan.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()extractContainedLibraries(URL jarFile) Takes all JAR files that are contained in this program's JAR file and extracts them to the system's temp directory.String[]Returns the classpaths that are required by the program.Returns the description provided by the Program class.Returns all provided libraries needed to run the program.getJobJarAndDependencies(File jarFile, String entryPointClassName) Returns all provided libraries needed to run the program.org.apache.flink.runtime.jobgraph.SavepointRestoreSettingsGets theClassLoaderthat must be used to load user code classes.voidThis method assumes that the context environment is prepared, or the execution will be a local execution by default.static PackagedProgram.Builder
-
Field Details
-
MANIFEST_ATTRIBUTE_ASSEMBLER_CLASS
Property name of the entry in JAR manifest file that describes the Flink specific entry point.- See Also:
-
MANIFEST_ATTRIBUTE_MAIN_CLASS
Property name of the entry in JAR manifest file that describes the class with the main method.- See Also:
-
-
Method Details
-
getSavepointSettings
public org.apache.flink.runtime.jobgraph.SavepointRestoreSettings getSavepointSettings() -
getArguments
-
getMainClassName
-
getDescription
Returns the description provided by the Program class. This may contain a description of the plan itself and its arguments.- Returns:
- The description of the PactProgram's input parameters.
- Throws:
ProgramInvocationException- This invocation is thrown if the Program can't be properly loaded. Causes may be a missing / wrong class or manifest files.
-
invokeInteractiveModeForExecution
This method assumes that the context environment is prepared, or the execution will be a local execution by default.- Throws:
ProgramInvocationException
-
getClasspaths
Returns the classpaths that are required by the program.- Returns:
- List of
URLs.
-
getUserCodeClassLoader
Gets theClassLoaderthat must be used to load user code classes.- Returns:
- The user code ClassLoader.
-
getJobJarAndDependencies
Returns all provided libraries needed to run the program. -
getJobJarAndDependencies
public static List<URL> getJobJarAndDependencies(File jarFile, @Nullable String entryPointClassName) throws ProgramInvocationException Returns all provided libraries needed to run the program.- Throws:
ProgramInvocationException
-
extractContainedLibraries
Takes all JAR files that are contained in this program's JAR file and extracts them to the system's temp directory.- Returns:
- The file names of the extracted temporary files.
- Throws:
ProgramInvocationException- Thrown, if the extraction process failed.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
newBuilder
-