@Override public void incrementSpanBytes(int i) { delegate.incrementBytes(i); }
.map(m -> m.message.getBytes(StandardCharsets.ISO_8859_1)) .peek(b -> metrics.incrementBytes(b.length)) .map(SpanBytesDecoder.THRIFT::decodeOne) .collect(Collectors.toList());
public void acceptSpans( byte[] serializedSpans, BytesDecoder<Span> decoder, Callback<Void> callback) { metrics.incrementBytes(serializedSpans.length); List<Span> spans; try { spans = decodeList(decoder, serializedSpans); } catch (RuntimeException e) { callback.onError(errorReading(e)); return; } accept(spans, callback); }
public void acceptSpans(byte[] serialized, Callback<Void> callback) { BytesDecoder<Span> decoder; try { decoder = SpanBytesDecoderDetector.decoderForListMessage(serialized); } catch (RuntimeException e) { metrics.incrementBytes(serialized.length); callback.onError(errorReading(e)); return; } acceptSpans(serialized, decoder, callback); }
metrics.incrementBytes(bytes.length); try { Span span = SpanBytesDecoder.THRIFT.decodeOne(bytes);
@Override public void run() { ConsumerIterator<byte[], byte[]> messages = stream.iterator(); while (messages.hasNext()) { byte[] bytes = messages.next().message(); metrics.incrementMessages(); if (bytes.length < 2) { // need two bytes to check if protobuf metrics.incrementMessagesDropped(); continue; } // If we received legacy single-span encoding, decode it into a singleton list if (!protobuf3(bytes) && bytes[0] <= 16 && bytes[0] != 12 /* thrift, but not a list */) { try { metrics.incrementBytes(bytes.length); Span span = SpanBytesDecoder.THRIFT.decodeOne(bytes); collector.accept(Collections.singletonList(span), NOOP); } catch (RuntimeException e) { metrics.incrementMessagesDropped(); } } else { collector.acceptSpans(bytes, NOOP); } } }