private boolean lockBuffer(LlapDataBuffer buffer, boolean doNotifyPolicy) {
    int rc = buffer.incRef();
    if (rc > 0) {
      metrics.incrCacheNumLockedBuffers();
    }
    if (doNotifyPolicy && rc == 1) {
      // We have just locked a buffer that wasn't previously locked.
      cachePolicy.notifyLock(buffer);
    }
    return rc > 0;
  }
Adds cached buffer to buffer list.
@param currentNotCached Pointer to the list node where we are inserting.
@param currentCached The cached buffer found for this node, to insert.
@return The new currentNotCached pointer, following the cached buffer insertion.
llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheImpl.java