public JSONObject outputDependencies(PrintStream out, boolean jsonOutput, boolean appendTaskType, List<Task> tasks) throws Exception { if (out != null) { out.println(STAGE_DEPENDENCIES + ":"); } JSONObject json = jsonOutput ? new JSONObject(new LinkedHashMap<>()) : null; for (Task task : tasks) { JSONObject jsonOut = outputDependencies(task, out, json, jsonOutput, appendTaskType, 2); if (jsonOutput && jsonOut != null) { json.put(task.getId(), jsonOut); } } return jsonOutput ? json : null; }
public JSONObject outputDependencies(PrintStream out, boolean jsonOutput, boolean appendTaskType, List<Task> tasks) throws Exception { if (out != null) { out.println("STAGE DEPENDENCIES:"); } JSONObject json = jsonOutput ? new JSONObject(new LinkedHashMap<>()) : null; for (Task task : tasks) { JSONObject jsonOut = outputDependencies(task, out, json, jsonOutput, appendTaskType, 2); if (jsonOutput && jsonOut != null) { json.put(task.getId(), jsonOut); } } return jsonOutput ? json : null; }
JSONObject jsonDependencies = outputDependencies(out, jsonOutput, appendTaskType, ordered);
@Test public void testOutputDependenciesJsonShouldMatch() throws Exception { Task<? extends ExplainTask> task = mockTask(); JsonNode result = objectMapper.readTree( uut.outputDependencies(task, out, null, true, true, 0).toString()); JsonNode expected = objectMapper.readTree("{\"ROOT STAGE\":\"TRUE\",\"BACKUP STAGE\":" + "\""+BACKUP_ID+"\",\"TASK TYPE\":\"EXPLAIN\"}"); assertEquals(expected, result); }
JSONObject jsonDependencies = outputDependencies(out, jsonOutput, appendTaskType, ordered);
public void outputDependencies(PrintStream out, List<Task<? extends Serializable>> rootTasks, int indent) throws Exception { out.print(indentString(indent)); out.println("STAGE DEPENDENCIES:"); for (Task<? extends Serializable> rootTask : rootTasks) { outputDependencies(rootTask, out, indent + 2, true); } }
public JSONObject outputDependencies(PrintStream out, boolean jsonOutput, boolean appendTaskType, List<Task> tasks) throws Exception { if (out != null) { out.println("STAGE DEPENDENCIES:"); } JSONObject json = jsonOutput ? new JSONObject() : null; for (Task task : tasks) { JSONObject jsonOut = outputDependencies(task, out, json, jsonOutput, appendTaskType, 2); if (jsonOutput && jsonOut != null) { json.put(task.getId(), jsonOut); } } return jsonOutput ? json : null; }
@Override public int execute(DriverContext driverContext) { try { Path resFile = new Path(work.getResFile()); OutputStream outS = resFile.getFileSystem(conf).create(resFile); PrintStream out = new PrintStream(outS); // Print out the parse AST outputAST(work.getAstStringTree(), out, 0); out.println(); outputDependencies(out, work.getRootTasks(), 0); out.println(); // Go over all the tasks and dump out the plans outputStagePlans(out, work.getRootTasks(), 0); out.close(); return (0); } catch (Exception e) { console.printError("Failed with exception " + e.getMessage(), "\n" + StringUtils.stringifyException(e)); return (1); } }
for (Task<? extends Serializable> con : ((ConditionalTask) task) .getListTasks()) { outputDependencies(con, out, indent, false); outputDependencies(child, out, indent, true);
JSONObject jsonDependencies = outputDependencies(out, jsonOutput, appendTaskType, ordered);