Search in sources :

Example 1 with HeaderTBaseSerializerFactory

use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory 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 2 with HeaderTBaseSerializerFactory

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

the class HeaderTBaseDeserializerFactoryTest method optionTest2.

@Test
public void optionTest2() {
    HeaderTBaseSerializerFactory factory = new HeaderTBaseSerializerFactory(true, 1);
    Assert.assertTrue(factory.isSafetyGuaranteed());
}
Also used : HeaderTBaseSerializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory) Test(org.junit.Test)

Example 3 with HeaderTBaseSerializerFactory

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

the class HeaderTBaseDeserializerFactoryTest method optionTest.

@Test
public void optionTest() {
    HeaderTBaseSerializerFactory factory = new HeaderTBaseSerializerFactory(false, 1);
    Assert.assertFalse(factory.isSafetyGuaranteed());
}
Also used : HeaderTBaseSerializerFactory(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory) Test(org.junit.Test)

Example 4 with HeaderTBaseSerializerFactory

use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory 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 5 with HeaderTBaseSerializerFactory

use of com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory 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)

Aggregations

HeaderTBaseSerializerFactory (com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializerFactory)11 Test (org.junit.Test)9 TSpanEvent (com.navercorp.pinpoint.thrift.dto.TSpanEvent)4 HeaderTBaseDeserializer (com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializer)4 HeaderTBaseDeserializerFactory (com.navercorp.pinpoint.thrift.io.HeaderTBaseDeserializerFactory)4 HeaderTBaseSerializer (com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer)4 Span (com.navercorp.pinpoint.profiler.context.Span)2 SpanChunk (com.navercorp.pinpoint.profiler.context.SpanChunk)2 SpanEvent (com.navercorp.pinpoint.profiler.context.SpanEvent)2 PartitionedByteBufferLocator (com.navercorp.pinpoint.profiler.sender.PartitionedByteBufferLocator)2 SpanStreamSendDataFactory (com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataFactory)2 SpanStreamSendDataSerializer (com.navercorp.pinpoint.profiler.sender.SpanStreamSendDataSerializer)2 TSpanChunk (com.navercorp.pinpoint.thrift.dto.TSpanChunk)2 ByteBuffer (java.nio.ByteBuffer)2 TSpan (com.navercorp.pinpoint.thrift.dto.TSpan)1 NetworkAvailabilityCheckPacket (com.navercorp.pinpoint.thrift.io.NetworkAvailabilityCheckPacket)1 TException (org.apache.thrift.TException)1