コード例 #1
0
            public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
            {
                iprot.IncrementRecursionDepth();
                try
                {
                    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)
                            {
                                Key = await iprot.ReadBinaryAsync(cancellationToken);
                            }
                            else
                            {
                                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                            }
                            break;

                        case 2:
                            if (field.Type == TType.String)
                            {
                                Value = await iprot.ReadBinaryAsync(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);
                }
                finally
                {
                    iprot.DecrementRecursionDepth();
                }
            }
コード例 #2
0
ファイル: ChannelHandler.cs プロジェクト: zzskyhot/surging
        public async Task ChannelRead(TProtocol context)
        {
            var msg = await context.ReadMessageBeginAsync();

            var message = _transportMessageDecoder.Decode(await context.ReadBinaryAsync());
            await context.ReadMessageEndAsync();

            await _messageListener.OnReceived(_messageSender, message);
        }
コード例 #3
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_schemaBytes = 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)
                        {
                            SchemaBytes = await iprot.ReadBinaryAsync(cancellationToken);

                            isset_schemaBytes = 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_schemaBytes)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #4
0
        public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_count = 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)
                        {
                            Start_key = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            End_key = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Start_token = await iprot.ReadStringAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.String)
                        {
                            End_token = await iprot.ReadStringAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

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

                            isset_count = 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_count)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #5
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            bool   isset_family    = false;
            bool   isset_qualifier = 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)
                    {
                        Family = await iprot.ReadBinaryAsync(cancellationToken);

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

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

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

                case 3:
                    if (field.Type == TType.I64)
                    {
                        Amount = await iprot.ReadI64Async(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_family)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_qualifier)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #6
0
        public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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.List)
                        {
                            {
                                TList _list39 = await iprot.ReadListBeginAsync(cancellationToken);

                                Column_names = new List <byte[]>(_list39.Count);
                                for (int _i40 = 0; _i40 < _list39.Count; ++_i40)
                                {
                                    byte[] _elem41;
                                    _elem41 = await iprot.ReadBinaryAsync(cancellationToken);

                                    Column_names.Add(_elem41);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.Struct)
                        {
                            Slice_range = new global::Apache.Cassandra.Test.SliceRange();
                            await Slice_range.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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #7
0
        public static async Task SkipAsync(TProtocol protocol, TType type, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            protocol.IncrementRecursionDepth();
            try
            {
                switch (type)
                {
                case TType.Bool:
                    await protocol.ReadBoolAsync(cancellationToken);

                    break;

                case TType.Byte:
                    await protocol.ReadByteAsync(cancellationToken);

                    break;

                case TType.I16:
                    await protocol.ReadI16Async(cancellationToken);

                    break;

                case TType.I32:
                    await protocol.ReadI32Async(cancellationToken);

                    break;

                case TType.I64:
                    await protocol.ReadI64Async(cancellationToken);

                    break;

                case TType.Double:
                    await protocol.ReadDoubleAsync(cancellationToken);

                    break;

                case TType.String:
                    // Don't try to decode the string, just skip it.
                    await protocol.ReadBinaryAsync(cancellationToken);

                    break;

                case TType.Struct:
                    await protocol.ReadStructBeginAsync(cancellationToken);

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

                        if (field.Type == TType.Stop)
                        {
                            break;
                        }
                        await SkipAsync(protocol, field.Type, cancellationToken);

                        await protocol.ReadFieldEndAsync(cancellationToken);
                    }
                    await protocol.ReadStructEndAsync(cancellationToken);

                    break;

                case TType.Map:
                    var map = await protocol.ReadMapBeginAsync(cancellationToken);

                    for (var i = 0; i < map.Count; i++)
                    {
                        await SkipAsync(protocol, map.KeyType, cancellationToken);
                        await SkipAsync(protocol, map.ValueType, cancellationToken);
                    }
                    await protocol.ReadMapEndAsync(cancellationToken);

                    break;

                case TType.Set:
                    var set = await protocol.ReadSetBeginAsync(cancellationToken);

                    for (var i = 0; i < set.Count; i++)
                    {
                        await SkipAsync(protocol, set.ElementType, cancellationToken);
                    }
                    await protocol.ReadSetEndAsync(cancellationToken);

                    break;

                case TType.List:
                    var list = await protocol.ReadListBeginAsync(cancellationToken);

                    for (var i = 0; i < list.Count; i++)
                    {
                        await SkipAsync(protocol, list.ElementType, cancellationToken);
                    }
                    await protocol.ReadListEndAsync(cancellationToken);

                    break;

                default:
                    throw new TProtocolException(TProtocolException.INVALID_DATA, "Unknown data type " + type.ToString("d"));
                }
            }
            finally
            {
                protocol.DecrementRecursionDepth();
            }
        }
コード例 #8
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_values = false;
                bool   isset_nulls  = 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.List)
                        {
                            {
                                TList _list39 = await iprot.ReadListBeginAsync(cancellationToken);

                                Values = new List <int>(_list39.Count);
                                for (int _i40 = 0; _i40 < _list39.Count; ++_i40)
                                {
                                    int _elem41;
                                    _elem41 = await iprot.ReadI32Async(cancellationToken);

                                    Values.Add(_elem41);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                            isset_values = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

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

                            isset_nulls = 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_values)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_nulls)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #9
0
        public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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)
                        {
                            Key = await iprot.ReadStringAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            Value = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I32)
                        {
                            Annotation_type = (global::Jaeger.Thrift.Agent.Zipkin.AnnotationType) await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.Struct)
                        {
                            Host = new global::Jaeger.Thrift.Agent.Zipkin.Endpoint();
                            await Host.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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #10
0
ファイル: TDataFrame.cs プロジェクト: trmcnealy/Apache.Thrift
        public async Task ReadAsync(TProtocol iprot,
                                    CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();

            try
            {
                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)
                        {
                            Sm_handle = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot,
                                                          field.Type,
                                                          cancellationToken);
                        }

                        break;

                    case 2:
                        if (field.Type == TType.I64)
                        {
                            Sm_size = await iprot.ReadI64Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot,
                                                          field.Type,
                                                          cancellationToken);
                        }

                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Df_handle = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot,
                                                          field.Type,
                                                          cancellationToken);
                        }

                        break;

                    case 4:
                        if (field.Type == TType.I64)
                        {
                            Df_size = await iprot.ReadI64Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot,
                                                          field.Type,
                                                          cancellationToken);
                        }

                        break;

                    case 5:
                        if (field.Type == TType.I64)
                        {
                            Execution_time_ms = await iprot.ReadI64Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot,
                                                          field.Type,
                                                          cancellationToken);
                        }

                        break;

                    case 6:
                        if (field.Type == TType.I64)
                        {
                            Arrow_conversion_time_ms = await iprot.ReadI64Async(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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #11
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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)
                        {
                            StartRow = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            StopRow = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I64)
                        {
                            Timestamp = await iprot.ReadI64Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                TList _list13 = await iprot.ReadListBeginAsync(cancellationToken);

                                Columns = new List <byte[]>(_list13.Count);
                                for (int _i14 = 0; _i14 < _list13.Count; ++_i14)
                                {
                                    byte[] _elem15;
                                    _elem15 = await iprot.ReadBinaryAsync(cancellationToken);

                                    Columns.Add(_elem15);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.I32)
                        {
                            Caching = await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.String)
                        {
                            FilterString = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.I32)
                        {
                            BatchSize = await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.Bool)
                        {
                            SortColumns = await iprot.ReadBoolAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.Bool)
                        {
                            Reversed = await iprot.ReadBoolAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 10:
                        if (field.Type == TType.Bool)
                        {
                            CacheBlocks = await iprot.ReadBoolAsync(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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #12
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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)
                        {
                            StartKey = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            EndKey = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I64)
                        {
                            Id = await iprot.ReadI64Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.String)
                        {
                            Name = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.Byte)
                        {
                            Version = await iprot.ReadByteAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.String)
                        {
                            ServerName = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.I32)
                        {
                            Port = await iprot.ReadI32Async(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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #13
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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.Map)
                        {
                            {
                                TMap _map12 = await iprot.ReadMapBeginAsync(cancellationToken);

                                SnapshotBytes = new Dictionary <int, byte[]>(_map12.Count);
                                for (int _i13 = 0; _i13 < _map12.Count; ++_i13)
                                {
                                    int    _key14;
                                    byte[] _val15;
                                    _key14 = await iprot.ReadI32Async(cancellationToken);

                                    _val15 = await iprot.ReadBinaryAsync(cancellationToken);

                                    SnapshotBytes[_key14] = _val15;
                                }
                                await iprot.ReadMapEndAsync(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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #14
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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)
                        {
                            Name = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.I32)
                        {
                            MaxVersions = await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Compression = await iprot.ReadStringAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.Bool)
                        {
                            InMemory = await iprot.ReadBoolAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.String)
                        {
                            BloomFilterType = await iprot.ReadStringAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.I32)
                        {
                            BloomFilterVectorSize = await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.I32)
                        {
                            BloomFilterNbHashes = await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.Bool)
                        {
                            BlockCacheEnabled = await iprot.ReadBoolAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.I32)
                        {
                            TimeToLive = await iprot.ReadI32Async(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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #15
0
        public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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.I32)
                        {
                            Ipv4 = await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.I16)
                        {
                            Port = await iprot.ReadI16Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Service_name = await iprot.ReadStringAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.String)
                        {
                            Ipv6 = await iprot.ReadBinaryAsync(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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #16
0
        public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_name    = false;
                bool   isset_columns = 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)
                        {
                            Name = await iprot.ReadBinaryAsync(cancellationToken);

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

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                TList _list11 = await iprot.ReadListBeginAsync(cancellationToken);

                                Columns = new List <global::Apache.Cassandra.Test.CounterColumn>(_list11.Count);
                                for (int _i12 = 0; _i12 < _list11.Count; ++_i12)
                                {
                                    global::Apache.Cassandra.Test.CounterColumn _elem13;
                                    _elem13 = new global::Apache.Cassandra.Test.CounterColumn();
                                    await _elem13.ReadAsync(iprot, cancellationToken);

                                    Columns.Add(_elem13);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                            isset_columns = 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_name)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_columns)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #17
0
ファイル: CellValueSerial.cs プロジェクト: thither/swc-db
    public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            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.I32)
                    {
                        Field_id = await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.I64)
                    {
                        V_int64 = await iprot.ReadI64Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Double)
                    {
                        V_double = await iprot.ReadDoubleAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        V_bytes = await iprot.ReadBinaryAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list244 = await iprot.ReadListBeginAsync(cancellationToken);

                            V_key = new List <byte[]>(_list244.Count);
                            for (int _i245 = 0; _i245 < _list244.Count; ++_i245)
                            {
                                byte[] _elem246;
                                _elem246 = await iprot.ReadBinaryAsync(cancellationToken);

                                V_key.Add(_elem246);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 6:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list247 = await iprot.ReadListBeginAsync(cancellationToken);

                            V_li = new List <long>(_list247.Count);
                            for (int _i248 = 0; _i248 < _list247.Count; ++_i248)
                            {
                                long _elem249;
                                _elem249 = await iprot.ReadI64Async(cancellationToken);

                                V_li.Add(_elem249);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 7:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list250 = await iprot.ReadListBeginAsync(cancellationToken);

                            V_lb = new List <byte[]>(_list250.Count);
                            for (int _i251 = 0; _i251 < _list250.Count; ++_i251)
                            {
                                byte[] _elem252;
                                _elem252 = await iprot.ReadBinaryAsync(cancellationToken);

                                V_lb.Add(_elem252);
                            }
                            await iprot.ReadListEndAsync(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);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #18
0
    public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            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.List)
                    {
                        {
                            TList _list358 = await iprot.ReadListBeginAsync(cancellationToken);

                            K = new List <byte[]>(_list358.Count);
                            for (int _i359 = 0; _i359 < _list358.Count; ++_i359)
                            {
                                byte[] _elem360;
                                _elem360 = await iprot.ReadBinaryAsync(cancellationToken);

                                K.Add(_elem360);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list361 = await iprot.ReadListBeginAsync(cancellationToken);

                            Cells = new List <KCell>(_list361.Count);
                            for (int _i362 = 0; _i362 < _list361.Count; ++_i362)
                            {
                                KCell _elem363;
                                _elem363 = new KCell();
                                await _elem363.ReadAsync(iprot, cancellationToken);

                                Cells.Add(_elem363);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list364 = await iprot.ReadListBeginAsync(cancellationToken);

                            Serial_cells = new List <KCellSerial>(_list364.Count);
                            for (int _i365 = 0; _i365 < _list364.Count; ++_i365)
                            {
                                KCellSerial _elem366;
                                _elem366 = new KCellSerial();
                                await _elem366.ReadAsync(iprot, cancellationToken);

                                Serial_cells.Add(_elem366);
                            }
                            await iprot.ReadListEndAsync(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);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #19
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
      iprot.IncrementRecursionDepth();
      try
      {
        bool isset_sessionId = false;
        bool isset_deviceId = false;
        bool isset_measurements = false;
        bool isset_values = false;
        bool isset_timestamp = 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.I64)
              {
                SessionId = await iprot.ReadI64Async(cancellationToken);
                isset_sessionId = true;
              }
              else
              {
                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
              }
              break;
            case 2:
              if (field.Type == TType.String)
              {
                DeviceId = await iprot.ReadStringAsync(cancellationToken);
                isset_deviceId = true;
              }
              else
              {
                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
              }
              break;
            case 3:
              if (field.Type == TType.List)
              {
                {
                  TList _list35 = await iprot.ReadListBeginAsync(cancellationToken);
                  Measurements = new List<string>(_list35.Count);
                  for(int _i36 = 0; _i36 < _list35.Count; ++_i36)
                  {
                    string _elem37;
                    _elem37 = await iprot.ReadStringAsync(cancellationToken);
                    Measurements.Add(_elem37);
                  }
                  await iprot.ReadListEndAsync(cancellationToken);
                }
                isset_measurements = true;
              }
              else
              {
                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
              }
              break;
            case 4:
              if (field.Type == TType.String)
              {
                Values = await iprot.ReadBinaryAsync(cancellationToken);
                isset_values = true;
              }
              else
              {
                await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
              }
              break;
            case 5:
              if (field.Type == TType.I64)
              {
                Timestamp = await iprot.ReadI64Async(cancellationToken);
                isset_timestamp = 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_sessionId)
        {
          throw new TProtocolException(TProtocolException.INVALID_DATA);
        }
        if (!isset_deviceId)
        {
          throw new TProtocolException(TProtocolException.INVALID_DATA);
        }
        if (!isset_measurements)
        {
          throw new TProtocolException(TProtocolException.INVALID_DATA);
        }
        if (!isset_values)
        {
          throw new TProtocolException(TProtocolException.INVALID_DATA);
        }
        if (!isset_timestamp)
        {
          throw new TProtocolException(TProtocolException.INVALID_DATA);
        }
      }
      finally
      {
        iprot.DecrementRecursionDepth();
      }
    }
コード例 #20
0
    public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            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)
                    {
                        C = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list283 = await iprot.ReadListBeginAsync(cancellationToken);

                            K = new List <byte[]>(_list283.Count);
                            for (int _i284 = 0; _i284 < _list283.Count; ++_i284)
                            {
                                byte[] _elem285;
                                _elem285 = await iprot.ReadBinaryAsync(cancellationToken);

                                K.Add(_elem285);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.I64)
                    {
                        Ts = await iprot.ReadI64Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list286 = await iprot.ReadListBeginAsync(cancellationToken);

                            V = new List <CellValueSerial>(_list286.Count);
                            for (int _i287 = 0; _i287 < _list286.Count; ++_i287)
                            {
                                CellValueSerial _elem288;
                                _elem288 = new CellValueSerial();
                                await _elem288.ReadAsync(iprot, cancellationToken);

                                V.Add(_elem288);
                            }
                            await iprot.ReadListEndAsync(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);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #21
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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.I32)
                        {
                            Num_pixel_channels = await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.I32)
                        {
                            Num_pixel_samples = await iprot.ReadI32Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.String)
                        {
                            Pixels = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.String)
                        {
                            Row_ids_A = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.String)
                        {
                            Row_ids_B = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.String)
                        {
                            Table_ids = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.String)
                        {
                            Accum_data = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.I32)
                        {
                            Accum_depth = await iprot.ReadI32Async(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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #22
0
ファイル: TGet.cs プロジェクト: jm6041/HbaseApp
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            bool   isset_row = 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)
                    {
                        Row = await iprot.ReadBinaryAsync(cancellationToken);

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

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            Columns = new List <TColumn>();
                            TList _list8 = await iprot.ReadListBeginAsync(cancellationToken);

                            for (int _i9 = 0; _i9 < _list8.Count; ++_i9)
                            {
                                TColumn _elem10;
                                _elem10 = new TColumn();
                                await _elem10.ReadAsync(iprot, cancellationToken);

                                Columns.Add(_elem10);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.I64)
                    {
                        Timestamp = await iprot.ReadI64Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

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

                case 5:
                    if (field.Type == TType.I32)
                    {
                        MaxVersions = await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 6:
                    if (field.Type == TType.String)
                    {
                        FilterString = await iprot.ReadBinaryAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 7:
                    if (field.Type == TType.Map)
                    {
                        {
                            Attributes = new Dictionary <byte[], byte[]>();
                            TMap _map11 = await iprot.ReadMapBeginAsync(cancellationToken);

                            for (int _i12 = 0; _i12 < _map11.Count; ++_i12)
                            {
                                byte[] _key13;
                                byte[] _val14;
                                _key13 = await iprot.ReadBinaryAsync(cancellationToken);

                                _val14 = await iprot.ReadBinaryAsync(cancellationToken);

                                Attributes[_key13] = _val14;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 8:
                    if (field.Type == TType.Struct)
                    {
                        Authorizations = new TAuthorization();
                        await Authorizations.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_row)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #23
0
ファイル: SpecIntervalSerial.cs プロジェクト: thither/swc-db
    public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            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.List)
                    {
                        {
                            TList _list188 = await iprot.ReadListBeginAsync(cancellationToken);

                            Range_begin = new List <byte[]>(_list188.Count);
                            for (int _i189 = 0; _i189 < _list188.Count; ++_i189)
                            {
                                byte[] _elem190;
                                _elem190 = await iprot.ReadBinaryAsync(cancellationToken);

                                Range_begin.Add(_elem190);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list191 = await iprot.ReadListBeginAsync(cancellationToken);

                            Range_end = new List <byte[]>(_list191.Count);
                            for (int _i192 = 0; _i192 < _list191.Count; ++_i192)
                            {
                                byte[] _elem193;
                                _elem193 = await iprot.ReadBinaryAsync(cancellationToken);

                                Range_end.Add(_elem193);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list194 = await iprot.ReadListBeginAsync(cancellationToken);

                            Offset_key = new List <byte[]>(_list194.Count);
                            for (int _i195 = 0; _i195 < _list194.Count; ++_i195)
                            {
                                byte[] _elem196;
                                _elem196 = await iprot.ReadBinaryAsync(cancellationToken);

                                Offset_key.Add(_elem196);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.I64)
                    {
                        Offset_rev = await iprot.ReadI64Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list197 = await iprot.ReadListBeginAsync(cancellationToken);

                            Key_intervals = new List <SpecKeyInterval>(_list197.Count);
                            for (int _i198 = 0; _i198 < _list197.Count; ++_i198)
                            {
                                SpecKeyInterval _elem199;
                                _elem199 = new SpecKeyInterval();
                                await _elem199.ReadAsync(iprot, cancellationToken);

                                Key_intervals.Add(_elem199);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 6:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list200 = await iprot.ReadListBeginAsync(cancellationToken);

                            Values = new List <SpecValueSerial>(_list200.Count);
                            for (int _i201 = 0; _i201 < _list200.Count; ++_i201)
                            {
                                SpecValueSerial _elem202;
                                _elem202 = new SpecValueSerial();
                                await _elem202.ReadAsync(iprot, cancellationToken);

                                Values.Add(_elem202);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

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

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

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

                case 10:
                    if (field.Type == TType.I32)
                    {
                        Options = (SpecIntervalOptions)await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 11:
                    if (field.Type == TType.Struct)
                    {
                        Updating = new SpecIntervalUpdateSerial();
                        await Updating.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);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #24
0
ファイル: TRowMutations.cs プロジェクト: jm6041/HbaseApp
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            bool   isset_row       = false;
            bool   isset_mutations = 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)
                    {
                        Row = await iprot.ReadBinaryAsync(cancellationToken);

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

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            Mutations = new List <TMutation>();
                            TList _list62 = await iprot.ReadListBeginAsync(cancellationToken);

                            for (int _i63 = 0; _i63 < _list62.Count; ++_i63)
                            {
                                TMutation _elem64;
                                _elem64 = new TMutation();
                                await _elem64.ReadAsync(iprot, cancellationToken);

                                Mutations.Add(_elem64);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                        isset_mutations = 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_row)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_mutations)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #25
0
ファイル: Deletion.cs プロジェクト: ste93/yarp
        public async global::System.Threading.Tasks.Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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.I64)
                        {
                            Timestamp = await iprot.ReadI64Async(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.String)
                        {
                            Super_column = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.Struct)
                        {
                            Predicate = new global::Apache.Cassandra.Test.SlicePredicate();
                            await Predicate.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);
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #26
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            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)
                    {
                        _from = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        To = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.I32)
                    {
                        ToType = (MIDType)await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        Id = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 5:
                    if (field.Type == TType.I64)
                    {
                        CreatedTime = await iprot.ReadI64Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 6:
                    if (field.Type == TType.I64)
                    {
                        DeliveredTime = await iprot.ReadI64Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 10:
                    if (field.Type == TType.String)
                    {
                        Text = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

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

                case 14:
                    if (field.Type == TType.Bool)
                    {
                        HasContent = await iprot.ReadBoolAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 15:
                    if (field.Type == TType.I32)
                    {
                        ContentType = (ContentType)await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 17:
                    if (field.Type == TType.String)
                    {
                        ContentPreview = await iprot.ReadBinaryAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 18:
                    if (field.Type == TType.Map)
                    {
                        {
                            TMap _map157 = await iprot.ReadMapBeginAsync(cancellationToken);

                            ContentMetadata = new Dictionary <string, string>(_map157.Count);
                            for (int _i158 = 0; _i158 < _map157.Count; ++_i158)
                            {
                                string _key159;
                                string _val160;
                                _key159 = await iprot.ReadStringAsync(cancellationToken);

                                _val160 = await iprot.ReadStringAsync(cancellationToken);

                                ContentMetadata[_key159] = _val160;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 19:
                    if (field.Type == TType.Byte)
                    {
                        SessionId = await iprot.ReadByteAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 20:
                    if (field.Type == TType.List)
                    {
                        {
                            TList _list161 = await iprot.ReadListBeginAsync(cancellationToken);

                            Chunks = new List <byte[]>(_list161.Count);
                            for (int _i162 = 0; _i162 < _list161.Count; ++_i162)
                            {
                                byte[] _elem163;
                                _elem163 = await iprot.ReadBinaryAsync(cancellationToken);

                                Chunks.Add(_elem163);
                            }
                            await iprot.ReadListEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 21:
                    if (field.Type == TType.String)
                    {
                        RelatedMessageId = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 22:
                    if (field.Type == TType.I32)
                    {
                        MessageRelationType = (MessageRelationType)await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 23:
                    if (field.Type == TType.I64)
                    {
                        ReadCount = await iprot.ReadI64Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 24:
                    if (field.Type == TType.I32)
                    {
                        RelatedMessageServiceCode = (ServiceCode)await iprot.ReadI32Async(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);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #27
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            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)
                    {
                        Row = await iprot.ReadBinaryAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            Mutations = new List <Mutation>();
                            TList _list0 = await iprot.ReadListBeginAsync(cancellationToken);

                            for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                            {
                                Mutation _elem2;
                                _elem2 = new Mutation();
                                await _elem2.ReadAsync(iprot, cancellationToken);

                                Mutations.Add(_elem2);
                            }
                            await iprot.ReadListEndAsync(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);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #28
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_sessionId        = false;
                bool   isset_deviceIds        = false;
                bool   isset_measurementsList = false;
                bool   isset_valuesList       = false;
                bool   isset_timestamps       = 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.I64)
                        {
                            SessionId = await iprot.ReadI64Async(cancellationToken);

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

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                TList _list87 = await iprot.ReadListBeginAsync(cancellationToken);

                                DeviceIds = new List <string>(_list87.Count);
                                for (int _i88 = 0; _i88 < _list87.Count; ++_i88)
                                {
                                    string _elem89;
                                    _elem89 = await iprot.ReadStringAsync(cancellationToken);

                                    DeviceIds.Add(_elem89);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                            isset_deviceIds = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.List)
                        {
                            {
                                TList _list90 = await iprot.ReadListBeginAsync(cancellationToken);

                                MeasurementsList = new List <List <string> >(_list90.Count);
                                for (int _i91 = 0; _i91 < _list90.Count; ++_i91)
                                {
                                    List <string> _elem92;
                                    {
                                        TList _list93 = await iprot.ReadListBeginAsync(cancellationToken);

                                        _elem92 = new List <string>(_list93.Count);
                                        for (int _i94 = 0; _i94 < _list93.Count; ++_i94)
                                        {
                                            string _elem95;
                                            _elem95 = await iprot.ReadStringAsync(cancellationToken);

                                            _elem92.Add(_elem95);
                                        }
                                        await iprot.ReadListEndAsync(cancellationToken);
                                    }
                                    MeasurementsList.Add(_elem92);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                            isset_measurementsList = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                TList _list96 = await iprot.ReadListBeginAsync(cancellationToken);

                                ValuesList = new List <byte[]>(_list96.Count);
                                for (int _i97 = 0; _i97 < _list96.Count; ++_i97)
                                {
                                    byte[] _elem98;
                                    _elem98 = await iprot.ReadBinaryAsync(cancellationToken);

                                    ValuesList.Add(_elem98);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                            isset_valuesList = true;
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                TList _list99 = await iprot.ReadListBeginAsync(cancellationToken);

                                Timestamps = new List <long>(_list99.Count);
                                for (int _i100 = 0; _i100 < _list99.Count; ++_i100)
                                {
                                    long _elem101;
                                    _elem101 = await iprot.ReadI64Async(cancellationToken);

                                    Timestamps.Add(_elem101);
                                }
                                await iprot.ReadListEndAsync(cancellationToken);
                            }
                            isset_timestamps = 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_sessionId)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_deviceIds)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_measurementsList)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_valuesList)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_timestamps)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #29
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_respNum = 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.I32)
                        {
                            RespNum = await iprot.ReadI32Async(cancellationToken);

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

                    case 2:
                        if (field.Type == TType.String)
                        {
                            PartitionTableBytes = await iprot.ReadBinaryAsync(cancellationToken);
                        }
                        else
                        {
                            await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.Struct)
                        {
                            CheckStatusResponse = new CheckStatusResponse();
                            await CheckStatusResponse.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_respNum)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
コード例 #30
0
    public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
    {
        iprot.IncrementRecursionDepth();
        try
        {
            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.I32)
                    {
                        Status = (SuggestDictionaryIncrementStatus)await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 2:
                    if (field.Type == TType.I64)
                    {
                        Revision = await iprot.ReadI64Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.String)
                    {
                        Scheme = await iprot.ReadStringAsync(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        Data = await iprot.ReadBinaryAsync(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);
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }
コード例 #31
0
ファイル: TProtocolUtil.cs プロジェクト: nsuke/thrift
        public static async Task SkipAsync(TProtocol prot, TType type, CancellationToken cancellationToken)
        {
            if (cancellationToken.IsCancellationRequested)
            {
                await Task.FromCanceled(cancellationToken);
            }

            prot.IncrementRecursionDepth();
            try
            {
                switch (type)
                {
                    case TType.Bool:
                        await prot.ReadBoolAsync(cancellationToken);
                        break;
                    case TType.Byte:
                        await prot.ReadByteAsync(cancellationToken);
                        break;
                    case TType.I16:
                        await prot.ReadI16Async(cancellationToken);
                        break;
                    case TType.I32:
                        await prot.ReadI32Async(cancellationToken);
                        break;
                    case TType.I64:
                        await prot.ReadI64Async(cancellationToken);
                        break;
                    case TType.Double:
                        await prot.ReadDoubleAsync(cancellationToken);
                        break;
                    case TType.String:
                        // Don't try to decode the string, just skip it.
                        await prot.ReadBinaryAsync(cancellationToken);
                        break;
                    case TType.Struct:
                        await prot.ReadStructBeginAsync(cancellationToken);
                        while (true)
                        {
                            var field = await prot.ReadFieldBeginAsync(cancellationToken);
                            if (field.Type == TType.Stop)
                            {
                                break;
                            }
                            await SkipAsync(prot, field.Type, cancellationToken);
                            await prot.ReadFieldEndAsync(cancellationToken);
                        }
                        await prot.ReadStructEndAsync(cancellationToken);
                        break;
                    case TType.Map:
                        var map = await prot.ReadMapBeginAsync(cancellationToken);
                        for (var i = 0; i < map.Count; i++)
                        {
                            await SkipAsync(prot, map.KeyType, cancellationToken);
                            await SkipAsync(prot, map.ValueType, cancellationToken);
                        }
                        await prot.ReadMapEndAsync(cancellationToken);
                        break;
                    case TType.Set:
                        var set = await prot.ReadSetBeginAsync(cancellationToken);
                        for (var i = 0; i < set.Count; i++)
                        {
                            await SkipAsync(prot, set.ElementType, cancellationToken);
                        }
                        await prot.ReadSetEndAsync(cancellationToken);
                        break;
                    case TType.List:
                        var list = await prot.ReadListBeginAsync(cancellationToken);
                        for (var i = 0; i < list.Count; i++)
                        {
                            await SkipAsync(prot, list.ElementType, cancellationToken);
                        }
                        await prot.ReadListEndAsync(cancellationToken);
                        break;
                    default:
                        throw new TProtocolException(TProtocolException.INVALID_DATA, "Unknown data type " + type.ToString("d"));
                }
            }
            finally
            {
                prot.DecrementRecursionDepth();
            }
        }