예제 #1
0
            public void Read(ThriftProtocol iprot)
            {
                iprot.IncrementRecursionDepth();
                try
                {
                    TField field;
                    iprot.ReadStructBegin();
                    while (true)
                    {
                        field = iprot.ReadFieldBegin();
                        if (field.Type == TType.Stop)
                        {
                            break;
                        }
                        switch (field.ID)
                        {
                        case 1:
                            if (field.Type == TType.List)
                            {
                                {
                                    Messages = new List <LogEntry>();
                                    TList list = iprot.ReadListBegin();
                                    for (int i = 0; i < list.Count; ++i)
                                    {
                                        var entry = LogEntrySerializer.Read(iprot);
                                        Messages.Add(entry);
                                    }
                                    iprot.ReadListEnd();
                                }
                            }
                            else
                            {
                                iprot.Skip(field.Type);
                            }
                            break;

                        default:
                            iprot.Skip(field.Type);
                            break;
                        }
                        iprot.ReadFieldEnd();
                    }
                    iprot.ReadStructEnd();
                }
                finally
                {
                    iprot.DecrementRecursionDepth();
                }
            }
예제 #2
0
        public static IList <Span> ReadList(ThriftProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            var list = new List <Span>();

            try
            {
                var listInfo = iprot.ReadListBegin();
                for (int i = 0; i < listInfo.Count; i++)
                {
                    list.Add(SpanSerializer.Read(iprot));
                }
                iprot.ReadListEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
            return(list);
        }
예제 #3
0
        public static Span Read(ThriftProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            var span = new Span();

            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.I64)
                        {
                            span.TraceId = iprot.ReadI64();
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            span.Name = iprot.ReadString();
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.I64)
                        {
                            span.Id = iprot.ReadI64();
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.I64)
                        {
                            span.ParentId = iprot.ReadI64();
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.List)
                        {
                            {
                                span.Annotations = new List <Annotation>();
                                var _list0 = iprot.ReadListBegin();
                                for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                                {
                                    var annotation = AnnotationSerializer.Read(iprot);
                                    span.Annotations.Add(annotation);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.List)
                        {
                            {
                                span.BinaryAnnotations = new List <BinaryAnnotation>();
                                var _list3 = iprot.ReadListBegin();
                                for (int _i4 = 0; _i4 < _list3.Count; ++_i4)
                                {
//										BinaryAnnotation _elem5;
//										_elem5 = new BinaryAnnotation();
//										_elem5.Read(iprot);
//										Binary_annotations.Add(_elem5);
                                    var annotation = BinaryAnnotationSerializer.Read(iprot);
                                    span.BinaryAnnotations.Add(annotation);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.Bool)
                        {
                            span.IsDebug = iprot.ReadBool();
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    case 10:
                        if (field.Type == TType.I64)
                        {
                            span.Timestamp = DateTimeOffsetExtensions.FromLong(iprot.ReadI64());
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    case 11:
                        if (field.Type == TType.I64)
                        {
                            span.DurationInMicroseconds = iprot.ReadI64();
                        }
                        else
                        {
                            iprot.Skip(field.Type);
                        }
                        break;

                    default:
                        iprot.Skip(field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
            return(span);
        }