Read() public method

public Read ( TProtocol iprot ) : void
iprot Thrift.Protocol.TProtocol
return void
Beispiel #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.String) {
           TableName = iprot.ReadBinary();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.List) {
           {
             RowBatches = new List<BatchMutation>();
             TList _list191 = iprot.ReadListBegin();
             for( int _i192 = 0; _i192 < _list191.Count; ++_i192)
             {
               BatchMutation _elem193 = new BatchMutation();
               _elem193 = new BatchMutation();
               _elem193.Read(iprot);
               RowBatches.Add(_elem193);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.Map) {
           {
             Attributes = new Dictionary<byte[], byte[]>();
             TMap _map194 = iprot.ReadMapBegin();
             for( int _i195 = 0; _i195 < _map194.Count; ++_i195)
             {
               byte[] _key196;
               byte[] _val197;
               _key196 = iprot.ReadBinary();
               _val197 = iprot.ReadBinary();
               Attributes[_key196] = _val197;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Beispiel #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.String) {
           TableName = iprot.ReadBinary();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.List) {
           {
             RowBatches = new List<BatchMutation>();
             TList _list200 = iprot.ReadListBegin();
             for( int _i201 = 0; _i201 < _list200.Count; ++_i201)
             {
               BatchMutation _elem202 = new BatchMutation();
               _elem202 = new BatchMutation();
               _elem202.Read(iprot);
               RowBatches.Add(_elem202);
             }
             iprot.ReadListEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 3:
         if (field.Type == TType.I64) {
           Timestamp = iprot.ReadI64();
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 4:
         if (field.Type == TType.Map) {
           {
             Attributes = new Dictionary<byte[], byte[]>();
             TMap _map203 = iprot.ReadMapBegin();
             for( int _i204 = 0; _i204 < _map203.Count; ++_i204)
             {
               byte[] _key205;
               byte[] _val206;
               _key205 = iprot.ReadBinary();
               _val206 = iprot.ReadBinary();
               Attributes[_key205] = _val206;
             }
             iprot.ReadMapEnd();
           }
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Beispiel #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) {
       TableName = iprot.ReadBinary();
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       case 2:
     if (field.Type == TType.List) {
       {
         RowBatches = new List<BatchMutation>();
         TList _list70 = iprot.ReadListBegin();
         for( int _i71 = 0; _i71 < _list70.Count; ++_i71)
         {
           BatchMutation _elem72 = new BatchMutation();
           _elem72 = new BatchMutation();
           _elem72.Read(iprot);
           RowBatches.Add(_elem72);
         }
         iprot.ReadListEnd();
       }
     } else {
       TProtocolUtil.Skip(iprot, field.Type);
     }
     break;
       default:
     TProtocolUtil.Skip(iprot, field.Type);
     break;
     }
     iprot.ReadFieldEnd();
       }
       iprot.ReadStructEnd();
 }