public int size() {
    final ReentrantLock lock = this.lock;
    lock.lock();
    try {
      return queue.size();
    } finally {
      lock.unlock();
    }
  }
Add a hook for this queue. If an element is kicked out because the queue's size exceed the
largest value, the hook will apply to this element. Notice, multiple hooks can be added to a
queue, and all of them will be applied to the element kicked out. The order in which they are
applied depends on the order in which they were registered.

@param hook
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/FixedPriorityBlockingQueue.java