public T get() {
    return threadLocalMap.computeIfAbsent(Thread.currentThread(), thread -> initialValue.get());
  }
This class has similar functionality as {@link ThreadLocal}.
Plus it provides a close function to clean up resources in all threads where the resource was initialized.
@param <T> - type of resource, it must implement {@link AutoCloseable}
ql/src/java/org/apache/hadoop/hive/ql/util/CloseableThreadLocal.java