@Override
    public Iterator<Span> next() {
      if (!hasNext()) throw new NoSuchElementException();
      currentTraceIdHi = hasTraceIdHigh ? traceIdHigh(delegate) : 0L;
      currentTraceIdLo = delegate.peek().getValue(ZipkinSpans.ZIPKIN_SPANS.TRACE_ID);
      return new DependencyLinkV2SpanIterator(delegate, currentTraceIdHi, currentTraceIdLo);
    }
Assumes the input records are sorted by trace id, span id
zipkin-storage/mysql-v1/src/main/java/zipkin2/storage/mysql/v1/DependencyLinkV2SpanIterator.java