private void reportRemoved(TagState state, long size) {
    synchronized (state) {
      --state.bufferCount;
      assert state.bufferCount >= 0;
      state.totalSize -= size;
      if (state.bufferCount == 0) {
        state.emptyTimeNs = System.nanoTime();
      }
    }
  }
A wrapper around cache eviction policy that tracks cache contents via tags.
llap-server/src/java/org/apache/hadoop/hive/llap/cache/CacheContentsTracker.java