public void setFirstIndex(final long firstIndex) {
    lock.writeLock().lock();
    try {
      this.firstIndex = firstIndex;
      if (tailIndex < firstIndex) {
        tailIndex = firstIndex;
      }
    } finally {
      lock.writeLock().unlock();
    }
  }
Clear the queue. All elements will be removed. All iterators will be closed.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/queue/ConcurrentIterableLinkedQueue.java