private RuntimeStat encode(List<PersistedRuntimeStats> list) throws IOException {
    String payload = RuntimeStatsPersister.INSTANCE.encode(new ArrayList<PersistedRuntimeStats>(list));
    RuntimeStat rs = new RuntimeStat();
    rs.setWeight(list.size());
    rs.setPayload(ByteBuffer.wrap(payload.getBytes(Charsets.UTF_8)));
    return rs;
  }
Decorates a StatSource to be loaded and persisted in the metastore as well.
ql/src/java/org/apache/hadoop/hive/ql/plan/mapper/MetastoreStatsConnector.java