public boolean isClosed() {
      return isClosed;
    }
Seek to the given index, which represents the index of the next element to be returned. If
the given index is smaller than {@link ConcurrentIterableLinkedQueue#firstIndex}, the
iterator will be reset to the earliest element. If the given index is larger than {@link
ConcurrentIterableLinkedQueue#tailIndex}, the iterator will be reset to the latest element.
Otherwise, the iterator will be reset to the element whose index is the given index.

@param newNextIndex the given index
@return the actual index of the next element to be returned
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/queue/ConcurrentIterableLinkedQueue.java