예제 #1
0
 public void Read (TProtocol iprot)
 {
   bool isset_cf_def = 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.Struct) {
           Cf_def = new CfDef();
           Cf_def.Read(iprot);
           isset_cf_def = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_cf_def)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }
예제 #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.Struct) {
           Cf_def = new CfDef();
           Cf_def.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
예제 #3
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.String) {
           Name = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.String) {
           Strategy_class = iprot.ReadString();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.Map) {
           {
             Strategy_options = new Dictionary<string, string>();
             TMap _map60 = iprot.ReadMapBegin();
             for( int _i61 = 0; _i61 < _map60.Count; ++_i61)
             {
               string _key62;
               string _val63;
               _key62 = iprot.ReadString();
               _val63 = iprot.ReadString();
               Strategy_options[_key62] = _val63;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.I32) {
           Replication_factor = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.List) {
           {
             Cf_defs = new List<CfDef>();
             TList _list64 = iprot.ReadListBegin();
             for( int _i65 = 0; _i65 < _list64.Count; ++_i65)
             {
               CfDef _elem66 = new CfDef();
               _elem66 = new CfDef();
               _elem66.Read(iprot);
               Cf_defs.Add(_elem66);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 6:
         if (field.Type == TType.Bool) {
           Durable_writes = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
예제 #4
0
        public void Read(TProtocol iprot)
        {
            bool   isset_name           = false;
            bool   isset_strategy_class = false;
            bool   isset_cf_defs        = 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)
                    {
                        Name       = iprot.ReadString();
                        isset_name = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 3:
                    if (field.Type == TType.Map)
                    {
                        {
                            Strategy_options = new Dictionary <string, string>();
                            TMap _map73 = iprot.ReadMapBegin();
                            for (int _i74 = 0; _i74 < _map73.Count; ++_i74)
                            {
                                string _key75;
                                string _val76;
                                _key75 = iprot.ReadString();
                                _val76 = iprot.ReadString();
                                Strategy_options[_key75] = _val76;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            Cf_defs = new List <CfDef>();
                            TList _list77 = iprot.ReadListBegin();
                            for (int _i78 = 0; _i78 < _list77.Count; ++_i78)
                            {
                                CfDef _elem79 = new CfDef();
                                _elem79 = new CfDef();
                                _elem79.Read(iprot);
                                Cf_defs.Add(_elem79);
                            }
                            iprot.ReadListEnd();
                        }
                        isset_cf_defs = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_name)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_strategy_class)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_cf_defs)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
예제 #5
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.String)
                    {
                        Name = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 3:
                    if (field.Type == TType.Map)
                    {
                        {
                            Strategy_options = new Dictionary <string, string>();
                            TMap _map60 = iprot.ReadMapBegin();
                            for (int _i61 = 0; _i61 < _map60.Count; ++_i61)
                            {
                                string _key62;
                                string _val63;
                                _key62 = iprot.ReadString();
                                _val63 = iprot.ReadString();
                                Strategy_options[_key62] = _val63;
                            }
                            iprot.ReadMapEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                case 5:
                    if (field.Type == TType.List)
                    {
                        {
                            Cf_defs = new List <CfDef>();
                            TList _list64 = iprot.ReadListBegin();
                            for (int _i65 = 0; _i65 < _list64.Count; ++_i65)
                            {
                                CfDef _elem66 = new CfDef();
                                _elem66 = new CfDef();
                                _elem66.Read(iprot);
                                Cf_defs.Add(_elem66);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
예제 #6
0
 public void Read (TProtocol iprot)
 {
   bool isset_name = false;
   bool isset_strategy_class = false;
   bool isset_cf_defs = 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) {
           Name = iprot.ReadString();
           isset_name = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.String) {
           Strategy_class = iprot.ReadString();
           isset_strategy_class = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.Map) {
           {
             Strategy_options = new Dictionary<string, string>();
             TMap _map73 = iprot.ReadMapBegin();
             for( int _i74 = 0; _i74 < _map73.Count; ++_i74)
             {
               string _key75;
               string _val76;
               _key75 = iprot.ReadString();
               _val76 = iprot.ReadString();
               Strategy_options[_key75] = _val76;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.I32) {
           Replication_factor = iprot.ReadI32();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 5:
         if (field.Type == TType.List) {
           {
             Cf_defs = new List<CfDef>();
             TList _list77 = iprot.ReadListBegin();
             for( int _i78 = 0; _i78 < _list77.Count; ++_i78)
             {
               CfDef _elem79 = new CfDef();
               _elem79 = new CfDef();
               _elem79.Read(iprot);
               Cf_defs.Add(_elem79);
             }
             iprot.ReadListEnd();
           }
           isset_cf_defs = true;
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 6:
         if (field.Type == TType.Bool) {
           Durable_writes = iprot.ReadBool();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
   if (!isset_name)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_strategy_class)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
   if (!isset_cf_defs)
     throw new TProtocolException(TProtocolException.INVALID_DATA);
 }