components/global/core/io.cellery.observability.tracing.receiver/src/main/java/io/cellery/observability/tracing/receiver/internal/Codec.java
public static List<ZipkinSpan> decodeData(byte[] byteArray) {
        BytesDecoder<zipkin2.Span> spanBytesDecoder = SpanBytesDecoderDetector.decoderForListMessage(byteArray);
        if (logger.isDebugEnabled()) {
            logger.debug("Using " + spanBytesDecoder.getClass().getName() + " decoder for received tracing data");
        }
        List<zipkin2.Span> zipkin2Spans = spanBytesDecoder.decodeList(byteArray);

        List<ZipkinSpan> spans = new ArrayList<>();
        for (zipkin2.Span zipkin2Span : zipkin2Spans) {
            ZipkinSpan span = new ZipkinSpan();
            span.setTraceId(zipkin2Span.traceId());
            span.setId(zipkin2Span.id());
            span.setParentId(zipkin2Span.parentId());
            span.setName(zipkin2Span.name());
            span.setServiceName(zipkin2Span.localServiceName() != null ? zipkin2Span.localServiceName() : "");
            span.setKind(zipkin2Span.kind() != null ? zipkin2Span.kind().toString() : "");
            span.setTimestamp(zipkin2Span.timestampAsLong());
            span.setDuration(zipkin2Span.durationAsLong());
            span.setTags(zipkin2Span.tags());
            spans.add(span);
        }
        return spans;
    }
/**
     * Decode a default byte array.
     *
     * @param byteArray The byte array to decode
     * @return spans list
     */
Decode a default byte array.
@param byteArray The byte array to decode
@return spans list
Decode a default byte array . @param byteArray The byte array to decode @return spans list
public static List<ZipkinSpan> decodeData(byte[] byteArray) {
        BytesDecoder<zipkin2.Span> spanBytesDecoder = SpanBytesDecoderDetector.decoderForListMessage(byteArray);
        if (logger.isDebugEnabled()) {
            logger.debug("Using " + spanBytesDecoder.getClass().getName() + " decoder for received tracing data");
        }
        List<zipkin2.Span> zipkin2Spans = spanBytesDecoder.decodeList(byteArray);
        List<ZipkinSpan> spans = new ArrayList<>();
        for (zipkin2.Span zipkin2Span : zipkin2Spans) {
            ZipkinSpan span = new ZipkinSpan();
            span.setTraceId(zipkin2Span.traceId());
            span.setId(zipkin2Span.id());
            span.setParentId(zipkin2Span.parentId());
            span.setName(zipkin2Span.name());
            span.setServiceName(zipkin2Span.localServiceName() != null ? zipkin2Span.localServiceName() : "");
            span.setKind(zipkin2Span.kind() != null ? zipkin2Span.kind().toString() : "");
            span.setTimestamp(zipkin2Span.timestampAsLong());
            span.setDuration(zipkin2Span.durationAsLong());
            span.setTags(zipkin2Span.tags());
            spans.add(span);
        }
        return spans;
    }
public static List < ZipkinSpan > decodeData ( byte [ ] byteArray ) { BytesDecoder < zipkin2 . Span > spanBytesDecoder = SpanBytesDecoderDetector . decoderForListMessage ( byteArray ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Using " + spanBytesDecoder . getClass ( ) . getName ( ) + " decoder for received tracing data" ) ; } List < zipkin2 . Span > zipkin2Spans = spanBytesDecoder . decodeList ( byteArray ) ; List < ZipkinSpan > spans = new ArrayList < > ( ) ; for ( zipkin2 . Span zipkin2Span : zipkin2Spans ) { ZipkinSpan span = new ZipkinSpan ( ) ; span . setTraceId ( zipkin2Span . traceId ( ) ) ; span . setId ( zipkin2Span . id ( ) ) ; span . setParentId ( zipkin2Span . parentId ( ) ) ; span . setName ( zipkin2Span . name ( ) ) ; span . setServiceName ( zipkin2Span . localServiceName ( ) != null ? zipkin2Span . localServiceName ( ) : "" ) ; span . setKind ( zipkin2Span . kind ( ) != null ? zipkin2Span . kind ( ) . toString ( ) : "" ) ; span . setTimestamp ( zipkin2Span . timestampAsLong ( ) ) ; span . setDuration ( zipkin2Span . durationAsLong ( ) ) ; span . setTags ( zipkin2Span . tags ( ) ) ; spans . add ( span ) ; } return spans ; }
Decode a default byte array.
Decode a default byte array .