예제 #1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.startRowOffset = iprot.readI64();
   struct.setStartRowOffsetIsSet(true);
   {
     org.apache.thrift.protocol.TList _list128 =
         new org.apache.thrift.protocol.TList(
             org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
     struct.rows = new ArrayList<TRow>(_list128.size);
     TRow _elem129;
     for (int _i130 = 0; _i130 < _list128.size; ++_i130) {
       _elem129 = new TRow();
       _elem129.read(iprot);
       struct.rows.add(_elem129);
     }
   }
   struct.setRowsIsSet(true);
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     {
       org.apache.thrift.protocol.TList _list131 =
           new org.apache.thrift.protocol.TList(
               org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
       struct.columns = new ArrayList<TColumn>(_list131.size);
       TColumn _elem132;
       for (int _i133 = 0; _i133 < _list131.size; ++_i133) {
         _elem132 = new TColumn();
         _elem132.read(iprot);
         struct.columns.add(_elem132);
       }
     }
     struct.setColumnsIsSet(true);
   }
   if (incoming.get(1)) {
     struct.binaryColumns = iprot.readBinary();
     struct.setBinaryColumnsIsSet(true);
   }
   if (incoming.get(2)) {
     struct.columnCount = iprot.readI32();
     struct.setColumnCountIsSet(true);
   }
 }
예제 #2
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct)
     throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField schemeField;
   iprot.readStructBegin();
   while (true) {
     schemeField = iprot.readFieldBegin();
     if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (schemeField.id) {
       case 1: // START_ROW_OFFSET
         if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
           struct.startRowOffset = iprot.readI64();
           struct.setStartRowOffsetIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // ROWS
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list118 = iprot.readListBegin();
             struct.rows = new ArrayList<TRow>(_list118.size);
             TRow _elem119;
             for (int _i120 = 0; _i120 < _list118.size; ++_i120) {
               _elem119 = new TRow();
               _elem119.read(iprot);
               struct.rows.add(_elem119);
             }
             iprot.readListEnd();
           }
           struct.setRowsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // COLUMNS
         if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list121 = iprot.readListBegin();
             struct.columns = new ArrayList<TColumn>(_list121.size);
             TColumn _elem122;
             for (int _i123 = 0; _i123 < _list121.size; ++_i123) {
               _elem122 = new TColumn();
               _elem122.read(iprot);
               struct.columns.add(_elem122);
             }
             iprot.readListEnd();
           }
           struct.setColumnsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // BINARY_COLUMNS
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.binaryColumns = iprot.readBinary();
           struct.setBinaryColumnsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // COLUMN_COUNT
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.columnCount = iprot.readI32();
           struct.setColumnCountIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   struct.validate();
 }