public String getPreviewPlan ( ) throws ProgramInvocationException { Thread . currentThread ( ) . setContextClassLoader ( this . getUserCodeClassLoader ( ) ) ; List < DataSinkNode > previewPlan ; if ( isUsingProgramEntryPoint ( ) ) { previewPlan = PactCompiler . createPreOptimizedPlan ( getPlan ( ) ) ; } else if ( isUsingInteractiveMode ( ) ) { // temporary hack to support the web client PreviewPlanEnvironment env = new PreviewPlanEnvironment ( ) ; env . setAsContext ( ) ; try { invokeInteractiveModeForExecution ( ) ; } catch ( ProgramInvocationException e ) { throw e ; } catch ( Throwable t ) { // the invocation gets aborted with the preview plan if ( env . previewPlan != null ) { previewPlan = env . previewPlan ; } else { throw new ProgramInvocationException ( "The program caused an error: " , t ) ; } } if ( env . previewPlan != null ) { previewPlan = env . previewPlan ; } else { throw new ProgramInvocationException ( "The program plan could not be fetched. The program silently swallowed the control flow exceptions." ) ; } } else { throw new RuntimeException ( ) ; } PlanJSONDumpGenerator jsonGen = new PlanJSONDumpGenerator ( ) ; StringWriter string = new StringWriter ( 1024 ) ; PrintWriter pw = null ; try { pw = new PrintWriter ( string ) ; jsonGen . dumpPactPlanAsJSON ( previewPlan , pw ) ; } finally { pw . close ( ) ; } return string . toString ( ) ; }
Returns the analyzed plan without any optimizations .