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 TExecuteStatementReq implements org.apache.thrift.TBase<TExecuteStatementReq, TExecuteStatementReq._Fields>, java.io.Serializable, Cloneable, Comparable<TExecuteStatementReq> {
0039   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementReq");
0040 
0041   private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1);
0042   private static final org.apache.thrift.protocol.TField STATEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("statement", org.apache.thrift.protocol.TType.STRING, (short)2);
0043   private static final org.apache.thrift.protocol.TField CONF_OVERLAY_FIELD_DESC = new org.apache.thrift.protocol.TField("confOverlay", org.apache.thrift.protocol.TType.MAP, (short)3);
0044   private static final org.apache.thrift.protocol.TField RUN_ASYNC_FIELD_DESC = new org.apache.thrift.protocol.TField("runAsync", org.apache.thrift.protocol.TType.BOOL, (short)4);
0045   private static final org.apache.thrift.protocol.TField QUERY_TIMEOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("queryTimeout", org.apache.thrift.protocol.TType.I64, (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 TExecuteStatementReqStandardSchemeFactory());
0050     schemes.put(TupleScheme.class, new TExecuteStatementReqTupleSchemeFactory());
0051   }
0052 
0053   private TSessionHandle sessionHandle; // required
0054   private String statement; // required
0055   private Map<String,String> confOverlay; // optional
0056   private boolean runAsync; // optional
0057   private long queryTimeout; // 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     SESSION_HANDLE((short)1, "sessionHandle"),
0062     STATEMENT((short)2, "statement"),
0063     CONF_OVERLAY((short)3, "confOverlay"),
0064     RUN_ASYNC((short)4, "runAsync"),
0065     QUERY_TIMEOUT((short)5, "queryTimeout");
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: // SESSION_HANDLE
0081           return SESSION_HANDLE;
0082         case 2: // STATEMENT
0083           return STATEMENT;
0084         case 3: // CONF_OVERLAY
0085           return CONF_OVERLAY;
0086         case 4: // RUN_ASYNC
0087           return RUN_ASYNC;
0088         case 5: // QUERY_TIMEOUT
0089           return QUERY_TIMEOUT;
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 __RUNASYNC_ISSET_ID = 0;
0131   private static final int __QUERYTIMEOUT_ISSET_ID = 1;
0132   private byte __isset_bitfield = 0;
0133   private static final _Fields optionals[] = {_Fields.CONF_OVERLAY,_Fields.RUN_ASYNC,_Fields.QUERY_TIMEOUT};
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.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0138         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class)));
0139     tmpMap.put(_Fields.STATEMENT, new org.apache.thrift.meta_data.FieldMetaData("statement", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0140         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
0141     tmpMap.put(_Fields.CONF_OVERLAY, new org.apache.thrift.meta_data.FieldMetaData("confOverlay", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0142         new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
0143             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
0144             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
0145     tmpMap.put(_Fields.RUN_ASYNC, new org.apache.thrift.meta_data.FieldMetaData("runAsync", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0146         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
0147     tmpMap.put(_Fields.QUERY_TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("queryTimeout", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0148         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
0149     metaDataMap = Collections.unmodifiableMap(tmpMap);
0150     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementReq.class, metaDataMap);
0151   }
0152 
0153   public TExecuteStatementReq() {
0154     this.runAsync = false;
0155 
0156     this.queryTimeout = 0L;
0157 
0158   }
0159 
0160   public TExecuteStatementReq(
0161     TSessionHandle sessionHandle,
0162     String statement)
0163   {
0164     this();
0165     this.sessionHandle = sessionHandle;
0166     this.statement = statement;
0167   }
0168 
0169   /**
0170    * Performs a deep copy on <i>other</i>.
0171    */
0172   public TExecuteStatementReq(TExecuteStatementReq other) {
0173     __isset_bitfield = other.__isset_bitfield;
0174     if (other.isSetSessionHandle()) {
0175       this.sessionHandle = new TSessionHandle(other.sessionHandle);
0176     }
0177     if (other.isSetStatement()) {
0178       this.statement = other.statement;
0179     }
0180     if (other.isSetConfOverlay()) {
0181       Map<String,String> __this__confOverlay = new HashMap<String,String>(other.confOverlay);
0182       this.confOverlay = __this__confOverlay;
0183     }
0184     this.runAsync = other.runAsync;
0185     this.queryTimeout = other.queryTimeout;
0186   }
0187 
0188   public TExecuteStatementReq deepCopy() {
0189     return new TExecuteStatementReq(this);
0190   }
0191 
0192   @Override
0193   public void clear() {
0194     this.sessionHandle = null;
0195     this.statement = null;
0196     this.confOverlay = null;
0197     this.runAsync = false;
0198 
0199     this.queryTimeout = 0L;
0200 
0201   }
0202 
0203   public TSessionHandle getSessionHandle() {
0204     return this.sessionHandle;
0205   }
0206 
0207   public void setSessionHandle(TSessionHandle sessionHandle) {
0208     this.sessionHandle = sessionHandle;
0209   }
0210 
0211   public void unsetSessionHandle() {
0212     this.sessionHandle = null;
0213   }
0214 
0215   /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */
0216   public boolean isSetSessionHandle() {
0217     return this.sessionHandle != null;
0218   }
0219 
0220   public void setSessionHandleIsSet(boolean value) {
0221     if (!value) {
0222       this.sessionHandle = null;
0223     }
0224   }
0225 
0226   public String getStatement() {
0227     return this.statement;
0228   }
0229 
0230   public void setStatement(String statement) {
0231     this.statement = statement;
0232   }
0233 
0234   public void unsetStatement() {
0235     this.statement = null;
0236   }
0237 
0238   /** Returns true if field statement is set (has been assigned a value) and false otherwise */
0239   public boolean isSetStatement() {
0240     return this.statement != null;
0241   }
0242 
0243   public void setStatementIsSet(boolean value) {
0244     if (!value) {
0245       this.statement = null;
0246     }
0247   }
0248 
0249   public int getConfOverlaySize() {
0250     return (this.confOverlay == null) ? 0 : this.confOverlay.size();
0251   }
0252 
0253   public void putToConfOverlay(String key, String val) {
0254     if (this.confOverlay == null) {
0255       this.confOverlay = new HashMap<String,String>();
0256     }
0257     this.confOverlay.put(key, val);
0258   }
0259 
0260   public Map<String,String> getConfOverlay() {
0261     return this.confOverlay;
0262   }
0263 
0264   public void setConfOverlay(Map<String,String> confOverlay) {
0265     this.confOverlay = confOverlay;
0266   }
0267 
0268   public void unsetConfOverlay() {
0269     this.confOverlay = null;
0270   }
0271 
0272   /** Returns true if field confOverlay is set (has been assigned a value) and false otherwise */
0273   public boolean isSetConfOverlay() {
0274     return this.confOverlay != null;
0275   }
0276 
0277   public void setConfOverlayIsSet(boolean value) {
0278     if (!value) {
0279       this.confOverlay = null;
0280     }
0281   }
0282 
0283   public boolean isRunAsync() {
0284     return this.runAsync;
0285   }
0286 
0287   public void setRunAsync(boolean runAsync) {
0288     this.runAsync = runAsync;
0289     setRunAsyncIsSet(true);
0290   }
0291 
0292   public void unsetRunAsync() {
0293     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID);
0294   }
0295 
0296   /** Returns true if field runAsync is set (has been assigned a value) and false otherwise */
0297   public boolean isSetRunAsync() {
0298     return EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID);
0299   }
0300 
0301   public void setRunAsyncIsSet(boolean value) {
0302     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value);
0303   }
0304 
0305   public long getQueryTimeout() {
0306     return this.queryTimeout;
0307   }
0308 
0309   public void setQueryTimeout(long queryTimeout) {
0310     this.queryTimeout = queryTimeout;
0311     setQueryTimeoutIsSet(true);
0312   }
0313 
0314   public void unsetQueryTimeout() {
0315     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID);
0316   }
0317 
0318   /** Returns true if field queryTimeout is set (has been assigned a value) and false otherwise */
0319   public boolean isSetQueryTimeout() {
0320     return EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID);
0321   }
0322 
0323   public void setQueryTimeoutIsSet(boolean value) {
0324     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value);
0325   }
0326 
0327   public void setFieldValue(_Fields field, Object value) {
0328     switch (field) {
0329     case SESSION_HANDLE:
0330       if (value == null) {
0331         unsetSessionHandle();
0332       } else {
0333         setSessionHandle((TSessionHandle)value);
0334       }
0335       break;
0336 
0337     case STATEMENT:
0338       if (value == null) {
0339         unsetStatement();
0340       } else {
0341         setStatement((String)value);
0342       }
0343       break;
0344 
0345     case CONF_OVERLAY:
0346       if (value == null) {
0347         unsetConfOverlay();
0348       } else {
0349         setConfOverlay((Map<String,String>)value);
0350       }
0351       break;
0352 
0353     case RUN_ASYNC:
0354       if (value == null) {
0355         unsetRunAsync();
0356       } else {
0357         setRunAsync((Boolean)value);
0358       }
0359       break;
0360 
0361     case QUERY_TIMEOUT:
0362       if (value == null) {
0363         unsetQueryTimeout();
0364       } else {
0365         setQueryTimeout((Long)value);
0366       }
0367       break;
0368 
0369     }
0370   }
0371 
0372   public Object getFieldValue(_Fields field) {
0373     switch (field) {
0374     case SESSION_HANDLE:
0375       return getSessionHandle();
0376 
0377     case STATEMENT:
0378       return getStatement();
0379 
0380     case CONF_OVERLAY:
0381       return getConfOverlay();
0382 
0383     case RUN_ASYNC:
0384       return isRunAsync();
0385 
0386     case QUERY_TIMEOUT:
0387       return getQueryTimeout();
0388 
0389     }
0390     throw new IllegalStateException();
0391   }
0392 
0393   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0394   public boolean isSet(_Fields field) {
0395     if (field == null) {
0396       throw new IllegalArgumentException();
0397     }
0398 
0399     switch (field) {
0400     case SESSION_HANDLE:
0401       return isSetSessionHandle();
0402     case STATEMENT:
0403       return isSetStatement();
0404     case CONF_OVERLAY:
0405       return isSetConfOverlay();
0406     case RUN_ASYNC:
0407       return isSetRunAsync();
0408     case QUERY_TIMEOUT:
0409       return isSetQueryTimeout();
0410     }
0411     throw new IllegalStateException();
0412   }
0413 
0414   @Override
0415   public boolean equals(Object that) {
0416     if (that == null)
0417       return false;
0418     if (that instanceof TExecuteStatementReq)
0419       return this.equals((TExecuteStatementReq)that);
0420     return false;
0421   }
0422 
0423   public boolean equals(TExecuteStatementReq that) {
0424     if (that == null)
0425       return false;
0426 
0427     boolean this_present_sessionHandle = true && this.isSetSessionHandle();
0428     boolean that_present_sessionHandle = true && that.isSetSessionHandle();
0429     if (this_present_sessionHandle || that_present_sessionHandle) {
0430       if (!(this_present_sessionHandle && that_present_sessionHandle))
0431         return false;
0432       if (!this.sessionHandle.equals(that.sessionHandle))
0433         return false;
0434     }
0435 
0436     boolean this_present_statement = true && this.isSetStatement();
0437     boolean that_present_statement = true && that.isSetStatement();
0438     if (this_present_statement || that_present_statement) {
0439       if (!(this_present_statement && that_present_statement))
0440         return false;
0441       if (!this.statement.equals(that.statement))
0442         return false;
0443     }
0444 
0445     boolean this_present_confOverlay = true && this.isSetConfOverlay();
0446     boolean that_present_confOverlay = true && that.isSetConfOverlay();
0447     if (this_present_confOverlay || that_present_confOverlay) {
0448       if (!(this_present_confOverlay && that_present_confOverlay))
0449         return false;
0450       if (!this.confOverlay.equals(that.confOverlay))
0451         return false;
0452     }
0453 
0454     boolean this_present_runAsync = true && this.isSetRunAsync();
0455     boolean that_present_runAsync = true && that.isSetRunAsync();
0456     if (this_present_runAsync || that_present_runAsync) {
0457       if (!(this_present_runAsync && that_present_runAsync))
0458         return false;
0459       if (this.runAsync != that.runAsync)
0460         return false;
0461     }
0462 
0463     boolean this_present_queryTimeout = true && this.isSetQueryTimeout();
0464     boolean that_present_queryTimeout = true && that.isSetQueryTimeout();
0465     if (this_present_queryTimeout || that_present_queryTimeout) {
0466       if (!(this_present_queryTimeout && that_present_queryTimeout))
0467         return false;
0468       if (this.queryTimeout != that.queryTimeout)
0469         return false;
0470     }
0471 
0472     return true;
0473   }
0474 
0475   @Override
0476   public int hashCode() {
0477     List<Object> list = new ArrayList<Object>();
0478 
0479     boolean present_sessionHandle = true && (isSetSessionHandle());
0480     list.add(present_sessionHandle);
0481     if (present_sessionHandle)
0482       list.add(sessionHandle);
0483 
0484     boolean present_statement = true && (isSetStatement());
0485     list.add(present_statement);
0486     if (present_statement)
0487       list.add(statement);
0488 
0489     boolean present_confOverlay = true && (isSetConfOverlay());
0490     list.add(present_confOverlay);
0491     if (present_confOverlay)
0492       list.add(confOverlay);
0493 
0494     boolean present_runAsync = true && (isSetRunAsync());
0495     list.add(present_runAsync);
0496     if (present_runAsync)
0497       list.add(runAsync);
0498 
0499     boolean present_queryTimeout = true && (isSetQueryTimeout());
0500     list.add(present_queryTimeout);
0501     if (present_queryTimeout)
0502       list.add(queryTimeout);
0503 
0504     return list.hashCode();
0505   }
0506 
0507   @Override
0508   public int compareTo(TExecuteStatementReq other) {
0509     if (!getClass().equals(other.getClass())) {
0510       return getClass().getName().compareTo(other.getClass().getName());
0511     }
0512 
0513     int lastComparison = 0;
0514 
0515     lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle());
0516     if (lastComparison != 0) {
0517       return lastComparison;
0518     }
0519     if (isSetSessionHandle()) {
0520       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle);
0521       if (lastComparison != 0) {
0522         return lastComparison;
0523       }
0524     }
0525     lastComparison = Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement());
0526     if (lastComparison != 0) {
0527       return lastComparison;
0528     }
0529     if (isSetStatement()) {
0530       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statement, other.statement);
0531       if (lastComparison != 0) {
0532         return lastComparison;
0533       }
0534     }
0535     lastComparison = Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay());
0536     if (lastComparison != 0) {
0537       return lastComparison;
0538     }
0539     if (isSetConfOverlay()) {
0540       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.confOverlay, other.confOverlay);
0541       if (lastComparison != 0) {
0542         return lastComparison;
0543       }
0544     }
0545     lastComparison = Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync());
0546     if (lastComparison != 0) {
0547       return lastComparison;
0548     }
0549     if (isSetRunAsync()) {
0550       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runAsync, other.runAsync);
0551       if (lastComparison != 0) {
0552         return lastComparison;
0553       }
0554     }
0555     lastComparison = Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout());
0556     if (lastComparison != 0) {
0557       return lastComparison;
0558     }
0559     if (isSetQueryTimeout()) {
0560       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryTimeout, other.queryTimeout);
0561       if (lastComparison != 0) {
0562         return lastComparison;
0563       }
0564     }
0565     return 0;
0566   }
0567 
0568   public _Fields fieldForId(int fieldId) {
0569     return _Fields.findByThriftId(fieldId);
0570   }
0571 
0572   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0573     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0574   }
0575 
0576   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0577     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0578   }
0579 
0580   @Override
0581   public String toString() {
0582     StringBuilder sb = new StringBuilder("TExecuteStatementReq(");
0583     boolean first = true;
0584 
0585     sb.append("sessionHandle:");
0586     if (this.sessionHandle == null) {
0587       sb.append("null");
0588     } else {
0589       sb.append(this.sessionHandle);
0590     }
0591     first = false;
0592     if (!first) sb.append(", ");
0593     sb.append("statement:");
0594     if (this.statement == null) {
0595       sb.append("null");
0596     } else {
0597       sb.append(this.statement);
0598     }
0599     first = false;
0600     if (isSetConfOverlay()) {
0601       if (!first) sb.append(", ");
0602       sb.append("confOverlay:");
0603       if (this.confOverlay == null) {
0604         sb.append("null");
0605       } else {
0606         sb.append(this.confOverlay);
0607       }
0608       first = false;
0609     }
0610     if (isSetRunAsync()) {
0611       if (!first) sb.append(", ");
0612       sb.append("runAsync:");
0613       sb.append(this.runAsync);
0614       first = false;
0615     }
0616     if (isSetQueryTimeout()) {
0617       if (!first) sb.append(", ");
0618       sb.append("queryTimeout:");
0619       sb.append(this.queryTimeout);
0620       first = false;
0621     }
0622     sb.append(")");
0623     return sb.toString();
0624   }
0625 
0626   public void validate() throws org.apache.thrift.TException {
0627     // check for required fields
0628     if (!isSetSessionHandle()) {
0629       throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString());
0630     }
0631 
0632     if (!isSetStatement()) {
0633       throw new org.apache.thrift.protocol.TProtocolException("Required field 'statement' is unset! Struct:" + toString());
0634     }
0635 
0636     // check for sub-struct validity
0637     if (sessionHandle != null) {
0638       sessionHandle.validate();
0639     }
0640   }
0641 
0642   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0643     try {
0644       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0645     } catch (org.apache.thrift.TException te) {
0646       throw new java.io.IOException(te);
0647     }
0648   }
0649 
0650   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0651     try {
0652       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
0653       __isset_bitfield = 0;
0654       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0655     } catch (org.apache.thrift.TException te) {
0656       throw new java.io.IOException(te);
0657     }
0658   }
0659 
0660   private static class TExecuteStatementReqStandardSchemeFactory implements SchemeFactory {
0661     public TExecuteStatementReqStandardScheme getScheme() {
0662       return new TExecuteStatementReqStandardScheme();
0663     }
0664   }
0665 
0666   private static class TExecuteStatementReqStandardScheme extends StandardScheme<TExecuteStatementReq> {
0667 
0668     public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementReq struct) throws org.apache.thrift.TException {
0669       org.apache.thrift.protocol.TField schemeField;
0670       iprot.readStructBegin();
0671       while (true)
0672       {
0673         schemeField = iprot.readFieldBegin();
0674         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0675           break;
0676         }
0677         switch (schemeField.id) {
0678           case 1: // SESSION_HANDLE
0679             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0680               struct.sessionHandle = new TSessionHandle();
0681               struct.sessionHandle.read(iprot);
0682               struct.setSessionHandleIsSet(true);
0683             } else { 
0684               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0685             }
0686             break;
0687           case 2: // STATEMENT
0688             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0689               struct.statement = iprot.readString();
0690               struct.setStatementIsSet(true);
0691             } else { 
0692               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0693             }
0694             break;
0695           case 3: // CONF_OVERLAY
0696             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
0697               {
0698                 org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin();
0699                 struct.confOverlay = new HashMap<String,String>(2*_map162.size);
0700                 String _key163;
0701                 String _val164;
0702                 for (int _i165 = 0; _i165 < _map162.size; ++_i165)
0703                 {
0704                   _key163 = iprot.readString();
0705                   _val164 = iprot.readString();
0706                   struct.confOverlay.put(_key163, _val164);
0707                 }
0708                 iprot.readMapEnd();
0709               }
0710               struct.setConfOverlayIsSet(true);
0711             } else { 
0712               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0713             }
0714             break;
0715           case 4: // RUN_ASYNC
0716             if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
0717               struct.runAsync = iprot.readBool();
0718               struct.setRunAsyncIsSet(true);
0719             } else { 
0720               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0721             }
0722             break;
0723           case 5: // QUERY_TIMEOUT
0724             if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
0725               struct.queryTimeout = iprot.readI64();
0726               struct.setQueryTimeoutIsSet(true);
0727             } else { 
0728               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0729             }
0730             break;
0731           default:
0732             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0733         }
0734         iprot.readFieldEnd();
0735       }
0736       iprot.readStructEnd();
0737       struct.validate();
0738     }
0739 
0740     public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementReq struct) throws org.apache.thrift.TException {
0741       struct.validate();
0742 
0743       oprot.writeStructBegin(STRUCT_DESC);
0744       if (struct.sessionHandle != null) {
0745         oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC);
0746         struct.sessionHandle.write(oprot);
0747         oprot.writeFieldEnd();
0748       }
0749       if (struct.statement != null) {
0750         oprot.writeFieldBegin(STATEMENT_FIELD_DESC);
0751         oprot.writeString(struct.statement);
0752         oprot.writeFieldEnd();
0753       }
0754       if (struct.confOverlay != null) {
0755         if (struct.isSetConfOverlay()) {
0756           oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC);
0757           {
0758             oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size()));
0759             for (Map.Entry<String, String> _iter166 : struct.confOverlay.entrySet())
0760             {
0761               oprot.writeString(_iter166.getKey());
0762               oprot.writeString(_iter166.getValue());
0763             }
0764             oprot.writeMapEnd();
0765           }
0766           oprot.writeFieldEnd();
0767         }
0768       }
0769       if (struct.isSetRunAsync()) {
0770         oprot.writeFieldBegin(RUN_ASYNC_FIELD_DESC);
0771         oprot.writeBool(struct.runAsync);
0772         oprot.writeFieldEnd();
0773       }
0774       if (struct.isSetQueryTimeout()) {
0775         oprot.writeFieldBegin(QUERY_TIMEOUT_FIELD_DESC);
0776         oprot.writeI64(struct.queryTimeout);
0777         oprot.writeFieldEnd();
0778       }
0779       oprot.writeFieldStop();
0780       oprot.writeStructEnd();
0781     }
0782 
0783   }
0784 
0785   private static class TExecuteStatementReqTupleSchemeFactory implements SchemeFactory {
0786     public TExecuteStatementReqTupleScheme getScheme() {
0787       return new TExecuteStatementReqTupleScheme();
0788     }
0789   }
0790 
0791   private static class TExecuteStatementReqTupleScheme extends TupleScheme<TExecuteStatementReq> {
0792 
0793     @Override
0794     public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException {
0795       TTupleProtocol oprot = (TTupleProtocol) prot;
0796       struct.sessionHandle.write(oprot);
0797       oprot.writeString(struct.statement);
0798       BitSet optionals = new BitSet();
0799       if (struct.isSetConfOverlay()) {
0800         optionals.set(0);
0801       }
0802       if (struct.isSetRunAsync()) {
0803         optionals.set(1);
0804       }
0805       if (struct.isSetQueryTimeout()) {
0806         optionals.set(2);
0807       }
0808       oprot.writeBitSet(optionals, 3);
0809       if (struct.isSetConfOverlay()) {
0810         {
0811           oprot.writeI32(struct.confOverlay.size());
0812           for (Map.Entry<String, String> _iter167 : struct.confOverlay.entrySet())
0813           {
0814             oprot.writeString(_iter167.getKey());
0815             oprot.writeString(_iter167.getValue());
0816           }
0817         }
0818       }
0819       if (struct.isSetRunAsync()) {
0820         oprot.writeBool(struct.runAsync);
0821       }
0822       if (struct.isSetQueryTimeout()) {
0823         oprot.writeI64(struct.queryTimeout);
0824       }
0825     }
0826 
0827     @Override
0828     public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException {
0829       TTupleProtocol iprot = (TTupleProtocol) prot;
0830       struct.sessionHandle = new TSessionHandle();
0831       struct.sessionHandle.read(iprot);
0832       struct.setSessionHandleIsSet(true);
0833       struct.statement = iprot.readString();
0834       struct.setStatementIsSet(true);
0835       BitSet incoming = iprot.readBitSet(3);
0836       if (incoming.get(0)) {
0837         {
0838           org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
0839           struct.confOverlay = new HashMap<String,String>(2*_map168.size);
0840           String _key169;
0841           String _val170;
0842           for (int _i171 = 0; _i171 < _map168.size; ++_i171)
0843           {
0844             _key169 = iprot.readString();
0845             _val170 = iprot.readString();
0846             struct.confOverlay.put(_key169, _val170);
0847           }
0848         }
0849         struct.setConfOverlayIsSet(true);
0850       }
0851       if (incoming.get(1)) {
0852         struct.runAsync = iprot.readBool();
0853         struct.setRunAsyncIsSet(true);
0854       }
0855       if (incoming.get(2)) {
0856         struct.queryTimeout = iprot.readI64();
0857         struct.setQueryTimeoutIsSet(true);
0858       }
0859     }
0860   }
0861 
0862 }
0863