Exemplo n.º 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.Struct)
                    {
                        HiveObject = new HiveObjectRef();
                        HiveObject.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 3:
                    if (field.Type == TType.I32)
                    {
                        PrincipalType = (PrincipalType)iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
Exemplo n.º 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.Map)
                    {
                        {
                            UserPrivileges = new Dictionary <string, List <PrivilegeGrantInfo> >();
                            TMap _map12 = iprot.ReadMapBegin();
                            for (int _i13 = 0; _i13 < _map12.Count; ++_i13)
                            {
                                string _key14;
                                List <PrivilegeGrantInfo> _val15;
                                _key14 = iprot.ReadString();
                                {
                                    _val15 = new List <PrivilegeGrantInfo>();
                                    TList _list16 = iprot.ReadListBegin();
                                    for (int _i17 = 0; _i17 < _list16.Count; ++_i17)
                                    {
                                        PrivilegeGrantInfo _elem18 = new PrivilegeGrantInfo();
                                        _elem18 = new PrivilegeGrantInfo();
                                        _elem18.Read(iprot);
                                        _val15.Add(_elem18);
                                    }
                                    iprot.ReadListEnd();
                                }
                                UserPrivileges[_key14] = _val15;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Map)
                    {
                        {
                            GroupPrivileges = new Dictionary <string, List <PrivilegeGrantInfo> >();
                            TMap _map19 = iprot.ReadMapBegin();
                            for (int _i20 = 0; _i20 < _map19.Count; ++_i20)
                            {
                                string _key21;
                                List <PrivilegeGrantInfo> _val22;
                                _key21 = iprot.ReadString();
                                {
                                    _val22 = new List <PrivilegeGrantInfo>();
                                    TList _list23 = iprot.ReadListBegin();
                                    for (int _i24 = 0; _i24 < _list23.Count; ++_i24)
                                    {
                                        PrivilegeGrantInfo _elem25 = new PrivilegeGrantInfo();
                                        _elem25 = new PrivilegeGrantInfo();
                                        _elem25.Read(iprot);
                                        _val22.Add(_elem25);
                                    }
                                    iprot.ReadListEnd();
                                }
                                GroupPrivileges[_key21] = _val22;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Map)
                    {
                        {
                            RolePrivileges = new Dictionary <string, List <PrivilegeGrantInfo> >();
                            TMap _map26 = iprot.ReadMapBegin();
                            for (int _i27 = 0; _i27 < _map26.Count; ++_i27)
                            {
                                string _key28;
                                List <PrivilegeGrantInfo> _val29;
                                _key28 = iprot.ReadString();
                                {
                                    _val29 = new List <PrivilegeGrantInfo>();
                                    TList _list30 = iprot.ReadListBegin();
                                    for (int _i31 = 0; _i31 < _list30.Count; ++_i31)
                                    {
                                        PrivilegeGrantInfo _elem32 = new PrivilegeGrantInfo();
                                        _elem32 = new PrivilegeGrantInfo();
                                        _elem32.Read(iprot);
                                        _val29.Add(_elem32);
                                    }
                                    iprot.ReadListEnd();
                                }
                                RolePrivileges[_key28] = _val29;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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