boolean incRef() {
    while (true) {
      int value = refCount.get();
      if (value == EVICTED_REFCOUNT) return false;
      if (value == EVICTING_REFCOUNT) continue; // spin until it resolves; extremely rare
      assert value >= 0;
      if (refCount.compareAndSet(value, value + 1)) return true;
    }
  }
Class used for a single file in LowLevelCacheImpl, etc.
llap-server/src/java/org/apache/hadoop/hive/llap/cache/FileCache.java