private void cancelDiscard(LlapAllocatorBuffer buf, int arenaIx) {
    Boolean result = buf.cancelDiscard();
    if (result == null) return;
    // If the result is not null, the buffer was evicted during the move.
    if (result) {
      long memUsage = buf.getMemoryUsage(); // Release memory - simple deallocation.
      arenas[arenaIx].deallocate(buf, true);
      memoryManager.releaseMemory(memUsage);
    } else {
      arenas[arenaIx].deallocate(buf, true); // No need to release memory - cache eviction.
    }
  }
Unlocks the buffer after the discard has been abandoned.
llap-server/src/java/org/apache/hadoop/hive/llap/cache/BuddyAllocator.java