@Override
public DependencyLinkSpan next() {
Record5<Long, Long, Long, String, String> row = delegate.next();
DependencyLinkSpan.Builder result = DependencyLinkSpan.builder(
row.getValue(ZipkinSpans.ZIPKIN_SPANS.PARENT_ID),
row.getValue(ZipkinSpans.ZIPKIN_SPANS.ID)
);
parseClientAndServerNames(
result,
row.getValue(ZIPKIN_ANNOTATIONS.A_KEY),
row.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME));
while (hasNext()) {
Record5<Long, Long, Long, String, String> next = delegate.peek();
if (next == null) {
continue;
}
if (row.getValue(ZipkinSpans.ZIPKIN_SPANS.ID).equals(next.getValue(ZipkinSpans.ZIPKIN_SPANS.ID))) {
delegate.next();
parseClientAndServerNames(
result,
next.getValue(ZIPKIN_ANNOTATIONS.A_KEY),
next.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME));
} else {
break;
}
}
return result.build();
}