public void releaseReader() {
      int readerCount = 0;
      synchronized (this) {
        readerCount = readers.decrementAndGet();
      }
      LOG.debug("releaseReader: entry: {}, readerCount: {}", this, readerCount);

      cleanupIfNeeded();
    }
A class to handle management and lookup of cached Hive query results.
ql/src/java/org/apache/hadoop/hive/ql/cache/results/QueryResultsCache.java