use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.
the class TCPServerResponse method write.
@Override
public void write(TBase<?, ?> message) {
Objects.requireNonNull(message, "message");
if (closed) {
throw new IllegalStateException("ServerResponse is closed");
}
closed = true;
try {
HeaderTBaseSerializer serializer = serializerFactory.createSerializer();
byte[] resultBytes = serializer.serialize(message);
pinpointSocket.response(requestId, resultBytes);
} catch (TException e) {
handleTException(message, e);
}
}
use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.
the class SpanStreamUdpSender method handleSpan.
private void handleSpan(Span span) {
if (span == null) {
return;
}
HeaderTBaseSerializer serializer = serializerPool.getObject();
PartitionedByteBufferLocator partitionedByteBufferLocator = spanStreamSendDataSerializer.serializeSpanStream(serializer, span);
if (partitionedByteBufferLocator == null) {
serializerPool.returnObject(serializer);
return;
}
doAddAndFlush(partitionedByteBufferLocator, serializer);
}
use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.
the class SpanStreamUdpSender method handleSpanChunk.
// streaming
private void handleSpanChunk(SpanChunk spanChunk) {
if (spanChunk == null) {
return;
}
HeaderTBaseSerializer serializer = serializerPool.getObject();
PartitionedByteBufferLocator partitionedByteBufferLocator = spanStreamSendDataSerializer.serializeSpanChunkStream(serializer, spanChunk);
if (partitionedByteBufferLocator == null) {
serializerPool.returnObject(serializer);
return;
}
doAddAndFlush(partitionedByteBufferLocator, serializer);
}
use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.
the class SpanChunkStreamSendDataPlanerTest method setUp.
@BeforeClass
public static void setUp() {
HeaderTBaseSerializerPoolFactory serializerFactory = new HeaderTBaseSerializerPoolFactory(true, 1000, true);
objectPool = new ObjectPool<HeaderTBaseSerializer>(serializerFactory, 16);
spanChunkFactory = new DefaultSpanChunkFactory("applicationName", "agentId", 0, ServiceType.STAND_ALONE);
}
use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.
the class NetworkAvailabilityChecker method getNetworkCheckPayload.
private static byte[] getNetworkCheckPayload() throws TException {
HeaderTBaseSerializer serializer = new HeaderTBaseSerializerFactory(false, 65535, false).createSerializer();
byte[] payload = serializer.serialize(new NetworkAvailabilityCheckPacket());
int size = serializer.getInterBufferSize();
return Arrays.copyOf(payload, size);
}
Aggregations