@Override
  public long evictSomeBlocks(long memoryToReserve) {
    // In normal case, we evict the items from the list.
    long evicted = evictFromList(memoryToReserve);
    if (evicted >= memoryToReserve) {
      return evicted;
    }
    // This should not happen unless we are evicting a lot at once, or buffers are large (so
    // there's a small number of buffers and they all live in the heap).
    long time = timer.get();
    while (evicted < memoryToReserve) {
      LlapCacheableBuffer buffer;
      heapLock.lock();
      try {
        buffer = evictFromHeapUnderLock(time);
      } finally {
        heapLock.unlock();
      }
      if (buffer == null) {
        return evicted;
      }
      evicted += buffer.getMemoryUsage();
      evictionListener.notifyEvicted(buffer);
    }
    return evicted;
  }
Flushes all BPWrappers which will in turn clear IO-Threads' threadlocal buffers.
llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelLrfuCachePolicy.java