@Override
    public boolean hasNext() {
      lock.readLock().lock();
      try {
        return !isClosed && currentNode.next != null;
      } finally {
        lock.readLock().unlock();
      }
    }
Get the next element in the queue. If the queue is empty, wait for the next element to be
added.

@param waitTimeMillis the maximum time to wait in milliseconds
@return the next element in the queue. {@code null} if the queue is closed, or if the waiting
    time elapsed, or the thread is interrupted
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/queue/ConcurrentIterableLinkedQueue.java