Java Code Examples for zipkin2.codec.SpanBytesEncoder#THRIFT

The following examples show how to use zipkin2.codec.SpanBytesEncoder#THRIFT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: URLConnectionSenderTest.java    From zipkin-reporter-java with Apache License 2.0 6 votes vote down vote up
Call<Void> send(Span... spans) {
  SpanBytesEncoder bytesEncoder;
  switch (sender.encoding()) {
    case JSON:
      bytesEncoder = SpanBytesEncoder.JSON_V2;
      break;
    case THRIFT:
      bytesEncoder = SpanBytesEncoder.THRIFT;
      break;
    case PROTO3:
      bytesEncoder = SpanBytesEncoder.PROTO3;
      break;
    default:
      throw new UnsupportedOperationException("encoding: " + sender.encoding());
  }
  return sender.sendSpans(Stream.of(spans).map(bytesEncoder::encode).collect(toList()));
}
 
Example 2
Source File: ITKafkaSender.java    From zipkin-reporter-java with Apache License 2.0 6 votes vote down vote up
Call<Void> send(Span... spans) {
  SpanBytesEncoder bytesEncoder;
  switch (sender.encoding()) {
    case JSON:
      bytesEncoder = SpanBytesEncoder.JSON_V2;
      break;
    case THRIFT:
      bytesEncoder = SpanBytesEncoder.THRIFT;
      break;
    case PROTO3:
      bytesEncoder = SpanBytesEncoder.PROTO3;
      break;
    default:
      throw new UnsupportedOperationException("encoding: " + sender.encoding());
  }
  return sender.sendSpans(Stream.of(spans).map(bytesEncoder::encode).collect(toList()));
}
 
Example 3
Source File: OkHttpSenderTest.java    From zipkin-reporter-java with Apache License 2.0 6 votes vote down vote up
Call<Void> send(Span... spans) {
  SpanBytesEncoder bytesEncoder;
  switch (sender.encoding()) {
    case JSON:
      bytesEncoder = SpanBytesEncoder.JSON_V2;
      break;
    case THRIFT:
      bytesEncoder = SpanBytesEncoder.THRIFT;
      break;
    case PROTO3:
      bytesEncoder = SpanBytesEncoder.PROTO3;
      break;
    default:
      throw new UnsupportedOperationException("encoding: " + sender.encoding());
  }
  return sender.sendSpans(Stream.of(spans).map(bytesEncoder::encode).collect(toList()));
}
 
Example 4
Source File: ITActiveMQSender.java    From zipkin-reporter-java with Apache License 2.0 6 votes vote down vote up
Call<Void> send(Span... spans) {
  SpanBytesEncoder bytesEncoder;
  switch (sender.encoding()) {
    case JSON:
      bytesEncoder = SpanBytesEncoder.JSON_V2;
      break;
    case THRIFT:
      bytesEncoder = SpanBytesEncoder.THRIFT;
      break;
    case PROTO3:
      bytesEncoder = SpanBytesEncoder.PROTO3;
      break;
    default:
      throw new UnsupportedOperationException("encoding: " + sender.encoding());
  }
  return sender.sendSpans(Stream.of(spans).map(bytesEncoder::encode).collect(toList()));
}
 
Example 5
Source File: ITKafkaSender.java    From zipkin-reporter-java with Apache License 2.0 6 votes vote down vote up
Call<Void> send(Span... spans) {
  SpanBytesEncoder bytesEncoder;
  switch (sender.encoding()) {
    case JSON:
      bytesEncoder = SpanBytesEncoder.JSON_V2;
      break;
    case THRIFT:
      bytesEncoder = SpanBytesEncoder.THRIFT;
      break;
    case PROTO3:
      bytesEncoder = SpanBytesEncoder.PROTO3;
      break;
    default:
      throw new UnsupportedOperationException("encoding: " + sender.encoding());
  }
  return sender.sendSpans(Stream.of(spans).map(bytesEncoder::encode).collect(toList()));
}
 
Example 6
Source File: FakeSender.java    From zipkin-finagle with Apache License 2.0 5 votes vote down vote up
static FakeSender create() {
  return new FakeSender(
      Encoding.THRIFT,
      Integer.MAX_VALUE,
      BytesMessageEncoder.forEncoding(Encoding.THRIFT),
      SpanBytesEncoder.THRIFT,
      SpanBytesDecoder.THRIFT,
      spans -> {
      }
  );
}
 
Example 7
Source File: ScribeZipkinTracerIntegrationTest.java    From zipkin-finagle with Apache License 2.0 4 votes vote down vote up
/** Scribe can only use thrift */
@Override protected SpanBytesEncoder encoder() {
  return SpanBytesEncoder.THRIFT;
}