Ejemplo n.º 1
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_type                    = false;
                bool   isset_encodings               = false;
                bool   isset_path_in_schema          = false;
                bool   isset_codec                   = false;
                bool   isset_num_values              = false;
                bool   isset_total_uncompressed_size = false;
                bool   isset_total_compressed_size   = false;
                bool   isset_data_page_offset        = false;
                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)
                        {
                            Type       = (Type)iprot.ReadI32();
                            isset_type = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Encodings = new List <Encoding>();
                                TList _list0 = iprot.ReadListBegin();
                                for (int _i1 = 0; _i1 < _list0.Count; ++_i1)
                                {
                                    Encoding _elem2;
                                    _elem2 = (Encoding)iprot.ReadI32();
                                    Encodings.Add(_elem2);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_encodings = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.List)
                        {
                            {
                                Path_in_schema = new List <string>();
                                TList _list3 = iprot.ReadListBegin();
                                for (int _i4 = 0; _i4 < _list3.Count; ++_i4)
                                {
                                    string _elem5;
                                    _elem5 = iprot.ReadString();
                                    Path_in_schema.Add(_elem5);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_path_in_schema = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.I32)
                        {
                            Codec       = (CompressionCodec)iprot.ReadI32();
                            isset_codec = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.I64)
                        {
                            Num_values       = iprot.ReadI64();
                            isset_num_values = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.I64)
                        {
                            Total_uncompressed_size       = iprot.ReadI64();
                            isset_total_uncompressed_size = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.I64)
                        {
                            Total_compressed_size       = iprot.ReadI64();
                            isset_total_compressed_size = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.List)
                        {
                            {
                                Key_value_metadata = new List <KeyValue>();
                                TList _list6 = iprot.ReadListBegin();
                                for (int _i7 = 0; _i7 < _list6.Count; ++_i7)
                                {
                                    KeyValue _elem8;
                                    _elem8 = new KeyValue();
                                    _elem8.Read(iprot);
                                    Key_value_metadata.Add(_elem8);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.I64)
                        {
                            Data_page_offset       = iprot.ReadI64();
                            isset_data_page_offset = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 10:
                        if (field.Type == TType.I64)
                        {
                            Index_page_offset = iprot.ReadI64();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 11:
                        if (field.Type == TType.I64)
                        {
                            Dictionary_page_offset = iprot.ReadI64();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 12:
                        if (field.Type == TType.Struct)
                        {
                            Statistics = new Statistics();
                            Statistics.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 13:
                        if (field.Type == TType.List)
                        {
                            {
                                Encoding_stats = new List <PageEncodingStats>();
                                TList _list9 = iprot.ReadListBegin();
                                for (int _i10 = 0; _i10 < _list9.Count; ++_i10)
                                {
                                    PageEncodingStats _elem11;
                                    _elem11 = new PageEncodingStats();
                                    _elem11.Read(iprot);
                                    Encoding_stats.Add(_elem11);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_type)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_encodings)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_path_in_schema)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_codec)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_num_values)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_total_uncompressed_size)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_total_compressed_size)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_data_page_offset)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Ejemplo n.º 2
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_version    = false;
                bool   isset_schema     = false;
                bool   isset_num_rows   = false;
                bool   isset_row_groups = false;
                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)
                        {
                            Version       = iprot.ReadI32();
                            isset_version = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Schema = new List <SchemaElement>();
                                TList _list24 = iprot.ReadListBegin();
                                for (int _i25 = 0; _i25 < _list24.Count; ++_i25)
                                {
                                    SchemaElement _elem26;
                                    _elem26 = new SchemaElement();
                                    _elem26.Read(iprot);
                                    Schema.Add(_elem26);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_schema = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I64)
                        {
                            Num_rows       = iprot.ReadI64();
                            isset_num_rows = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                Row_groups = new List <RowGroup>();
                                TList _list27 = iprot.ReadListBegin();
                                for (int _i28 = 0; _i28 < _list27.Count; ++_i28)
                                {
                                    RowGroup _elem29;
                                    _elem29 = new RowGroup();
                                    _elem29.Read(iprot);
                                    Row_groups.Add(_elem29);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_row_groups = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                Key_value_metadata = new List <KeyValue>();
                                TList _list30 = iprot.ReadListBegin();
                                for (int _i31 = 0; _i31 < _list30.Count; ++_i31)
                                {
                                    KeyValue _elem32;
                                    _elem32 = new KeyValue();
                                    _elem32.Read(iprot);
                                    Key_value_metadata.Add(_elem32);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.String)
                        {
                            Created_by = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_version)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_schema)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_num_rows)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_row_groups)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
Ejemplo n.º 3
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                bool   isset_version    = false;
                bool   isset_schema     = false;
                bool   isset_num_rows   = false;
                bool   isset_row_groups = false;
                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)
                        {
                            Version       = iprot.ReadI32();
                            isset_version = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 2:
                        if (field.Type == TType.List)
                        {
                            {
                                Schema = new List <SchemaElement>();
                                TList _list48 = iprot.ReadListBegin();
                                for (int _i49 = 0; _i49 < _list48.Count; ++_i49)
                                {
                                    SchemaElement _elem50;
                                    _elem50 = new SchemaElement();
                                    _elem50.Read(iprot);
                                    Schema.Add(_elem50);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_schema = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 3:
                        if (field.Type == TType.I64)
                        {
                            Num_rows       = iprot.ReadI64();
                            isset_num_rows = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 4:
                        if (field.Type == TType.List)
                        {
                            {
                                Row_groups = new List <RowGroup>();
                                TList _list51 = iprot.ReadListBegin();
                                for (int _i52 = 0; _i52 < _list51.Count; ++_i52)
                                {
                                    RowGroup _elem53;
                                    _elem53 = new RowGroup();
                                    _elem53.Read(iprot);
                                    Row_groups.Add(_elem53);
                                }
                                iprot.ReadListEnd();
                            }
                            isset_row_groups = true;
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 5:
                        if (field.Type == TType.List)
                        {
                            {
                                Key_value_metadata = new List <KeyValue>();
                                TList _list54 = iprot.ReadListBegin();
                                for (int _i55 = 0; _i55 < _list54.Count; ++_i55)
                                {
                                    KeyValue _elem56;
                                    _elem56 = new KeyValue();
                                    _elem56.Read(iprot);
                                    Key_value_metadata.Add(_elem56);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 6:
                        if (field.Type == TType.String)
                        {
                            Created_by = iprot.ReadString();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 7:
                        if (field.Type == TType.List)
                        {
                            {
                                Column_orders = new List <ColumnOrder>();
                                TList _list57 = iprot.ReadListBegin();
                                for (int _i58 = 0; _i58 < _list57.Count; ++_i58)
                                {
                                    ColumnOrder _elem59;
                                    _elem59 = new ColumnOrder();
                                    _elem59.Read(iprot);
                                    Column_orders.Add(_elem59);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 8:
                        if (field.Type == TType.Struct)
                        {
                            Encryption_algorithm = new EncryptionAlgorithm();
                            Encryption_algorithm.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 9:
                        if (field.Type == TType.String)
                        {
                            Footer_signing_key_metadata = iprot.ReadBinary();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
                if (!isset_version)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_schema)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_num_rows)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
                if (!isset_row_groups)
                {
                    throw new TProtocolException(TProtocolException.INVALID_DATA);
                }
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }