@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(); // advance the iterator since we are in the same span id parseClientAndServerNames( result, next.getValue(ZIPKIN_ANNOTATIONS.A_KEY), next.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME)); } else { break; } } return result.build(); }
@Override public DependencyLinkSpan next() { Record5<Long, Long, Long, String, String> row = delegate.next(); DependencyLinkSpan.Builder result = new DependencyLinkSpan.Builder( row.getValue(ZIPKIN_SPANS.PARENT_ID), row.getValue(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(ZIPKIN_SPANS.ID).equals(next.getValue(ZIPKIN_SPANS.ID))) { delegate.next(); // advance the iterator since we are in the same span id parseClientAndServerNames( result, next.getValue(ZIPKIN_ANNOTATIONS.A_KEY), next.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME)); } else { break; } } return result.build(); }
@Override public DependencyLinkSpan next() { Record5<Long, Long, Long, String, String> row = delegate.next(); DependencyLinkSpan.Builder result = new DependencyLinkSpan.Builder( row.getValue(ZIPKIN_SPANS.PARENT_ID), row.getValue(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(ZIPKIN_SPANS.ID).equals(next.getValue(ZIPKIN_SPANS.ID))) { delegate.next(); // advance the iterator since we are in the same span id parseClientAndServerNames( result, next.getValue(ZIPKIN_ANNOTATIONS.A_KEY), next.getValue(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME)); } else { break; } } return result.build(); }
break; // if we are in a new span Record next = delegate.next(); // row for the same span