@Override
  public <T> T retrieve(String key, Callable<T> fn) throws HiveException {
    T value = (T) cache.get(key);
    if (value != null || fn == null) {
      return value;
    }
    try {
      LOG.debug("Creating {}", key);
      value = fn.call();
    } catch (Exception e) {
      throw new HiveException(e);
    }
    T previous = (T) cache.putIfAbsent(key, value);
    return previous != null ? previous : value;
  }
ObjectCache. Simple implementation on MR we don't have a means to reuse
Objects between runs of the same task, this acts as a local cache.
ql/src/java/org/apache/hadoop/hive/ql/exec/mr/ObjectCache.java