final String rootpath = artifactPath.getAbsolutePath();
final String pfpath = asPath(rootpath, PRUNED_PF_NAME);
createDirectories(pfpath);
try {
TextProtoNetworkExternalizer textExternalizer =
new TextProtoNetworkExternalizer();
textExternalizer.writeProtoNetwork(pfpn, pfpath);
} catch (ProtoNetworkError e) {
stageError(e.getUserFacingMessage());
}
}
stageOutput("Merging proto-networks");
t1 = currentTimeMillis();
try {
p3.merge(pn, pfpn);
// Change the input proto-network descriptor to merged network
ProtoNetworkExternalizer pne = new BinaryProtoNetworkExternalizer();
final String artpath = artifactPath.getAbsolutePath();
final String s1path = asPath(artpath, STAGE1_OUTPUT);
createDirectoryArtifact(artifactPath, STAGE1_OUTPUT);
pne.writeProtoNetwork(pn, s1path);
// if debug, then save the text-based merged network
if (withDebug()) {
TextProtoNetworkExternalizer textExternalizer =
new TextProtoNetworkExternalizer();
textExternalizer.writeProtoNetwork(pn, s1path);
}
} catch (ProtoNetworkError e) {
stageError(e.getUserFacingMessage());
bail(FAILED_TO_MERGE_PROTO_NETWORKS);
return pn; // Dead code