Class FromClasspathEntryClassInformationProvider
- java.lang.Object
-
- org.apache.flink.client.deployment.application.FromClasspathEntryClassInformationProvider
-
- All Implemented Interfaces:
EntryClassInformationProvider
public class FromClasspathEntryClassInformationProvider extends Object implements EntryClassInformationProvider
FromClasspathEntryClassInformationProviderassumes the passed job class being available on some classpath.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FromClasspathEntryClassInformationProvidercreate(String jobClassName, Iterable<URL> classpath)Creates aFromClasspathEntryClassInformationProviderbased on the passed job class and classpath.static FromClasspathEntryClassInformationProvidercreateFromClasspath(Iterable<URL> classpath)Creates aFromClasspathEntryClassInformationProviderlooking for the entry class providing the main method on the passed classpath.static FromClasspathEntryClassInformationProvidercreateFromSystemClasspath()Creates aFromClasspathEntryClassInformationProviderlooking for the entry class providing the main method on the system classpath.static FromClasspathEntryClassInformationProvidercreateWithJobClassAssumingOnSystemClasspath(String jobClassName)Creates aFromClasspathEntryClassInformationProviderassuming that the passed job class is available on the system classpath.Optional<File>getJarFile()Always returns an emptyOptionalbecause this implementation relies on the JAR archive being available on either the user or the system classpath.Optional<String>getJobClassName()Returns the job class name if it could be derived from the specified classpath or was explicitly specified.
-
-
-
Method Detail
-
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.FlinkException
Creates 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
public Optional<File> 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
public Optional<String> 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.
-
-