Back to home page

OSCL-LXR

 
 

    


0001 /**
0002  * Autogenerated by Thrift Compiler (0.9.0)
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.cli.thrift;
0008 
0009 import org.apache.commons.lang.builder.HashCodeBuilder;
0010 import org.apache.thrift.scheme.IScheme;
0011 import org.apache.thrift.scheme.SchemeFactory;
0012 import org.apache.thrift.scheme.StandardScheme;
0013 
0014 import org.apache.thrift.scheme.TupleScheme;
0015 import org.apache.thrift.protocol.TTupleProtocol;
0016 import org.apache.thrift.protocol.TProtocolException;
0017 import org.apache.thrift.EncodingUtils;
0018 import org.apache.thrift.TException;
0019 import java.util.List;
0020 import java.util.ArrayList;
0021 import java.util.Map;
0022 import java.util.HashMap;
0023 import java.util.EnumMap;
0024 import java.util.Set;
0025 import java.util.HashSet;
0026 import java.util.EnumSet;
0027 import java.util.Collections;
0028 import java.util.BitSet;
0029 import java.nio.ByteBuffer;
0030 import java.util.Arrays;
0031 import org.slf4j.Logger;
0032 import org.slf4j.LoggerFactory;
0033 
0034 public class TFetchResultsReq implements org.apache.thrift.TBase<TFetchResultsReq, TFetchResultsReq._Fields>, java.io.Serializable, Cloneable {
0035   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsReq");
0036 
0037   private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1);
0038   private static final org.apache.thrift.protocol.TField ORIENTATION_FIELD_DESC = new org.apache.thrift.protocol.TField("orientation", org.apache.thrift.protocol.TType.I32, (short)2);
0039   private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRows", org.apache.thrift.protocol.TType.I64, (short)3);
0040   private static final org.apache.thrift.protocol.TField FETCH_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchType", org.apache.thrift.protocol.TType.I16, (short)4);
0041 
0042   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0043   static {
0044     schemes.put(StandardScheme.class, new TFetchResultsReqStandardSchemeFactory());
0045     schemes.put(TupleScheme.class, new TFetchResultsReqTupleSchemeFactory());
0046   }
0047 
0048   private TOperationHandle operationHandle; // required
0049   private TFetchOrientation orientation; // required
0050   private long maxRows; // required
0051   private short fetchType; // optional
0052 
0053   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
0054   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0055     OPERATION_HANDLE((short)1, "operationHandle"),
0056     /**
0057      * 
0058      * @see TFetchOrientation
0059      */
0060     ORIENTATION((short)2, "orientation"),
0061     MAX_ROWS((short)3, "maxRows"),
0062     FETCH_TYPE((short)4, "fetchType");
0063 
0064     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0065 
0066     static {
0067       for (_Fields field : EnumSet.allOf(_Fields.class)) {
0068         byName.put(field.getFieldName(), field);
0069       }
0070     }
0071 
0072     /**
0073      * Find the _Fields constant that matches fieldId, or null if its not found.
0074      */
0075     public static _Fields findByThriftId(int fieldId) {
0076       switch(fieldId) {
0077         case 1: // OPERATION_HANDLE
0078           return OPERATION_HANDLE;
0079         case 2: // ORIENTATION
0080           return ORIENTATION;
0081         case 3: // MAX_ROWS
0082           return MAX_ROWS;
0083         case 4: // FETCH_TYPE
0084           return FETCH_TYPE;
0085         default:
0086           return null;
0087       }
0088     }
0089 
0090     /**
0091      * Find the _Fields constant that matches fieldId, throwing an exception
0092      * if it is not found.
0093      */
0094     public static _Fields findByThriftIdOrThrow(int fieldId) {
0095       _Fields fields = findByThriftId(fieldId);
0096       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0097       return fields;
0098     }
0099 
0100     /**
0101      * Find the _Fields constant that matches name, or null if its not found.
0102      */
0103     public static _Fields findByName(String name) {
0104       return byName.get(name);
0105     }
0106 
0107     private final short _thriftId;
0108     private final String _fieldName;
0109 
0110     _Fields(short thriftId, String fieldName) {
0111       _thriftId = thriftId;
0112       _fieldName = fieldName;
0113     }
0114 
0115     public short getThriftFieldId() {
0116       return _thriftId;
0117     }
0118 
0119     public String getFieldName() {
0120       return _fieldName;
0121     }
0122   }
0123 
0124   // isset id assignments
0125   private static final int __MAXROWS_ISSET_ID = 0;
0126   private static final int __FETCHTYPE_ISSET_ID = 1;
0127   private byte __isset_bitfield = 0;
0128   private _Fields optionals[] = {_Fields.FETCH_TYPE};
0129   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0130   static {
0131     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0132     tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0133         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class)));
0134     tmpMap.put(_Fields.ORIENTATION, new org.apache.thrift.meta_data.FieldMetaData("orientation", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0135         new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFetchOrientation.class)));
0136     tmpMap.put(_Fields.MAX_ROWS, new org.apache.thrift.meta_data.FieldMetaData("maxRows", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0137         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
0138     tmpMap.put(_Fields.FETCH_TYPE, new org.apache.thrift.meta_data.FieldMetaData("fetchType", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0139         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
0140     metaDataMap = Collections.unmodifiableMap(tmpMap);
0141     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsReq.class, metaDataMap);
0142   }
0143 
0144   public TFetchResultsReq() {
0145     this.orientation = org.apache.hive.service.cli.thrift.TFetchOrientation.FETCH_NEXT;
0146 
0147     this.fetchType = (short)0;
0148 
0149   }
0150 
0151   public TFetchResultsReq(
0152     TOperationHandle operationHandle,
0153     TFetchOrientation orientation,
0154     long maxRows)
0155   {
0156     this();
0157     this.operationHandle = operationHandle;
0158     this.orientation = orientation;
0159     this.maxRows = maxRows;
0160     setMaxRowsIsSet(true);
0161   }
0162 
0163   /**
0164    * Performs a deep copy on <i>other</i>.
0165    */
0166   public TFetchResultsReq(TFetchResultsReq other) {
0167     __isset_bitfield = other.__isset_bitfield;
0168     if (other.isSetOperationHandle()) {
0169       this.operationHandle = new TOperationHandle(other.operationHandle);
0170     }
0171     if (other.isSetOrientation()) {
0172       this.orientation = other.orientation;
0173     }
0174     this.maxRows = other.maxRows;
0175     this.fetchType = other.fetchType;
0176   }
0177 
0178   public TFetchResultsReq deepCopy() {
0179     return new TFetchResultsReq(this);
0180   }
0181 
0182   @Override
0183   public void clear() {
0184     this.operationHandle = null;
0185     this.orientation = org.apache.hive.service.cli.thrift.TFetchOrientation.FETCH_NEXT;
0186 
0187     setMaxRowsIsSet(false);
0188     this.maxRows = 0;
0189     this.fetchType = (short)0;
0190 
0191   }
0192 
0193   public TOperationHandle getOperationHandle() {
0194     return this.operationHandle;
0195   }
0196 
0197   public void setOperationHandle(TOperationHandle operationHandle) {
0198     this.operationHandle = operationHandle;
0199   }
0200 
0201   public void unsetOperationHandle() {
0202     this.operationHandle = null;
0203   }
0204 
0205   /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */
0206   public boolean isSetOperationHandle() {
0207     return this.operationHandle != null;
0208   }
0209 
0210   public void setOperationHandleIsSet(boolean value) {
0211     if (!value) {
0212       this.operationHandle = null;
0213     }
0214   }
0215 
0216   /**
0217    * 
0218    * @see TFetchOrientation
0219    */
0220   public TFetchOrientation getOrientation() {
0221     return this.orientation;
0222   }
0223 
0224   /**
0225    * 
0226    * @see TFetchOrientation
0227    */
0228   public void setOrientation(TFetchOrientation orientation) {
0229     this.orientation = orientation;
0230   }
0231 
0232   public void unsetOrientation() {
0233     this.orientation = null;
0234   }
0235 
0236   /** Returns true if field orientation is set (has been assigned a value) and false otherwise */
0237   public boolean isSetOrientation() {
0238     return this.orientation != null;
0239   }
0240 
0241   public void setOrientationIsSet(boolean value) {
0242     if (!value) {
0243       this.orientation = null;
0244     }
0245   }
0246 
0247   public long getMaxRows() {
0248     return this.maxRows;
0249   }
0250 
0251   public void setMaxRows(long maxRows) {
0252     this.maxRows = maxRows;
0253     setMaxRowsIsSet(true);
0254   }
0255 
0256   public void unsetMaxRows() {
0257     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID);
0258   }
0259 
0260   /** Returns true if field maxRows is set (has been assigned a value) and false otherwise */
0261   public boolean isSetMaxRows() {
0262     return EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID);
0263   }
0264 
0265   public void setMaxRowsIsSet(boolean value) {
0266     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value);
0267   }
0268 
0269   public short getFetchType() {
0270     return this.fetchType;
0271   }
0272 
0273   public void setFetchType(short fetchType) {
0274     this.fetchType = fetchType;
0275     setFetchTypeIsSet(true);
0276   }
0277 
0278   public void unsetFetchType() {
0279     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID);
0280   }
0281 
0282   /** Returns true if field fetchType is set (has been assigned a value) and false otherwise */
0283   public boolean isSetFetchType() {
0284     return EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID);
0285   }
0286 
0287   public void setFetchTypeIsSet(boolean value) {
0288     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value);
0289   }
0290 
0291   public void setFieldValue(_Fields field, Object value) {
0292     switch (field) {
0293     case OPERATION_HANDLE:
0294       if (value == null) {
0295         unsetOperationHandle();
0296       } else {
0297         setOperationHandle((TOperationHandle)value);
0298       }
0299       break;
0300 
0301     case ORIENTATION:
0302       if (value == null) {
0303         unsetOrientation();
0304       } else {
0305         setOrientation((TFetchOrientation)value);
0306       }
0307       break;
0308 
0309     case MAX_ROWS:
0310       if (value == null) {
0311         unsetMaxRows();
0312       } else {
0313         setMaxRows((Long)value);
0314       }
0315       break;
0316 
0317     case FETCH_TYPE:
0318       if (value == null) {
0319         unsetFetchType();
0320       } else {
0321         setFetchType((Short)value);
0322       }
0323       break;
0324 
0325     }
0326   }
0327 
0328   public Object getFieldValue(_Fields field) {
0329     switch (field) {
0330     case OPERATION_HANDLE:
0331       return getOperationHandle();
0332 
0333     case ORIENTATION:
0334       return getOrientation();
0335 
0336     case MAX_ROWS:
0337       return Long.valueOf(getMaxRows());
0338 
0339     case FETCH_TYPE:
0340       return Short.valueOf(getFetchType());
0341 
0342     }
0343     throw new IllegalStateException();
0344   }
0345 
0346   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0347   public boolean isSet(_Fields field) {
0348     if (field == null) {
0349       throw new IllegalArgumentException();
0350     }
0351 
0352     switch (field) {
0353     case OPERATION_HANDLE:
0354       return isSetOperationHandle();
0355     case ORIENTATION:
0356       return isSetOrientation();
0357     case MAX_ROWS:
0358       return isSetMaxRows();
0359     case FETCH_TYPE:
0360       return isSetFetchType();
0361     }
0362     throw new IllegalStateException();
0363   }
0364 
0365   @Override
0366   public boolean equals(Object that) {
0367     if (that == null)
0368       return false;
0369     if (that instanceof TFetchResultsReq)
0370       return this.equals((TFetchResultsReq)that);
0371     return false;
0372   }
0373 
0374   public boolean equals(TFetchResultsReq that) {
0375     if (that == null)
0376       return false;
0377 
0378     boolean this_present_operationHandle = true && this.isSetOperationHandle();
0379     boolean that_present_operationHandle = true && that.isSetOperationHandle();
0380     if (this_present_operationHandle || that_present_operationHandle) {
0381       if (!(this_present_operationHandle && that_present_operationHandle))
0382         return false;
0383       if (!this.operationHandle.equals(that.operationHandle))
0384         return false;
0385     }
0386 
0387     boolean this_present_orientation = true && this.isSetOrientation();
0388     boolean that_present_orientation = true && that.isSetOrientation();
0389     if (this_present_orientation || that_present_orientation) {
0390       if (!(this_present_orientation && that_present_orientation))
0391         return false;
0392       if (!this.orientation.equals(that.orientation))
0393         return false;
0394     }
0395 
0396     boolean this_present_maxRows = true;
0397     boolean that_present_maxRows = true;
0398     if (this_present_maxRows || that_present_maxRows) {
0399       if (!(this_present_maxRows && that_present_maxRows))
0400         return false;
0401       if (this.maxRows != that.maxRows)
0402         return false;
0403     }
0404 
0405     boolean this_present_fetchType = true && this.isSetFetchType();
0406     boolean that_present_fetchType = true && that.isSetFetchType();
0407     if (this_present_fetchType || that_present_fetchType) {
0408       if (!(this_present_fetchType && that_present_fetchType))
0409         return false;
0410       if (this.fetchType != that.fetchType)
0411         return false;
0412     }
0413 
0414     return true;
0415   }
0416 
0417   @Override
0418   public int hashCode() {
0419     HashCodeBuilder builder = new HashCodeBuilder();
0420 
0421     boolean present_operationHandle = true && (isSetOperationHandle());
0422     builder.append(present_operationHandle);
0423     if (present_operationHandle)
0424       builder.append(operationHandle);
0425 
0426     boolean present_orientation = true && (isSetOrientation());
0427     builder.append(present_orientation);
0428     if (present_orientation)
0429       builder.append(orientation.getValue());
0430 
0431     boolean present_maxRows = true;
0432     builder.append(present_maxRows);
0433     if (present_maxRows)
0434       builder.append(maxRows);
0435 
0436     boolean present_fetchType = true && (isSetFetchType());
0437     builder.append(present_fetchType);
0438     if (present_fetchType)
0439       builder.append(fetchType);
0440 
0441     return builder.toHashCode();
0442   }
0443 
0444   public int compareTo(TFetchResultsReq other) {
0445     if (!getClass().equals(other.getClass())) {
0446       return getClass().getName().compareTo(other.getClass().getName());
0447     }
0448 
0449     int lastComparison = 0;
0450     TFetchResultsReq typedOther = (TFetchResultsReq)other;
0451 
0452     lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle());
0453     if (lastComparison != 0) {
0454       return lastComparison;
0455     }
0456     if (isSetOperationHandle()) {
0457       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle);
0458       if (lastComparison != 0) {
0459         return lastComparison;
0460       }
0461     }
0462     lastComparison = Boolean.valueOf(isSetOrientation()).compareTo(typedOther.isSetOrientation());
0463     if (lastComparison != 0) {
0464       return lastComparison;
0465     }
0466     if (isSetOrientation()) {
0467       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orientation, typedOther.orientation);
0468       if (lastComparison != 0) {
0469         return lastComparison;
0470       }
0471     }
0472     lastComparison = Boolean.valueOf(isSetMaxRows()).compareTo(typedOther.isSetMaxRows());
0473     if (lastComparison != 0) {
0474       return lastComparison;
0475     }
0476     if (isSetMaxRows()) {
0477       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRows, typedOther.maxRows);
0478       if (lastComparison != 0) {
0479         return lastComparison;
0480       }
0481     }
0482     lastComparison = Boolean.valueOf(isSetFetchType()).compareTo(typedOther.isSetFetchType());
0483     if (lastComparison != 0) {
0484       return lastComparison;
0485     }
0486     if (isSetFetchType()) {
0487       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetchType, typedOther.fetchType);
0488       if (lastComparison != 0) {
0489         return lastComparison;
0490       }
0491     }
0492     return 0;
0493   }
0494 
0495   public _Fields fieldForId(int fieldId) {
0496     return _Fields.findByThriftId(fieldId);
0497   }
0498 
0499   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0500     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0501   }
0502 
0503   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0504     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0505   }
0506 
0507   @Override
0508   public String toString() {
0509     StringBuilder sb = new StringBuilder("TFetchResultsReq(");
0510     boolean first = true;
0511 
0512     sb.append("operationHandle:");
0513     if (this.operationHandle == null) {
0514       sb.append("null");
0515     } else {
0516       sb.append(this.operationHandle);
0517     }
0518     first = false;
0519     if (!first) sb.append(", ");
0520     sb.append("orientation:");
0521     if (this.orientation == null) {
0522       sb.append("null");
0523     } else {
0524       sb.append(this.orientation);
0525     }
0526     first = false;
0527     if (!first) sb.append(", ");
0528     sb.append("maxRows:");
0529     sb.append(this.maxRows);
0530     first = false;
0531     if (isSetFetchType()) {
0532       if (!first) sb.append(", ");
0533       sb.append("fetchType:");
0534       sb.append(this.fetchType);
0535       first = false;
0536     }
0537     sb.append(")");
0538     return sb.toString();
0539   }
0540 
0541   public void validate() throws org.apache.thrift.TException {
0542     // check for required fields
0543     if (!isSetOperationHandle()) {
0544       throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString());
0545     }
0546 
0547     if (!isSetOrientation()) {
0548       throw new org.apache.thrift.protocol.TProtocolException("Required field 'orientation' is unset! Struct:" + toString());
0549     }
0550 
0551     if (!isSetMaxRows()) {
0552       throw new org.apache.thrift.protocol.TProtocolException("Required field 'maxRows' is unset! Struct:" + toString());
0553     }
0554 
0555     // check for sub-struct validity
0556     if (operationHandle != null) {
0557       operationHandle.validate();
0558     }
0559   }
0560 
0561   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0562     try {
0563       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0564     } catch (org.apache.thrift.TException te) {
0565       throw new java.io.IOException(te);
0566     }
0567   }
0568 
0569   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0570     try {
0571       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
0572       __isset_bitfield = 0;
0573       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0574     } catch (org.apache.thrift.TException te) {
0575       throw new java.io.IOException(te);
0576     }
0577   }
0578 
0579   private static class TFetchResultsReqStandardSchemeFactory implements SchemeFactory {
0580     public TFetchResultsReqStandardScheme getScheme() {
0581       return new TFetchResultsReqStandardScheme();
0582     }
0583   }
0584 
0585   private static class TFetchResultsReqStandardScheme extends StandardScheme<TFetchResultsReq> {
0586 
0587     public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq struct) throws org.apache.thrift.TException {
0588       org.apache.thrift.protocol.TField schemeField;
0589       iprot.readStructBegin();
0590       while (true)
0591       {
0592         schemeField = iprot.readFieldBegin();
0593         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0594           break;
0595         }
0596         switch (schemeField.id) {
0597           case 1: // OPERATION_HANDLE
0598             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0599               struct.operationHandle = new TOperationHandle();
0600               struct.operationHandle.read(iprot);
0601               struct.setOperationHandleIsSet(true);
0602             } else { 
0603               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0604             }
0605             break;
0606           case 2: // ORIENTATION
0607             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
0608               struct.orientation = TFetchOrientation.findByValue(iprot.readI32());
0609               struct.setOrientationIsSet(true);
0610             } else { 
0611               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0612             }
0613             break;
0614           case 3: // MAX_ROWS
0615             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
0616               struct.maxRows = iprot.readI64();
0617               struct.setMaxRowsIsSet(true);
0618             } else { 
0619               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0620             }
0621             break;
0622           case 4: // FETCH_TYPE
0623             if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
0624               struct.fetchType = iprot.readI16();
0625               struct.setFetchTypeIsSet(true);
0626             } else { 
0627               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0628             }
0629             break;
0630           default:
0631             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0632         }
0633         iprot.readFieldEnd();
0634       }
0635       iprot.readStructEnd();
0636       struct.validate();
0637     }
0638 
0639     public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsReq struct) throws org.apache.thrift.TException {
0640       struct.validate();
0641 
0642       oprot.writeStructBegin(STRUCT_DESC);
0643       if (struct.operationHandle != null) {
0644         oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC);
0645         struct.operationHandle.write(oprot);
0646         oprot.writeFieldEnd();
0647       }
0648       if (struct.orientation != null) {
0649         oprot.writeFieldBegin(ORIENTATION_FIELD_DESC);
0650         oprot.writeI32(struct.orientation.getValue());
0651         oprot.writeFieldEnd();
0652       }
0653       oprot.writeFieldBegin(MAX_ROWS_FIELD_DESC);
0654       oprot.writeI64(struct.maxRows);
0655       oprot.writeFieldEnd();
0656       if (struct.isSetFetchType()) {
0657         oprot.writeFieldBegin(FETCH_TYPE_FIELD_DESC);
0658         oprot.writeI16(struct.fetchType);
0659         oprot.writeFieldEnd();
0660       }
0661       oprot.writeFieldStop();
0662       oprot.writeStructEnd();
0663     }
0664 
0665   }
0666 
0667   private static class TFetchResultsReqTupleSchemeFactory implements SchemeFactory {
0668     public TFetchResultsReqTupleScheme getScheme() {
0669       return new TFetchResultsReqTupleScheme();
0670     }
0671   }
0672 
0673   private static class TFetchResultsReqTupleScheme extends TupleScheme<TFetchResultsReq> {
0674 
0675     @Override
0676     public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException {
0677       TTupleProtocol oprot = (TTupleProtocol) prot;
0678       struct.operationHandle.write(oprot);
0679       oprot.writeI32(struct.orientation.getValue());
0680       oprot.writeI64(struct.maxRows);
0681       BitSet optionals = new BitSet();
0682       if (struct.isSetFetchType()) {
0683         optionals.set(0);
0684       }
0685       oprot.writeBitSet(optionals, 1);
0686       if (struct.isSetFetchType()) {
0687         oprot.writeI16(struct.fetchType);
0688       }
0689     }
0690 
0691     @Override
0692     public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException {
0693       TTupleProtocol iprot = (TTupleProtocol) prot;
0694       struct.operationHandle = new TOperationHandle();
0695       struct.operationHandle.read(iprot);
0696       struct.setOperationHandleIsSet(true);
0697       struct.orientation = TFetchOrientation.findByValue(iprot.readI32());
0698       struct.setOrientationIsSet(true);
0699       struct.maxRows = iprot.readI64();
0700       struct.setMaxRowsIsSet(true);
0701       BitSet incoming = iprot.readBitSet(1);
0702       if (incoming.get(0)) {
0703         struct.fetchType = iprot.readI16();
0704         struct.setFetchTypeIsSet(true);
0705       }
0706     }
0707   }
0708 
0709 }
0710