Class FromClasspathEntryClassInformationProvider

    • Method Detail

      • create

        public static FromClasspathEntryClassInformationProvider create​(String jobClassName,
                                                                        Iterable<URL> classpath)
                                                                 throws IOException,
                                                                        org.apache.flink.util.FlinkException
        Creates a FromClasspathEntryClassInformationProvider based 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 FromClasspathEntryClassInformationProvider instances 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 a FromClasspathEntryClassInformationProvider looking 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 FromClasspathEntryClassInformationProvider providing 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 a FromClasspathEntryClassInformationProvider looking for the entry class providing the main method on the system classpath.
        Returns:
        The FromClasspathEntryClassInformationProvider providing 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 a FromClasspathEntryClassInformationProvider assuming that the passed job class is available on the system classpath.
        Parameters:
        jobClassName - The job class name working as the entry point.
        Returns:
        The FromClasspathEntryClassInformationProvider providing the job class found.
      • getJarFile

        public Optional<File> getJarFile()
        Always returns an empty Optional because this implementation relies on the JAR archive being available on either the user or the system classpath.
        Specified by:
        getJarFile in interface EntryClassInformationProvider
        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:
        getJobClassName in interface EntryClassInformationProvider
        Returns:
        The job class name or an empty Optional if none was specified and it couldn't be derived from the classpath.