Esempio n. 1
0
 public TSFetchResultsResp(TSStatus status, bool hasResultSet, bool isAlign) : this()
 {
     this.Status       = status;
     this.HasResultSet = hasResultSet;
     this.IsAlign      = isAlign;
 }
Esempio n. 2
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_status       = false;
                bool   isset_hasResultSet = false;
                bool   isset_isAlign      = 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.Struct)
                        {
                            Status = new TSStatus();
                            await Status.ReadAsync(iprot, cancellationToken);

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

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

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

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

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

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

                    case 5:
                        if (field.Type == TType.Struct)
                        {
                            NonAlignQueryDataSet = new TSQueryNonAlignDataSet();
                            await NonAlignQueryDataSet.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_status)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_hasResultSet)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_isAlign)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
 public TSExecuteStatementResp(TSStatus status) : this()
 {
     this.Status = status;
 }
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_status = 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.Struct)
                        {
                            Status = new TSStatus();
                            await Status.ReadAsync(iprot, cancellationToken);

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

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

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

                                Columns = new List <string>(_list4.Count);
                                for (int _i5 = 0; _i5 < _list4.Count; ++_i5)
                                {
                                    string _elem6;
                                    _elem6 = await iprot.ReadStringAsync(cancellationToken);

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

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

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

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

                                DataTypeList = new List <string>(_list7.Count);
                                for (int _i8 = 0; _i8 < _list7.Count; ++_i8)
                                {
                                    string _elem9;
                                    _elem9 = await iprot.ReadStringAsync(cancellationToken);

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

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

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

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

                                ColumnNameIndexMap = new Dictionary <string, int>(_map10.Count);
                                for (int _i11 = 0; _i11 < _map10.Count; ++_i11)
                                {
                                    string _key12;
                                    int    _val13;
                                    _key12 = await iprot.ReadStringAsync(cancellationToken);

                                    _val13 = await iprot.ReadI32Async(cancellationToken);

                                    ColumnNameIndexMap[_key12] = _val13;
                                }
                                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);

                if (!isset_status)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_status = false;
                bool   isset_serverProtocolVersion = 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.Struct)
                        {
                            Status = new TSStatus();
                            await Status.ReadAsync(iprot, cancellationToken);

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

                    case 2:
                        if (field.Type == TType.I32)
                        {
                            ServerProtocolVersion = (TSProtocolVersion)await iprot.ReadI32Async(cancellationToken);

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

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

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

                                Configuration = new Dictionary <string, string>(_map17.Count);
                                for (int _i18 = 0; _i18 < _map17.Count; ++_i18)
                                {
                                    string _key19;
                                    string _val20;
                                    _key19 = await iprot.ReadStringAsync(cancellationToken);

                                    _val20 = await iprot.ReadStringAsync(cancellationToken);

                                    Configuration[_key19] = _val20;
                                }
                                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);

                if (!isset_status)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_serverProtocolVersion)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Esempio n. 6
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_code = 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)
                        {
                            Code = await iprot.ReadI32Async(cancellationToken);

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

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

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

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

                                    SubStatus.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);

                if (!isset_code)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
 public TSOpenSessionResp(TSStatus status, TSProtocolVersion serverProtocolVersion) : this()
 {
     this.Status = status;
     this.ServerProtocolVersion = serverProtocolVersion;
 }
Esempio n. 8
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_status = 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.Struct)
                        {
                            Status = new TSStatus();
                            await Status.ReadAsync(iprot, cancellationToken);

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

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

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

                                ColumnsList = new List <string>(_list31.Count);
                                for (int _i32 = 0; _i32 < _list31.Count; ++_i32)
                                {
                                    string _elem33;
                                    _elem33 = await iprot.ReadStringAsync(cancellationToken);

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

                    case 4:
                        if (field.Type == TType.String)
                        {
                            DataType = await iprot.ReadStringAsync(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_status)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Esempio n. 9
0
 public TSFetchMetadataResp(TSStatus status) : this()
 {
     this.Status = status;
 }
Esempio n. 10
0
        public async Task ReadAsync(TProtocol iprot, CancellationToken cancellationToken)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_status   = false;
                bool   isset_timeZone = 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.Struct)
                        {
                            Status = new TSStatus();
                            await Status.ReadAsync(iprot, cancellationToken);

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

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

                            isset_timeZone = 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_status)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_timeZone)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Esempio n. 11
0
 public TSGetTimeZoneResp(TSStatus status, string timeZone) : this()
 {
     this.Status   = status;
     this.TimeZone = timeZone;
 }