Class FromClasspathEntryClassInformationProvider
java.lang.Object
org.apache.flink.client.deployment.application.FromClasspathEntryClassInformationProvider
- All Implemented Interfaces:
EntryClassInformationProvider
public class FromClasspathEntryClassInformationProvider
extends Object
implements EntryClassInformationProvider
FromClasspathEntryClassInformationProvider assumes the passed job class being available
on some classpath.-
Method Summary
Modifier and TypeMethodDescriptionCreates aFromClasspathEntryClassInformationProviderbased on the passed job class and classpath.createFromClasspath(Iterable<URL> classpath) Creates aFromClasspathEntryClassInformationProviderlooking for the entry class providing the main method on the passed classpath.Creates aFromClasspathEntryClassInformationProviderlooking for the entry class providing the main method on the system classpath.createWithJobClassAssumingOnSystemClasspath(String jobClassName) Creates aFromClasspathEntryClassInformationProviderassuming that the passed job class is available on the system classpath.Always returns an emptyOptionalbecause this implementation relies on the JAR archive being available on either the user or the system classpath.Returns the job class name if it could be derived from the specified classpath or was explicitly specified.
-
Method Details
-
create
public static FromClasspathEntryClassInformationProvider create(String jobClassName, Iterable<URL> classpath) throws IOException, org.apache.flink.util.FlinkException Creates aFromClasspathEntryClassInformationProviderbased on the passed job class and classpath.- Parameters:
jobClassName- The job's class name.classpath- The classpath the job class should be part of.- Returns:
- The
FromClasspathEntryClassInformationProviderinstances collecting the necessary information. - Throws:
IOException- If some Jar listed on the classpath wasn't accessible.org.apache.flink.util.FlinkException- If the passed job class is not present on the passed classpath.
-
createFromClasspath
public static FromClasspathEntryClassInformationProvider createFromClasspath(Iterable<URL> classpath) throws IOException, org.apache.flink.util.FlinkException Creates aFromClasspathEntryClassInformationProviderlooking for the entry class providing the main method on the passed classpath.- Parameters:
classpath- The classpath the job class is expected to be part of.- Returns:
- The
FromClasspathEntryClassInformationProviderproviding the job class found on the passed classpath. - Throws:
IOException- If some Jar listed on the classpath wasn't accessible.org.apache.flink.util.FlinkException- Either no or too many main methods were found on the classpath.
-
createFromSystemClasspath
public static FromClasspathEntryClassInformationProvider createFromSystemClasspath() throws IOException, org.apache.flink.util.FlinkExceptionCreates aFromClasspathEntryClassInformationProviderlooking for the entry class providing the main method on the system classpath.- Returns:
- The
FromClasspathEntryClassInformationProviderproviding the job class found on the system classpath. - Throws:
IOException- If some Jar listed on the system classpath wasn't accessible.org.apache.flink.util.FlinkException- Either no or too many main methods were found on the system classpath.
-
createWithJobClassAssumingOnSystemClasspath
public static FromClasspathEntryClassInformationProvider createWithJobClassAssumingOnSystemClasspath(String jobClassName) Creates aFromClasspathEntryClassInformationProviderassuming that the passed job class is available on the system classpath.- Parameters:
jobClassName- The job class name working as the entry point.- Returns:
- The
FromClasspathEntryClassInformationProviderproviding the job class found.
-
getJarFile
Always returns an emptyOptionalbecause this implementation relies on the JAR archive being available on either the user or the system classpath.- Specified by:
getJarFilein interfaceEntryClassInformationProvider- Returns:
- An empty
Optional.
-
getJobClassName
Returns the job class name if it could be derived from the specified classpath or was explicitly specified.- Specified by:
getJobClassNamein interfaceEntryClassInformationProvider- Returns:
- The job class name or an empty
Optionalif none was specified and it couldn't be derived from the classpath.
-