code: public static String getOptimizedPlanAsJson(Optimizer compiler, PackagedProgram prog, int parallelism)
  			throws CompilerException, ProgramInvocationException {
  		PlanJSONDumpGenerator jsonGen = new PlanJSONDumpGenerator();
  		return jsonGen.getOptimizerPlanAsJSON((OptimizedPlan) getOptimizedPlan(compiler, prog, parallelism));
  	}
docs: ------------------------------------------------------------------------