示例#1
0
 public StartTraceRequest(string serverRole, bool sampled, string baggage, Downstream downstream) : this()
 {
     this.ServerRole = serverRole;
     this.Sampled    = sampled;
     this.Baggage    = baggage;
     this.Downstream = downstream;
 }
        public Downstream DeepCopy()
        {
            var tmp0 = new Downstream();

            if ((ServiceName != null))
            {
                tmp0.ServiceName = this.ServiceName;
            }
            if ((ServerRole != null))
            {
                tmp0.ServerRole = this.ServerRole;
            }
            if ((Host != null))
            {
                tmp0.Host = this.Host;
            }
            if ((Port != null))
            {
                tmp0.Port = this.Port;
            }
            tmp0.Transport = this.Transport;
            if ((Downstream_ != null) && __isset.downstream)
            {
                tmp0.Downstream_ = (global::Jaeger.Thrift.Crossdock.Downstream) this.Downstream_.DeepCopy();
            }
            tmp0.__isset.downstream = this.__isset.downstream;
            return(tmp0);
        }
示例#3
0
        public override string ToString()
        {
            var sb   = new StringBuilder("TraceResponse(");
            int tmp9 = 0;

            if ((Span != null) && __isset.span)
            {
                if (0 < tmp9++)
                {
                    sb.Append(", ");
                }
                sb.Append("Span: ");
                Span.ToString(sb);
            }
            if ((Downstream != null) && __isset.downstream)
            {
                if (0 < tmp9++)
                {
                    sb.Append(", ");
                }
                sb.Append("Downstream: ");
                Downstream.ToString(sb);
            }
            if ((NotImplementedError != null))
            {
                if (0 < tmp9)
                {
                    sb.Append(", ");
                }
                sb.Append("NotImplementedError: ");
                NotImplementedError.ToString(sb);
            }
            sb.Append(')');
            return(sb.ToString());
        }
示例#4
0
        public async global::System.Threading.Tasks.Task WriteAsync(TProtocol oprot, CancellationToken cancellationToken)
        {
            oprot.IncrementRecursionDepth();
            try
            {
                var struc = new TStruct("TraceResponse");
                await oprot.WriteStructBeginAsync(struc, cancellationToken);

                var field = new TField();
                if ((Span != null) && __isset.span)
                {
                    field.Name = "span";
                    field.Type = TType.Struct;
                    field.ID   = 1;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Span.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if ((Downstream != null) && __isset.downstream)
                {
                    field.Name = "downstream";
                    field.Type = TType.Struct;
                    field.ID   = 2;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await Downstream.WriteAsync(oprot, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                if ((NotImplementedError != null))
                {
                    field.Name = "notImplementedError";
                    field.Type = TType.String;
                    field.ID   = 3;
                    await oprot.WriteFieldBeginAsync(field, cancellationToken);

                    await oprot.WriteStringAsync(NotImplementedError, cancellationToken);

                    await oprot.WriteFieldEndAsync(cancellationToken);
                }
                await oprot.WriteFieldStopAsync(cancellationToken);

                await oprot.WriteStructEndAsync(cancellationToken);
            }
            finally
            {
                oprot.DecrementRecursionDepth();
            }
        }
示例#5
0
        public override int GetHashCode()
        {
            int hashcode = 157;

            unchecked {
                if (__isset.span)
                {
                    hashcode = (hashcode * 397) + Span.GetHashCode();
                }
                if (__isset.downstream)
                {
                    hashcode = (hashcode * 397) + Downstream.GetHashCode();
                }
                hashcode = (hashcode * 397) + NotImplementedError.GetHashCode();
            }
            return(hashcode);
        }
示例#6
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_serverRole = false;
                bool   isset_sampled    = false;
                bool   isset_baggage    = false;
                bool   isset_downstream = false;
                TField field;
                await iprot.ReadStructBeginAsync(cancellationToken);

                while (true)
                {
                    field = await iprot.ReadFieldBeginAsync(cancellationToken);

                    if (field.Type == TType.Stop)
                    {
                        break;
                    }

                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.String)
                        {
                            ServerRole = await iprot.ReadStringAsync(cancellationToken);

                            isset_serverRole = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Bool)
                        {
                            Sampled = await iprot.ReadBoolAsync(cancellationToken);

                            isset_sampled = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Baggage = await iprot.ReadStringAsync(cancellationToken);

                            isset_baggage = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.Struct)
                        {
                            Downstream = new Downstream();
                            await Downstream.ReadAsync(iprot, cancellationToken);

                            isset_downstream = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    default:
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                        break;
                    }

                    await iprot.ReadFieldEndAsync(cancellationToken);
                }

                await iprot.ReadStructEndAsync(cancellationToken);

                if (!isset_serverRole)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_sampled)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_baggage)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_downstream)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
示例#7
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_serviceName = false;
                bool   isset_serverRole  = false;
                bool   isset_host        = false;
                bool   isset_port        = false;
                bool   isset_transport   = false;
                TField field;
                await iprot.ReadStructBeginAsync(cancellationToken);

                while (true)
                {
                    field = await iprot.ReadFieldBeginAsync(cancellationToken);

                    if (field.Type == TType.Stop)
                    {
                        break;
                    }

                    switch (field.ID)
                    {
                    case 1:
                        if (field.Type == TType.String)
                        {
                            ServiceName = await iprot.ReadStringAsync(cancellationToken);

                            isset_serviceName = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            ServerRole = await iprot.ReadStringAsync(cancellationToken);

                            isset_serverRole = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Host = await iprot.ReadStringAsync(cancellationToken);

                            isset_host = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.String)
                        {
                            Port = await iprot.ReadStringAsync(cancellationToken);

                            isset_port = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.I32)
                        {
                            Transport = (Transport)await iprot.ReadI32Async(cancellationToken);

                            isset_transport = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.Struct)
                        {
                            Downstream_ = new Downstream();
                            await Downstream_.ReadAsync(iprot, cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    default:
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);

                        break;
                    }

                    await iprot.ReadFieldEndAsync(cancellationToken);
                }

                await iprot.ReadStructEndAsync(cancellationToken);

                if (!isset_serviceName)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_serverRole)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_host)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_port)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_transport)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }