public static <T> T deserializePlan(Kryo kryo, InputStream in, Class<T> planClass) {
    PerfLogger perfLogger = SessionState.getPerfLogger();
    perfLogger.perfLogBegin(CLASS_NAME, PerfLogger.DESERIALIZE_PLAN);
    T plan;
    LOG.info("Deserializing " + planClass.getSimpleName() + " using kryo");
    plan = deserializeObjectByKryo(kryo, in, planClass);
    perfLogger.perfLogEnd(CLASS_NAME, PerfLogger.DESERIALIZE_PLAN);
    return plan;
  }
Deserializes the plan.

@param in        The stream to read from.
@param planClass class of plan
@return The plan, such as QueryPlan, MapredWork, etc.
ql/src/java/org/apache/hadoop/hive/ql/exec/SerializationUtilities.java