public boolean startMoveOrDiscard(int arenaIx, int headerIx, boolean isForceDiscard) {
    long oldValue, newValue;
    do {
      oldValue = state.get();
      if (State.getRefCount(oldValue) != 0) {
        return false;
      }
      int flags = State.getAllFlags(oldValue);
      // The only allowed flag is new-alloc, and that only if we are not discarding.
      if (flags != 0 && (isForceDiscard || flags != State.FLAG_NEW_ALLOC)) {
        return false; // We could start a move if it's being evicted, but let's not do it for now.
      }
      if (State.getArena(oldValue) != arenaIx || State.getHeader(oldValue) != headerIx) {
        return false; // The caller could re-check the location, but would probably find it locked.
      }
      newValue = State.setFlag(oldValue, State.FLAG_MOVING);
    } while (!state.compareAndSet(oldValue, newValue));
    if (LlapIoImpl.LOCKING_LOGGER.isTraceEnabled()) {
      LlapIoImpl.LOCKING_LOGGER.trace("Locked {} in preparation for a move", this);
    }
    return true;
  }
Marks this buffer as eligible for proactive eviction. No need to check refCount here.
@return buffer size
llap-server/src/java/org/apache/hadoop/hive/llap/cache/LlapAllocatorBuffer.java