@Override
  public void run(HookContext hookContext) throws Exception {

    PlanMapper pm = ((PrivateHookContext) hookContext).getContext().getPlanMapper();

    List<OpTreeSignature> sigs = pm.getAll(OpTreeSignature.class);

    for (OpTreeSignature sig : sigs) {
      try {
        OpTreeSignature sig2 = persistenceLoop(sig, OpTreeSignature.class);
        sig.getSig().proveEquals(sig2.getSig());
      } catch (Exception e) {
        throw new RuntimeException("while checking the signature of: " + sig.getSig(), e);
      }
    }
    for (OpTreeSignature sig : sigs) {
      try {
        OpTreeSignature sig2 = persistenceLoop(sig, OpTreeSignature.class);
        if (!sig.equals(sig2)) {
          throw new RuntimeException("signature mismatch");
        }
      } catch (Exception e) {
        throw new RuntimeException("while checking the signature of: " + sig.getSig(), e);
      }
    }
    LOG.debug("signature checked: " + sigs.size());
  }
This hook adds a persistence loop-back ensure that runtime statistics could be used.
ql/src/java/org/apache/hadoop/hive/ql/hooks/RuntimeStatsPersistenceCheckerHook.java