@VisibleForTesting
  static void serializePlan(Object plan, OutputStream out, Configuration configuration) {
    Kryo kryo = borrowKryo(configuration);
    try {
      serializePlan(kryo, plan, out);
    } finally {
      releaseKryo(kryo);
    }
  }
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