Back to home page

OSCL-LXR

 
 

    


0001 /**
0002  * Autogenerated by Thrift Compiler (0.9.3)
0003  *
0004  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
0005  *  @generated
0006  */
0007 package org.apache.hive.service.rpc.thrift;
0008 
0009 import org.apache.thrift.scheme.IScheme;
0010 import org.apache.thrift.scheme.SchemeFactory;
0011 import org.apache.thrift.scheme.StandardScheme;
0012 
0013 import org.apache.thrift.scheme.TupleScheme;
0014 import org.apache.thrift.protocol.TTupleProtocol;
0015 import org.apache.thrift.protocol.TProtocolException;
0016 import org.apache.thrift.EncodingUtils;
0017 import org.apache.thrift.TException;
0018 import org.apache.thrift.async.AsyncMethodCallback;
0019 import org.apache.thrift.server.AbstractNonblockingServer.*;
0020 import java.util.List;
0021 import java.util.ArrayList;
0022 import java.util.Map;
0023 import java.util.HashMap;
0024 import java.util.EnumMap;
0025 import java.util.Set;
0026 import java.util.HashSet;
0027 import java.util.EnumSet;
0028 import java.util.Collections;
0029 import java.util.BitSet;
0030 import java.nio.ByteBuffer;
0031 import java.util.Arrays;
0032 import javax.annotation.Generated;
0033 import org.slf4j.Logger;
0034 import org.slf4j.LoggerFactory;
0035 
0036 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
0037 @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
0038 public class TRowSet implements org.apache.thrift.TBase<TRowSet, TRowSet._Fields>, java.io.Serializable, Cloneable, Comparable<TRowSet> {
0039   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet");
0040 
0041   private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startRowOffset", org.apache.thrift.protocol.TType.I64, (short)1);
0042   private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2);
0043   private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3);
0044   private static final org.apache.thrift.protocol.TField BINARY_COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryColumns", org.apache.thrift.protocol.TType.STRING, (short)4);
0045   private static final org.apache.thrift.protocol.TField COLUMN_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("columnCount", org.apache.thrift.protocol.TType.I32, (short)5);
0046 
0047   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0048   static {
0049     schemes.put(StandardScheme.class, new TRowSetStandardSchemeFactory());
0050     schemes.put(TupleScheme.class, new TRowSetTupleSchemeFactory());
0051   }
0052 
0053   private long startRowOffset; // required
0054   private List<TRow> rows; // required
0055   private List<TColumn> columns; // optional
0056   private ByteBuffer binaryColumns; // optional
0057   private int columnCount; // optional
0058 
0059   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
0060   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0061     START_ROW_OFFSET((short)1, "startRowOffset"),
0062     ROWS((short)2, "rows"),
0063     COLUMNS((short)3, "columns"),
0064     BINARY_COLUMNS((short)4, "binaryColumns"),
0065     COLUMN_COUNT((short)5, "columnCount");
0066 
0067     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0068 
0069     static {
0070       for (_Fields field : EnumSet.allOf(_Fields.class)) {
0071         byName.put(field.getFieldName(), field);
0072       }
0073     }
0074 
0075     /**
0076      * Find the _Fields constant that matches fieldId, or null if its not found.
0077      */
0078     public static _Fields findByThriftId(int fieldId) {
0079       switch(fieldId) {
0080         case 1: // START_ROW_OFFSET
0081           return START_ROW_OFFSET;
0082         case 2: // ROWS
0083           return ROWS;
0084         case 3: // COLUMNS
0085           return COLUMNS;
0086         case 4: // BINARY_COLUMNS
0087           return BINARY_COLUMNS;
0088         case 5: // COLUMN_COUNT
0089           return COLUMN_COUNT;
0090         default:
0091           return null;
0092       }
0093     }
0094 
0095     /**
0096      * Find the _Fields constant that matches fieldId, throwing an exception
0097      * if it is not found.
0098      */
0099     public static _Fields findByThriftIdOrThrow(int fieldId) {
0100       _Fields fields = findByThriftId(fieldId);
0101       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0102       return fields;
0103     }
0104 
0105     /**
0106      * Find the _Fields constant that matches name, or null if its not found.
0107      */
0108     public static _Fields findByName(String name) {
0109       return byName.get(name);
0110     }
0111 
0112     private final short _thriftId;
0113     private final String _fieldName;
0114 
0115     _Fields(short thriftId, String fieldName) {
0116       _thriftId = thriftId;
0117       _fieldName = fieldName;
0118     }
0119 
0120     public short getThriftFieldId() {
0121       return _thriftId;
0122     }
0123 
0124     public String getFieldName() {
0125       return _fieldName;
0126     }
0127   }
0128 
0129   // isset id assignments
0130   private static final int __STARTROWOFFSET_ISSET_ID = 0;
0131   private static final int __COLUMNCOUNT_ISSET_ID = 1;
0132   private byte __isset_bitfield = 0;
0133   private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.BINARY_COLUMNS,_Fields.COLUMN_COUNT};
0134   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0135   static {
0136     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0137     tmpMap.put(_Fields.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0138         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
0139     tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0140         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
0141             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRow.class))));
0142     tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0143         new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
0144             new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class))));
0145     tmpMap.put(_Fields.BINARY_COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("binaryColumns", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0146         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
0147     tmpMap.put(_Fields.COLUMN_COUNT, new org.apache.thrift.meta_data.FieldMetaData("columnCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0148         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
0149     metaDataMap = Collections.unmodifiableMap(tmpMap);
0150     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap);
0151   }
0152 
0153   public TRowSet() {
0154   }
0155 
0156   public TRowSet(
0157     long startRowOffset,
0158     List<TRow> rows)
0159   {
0160     this();
0161     this.startRowOffset = startRowOffset;
0162     setStartRowOffsetIsSet(true);
0163     this.rows = rows;
0164   }
0165 
0166   /**
0167    * Performs a deep copy on <i>other</i>.
0168    */
0169   public TRowSet(TRowSet other) {
0170     __isset_bitfield = other.__isset_bitfield;
0171     this.startRowOffset = other.startRowOffset;
0172     if (other.isSetRows()) {
0173       List<TRow> __this__rows = new ArrayList<TRow>(other.rows.size());
0174       for (TRow other_element : other.rows) {
0175         __this__rows.add(new TRow(other_element));
0176       }
0177       this.rows = __this__rows;
0178     }
0179     if (other.isSetColumns()) {
0180       List<TColumn> __this__columns = new ArrayList<TColumn>(other.columns.size());
0181       for (TColumn other_element : other.columns) {
0182         __this__columns.add(new TColumn(other_element));
0183       }
0184       this.columns = __this__columns;
0185     }
0186     if (other.isSetBinaryColumns()) {
0187       this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(other.binaryColumns);
0188     }
0189     this.columnCount = other.columnCount;
0190   }
0191 
0192   public TRowSet deepCopy() {
0193     return new TRowSet(this);
0194   }
0195 
0196   @Override
0197   public void clear() {
0198     setStartRowOffsetIsSet(false);
0199     this.startRowOffset = 0;
0200     this.rows = null;
0201     this.columns = null;
0202     this.binaryColumns = null;
0203     setColumnCountIsSet(false);
0204     this.columnCount = 0;
0205   }
0206 
0207   public long getStartRowOffset() {
0208     return this.startRowOffset;
0209   }
0210 
0211   public void setStartRowOffset(long startRowOffset) {
0212     this.startRowOffset = startRowOffset;
0213     setStartRowOffsetIsSet(true);
0214   }
0215 
0216   public void unsetStartRowOffset() {
0217     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID);
0218   }
0219 
0220   /** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */
0221   public boolean isSetStartRowOffset() {
0222     return EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID);
0223   }
0224 
0225   public void setStartRowOffsetIsSet(boolean value) {
0226     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value);
0227   }
0228 
0229   public int getRowsSize() {
0230     return (this.rows == null) ? 0 : this.rows.size();
0231   }
0232 
0233   public java.util.Iterator<TRow> getRowsIterator() {
0234     return (this.rows == null) ? null : this.rows.iterator();
0235   }
0236 
0237   public void addToRows(TRow elem) {
0238     if (this.rows == null) {
0239       this.rows = new ArrayList<TRow>();
0240     }
0241     this.rows.add(elem);
0242   }
0243 
0244   public List<TRow> getRows() {
0245     return this.rows;
0246   }
0247 
0248   public void setRows(List<TRow> rows) {
0249     this.rows = rows;
0250   }
0251 
0252   public void unsetRows() {
0253     this.rows = null;
0254   }
0255 
0256   /** Returns true if field rows is set (has been assigned a value) and false otherwise */
0257   public boolean isSetRows() {
0258     return this.rows != null;
0259   }
0260 
0261   public void setRowsIsSet(boolean value) {
0262     if (!value) {
0263       this.rows = null;
0264     }
0265   }
0266 
0267   public int getColumnsSize() {
0268     return (this.columns == null) ? 0 : this.columns.size();
0269   }
0270 
0271   public java.util.Iterator<TColumn> getColumnsIterator() {
0272     return (this.columns == null) ? null : this.columns.iterator();
0273   }
0274 
0275   public void addToColumns(TColumn elem) {
0276     if (this.columns == null) {
0277       this.columns = new ArrayList<TColumn>();
0278     }
0279     this.columns.add(elem);
0280   }
0281 
0282   public List<TColumn> getColumns() {
0283     return this.columns;
0284   }
0285 
0286   public void setColumns(List<TColumn> columns) {
0287     this.columns = columns;
0288   }
0289 
0290   public void unsetColumns() {
0291     this.columns = null;
0292   }
0293 
0294   /** Returns true if field columns is set (has been assigned a value) and false otherwise */
0295   public boolean isSetColumns() {
0296     return this.columns != null;
0297   }
0298 
0299   public void setColumnsIsSet(boolean value) {
0300     if (!value) {
0301       this.columns = null;
0302     }
0303   }
0304 
0305   public byte[] getBinaryColumns() {
0306     setBinaryColumns(org.apache.thrift.TBaseHelper.rightSize(binaryColumns));
0307     return binaryColumns == null ? null : binaryColumns.array();
0308   }
0309 
0310   public ByteBuffer bufferForBinaryColumns() {
0311     return org.apache.thrift.TBaseHelper.copyBinary(binaryColumns);
0312   }
0313 
0314   public void setBinaryColumns(byte[] binaryColumns) {
0315     this.binaryColumns = binaryColumns == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(binaryColumns, binaryColumns.length));
0316   }
0317 
0318   public void setBinaryColumns(ByteBuffer binaryColumns) {
0319     this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(binaryColumns);
0320   }
0321 
0322   public void unsetBinaryColumns() {
0323     this.binaryColumns = null;
0324   }
0325 
0326   /** Returns true if field binaryColumns is set (has been assigned a value) and false otherwise */
0327   public boolean isSetBinaryColumns() {
0328     return this.binaryColumns != null;
0329   }
0330 
0331   public void setBinaryColumnsIsSet(boolean value) {
0332     if (!value) {
0333       this.binaryColumns = null;
0334     }
0335   }
0336 
0337   public int getColumnCount() {
0338     return this.columnCount;
0339   }
0340 
0341   public void setColumnCount(int columnCount) {
0342     this.columnCount = columnCount;
0343     setColumnCountIsSet(true);
0344   }
0345 
0346   public void unsetColumnCount() {
0347     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID);
0348   }
0349 
0350   /** Returns true if field columnCount is set (has been assigned a value) and false otherwise */
0351   public boolean isSetColumnCount() {
0352     return EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID);
0353   }
0354 
0355   public void setColumnCountIsSet(boolean value) {
0356     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value);
0357   }
0358 
0359   public void setFieldValue(_Fields field, Object value) {
0360     switch (field) {
0361     case START_ROW_OFFSET:
0362       if (value == null) {
0363         unsetStartRowOffset();
0364       } else {
0365         setStartRowOffset((Long)value);
0366       }
0367       break;
0368 
0369     case ROWS:
0370       if (value == null) {
0371         unsetRows();
0372       } else {
0373         setRows((List<TRow>)value);
0374       }
0375       break;
0376 
0377     case COLUMNS:
0378       if (value == null) {
0379         unsetColumns();
0380       } else {
0381         setColumns((List<TColumn>)value);
0382       }
0383       break;
0384 
0385     case BINARY_COLUMNS:
0386       if (value == null) {
0387         unsetBinaryColumns();
0388       } else {
0389         setBinaryColumns((ByteBuffer)value);
0390       }
0391       break;
0392 
0393     case COLUMN_COUNT:
0394       if (value == null) {
0395         unsetColumnCount();
0396       } else {
0397         setColumnCount((Integer)value);
0398       }
0399       break;
0400 
0401     }
0402   }
0403 
0404   public Object getFieldValue(_Fields field) {
0405     switch (field) {
0406     case START_ROW_OFFSET:
0407       return getStartRowOffset();
0408 
0409     case ROWS:
0410       return getRows();
0411 
0412     case COLUMNS:
0413       return getColumns();
0414 
0415     case BINARY_COLUMNS:
0416       return getBinaryColumns();
0417 
0418     case COLUMN_COUNT:
0419       return getColumnCount();
0420 
0421     }
0422     throw new IllegalStateException();
0423   }
0424 
0425   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0426   public boolean isSet(_Fields field) {
0427     if (field == null) {
0428       throw new IllegalArgumentException();
0429     }
0430 
0431     switch (field) {
0432     case START_ROW_OFFSET:
0433       return isSetStartRowOffset();
0434     case ROWS:
0435       return isSetRows();
0436     case COLUMNS:
0437       return isSetColumns();
0438     case BINARY_COLUMNS:
0439       return isSetBinaryColumns();
0440     case COLUMN_COUNT:
0441       return isSetColumnCount();
0442     }
0443     throw new IllegalStateException();
0444   }
0445 
0446   @Override
0447   public boolean equals(Object that) {
0448     if (that == null)
0449       return false;
0450     if (that instanceof TRowSet)
0451       return this.equals((TRowSet)that);
0452     return false;
0453   }
0454 
0455   public boolean equals(TRowSet that) {
0456     if (that == null)
0457       return false;
0458 
0459     boolean this_present_startRowOffset = true;
0460     boolean that_present_startRowOffset = true;
0461     if (this_present_startRowOffset || that_present_startRowOffset) {
0462       if (!(this_present_startRowOffset && that_present_startRowOffset))
0463         return false;
0464       if (this.startRowOffset != that.startRowOffset)
0465         return false;
0466     }
0467 
0468     boolean this_present_rows = true && this.isSetRows();
0469     boolean that_present_rows = true && that.isSetRows();
0470     if (this_present_rows || that_present_rows) {
0471       if (!(this_present_rows && that_present_rows))
0472         return false;
0473       if (!this.rows.equals(that.rows))
0474         return false;
0475     }
0476 
0477     boolean this_present_columns = true && this.isSetColumns();
0478     boolean that_present_columns = true && that.isSetColumns();
0479     if (this_present_columns || that_present_columns) {
0480       if (!(this_present_columns && that_present_columns))
0481         return false;
0482       if (!this.columns.equals(that.columns))
0483         return false;
0484     }
0485 
0486     boolean this_present_binaryColumns = true && this.isSetBinaryColumns();
0487     boolean that_present_binaryColumns = true && that.isSetBinaryColumns();
0488     if (this_present_binaryColumns || that_present_binaryColumns) {
0489       if (!(this_present_binaryColumns && that_present_binaryColumns))
0490         return false;
0491       if (!this.binaryColumns.equals(that.binaryColumns))
0492         return false;
0493     }
0494 
0495     boolean this_present_columnCount = true && this.isSetColumnCount();
0496     boolean that_present_columnCount = true && that.isSetColumnCount();
0497     if (this_present_columnCount || that_present_columnCount) {
0498       if (!(this_present_columnCount && that_present_columnCount))
0499         return false;
0500       if (this.columnCount != that.columnCount)
0501         return false;
0502     }
0503 
0504     return true;
0505   }
0506 
0507   @Override
0508   public int hashCode() {
0509     List<Object> list = new ArrayList<Object>();
0510 
0511     boolean present_startRowOffset = true;
0512     list.add(present_startRowOffset);
0513     if (present_startRowOffset)
0514       list.add(startRowOffset);
0515 
0516     boolean present_rows = true && (isSetRows());
0517     list.add(present_rows);
0518     if (present_rows)
0519       list.add(rows);
0520 
0521     boolean present_columns = true && (isSetColumns());
0522     list.add(present_columns);
0523     if (present_columns)
0524       list.add(columns);
0525 
0526     boolean present_binaryColumns = true && (isSetBinaryColumns());
0527     list.add(present_binaryColumns);
0528     if (present_binaryColumns)
0529       list.add(binaryColumns);
0530 
0531     boolean present_columnCount = true && (isSetColumnCount());
0532     list.add(present_columnCount);
0533     if (present_columnCount)
0534       list.add(columnCount);
0535 
0536     return list.hashCode();
0537   }
0538 
0539   @Override
0540   public int compareTo(TRowSet other) {
0541     if (!getClass().equals(other.getClass())) {
0542       return getClass().getName().compareTo(other.getClass().getName());
0543     }
0544 
0545     int lastComparison = 0;
0546 
0547     lastComparison = Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset());
0548     if (lastComparison != 0) {
0549       return lastComparison;
0550     }
0551     if (isSetStartRowOffset()) {
0552       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRowOffset, other.startRowOffset);
0553       if (lastComparison != 0) {
0554         return lastComparison;
0555       }
0556     }
0557     lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows());
0558     if (lastComparison != 0) {
0559       return lastComparison;
0560     }
0561     if (isSetRows()) {
0562       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows);
0563       if (lastComparison != 0) {
0564         return lastComparison;
0565       }
0566     }
0567     lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns());
0568     if (lastComparison != 0) {
0569       return lastComparison;
0570     }
0571     if (isSetColumns()) {
0572       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns);
0573       if (lastComparison != 0) {
0574         return lastComparison;
0575       }
0576     }
0577     lastComparison = Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns());
0578     if (lastComparison != 0) {
0579       return lastComparison;
0580     }
0581     if (isSetBinaryColumns()) {
0582       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryColumns, other.binaryColumns);
0583       if (lastComparison != 0) {
0584         return lastComparison;
0585       }
0586     }
0587     lastComparison = Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount());
0588     if (lastComparison != 0) {
0589       return lastComparison;
0590     }
0591     if (isSetColumnCount()) {
0592       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnCount, other.columnCount);
0593       if (lastComparison != 0) {
0594         return lastComparison;
0595       }
0596     }
0597     return 0;
0598   }
0599 
0600   public _Fields fieldForId(int fieldId) {
0601     return _Fields.findByThriftId(fieldId);
0602   }
0603 
0604   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0605     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0606   }
0607 
0608   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0609     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0610   }
0611 
0612   @Override
0613   public String toString() {
0614     StringBuilder sb = new StringBuilder("TRowSet(");
0615     boolean first = true;
0616 
0617     sb.append("startRowOffset:");
0618     sb.append(this.startRowOffset);
0619     first = false;
0620     if (!first) sb.append(", ");
0621     sb.append("rows:");
0622     if (this.rows == null) {
0623       sb.append("null");
0624     } else {
0625       sb.append(this.rows);
0626     }
0627     first = false;
0628     if (isSetColumns()) {
0629       if (!first) sb.append(", ");
0630       sb.append("columns:");
0631       if (this.columns == null) {
0632         sb.append("null");
0633       } else {
0634         sb.append(this.columns);
0635       }
0636       first = false;
0637     }
0638     if (isSetBinaryColumns()) {
0639       if (!first) sb.append(", ");
0640       sb.append("binaryColumns:");
0641       if (this.binaryColumns == null) {
0642         sb.append("null");
0643       } else {
0644         org.apache.thrift.TBaseHelper.toString(this.binaryColumns, sb);
0645       }
0646       first = false;
0647     }
0648     if (isSetColumnCount()) {
0649       if (!first) sb.append(", ");
0650       sb.append("columnCount:");
0651       sb.append(this.columnCount);
0652       first = false;
0653     }
0654     sb.append(")");
0655     return sb.toString();
0656   }
0657 
0658   public void validate() throws org.apache.thrift.TException {
0659     // check for required fields
0660     if (!isSetStartRowOffset()) {
0661       throw new org.apache.thrift.protocol.TProtocolException("Required field 'startRowOffset' is unset! Struct:" + toString());
0662     }
0663 
0664     if (!isSetRows()) {
0665       throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString());
0666     }
0667 
0668     // check for sub-struct validity
0669   }
0670 
0671   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0672     try {
0673       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0674     } catch (org.apache.thrift.TException te) {
0675       throw new java.io.IOException(te);
0676     }
0677   }
0678 
0679   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0680     try {
0681       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
0682       __isset_bitfield = 0;
0683       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0684     } catch (org.apache.thrift.TException te) {
0685       throw new java.io.IOException(te);
0686     }
0687   }
0688 
0689   private static class TRowSetStandardSchemeFactory implements SchemeFactory {
0690     public TRowSetStandardScheme getScheme() {
0691       return new TRowSetStandardScheme();
0692     }
0693   }
0694 
0695   private static class TRowSetStandardScheme extends StandardScheme<TRowSet> {
0696 
0697     public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) throws org.apache.thrift.TException {
0698       org.apache.thrift.protocol.TField schemeField;
0699       iprot.readStructBegin();
0700       while (true)
0701       {
0702         schemeField = iprot.readFieldBegin();
0703         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0704           break;
0705         }
0706         switch (schemeField.id) {
0707           case 1: // START_ROW_OFFSET
0708             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
0709               struct.startRowOffset = iprot.readI64();
0710               struct.setStartRowOffsetIsSet(true);
0711             } else { 
0712               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0713             }
0714             break;
0715           case 2: // ROWS
0716             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
0717               {
0718                 org.apache.thrift.protocol.TList _list118 = iprot.readListBegin();
0719                 struct.rows = new ArrayList<TRow>(_list118.size);
0720                 TRow _elem119;
0721                 for (int _i120 = 0; _i120 < _list118.size; ++_i120)
0722                 {
0723                   _elem119 = new TRow();
0724                   _elem119.read(iprot);
0725                   struct.rows.add(_elem119);
0726                 }
0727                 iprot.readListEnd();
0728               }
0729               struct.setRowsIsSet(true);
0730             } else { 
0731               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0732             }
0733             break;
0734           case 3: // COLUMNS
0735             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
0736               {
0737                 org.apache.thrift.protocol.TList _list121 = iprot.readListBegin();
0738                 struct.columns = new ArrayList<TColumn>(_list121.size);
0739                 TColumn _elem122;
0740                 for (int _i123 = 0; _i123 < _list121.size; ++_i123)
0741                 {
0742                   _elem122 = new TColumn();
0743                   _elem122.read(iprot);
0744                   struct.columns.add(_elem122);
0745                 }
0746                 iprot.readListEnd();
0747               }
0748               struct.setColumnsIsSet(true);
0749             } else { 
0750               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0751             }
0752             break;
0753           case 4: // BINARY_COLUMNS
0754             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0755               struct.binaryColumns = iprot.readBinary();
0756               struct.setBinaryColumnsIsSet(true);
0757             } else { 
0758               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0759             }
0760             break;
0761           case 5: // COLUMN_COUNT
0762             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
0763               struct.columnCount = iprot.readI32();
0764               struct.setColumnCountIsSet(true);
0765             } else { 
0766               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0767             }
0768             break;
0769           default:
0770             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0771         }
0772         iprot.readFieldEnd();
0773       }
0774       iprot.readStructEnd();
0775       struct.validate();
0776     }
0777 
0778     public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) throws org.apache.thrift.TException {
0779       struct.validate();
0780 
0781       oprot.writeStructBegin(STRUCT_DESC);
0782       oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC);
0783       oprot.writeI64(struct.startRowOffset);
0784       oprot.writeFieldEnd();
0785       if (struct.rows != null) {
0786         oprot.writeFieldBegin(ROWS_FIELD_DESC);
0787         {
0788           oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size()));
0789           for (TRow _iter124 : struct.rows)
0790           {
0791             _iter124.write(oprot);
0792           }
0793           oprot.writeListEnd();
0794         }
0795         oprot.writeFieldEnd();
0796       }
0797       if (struct.columns != null) {
0798         if (struct.isSetColumns()) {
0799           oprot.writeFieldBegin(COLUMNS_FIELD_DESC);
0800           {
0801             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size()));
0802             for (TColumn _iter125 : struct.columns)
0803             {
0804               _iter125.write(oprot);
0805             }
0806             oprot.writeListEnd();
0807           }
0808           oprot.writeFieldEnd();
0809         }
0810       }
0811       if (struct.binaryColumns != null) {
0812         if (struct.isSetBinaryColumns()) {
0813           oprot.writeFieldBegin(BINARY_COLUMNS_FIELD_DESC);
0814           oprot.writeBinary(struct.binaryColumns);
0815           oprot.writeFieldEnd();
0816         }
0817       }
0818       if (struct.isSetColumnCount()) {
0819         oprot.writeFieldBegin(COLUMN_COUNT_FIELD_DESC);
0820         oprot.writeI32(struct.columnCount);
0821         oprot.writeFieldEnd();
0822       }
0823       oprot.writeFieldStop();
0824       oprot.writeStructEnd();
0825     }
0826 
0827   }
0828 
0829   private static class TRowSetTupleSchemeFactory implements SchemeFactory {
0830     public TRowSetTupleScheme getScheme() {
0831       return new TRowSetTupleScheme();
0832     }
0833   }
0834 
0835   private static class TRowSetTupleScheme extends TupleScheme<TRowSet> {
0836 
0837     @Override
0838     public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException {
0839       TTupleProtocol oprot = (TTupleProtocol) prot;
0840       oprot.writeI64(struct.startRowOffset);
0841       {
0842         oprot.writeI32(struct.rows.size());
0843         for (TRow _iter126 : struct.rows)
0844         {
0845           _iter126.write(oprot);
0846         }
0847       }
0848       BitSet optionals = new BitSet();
0849       if (struct.isSetColumns()) {
0850         optionals.set(0);
0851       }
0852       if (struct.isSetBinaryColumns()) {
0853         optionals.set(1);
0854       }
0855       if (struct.isSetColumnCount()) {
0856         optionals.set(2);
0857       }
0858       oprot.writeBitSet(optionals, 3);
0859       if (struct.isSetColumns()) {
0860         {
0861           oprot.writeI32(struct.columns.size());
0862           for (TColumn _iter127 : struct.columns)
0863           {
0864             _iter127.write(oprot);
0865           }
0866         }
0867       }
0868       if (struct.isSetBinaryColumns()) {
0869         oprot.writeBinary(struct.binaryColumns);
0870       }
0871       if (struct.isSetColumnCount()) {
0872         oprot.writeI32(struct.columnCount);
0873       }
0874     }
0875 
0876     @Override
0877     public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException {
0878       TTupleProtocol iprot = (TTupleProtocol) prot;
0879       struct.startRowOffset = iprot.readI64();
0880       struct.setStartRowOffsetIsSet(true);
0881       {
0882         org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
0883         struct.rows = new ArrayList<TRow>(_list128.size);
0884         TRow _elem129;
0885         for (int _i130 = 0; _i130 < _list128.size; ++_i130)
0886         {
0887           _elem129 = new TRow();
0888           _elem129.read(iprot);
0889           struct.rows.add(_elem129);
0890         }
0891       }
0892       struct.setRowsIsSet(true);
0893       BitSet incoming = iprot.readBitSet(3);
0894       if (incoming.get(0)) {
0895         {
0896           org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
0897           struct.columns = new ArrayList<TColumn>(_list131.size);
0898           TColumn _elem132;
0899           for (int _i133 = 0; _i133 < _list131.size; ++_i133)
0900           {
0901             _elem132 = new TColumn();
0902             _elem132.read(iprot);
0903             struct.columns.add(_elem132);
0904           }
0905         }
0906         struct.setColumnsIsSet(true);
0907       }
0908       if (incoming.get(1)) {
0909         struct.binaryColumns = iprot.readBinary();
0910         struct.setBinaryColumnsIsSet(true);
0911       }
0912       if (incoming.get(2)) {
0913         struct.columnCount = iprot.readI32();
0914         struct.setColumnCountIsSet(true);
0915       }
0916     }
0917   }
0918 
0919 }
0920