@Test public void makeRequest() throws TException { Endpoint web = Endpoint.newBuilder().serviceName("web").ip("127.0.0.1").build(); Span span1 = Span.newBuilder() .traceId(FinagleTestObjects.root.traceId().toString()) .id(FinagleTestObjects.root.spanId().toLong()) .name("get") .timestamp(FinagleTestObjects.TODAY * 1000) .duration(1000L) .kind(Span.Kind.SERVER) .localEndpoint(web) .build(); Span span2 = span1 .toBuilder() .kind(Span.Kind.CLIENT) .parentId(FinagleTestObjects.child.parentId().toLong()) .id(FinagleTestObjects.child.spanId().toLong()) .build(); new ScribeSender(config) .makeRequest( asList(SpanBytesEncoder.THRIFT.encode(span1), SpanBytesEncoder.THRIFT.encode(span2))); }
@Override protected ThriftClientRequest makeRequest(List<byte[]> spans) throws TException { int encodedSize = InternalScribeCodec.messageSizeInBytes(category, spans); TMemoryBuffer mem = new TMemoryBuffer(encodedSize); TBinaryProtocol prot = new TBinaryProtocol(mem); InternalScribeCodec.writeLogRequest(category, spans, 0, prot); return new ThriftClientRequest(mem.getArray(), false); }
ScribeSender extends FinagleSender<Config, ThriftClientRequest, Void> { @Override protected ThriftClientRequest makeRequest(List<byte[]> spans) throws TException { int encodedSize = InternalScribeCodec.messageSizeInBytes(category, spans); TMemoryBuffer mem = new TMemoryBuffer(encodedSize); TBinaryProtocol prot = new TBinaryProtocol(mem); InternalScribeCodec.writeLogRequest(category, spans, 0, prot); return new ThriftClientRequest(mem.getArray(), false); } }
ScribeSender extends FinagleSender<Config, ThriftClientRequest, Void> { @Override protected ThriftClientRequest makeRequest(List<byte[]> spans) throws TException { int encodedSize = InternalScribeCodec.messageSizeInBytes(category, spans); TMemoryBuffer mem = new TMemoryBuffer(encodedSize); TBinaryProtocol prot = new TBinaryProtocol(mem); InternalScribeCodec.writeLogRequest(category, spans, 0, prot); return new ThriftClientRequest(mem.getArray(), false); } ScribeSender(Config config); }
ScribeSender extends FinagleSender<Config, ThriftClientRequest, Void> { @Override protected ThriftClientRequest makeRequest(List<byte[]> spans) throws TException { int encodedSize = InternalScribeCodec.messageSizeInBytes(category, spans); TMemoryBuffer mem = new TMemoryBuffer(encodedSize); TBinaryProtocol prot = new TBinaryProtocol(mem); InternalScribeCodec.writeLogRequest(category, spans, 0, prot); return new ThriftClientRequest(mem.getArray(), false); } ScribeSender(Config config); @Override int messageSizeInBytes(int encodedSizeInBytes); @Override int messageSizeInBytes(List<byte[]> spans); @Override Encoding encoding(); @Override int messageMaxBytes(); @Override final String toString(); }
ScribeSender extends FinagleSender<Config, ThriftClientRequest, Void> { @Override protected ThriftClientRequest makeRequest(List<byte[]> spans) throws TException { int encodedSize = InternalScribeCodec.messageSizeInBytes(category, spans); TMemoryBuffer mem = new TMemoryBuffer(encodedSize); TBinaryProtocol prot = new TBinaryProtocol(mem); InternalScribeCodec.writeLogRequest(category, spans, 0, prot); return new ThriftClientRequest(mem.getArray(), false); } ScribeSender(Config config); @Override int messageSizeInBytes(int encodedSizeInBytes); @Override int messageSizeInBytes(List<byte[]> spans); @Override Encoding encoding(); @Override int messageMaxBytes(); @Override final String toString();  }