Search in sources :

Example 1 with HeaderTBaseSerializer

use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.

the class SpanStreamSendDataPlanerTest method setUp.

@BeforeClass
public static void setUp() {
    HeaderTBaseSerializerPoolFactory serializerFactory = new HeaderTBaseSerializerPoolFactory(true, 1000, true);
    objectPool = new ObjectPool<HeaderTBaseSerializer>(serializerFactory, 16);
}
Also used : HeaderTBaseSerializer(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer) HeaderTBaseSerializerPoolFactory(com.navercorp.pinpoint.profiler.sender.HeaderTBaseSerializerPoolFactory) BeforeClass(org.junit.BeforeClass)

Example 2 with HeaderTBaseSerializer

use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.

the class SpanStreamSendDataPlaner method getSpanChunkBuffer0.

private byte[] getSpanChunkBuffer0() {
    if (spanChunkBuffer == null) {
        final TSpanChunk spanChunk = toSpanChunk(span);
        HeaderTBaseSerializer serializer = new HeaderTBaseSerializerFactory(false, SpanStreamSendDataFactory.DEFAULT_UDP_MAX_BUFFER_SIZE, false).createSerializer();
        byte[] spanChunkBuffer;
        try {
            spanChunkBuffer = serializer.serialize(spanChunk);
            this.spanChunkBuffer = spanChunkBuffer;
            this.spanChunkSize = serializer.getInterBufferSize();
        } catch (TException e) {
            logger.warn("Spanchunk serializer failed. {}.", spanChunk);
        }
    }
    if (spanChunkBuffer == null) {
        return new byte[0];
    }
    return spanChunkBuffer;
}
Also used : TSpanChunk(com.navercorp.pinpoint.thrift.dto.TSpanChunk) HeaderTBaseSerializer(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer) TException(org.apache.thrift.TException) HeaderTBaseSerializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory)

Example 3 with HeaderTBaseSerializer

use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.

the class HeaderTBaseSerializerTest method testSerialize2.

@Test
public void testSerialize2() throws Exception {
    HeaderTBaseSerializer serializer = new HeaderTBaseSerializerFactory().createSerializer();
    HeaderTBaseDeserializer deserializer = new HeaderTBaseDeserializerFactory().createDeserializer();
    test(serializer, deserializer);
}
Also used : HeaderTBaseSerializer(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer) HeaderTBaseSerializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory) HeaderTBaseDeserializer(com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializer) HeaderTBaseDeserializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializerFactory) Test(org.junit.Test)

Example 4 with HeaderTBaseSerializer

use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.

the class HeaderTBaseSerializerTest method testSerialize1.

@Test
public void testSerialize1() throws Exception {
    HeaderTBaseSerializer serializer = new HeaderTBaseSerializerFactory(false).createSerializer();
    HeaderTBaseDeserializer deserializer = new HeaderTBaseDeserializerFactory().createDeserializer();
    test(serializer, deserializer);
}
Also used : HeaderTBaseSerializer(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer) HeaderTBaseSerializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory) HeaderTBaseDeserializer(com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializer) HeaderTBaseDeserializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializerFactory) Test(org.junit.Test)

Example 5 with HeaderTBaseSerializer

use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer in project pinpoint by naver.

the class TcpDataSenderProvider method get.

@Override
public EnhancedDataSender<MetaDataType> get() {
    PinpointClientFactory clientFactory = clientFactoryProvider.get();
    String collectorTcpServerIp = thriftTransportConfig.getCollectorTcpServerIp();
    int collectorTcpServerPort = thriftTransportConfig.getCollectorTcpServerPort();
    HeaderTBaseSerializer headerTBaseSerializer = tBaseSerializerProvider.get();
    MessageSerializer<MetaDataType, byte[]> messageSerializer = new ThriftMessageSerializer<>(messageConverter, headerTBaseSerializer);
    return new TcpDataSender<>("Default", collectorTcpServerIp, collectorTcpServerPort, clientFactory, messageSerializer);
}
Also used : HeaderTBaseSerializer(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer) ThriftMessageSerializer(com.navercorp.pinpoint.profiler.sender.ThriftMessageSerializer) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) TcpDataSender(com.navercorp.pinpoint.profiler.sender.TcpDataSender)

Aggregations

HeaderTBaseSerializer (com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer)10 HeaderTBaseSerializerFactory (com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory)4 HeaderTBaseSerializerPoolFactory (com.navercorp.pinpoint.profiler.sender.HeaderTBaseSerializerPoolFactory)2 HeaderTBaseDeserializer (com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializer)2 HeaderTBaseDeserializerFactory (com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializerFactory)2 TException (org.apache.thrift.TException)2 BeforeClass (org.junit.BeforeClass)2 Test (org.junit.Test)2 DefaultSpanChunkFactory (com.navercorp.pinpoint.profiler.context.DefaultSpanChunkFactory)1 MetaDataType (com.navercorp.pinpoint.profiler.metadata.MetaDataType)1 TcpDataSender (com.navercorp.pinpoint.profiler.sender.TcpDataSender)1 ThriftMessageSerializer (com.navercorp.pinpoint.profiler.sender.ThriftMessageSerializer)1 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)1 TSpanChunk (com.navercorp.pinpoint.thrift.dto.TSpanChunk)1 NetworkAvailabilityCheckPacket (com.navercorp.pinpoint.thrift.io.NetworkAvailabilityCheckPacket)1