private ByteBuffer getSerializedSargForMetastore(boolean isOriginal) {
    if (sarg == null) {
      return null;
    }
    ByteBuffer serializedSarg = isOriginal ? sargIsOriginal : sargNotIsOriginal;
    if (serializedSarg != null) {
      return serializedSarg;
    }
    SearchArgument sarg2 = sarg;
    Kryo kryo = SerializationUtilities.borrowKryo();
    try {
      if ((isOriginal ? sargNotIsOriginal : sargIsOriginal) == null) {
        sarg2 = kryo.copy(sarg2); // In case we need it for the other case.
      }
      translateSargToTableColIndexes(sarg2, conf, OrcInputFormat.getRootColumn(isOriginal));
      ExternalCache.Baos baos = new Baos();
      Output output = new Output(baos);
      kryo.writeObject(output, sarg2);
      output.flush();
      serializedSarg = baos.get();
      if (isOriginal) {
        sargIsOriginal = serializedSarg;
      } else {
        sargNotIsOriginal = serializedSarg;
      }
    } finally {
      SerializationUtilities.releaseKryo(kryo);
    }
    return serializedSarg;
  }
Metastore-based footer cache storing serialized footers. Also has a local cache.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/ExternalCache.java