public static void serializePlan(Object plan, OutputStream out) {
    serializePlan(plan, out, null);
  }
Serializes the plan.

@param plan The plan, such as QueryPlan, MapredWork, etc.
@param out  The stream to write to.
ql/src/java/org/apache/hadoop/hive/ql/exec/SerializationUtilities.java