@Override public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI64(struct.startRowOffset); { oprot.writeI32(struct.rows.size()); for (TRow _iter126 : struct.rows) { _iter126.write(oprot); } } BitSet optionals = new BitSet(); if (struct.isSetColumns()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetColumns()) { { oprot.writeI32(struct.columns.size()); for (TColumn _iter127 : struct.columns) { _iter127.write(oprot); } } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC); oprot.writeI64(struct.startRowOffset); oprot.writeFieldEnd(); if (struct.rows != null) { oprot.writeFieldBegin(ROWS_FIELD_DESC); { oprot.writeListBegin( new org.apache.thrift.protocol.TList( org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); for (TRow _iter124 : struct.rows) { _iter124.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } if (struct.columns != null) { if (struct.isSetColumns()) { oprot.writeFieldBegin(COLUMNS_FIELD_DESC); { oprot.writeListBegin( new org.apache.thrift.protocol.TList( org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); for (TColumn _iter125 : struct.columns) { _iter125.write(oprot); } oprot.writeListEnd(); } oprot.writeFieldEnd(); } } if (struct.binaryColumns != null) { if (struct.isSetBinaryColumns()) { oprot.writeFieldBegin(BINARY_COLUMNS_FIELD_DESC); oprot.writeBinary(struct.binaryColumns); oprot.writeFieldEnd(); } } if (struct.isSetColumnCount()) { oprot.writeFieldBegin(COLUMN_COUNT_FIELD_DESC); oprot.writeI32(struct.columnCount); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@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); } }
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(); }