示例#1
0
        public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.List)
                    {
                        {
                            this.columns = new List <ColumnDef>();
                            TList _list0 = iprot.ReadListBegin();
                            for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                            {
                                ColumnDef _elem2 = new ColumnDef();
                                _elem2 = new ColumnDef();
                                _elem2.Read(iprot);
                                this.columns.Add(_elem2);
                            }
                            iprot.ReadListEnd();
                        }
                        this.__isset.columns = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Struct)
                    {
                        this.schema_prop = new SchemaProp();
                        this.schema_prop.Read(iprot);
                        this.__isset.schema_prop = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
示例#2
0
        public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.I32)
                    {
                        this.index_id         = iprot.ReadI32();
                        this.__isset.index_id = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        this.index_name         = iprot.ReadBinary();
                        this.__isset.index_name = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Struct)
                    {
                        this.schema_id = new SchemaID();
                        this.schema_id.Read(iprot);
                        this.__isset.schema_id = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.String)
                    {
                        this.schema_name         = iprot.ReadBinary();
                        this.__isset.schema_name = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            this.fields = new List <ColumnDef>();
                            TList _list4 = iprot.ReadListBegin();
                            for (int _i5 = 0; _i5 < _list4.Count; ++_i5)
                            {
                                ColumnDef _elem6 = new ColumnDef();
                                _elem6 = new ColumnDef();
                                _elem6.Read(iprot);
                                this.fields.Add(_elem6);
                            }
                            iprot.ReadListEnd();
                        }
                        this.__isset.fields = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }