public void add(final E e) {
    if (e == null) {
      throw new IllegalArgumentException("Null element is not allowed.");
    }

    final LinkedListNode<E> newNode = new LinkedListNode<>(e);
    lock.writeLock().lock();
    try {
      if (firstNode == pilotNode) {
        firstIndex = tailIndex;
        firstNode = newNode;
        // Always explicitly set pilotNode.next to firstNode
        pilotNode.next = newNode;
      }

      ++tailIndex;
      // If firstNode == pilotNode, then lastNode == pilotNode
      lastNode.next = newNode;
      lastNode = newNode;

      hasNextCondition.signalAll();
    } finally {
      lock.writeLock().unlock();
    }
  }
Add an element to the tail of the queue.

@param e the element to be added, which cannot be {@code null}
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/queue/ConcurrentIterableLinkedQueue.java