Ejemplo n.º 1
0
    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();
        }
    }
Ejemplo n.º 2
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.List)
                    {
                        {
                            Columns = new List <TColumn>();
                            TList _list53 = await iprot.ReadListBeginAsync(cancellationToken);

                            for (int _i54 = 0; _i54 < _list53.Count; ++_i54)
                            {
                                TColumn _elem55;
                                _elem55 = new TColumn();
                                await _elem55.ReadAsync(iprot, cancellationToken);

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

                case 4:
                    if (field.Type == TType.I32)
                    {
                        Caching = await iprot.ReadI32Async(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.Struct)
                    {
                        TimeRange = new TTimeRange();
                        await TimeRange.ReadAsync(iprot, cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

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

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

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

                            for (int _i57 = 0; _i57 < _map56.Count; ++_i57)
                            {
                                byte[] _key58;
                                byte[] _val59;
                                _key58 = await iprot.ReadBinaryAsync(cancellationToken);

                                _val59 = await iprot.ReadBinaryAsync(cancellationToken);

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

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

                case 11:
                    if (field.Type == TType.Bool)
                    {
                        Reversed = 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();
        }
    }
Ejemplo n.º 3
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.Map)
                    {
                        {
                            Columns = new Dictionary <byte[], TCell>();
                            TMap _map4 = await iprot.ReadMapBeginAsync(cancellationToken);

                            for (int _i5 = 0; _i5 < _map4.Count; ++_i5)
                            {
                                byte[] _key6;
                                TCell  _val7;
                                _key6 = await iprot.ReadBinaryAsync(cancellationToken);

                                _val7 = new TCell();
                                await _val7.ReadAsync(iprot, cancellationToken);

                                Columns[_key6] = _val7;
                            }
                            await iprot.ReadMapEndAsync(cancellationToken);
                        }
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

                case 3:
                    if (field.Type == TType.List)
                    {
                        {
                            SortedColumns = 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);

                                SortedColumns.Add(_elem10);
                            }
                            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();
        }
    }
Ejemplo n.º 4
0
    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 _list26 = await iprot.ReadListBeginAsync(cancellationToken);

                            for (int _i27 = 0; _i27 < _list26.Count; ++_i27)
                            {
                                TColumn _elem28;
                                _elem28 = new TColumn();
                                await _elem28.ReadAsync(iprot, cancellationToken);

                                Columns.Add(_elem28);
                            }
                            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.I32)
                    {
                        DeleteType = (TDeleteType)await iprot.ReadI32Async(cancellationToken);
                    }
                    else
                    {
                        await TProtocolUtil.SkipAsync(iprot, field.Type, cancellationToken);
                    }
                    break;

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

                            for (int _i30 = 0; _i30 < _map29.Count; ++_i30)
                            {
                                byte[] _key31;
                                byte[] _val32;
                                _key31 = await iprot.ReadBinaryAsync(cancellationToken);

                                _val32 = await iprot.ReadBinaryAsync(cancellationToken);

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

                case 7:
                    if (field.Type == TType.I32)
                    {
                        Durability = (TDurability)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);

            if (!isset_row)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
        finally
        {
            iprot.DecrementRecursionDepth();
        }
    }