test_class.file: flink-clients/src/test/java/org/apache/flink/client/program/PackagedProgramTest.java
test_class.identifier: PackagedProgramTest
test_case.body: @Test
  	public void testGetPreviewPlan() {
  		try {
  			PackagedProgram prog = new PackagedProgram(new File(CliFrontendTestUtils.getTestJarPath()));
  			
  			final PrintStream out = System.out;
  			final PrintStream err = System.err;
  			try {
  				System.setOut(new PrintStream(new NullOutputStream()));
  				System.setErr(new PrintStream(new NullOutputStream()));
  				
  				Assert.assertNotNull(prog.getPreviewPlan());
  			}
  			finally {
  				System.setOut(out);
  				System.setErr(err);
  			}
  		}
  		catch (Exception e) {
  			System.err.println(e.getMessage());
  			e.printStackTrace();
  			Assert.fail("Test is erroneous: " + e.getMessage());
  		}
  	}
test_case.class_method_signature: PackagedProgramTest.testGetPreviewPlan()
test_case.full_signature: @Test public void testGetPreviewPlan()
test_case.identifier: testGetPreviewPlan
test_case.invocations: getTestJarPath setOut setErr assertNotNull getPreviewPlan setOut setErr println getMessage printStackTrace fail getMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetPreviewPlan()
focal_class.declarator: MANIFEST_ATTRIBUTE_ASSEMBLER_CLASS = "program-class"
focal_class.modifier: public static final
focal_class.original_string: public static final String MANIFEST_ATTRIBUTE_ASSEMBLER_CLASS = "program-class";
focal_class.type: String
focal_class.var_name: MANIFEST_ATTRIBUTE_ASSEMBLER_CLASS
focal_class.declarator: MANIFEST_ATTRIBUTE_MAIN_CLASS = "Main-Class"
focal_class.modifier: public static final
focal_class.original_string: public static final String MANIFEST_ATTRIBUTE_MAIN_CLASS = "Main-Class";
focal_class.type: String
focal_class.var_name: MANIFEST_ATTRIBUTE_MAIN_CLASS
focal_class.declarator: jarFile
focal_class.modifier: private final
focal_class.original_string: private final URL jarFile;
focal_class.type: URL
focal_class.var_name: jarFile
focal_class.declarator: args
focal_class.modifier: private final
focal_class.original_string: private final String[] args;
focal_class.type: String[]
focal_class.var_name: args
focal_class.declarator: program
focal_class.modifier: private final
focal_class.original_string: private final Program program;
focal_class.type: Program
focal_class.var_name: program
focal_class.declarator: mainClass
focal_class.modifier: private final
focal_class.original_string: private final Class<?> mainClass;
focal_class.type: Class<?>
focal_class.var_name: mainClass
focal_class.declarator: extractedTempLibraries
focal_class.modifier: private final
focal_class.original_string: private final List<File> extractedTempLibraries;
focal_class.type: List<File>
focal_class.var_name: extractedTempLibraries
focal_class.declarator: classpaths
focal_class.modifier: private final
focal_class.original_string: private final List<URL> classpaths;
focal_class.type: List<URL>
focal_class.var_name: classpaths
focal_class.declarator: userCodeClassLoader
focal_class.modifier: private
focal_class.original_string: private ClassLoader userCodeClassLoader;
focal_class.type: ClassLoader
focal_class.var_name: userCodeClassLoader
focal_class.declarator: plan
focal_class.modifier: private
focal_class.original_string: private Plan plan;
focal_class.type: Plan
focal_class.var_name: plan
focal_class.declarator: savepointPath
focal_class.modifier: private
focal_class.original_string: private String savepointPath;
focal_class.type: String
focal_class.var_name: savepointPath
focal_class.file: flink-clients/src/main/java/org/apache/flink/client/program/PackagedProgram.java
focal_class.identifier: PackagedProgram
focal_class.class_method_signature: PackagedProgram.PackagedProgram(File jarFile, String... args)
focal_class.full_signature: public  PackagedProgram(File jarFile, String... args)
focal_class.identifier: PackagedProgram
focal_class.modifiers: public
focal_class.parameters: (File jarFile, String... args)
focal_class.signature:  PackagedProgram(File jarFile, String... args)
focal_class.class_method_signature: PackagedProgram.PackagedProgram(File jarFile, List<URL> classpaths, String... args)
focal_class.full_signature: public  PackagedProgram(File jarFile, List<URL> classpaths, String... args)
focal_class.identifier: PackagedProgram
focal_class.modifiers: public
focal_class.parameters: (File jarFile, List<URL> classpaths, String... args)
focal_class.signature:  PackagedProgram(File jarFile, List<URL> classpaths, String... args)
focal_class.class_method_signature: PackagedProgram.PackagedProgram(File jarFile, String entryPointClassName, String... args)
focal_class.full_signature: public  PackagedProgram(File jarFile, String entryPointClassName, String... args)
focal_class.identifier: PackagedProgram
focal_class.modifiers: public
focal_class.parameters: (File jarFile, String entryPointClassName, String... args)
focal_class.signature:  PackagedProgram(File jarFile, String entryPointClassName, String... args)
focal_class.class_method_signature: PackagedProgram.PackagedProgram(File jarFile, List<URL> classpaths, String entryPointClassName, String... args)
focal_class.full_signature: public  PackagedProgram(File jarFile, List<URL> classpaths, String entryPointClassName, String... args)
focal_class.identifier: PackagedProgram
focal_class.modifiers: public
focal_class.parameters: (File jarFile, List<URL> classpaths, String entryPointClassName, String... args)
focal_class.signature:  PackagedProgram(File jarFile, List<URL> classpaths, String entryPointClassName, String... args)
focal_class.class_method_signature: PackagedProgram.PackagedProgram(Class<?> entryPointClass, String... args)
focal_class.full_signature:   PackagedProgram(Class<?> entryPointClass, String... args)
focal_class.identifier: PackagedProgram
focal_class.parameters: (Class<?> entryPointClass, String... args)
focal_class.signature:  PackagedProgram(Class<?> entryPointClass, String... args)
focal_class.class_method_signature: PackagedProgram.setSavepointPath(String savepointPath)
focal_class.full_signature: public void setSavepointPath(String savepointPath)
focal_class.identifier: setSavepointPath
focal_class.modifiers: public
focal_class.parameters: (String savepointPath)
focal_class.return: void
focal_class.signature: void setSavepointPath(String savepointPath)
focal_class.class_method_signature: PackagedProgram.getSavepointPath()
focal_class.full_signature: public String getSavepointPath()
focal_class.identifier: getSavepointPath
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getSavepointPath()
focal_class.class_method_signature: PackagedProgram.getArguments()
focal_class.full_signature: public String[] getArguments()
focal_class.identifier: getArguments
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String[]
focal_class.signature: String[] getArguments()
focal_class.class_method_signature: PackagedProgram.getMainClassName()
focal_class.full_signature: public String getMainClassName()
focal_class.identifier: getMainClassName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getMainClassName()
focal_class.class_method_signature: PackagedProgram.isUsingInteractiveMode()
focal_class.full_signature: public boolean isUsingInteractiveMode()
focal_class.identifier: isUsingInteractiveMode
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isUsingInteractiveMode()
focal_class.class_method_signature: PackagedProgram.isUsingProgramEntryPoint()
focal_class.full_signature: public boolean isUsingProgramEntryPoint()
focal_class.identifier: isUsingProgramEntryPoint
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isUsingProgramEntryPoint()
focal_class.class_method_signature: PackagedProgram.getPlanWithJars()
focal_class.full_signature: public JobWithJars getPlanWithJars()
focal_class.identifier: getPlanWithJars
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: JobWithJars
focal_class.signature: JobWithJars getPlanWithJars()
focal_class.class_method_signature: PackagedProgram.getPreviewPlan()
focal_class.full_signature: public String getPreviewPlan()
focal_class.identifier: getPreviewPlan
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getPreviewPlan()
focal_class.class_method_signature: PackagedProgram.getDescription()
focal_class.full_signature: public String getDescription()
focal_class.identifier: getDescription
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDescription()
focal_class.class_method_signature: PackagedProgram.invokeInteractiveModeForExecution()
focal_class.full_signature: public void invokeInteractiveModeForExecution()
focal_class.identifier: invokeInteractiveModeForExecution
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void invokeInteractiveModeForExecution()
focal_class.class_method_signature: PackagedProgram.getClasspaths()
focal_class.full_signature: public List<URL> getClasspaths()
focal_class.identifier: getClasspaths
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<URL>
focal_class.signature: List<URL> getClasspaths()
focal_class.class_method_signature: PackagedProgram.getUserCodeClassLoader()
focal_class.full_signature: public ClassLoader getUserCodeClassLoader()
focal_class.identifier: getUserCodeClassLoader
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ClassLoader
focal_class.signature: ClassLoader getUserCodeClassLoader()
focal_class.class_method_signature: PackagedProgram.getAllLibraries()
focal_class.full_signature: public List<URL> getAllLibraries()
focal_class.identifier: getAllLibraries
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<URL>
focal_class.signature: List<URL> getAllLibraries()
focal_class.class_method_signature: PackagedProgram.deleteExtractedLibraries()
focal_class.full_signature: public void deleteExtractedLibraries()
focal_class.identifier: deleteExtractedLibraries
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void deleteExtractedLibraries()
focal_class.class_method_signature: PackagedProgram.getPlan()
focal_class.full_signature: private Plan getPlan()
focal_class.identifier: getPlan
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Plan
focal_class.signature: Plan getPlan()
focal_class.class_method_signature: PackagedProgram.hasMainMethod(Class<?> entryClass)
focal_class.full_signature: private static boolean hasMainMethod(Class<?> entryClass)
focal_class.identifier: hasMainMethod
focal_class.modifiers: private static
focal_class.parameters: (Class<?> entryClass)
focal_class.return: boolean
focal_class.signature: boolean hasMainMethod(Class<?> entryClass)
focal_class.class_method_signature: PackagedProgram.callMainMethod(Class<?> entryClass, String[] args)
focal_class.full_signature: private static void callMainMethod(Class<?> entryClass, String[] args)
focal_class.identifier: callMainMethod
focal_class.modifiers: private static
focal_class.parameters: (Class<?> entryClass, String[] args)
focal_class.return: void
focal_class.signature: void callMainMethod(Class<?> entryClass, String[] args)
focal_class.class_method_signature: PackagedProgram.getEntryPointClassNameFromJar(URL jarFile)
focal_class.full_signature: private static String getEntryPointClassNameFromJar(URL jarFile)
focal_class.identifier: getEntryPointClassNameFromJar
focal_class.modifiers: private static
focal_class.parameters: (URL jarFile)
focal_class.return: String
focal_class.signature: String getEntryPointClassNameFromJar(URL jarFile)
focal_class.class_method_signature: PackagedProgram.loadMainClass(String className, ClassLoader cl)
focal_class.full_signature: private static Class<?> loadMainClass(String className, ClassLoader cl)
focal_class.identifier: loadMainClass
focal_class.modifiers: private static
focal_class.parameters: (String className, ClassLoader cl)
focal_class.return: Class<?>
focal_class.signature: Class<?> loadMainClass(String className, ClassLoader cl)
focal_class.class_method_signature: PackagedProgram.createPlanFromProgram(Program program, String[] options)
focal_class.full_signature: private static Plan createPlanFromProgram(Program program, String[] options)
focal_class.identifier: createPlanFromProgram
focal_class.modifiers: private static
focal_class.parameters: (Program program, String[] options)
focal_class.return: Plan
focal_class.signature: Plan createPlanFromProgram(Program program, String[] options)
focal_class.class_method_signature: PackagedProgram.extractContainedLibaries(URL jarFile)
focal_class.full_signature: private static List<File> extractContainedLibaries(URL jarFile)
focal_class.identifier: extractContainedLibaries
focal_class.modifiers: private static
focal_class.parameters: (URL jarFile)
focal_class.return: List<File>
focal_class.signature: List<File> extractContainedLibaries(URL jarFile)
focal_class.class_method_signature: PackagedProgram.deleteExtractedLibraries(List<File> tempLibraries)
focal_class.full_signature: private static void deleteExtractedLibraries(List<File> tempLibraries)
focal_class.identifier: deleteExtractedLibraries
focal_class.modifiers: private static
focal_class.parameters: (List<File> tempLibraries)
focal_class.return: void
focal_class.signature: void deleteExtractedLibraries(List<File> tempLibraries)
focal_class.class_method_signature: PackagedProgram.checkJarFile(URL jarfile)
focal_class.full_signature: private static void checkJarFile(URL jarfile)
focal_class.identifier: checkJarFile
focal_class.modifiers: private static
focal_class.parameters: (URL jarfile)
focal_class.return: void
focal_class.signature: void checkJarFile(URL jarfile)
focal_method.body: public String getPreviewPlan() throws ProgramInvocationException {
  		Thread.currentThread().setContextClassLoader(this.getUserCodeClassLoader());
  		List<DataSinkNode> previewPlan;
  		
  		if (isUsingProgramEntryPoint()) {
  			previewPlan = Optimizer.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 if (env.preview != null) {
  					return env.preview;
  				} else {
  					throw new ProgramInvocationException("The program caused an error: ", t);
  				}
  			}
  			finally {
  				env.unsetAsContext();
  			}
  			
  			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);
  		try (PrintWriter pw = new PrintWriter(string)) {
  			jsonGen.dumpPactPlanAsJSON(previewPlan, pw);
  		}
  		return string.toString();
  
  	}
focal_method.class_method_signature: PackagedProgram.getPreviewPlan()
focal_method.full_signature: public String getPreviewPlan()
focal_method.identifier: getPreviewPlan
focal_method.invocations: setContextClassLoader currentThread getUserCodeClassLoader isUsingProgramEntryPoint createPreOptimizedPlan getPlan isUsingInteractiveMode setAsContext invokeInteractiveModeForExecution unsetAsContext dumpPactPlanAsJSON toString
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: String
focal_method.signature: String getPreviewPlan()