示例#1
0
 public DropPartitionsRequest(string dbName, string tblName, RequestPartsSpec parts)
     : this()
 {
     this.DbName  = dbName;
     this.TblName = tblName;
     this.Parts   = parts;
 }
示例#2
0
        public void Read(TProtocol iprot)
        {
            bool   isset_dbName  = false;
            bool   isset_tblName = false;
            bool   isset_parts   = 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.String)
                    {
                        DbName       = iprot.ReadString();
                        isset_dbName = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 3:
                    if (field.Type == TType.Struct)
                    {
                        Parts = new RequestPartsSpec();
                        Parts.Read(iprot);
                        isset_parts = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.Bool)
                    {
                        DeleteData = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.Bool)
                    {
                        IfExists = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 6:
                    if (field.Type == TType.Bool)
                    {
                        IgnoreProtection = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 8:
                    if (field.Type == TType.Bool)
                    {
                        NeedResult = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_dbName)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_tblName)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_parts)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }