hello first I'm sorry for my poor english.
I were looking at PackagedProgram.java from org.apache.flink.client.program and in following cunstructor: PackagedProgram(File jarFile, List classpaths, String entryPointClassName, String... args) there is some code I couldn't understand. please look blow
how can
Thank you for your reading. |
On Thu, May 19, 2016 at 4:46 PM, 윤형덕 <[hidden email]> wrote: > > how can this.mainClass that doesn't override getPlan method that is abstract method of Program interface(program.class) and has only static main method be instantiate as Program? This is only called if the class is actually a subclass of Program. That's why there is the `isAssignable` check. Otherwise, we check that there is a mainMethod (else if (hasMainMethod(mainClass)). If this is not the case, a ProgramInvocationException is thrown. |
then this.program of PackageProgram's object has null. [1] in run() of CliFrontend.java, invokes executeProgramBlocking(program, client, userParallelism) [2] and this method invokes client.runBlocking(program, parallelism) [3] and this method invokes runBlocking(prog.getPlanWithJars(), parallelism, prog.getSavepointPath()) that is overloaded function[4] and prog.getPlanWithJars() invokes getPlan() of PackagedProgram.java[5] and getPlan() invokes createPlanFromProgram(this.program, this.args); [6] and createPlanFromProgram's source is folowing
private static Plan createPlanFromProgram(Program program, String[] options) throws ProgramInvocationException { }
as we checked, this.program has null. so if we invoke program.getPlan(options), exception will happen. but when i runned program, exception didn't occur. i'd appreciate if you explain this.
[1] else if (hasMainMethod(mainClass)) {
[2] if (options.getDetachedMode() || (yarnCluster != null && yarnCluster.isDetached())) { }
[3] protected int executeProgramBlocking(PackagedProgram program, Client client, int parallelism) { JobSubmissionResult result;
[4] public JobSubmissionResult runBlocking(PackagedProgram prog, int parallelism) throws ProgramInvocationException {
[5] public JobWithJars getPlanWithJars() throws ProgramInvocationException {
[6] private Plan getPlan() throws ProgramInvocationException { }
-----Original Message----- On Thu, May 19, 2016 at 4:46 PM, 윤형덕 <[hidden email]> wrote: > > how can this.mainClass that doesn't override getPlan method that is abstract method of Program interface(program.class) and has only static main method be instantiate as Program? This is only called if the class is actually a subclass of Program. That's why there is the `isAssignable` check. Otherwise, we check that there is a mainMethod (else if (hasMainMethod(mainClass)). If this is not the case, a ProgramInvocationException is thrown. |
Free forum by Nabble | Edit this page |