Skip to content

Instantly share code, notes, and snippets.

@oza
Created February 21, 2014 04:11
Show Gist options
  • Save oza/9128583 to your computer and use it in GitHub Desktop.
Save oza/9128583 to your computer and use it in GitHub Desktop.
getDAGPlan
private DAGProtos.DAGPlan getDAGPlan() throws IOException {
String stagingDir = conf.get(TezConfiguration.TEZ_AM_STAGING_DIR,
TezConfiguration.TEZ_AM_STAGING_DIR_DEFAULT);
Path binaryPlan = new Path(
stagingDir, TezConfiguration.TEZ_PB_PLAN_BINARY_NAME);
FileInputStream dagPBBinaryStream = null;
DAGProtos.DAGPlan dagPlan = null;
try {
// Read the protobuf DAG
dagPBBinaryStream = new FileInputStream(binaryPlan.getName());
dagPlan = DAGProtos.DAGPlan.parseFrom(dagPBBinaryStream);
} finally {
if (dagPBBinaryStream != null) {
dagPBBinaryStream.close();
}
}
return dagPlan;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment