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 TStatus implements org.apache.thrift.TBase<TStatus, TStatus._Fields>, java.io.Serializable, Cloneable, Comparable<TStatus> {
0039   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus");
0040 
0041   private static final org.apache.thrift.protocol.TField STATUS_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCode", org.apache.thrift.protocol.TType.I32, (short)1);
0042   private static final org.apache.thrift.protocol.TField INFO_MESSAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("infoMessages", org.apache.thrift.protocol.TType.LIST, (short)2);
0043   private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3);
0044   private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4);
0045   private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (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 TStatusStandardSchemeFactory());
0050     schemes.put(TupleScheme.class, new TStatusTupleSchemeFactory());
0051   }
0052 
0053   private TStatusCode statusCode; // required
0054   private List<String> infoMessages; // optional
0055   private String sqlState; // optional
0056   private int errorCode; // optional
0057   private String errorMessage; // 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     /**
0062      * 
0063      * @see TStatusCode
0064      */
0065     STATUS_CODE((short)1, "statusCode"),
0066     INFO_MESSAGES((short)2, "infoMessages"),
0067     SQL_STATE((short)3, "sqlState"),
0068     ERROR_CODE((short)4, "errorCode"),
0069     ERROR_MESSAGE((short)5, "errorMessage");
0070 
0071     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0072 
0073     static {
0074       for (_Fields field : EnumSet.allOf(_Fields.class)) {
0075         byName.put(field.getFieldName(), field);
0076       }
0077     }
0078 
0079     /**
0080      * Find the _Fields constant that matches fieldId, or null if its not found.
0081      */
0082     public static _Fields findByThriftId(int fieldId) {
0083       switch(fieldId) {
0084         case 1: // STATUS_CODE
0085           return STATUS_CODE;
0086         case 2: // INFO_MESSAGES
0087           return INFO_MESSAGES;
0088         case 3: // SQL_STATE
0089           return SQL_STATE;
0090         case 4: // ERROR_CODE
0091           return ERROR_CODE;
0092         case 5: // ERROR_MESSAGE
0093           return ERROR_MESSAGE;
0094         default:
0095           return null;
0096       }
0097     }
0098 
0099     /**
0100      * Find the _Fields constant that matches fieldId, throwing an exception
0101      * if it is not found.
0102      */
0103     public static _Fields findByThriftIdOrThrow(int fieldId) {
0104       _Fields fields = findByThriftId(fieldId);
0105       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0106       return fields;
0107     }
0108 
0109     /**
0110      * Find the _Fields constant that matches name, or null if its not found.
0111      */
0112     public static _Fields findByName(String name) {
0113       return byName.get(name);
0114     }
0115 
0116     private final short _thriftId;
0117     private final String _fieldName;
0118 
0119     _Fields(short thriftId, String fieldName) {
0120       _thriftId = thriftId;
0121       _fieldName = fieldName;
0122     }
0123 
0124     public short getThriftFieldId() {
0125       return _thriftId;
0126     }
0127 
0128     public String getFieldName() {
0129       return _fieldName;
0130     }
0131   }
0132 
0133   // isset id assignments
0134   private static final int __ERRORCODE_ISSET_ID = 0;
0135   private byte __isset_bitfield = 0;
0136   private static final _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE};
0137   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0138   static {
0139     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0140     tmpMap.put(_Fields.STATUS_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0141         new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class)));
0142     tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
0145     tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0146         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
0147     tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0148         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
0149     tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0150         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
0151     metaDataMap = Collections.unmodifiableMap(tmpMap);
0152     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap);
0153   }
0154 
0155   public TStatus() {
0156   }
0157 
0158   public TStatus(
0159     TStatusCode statusCode)
0160   {
0161     this();
0162     this.statusCode = statusCode;
0163   }
0164 
0165   /**
0166    * Performs a deep copy on <i>other</i>.
0167    */
0168   public TStatus(TStatus other) {
0169     __isset_bitfield = other.__isset_bitfield;
0170     if (other.isSetStatusCode()) {
0171       this.statusCode = other.statusCode;
0172     }
0173     if (other.isSetInfoMessages()) {
0174       List<String> __this__infoMessages = new ArrayList<String>(other.infoMessages);
0175       this.infoMessages = __this__infoMessages;
0176     }
0177     if (other.isSetSqlState()) {
0178       this.sqlState = other.sqlState;
0179     }
0180     this.errorCode = other.errorCode;
0181     if (other.isSetErrorMessage()) {
0182       this.errorMessage = other.errorMessage;
0183     }
0184   }
0185 
0186   public TStatus deepCopy() {
0187     return new TStatus(this);
0188   }
0189 
0190   @Override
0191   public void clear() {
0192     this.statusCode = null;
0193     this.infoMessages = null;
0194     this.sqlState = null;
0195     setErrorCodeIsSet(false);
0196     this.errorCode = 0;
0197     this.errorMessage = null;
0198   }
0199 
0200   /**
0201    * 
0202    * @see TStatusCode
0203    */
0204   public TStatusCode getStatusCode() {
0205     return this.statusCode;
0206   }
0207 
0208   /**
0209    * 
0210    * @see TStatusCode
0211    */
0212   public void setStatusCode(TStatusCode statusCode) {
0213     this.statusCode = statusCode;
0214   }
0215 
0216   public void unsetStatusCode() {
0217     this.statusCode = null;
0218   }
0219 
0220   /** Returns true if field statusCode is set (has been assigned a value) and false otherwise */
0221   public boolean isSetStatusCode() {
0222     return this.statusCode != null;
0223   }
0224 
0225   public void setStatusCodeIsSet(boolean value) {
0226     if (!value) {
0227       this.statusCode = null;
0228     }
0229   }
0230 
0231   public int getInfoMessagesSize() {
0232     return (this.infoMessages == null) ? 0 : this.infoMessages.size();
0233   }
0234 
0235   public java.util.Iterator<String> getInfoMessagesIterator() {
0236     return (this.infoMessages == null) ? null : this.infoMessages.iterator();
0237   }
0238 
0239   public void addToInfoMessages(String elem) {
0240     if (this.infoMessages == null) {
0241       this.infoMessages = new ArrayList<String>();
0242     }
0243     this.infoMessages.add(elem);
0244   }
0245 
0246   public List<String> getInfoMessages() {
0247     return this.infoMessages;
0248   }
0249 
0250   public void setInfoMessages(List<String> infoMessages) {
0251     this.infoMessages = infoMessages;
0252   }
0253 
0254   public void unsetInfoMessages() {
0255     this.infoMessages = null;
0256   }
0257 
0258   /** Returns true if field infoMessages is set (has been assigned a value) and false otherwise */
0259   public boolean isSetInfoMessages() {
0260     return this.infoMessages != null;
0261   }
0262 
0263   public void setInfoMessagesIsSet(boolean value) {
0264     if (!value) {
0265       this.infoMessages = null;
0266     }
0267   }
0268 
0269   public String getSqlState() {
0270     return this.sqlState;
0271   }
0272 
0273   public void setSqlState(String sqlState) {
0274     this.sqlState = sqlState;
0275   }
0276 
0277   public void unsetSqlState() {
0278     this.sqlState = null;
0279   }
0280 
0281   /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */
0282   public boolean isSetSqlState() {
0283     return this.sqlState != null;
0284   }
0285 
0286   public void setSqlStateIsSet(boolean value) {
0287     if (!value) {
0288       this.sqlState = null;
0289     }
0290   }
0291 
0292   public int getErrorCode() {
0293     return this.errorCode;
0294   }
0295 
0296   public void setErrorCode(int errorCode) {
0297     this.errorCode = errorCode;
0298     setErrorCodeIsSet(true);
0299   }
0300 
0301   public void unsetErrorCode() {
0302     __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID);
0303   }
0304 
0305   /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */
0306   public boolean isSetErrorCode() {
0307     return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID);
0308   }
0309 
0310   public void setErrorCodeIsSet(boolean value) {
0311     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value);
0312   }
0313 
0314   public String getErrorMessage() {
0315     return this.errorMessage;
0316   }
0317 
0318   public void setErrorMessage(String errorMessage) {
0319     this.errorMessage = errorMessage;
0320   }
0321 
0322   public void unsetErrorMessage() {
0323     this.errorMessage = null;
0324   }
0325 
0326   /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */
0327   public boolean isSetErrorMessage() {
0328     return this.errorMessage != null;
0329   }
0330 
0331   public void setErrorMessageIsSet(boolean value) {
0332     if (!value) {
0333       this.errorMessage = null;
0334     }
0335   }
0336 
0337   public void setFieldValue(_Fields field, Object value) {
0338     switch (field) {
0339     case STATUS_CODE:
0340       if (value == null) {
0341         unsetStatusCode();
0342       } else {
0343         setStatusCode((TStatusCode)value);
0344       }
0345       break;
0346 
0347     case INFO_MESSAGES:
0348       if (value == null) {
0349         unsetInfoMessages();
0350       } else {
0351         setInfoMessages((List<String>)value);
0352       }
0353       break;
0354 
0355     case SQL_STATE:
0356       if (value == null) {
0357         unsetSqlState();
0358       } else {
0359         setSqlState((String)value);
0360       }
0361       break;
0362 
0363     case ERROR_CODE:
0364       if (value == null) {
0365         unsetErrorCode();
0366       } else {
0367         setErrorCode((Integer)value);
0368       }
0369       break;
0370 
0371     case ERROR_MESSAGE:
0372       if (value == null) {
0373         unsetErrorMessage();
0374       } else {
0375         setErrorMessage((String)value);
0376       }
0377       break;
0378 
0379     }
0380   }
0381 
0382   public Object getFieldValue(_Fields field) {
0383     switch (field) {
0384     case STATUS_CODE:
0385       return getStatusCode();
0386 
0387     case INFO_MESSAGES:
0388       return getInfoMessages();
0389 
0390     case SQL_STATE:
0391       return getSqlState();
0392 
0393     case ERROR_CODE:
0394       return getErrorCode();
0395 
0396     case ERROR_MESSAGE:
0397       return getErrorMessage();
0398 
0399     }
0400     throw new IllegalStateException();
0401   }
0402 
0403   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0404   public boolean isSet(_Fields field) {
0405     if (field == null) {
0406       throw new IllegalArgumentException();
0407     }
0408 
0409     switch (field) {
0410     case STATUS_CODE:
0411       return isSetStatusCode();
0412     case INFO_MESSAGES:
0413       return isSetInfoMessages();
0414     case SQL_STATE:
0415       return isSetSqlState();
0416     case ERROR_CODE:
0417       return isSetErrorCode();
0418     case ERROR_MESSAGE:
0419       return isSetErrorMessage();
0420     }
0421     throw new IllegalStateException();
0422   }
0423 
0424   @Override
0425   public boolean equals(Object that) {
0426     if (that == null)
0427       return false;
0428     if (that instanceof TStatus)
0429       return this.equals((TStatus)that);
0430     return false;
0431   }
0432 
0433   public boolean equals(TStatus that) {
0434     if (that == null)
0435       return false;
0436 
0437     boolean this_present_statusCode = true && this.isSetStatusCode();
0438     boolean that_present_statusCode = true && that.isSetStatusCode();
0439     if (this_present_statusCode || that_present_statusCode) {
0440       if (!(this_present_statusCode && that_present_statusCode))
0441         return false;
0442       if (!this.statusCode.equals(that.statusCode))
0443         return false;
0444     }
0445 
0446     boolean this_present_infoMessages = true && this.isSetInfoMessages();
0447     boolean that_present_infoMessages = true && that.isSetInfoMessages();
0448     if (this_present_infoMessages || that_present_infoMessages) {
0449       if (!(this_present_infoMessages && that_present_infoMessages))
0450         return false;
0451       if (!this.infoMessages.equals(that.infoMessages))
0452         return false;
0453     }
0454 
0455     boolean this_present_sqlState = true && this.isSetSqlState();
0456     boolean that_present_sqlState = true && that.isSetSqlState();
0457     if (this_present_sqlState || that_present_sqlState) {
0458       if (!(this_present_sqlState && that_present_sqlState))
0459         return false;
0460       if (!this.sqlState.equals(that.sqlState))
0461         return false;
0462     }
0463 
0464     boolean this_present_errorCode = true && this.isSetErrorCode();
0465     boolean that_present_errorCode = true && that.isSetErrorCode();
0466     if (this_present_errorCode || that_present_errorCode) {
0467       if (!(this_present_errorCode && that_present_errorCode))
0468         return false;
0469       if (this.errorCode != that.errorCode)
0470         return false;
0471     }
0472 
0473     boolean this_present_errorMessage = true && this.isSetErrorMessage();
0474     boolean that_present_errorMessage = true && that.isSetErrorMessage();
0475     if (this_present_errorMessage || that_present_errorMessage) {
0476       if (!(this_present_errorMessage && that_present_errorMessage))
0477         return false;
0478       if (!this.errorMessage.equals(that.errorMessage))
0479         return false;
0480     }
0481 
0482     return true;
0483   }
0484 
0485   @Override
0486   public int hashCode() {
0487     List<Object> list = new ArrayList<Object>();
0488 
0489     boolean present_statusCode = true && (isSetStatusCode());
0490     list.add(present_statusCode);
0491     if (present_statusCode)
0492       list.add(statusCode.getValue());
0493 
0494     boolean present_infoMessages = true && (isSetInfoMessages());
0495     list.add(present_infoMessages);
0496     if (present_infoMessages)
0497       list.add(infoMessages);
0498 
0499     boolean present_sqlState = true && (isSetSqlState());
0500     list.add(present_sqlState);
0501     if (present_sqlState)
0502       list.add(sqlState);
0503 
0504     boolean present_errorCode = true && (isSetErrorCode());
0505     list.add(present_errorCode);
0506     if (present_errorCode)
0507       list.add(errorCode);
0508 
0509     boolean present_errorMessage = true && (isSetErrorMessage());
0510     list.add(present_errorMessage);
0511     if (present_errorMessage)
0512       list.add(errorMessage);
0513 
0514     return list.hashCode();
0515   }
0516 
0517   @Override
0518   public int compareTo(TStatus other) {
0519     if (!getClass().equals(other.getClass())) {
0520       return getClass().getName().compareTo(other.getClass().getName());
0521     }
0522 
0523     int lastComparison = 0;
0524 
0525     lastComparison = Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode());
0526     if (lastComparison != 0) {
0527       return lastComparison;
0528     }
0529     if (isSetStatusCode()) {
0530       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusCode, other.statusCode);
0531       if (lastComparison != 0) {
0532         return lastComparison;
0533       }
0534     }
0535     lastComparison = Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages());
0536     if (lastComparison != 0) {
0537       return lastComparison;
0538     }
0539     if (isSetInfoMessages()) {
0540       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoMessages, other.infoMessages);
0541       if (lastComparison != 0) {
0542         return lastComparison;
0543       }
0544     }
0545     lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState());
0546     if (lastComparison != 0) {
0547       return lastComparison;
0548     }
0549     if (isSetSqlState()) {
0550       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState);
0551       if (lastComparison != 0) {
0552         return lastComparison;
0553       }
0554     }
0555     lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode());
0556     if (lastComparison != 0) {
0557       return lastComparison;
0558     }
0559     if (isSetErrorCode()) {
0560       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode);
0561       if (lastComparison != 0) {
0562         return lastComparison;
0563       }
0564     }
0565     lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage());
0566     if (lastComparison != 0) {
0567       return lastComparison;
0568     }
0569     if (isSetErrorMessage()) {
0570       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage);
0571       if (lastComparison != 0) {
0572         return lastComparison;
0573       }
0574     }
0575     return 0;
0576   }
0577 
0578   public _Fields fieldForId(int fieldId) {
0579     return _Fields.findByThriftId(fieldId);
0580   }
0581 
0582   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0583     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0584   }
0585 
0586   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0587     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0588   }
0589 
0590   @Override
0591   public String toString() {
0592     StringBuilder sb = new StringBuilder("TStatus(");
0593     boolean first = true;
0594 
0595     sb.append("statusCode:");
0596     if (this.statusCode == null) {
0597       sb.append("null");
0598     } else {
0599       sb.append(this.statusCode);
0600     }
0601     first = false;
0602     if (isSetInfoMessages()) {
0603       if (!first) sb.append(", ");
0604       sb.append("infoMessages:");
0605       if (this.infoMessages == null) {
0606         sb.append("null");
0607       } else {
0608         sb.append(this.infoMessages);
0609       }
0610       first = false;
0611     }
0612     if (isSetSqlState()) {
0613       if (!first) sb.append(", ");
0614       sb.append("sqlState:");
0615       if (this.sqlState == null) {
0616         sb.append("null");
0617       } else {
0618         sb.append(this.sqlState);
0619       }
0620       first = false;
0621     }
0622     if (isSetErrorCode()) {
0623       if (!first) sb.append(", ");
0624       sb.append("errorCode:");
0625       sb.append(this.errorCode);
0626       first = false;
0627     }
0628     if (isSetErrorMessage()) {
0629       if (!first) sb.append(", ");
0630       sb.append("errorMessage:");
0631       if (this.errorMessage == null) {
0632         sb.append("null");
0633       } else {
0634         sb.append(this.errorMessage);
0635       }
0636       first = false;
0637     }
0638     sb.append(")");
0639     return sb.toString();
0640   }
0641 
0642   public void validate() throws org.apache.thrift.TException {
0643     // check for required fields
0644     if (!isSetStatusCode()) {
0645       throw new org.apache.thrift.protocol.TProtocolException("Required field 'statusCode' is unset! Struct:" + toString());
0646     }
0647 
0648     // check for sub-struct validity
0649   }
0650 
0651   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0652     try {
0653       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0654     } catch (org.apache.thrift.TException te) {
0655       throw new java.io.IOException(te);
0656     }
0657   }
0658 
0659   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0660     try {
0661       // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
0662       __isset_bitfield = 0;
0663       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0664     } catch (org.apache.thrift.TException te) {
0665       throw new java.io.IOException(te);
0666     }
0667   }
0668 
0669   private static class TStatusStandardSchemeFactory implements SchemeFactory {
0670     public TStatusStandardScheme getScheme() {
0671       return new TStatusStandardScheme();
0672     }
0673   }
0674 
0675   private static class TStatusStandardScheme extends StandardScheme<TStatus> {
0676 
0677     public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) throws org.apache.thrift.TException {
0678       org.apache.thrift.protocol.TField schemeField;
0679       iprot.readStructBegin();
0680       while (true)
0681       {
0682         schemeField = iprot.readFieldBegin();
0683         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0684           break;
0685         }
0686         switch (schemeField.id) {
0687           case 1: // STATUS_CODE
0688             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
0689               struct.statusCode = org.apache.hive.service.rpc.thrift.TStatusCode.findByValue(iprot.readI32());
0690               struct.setStatusCodeIsSet(true);
0691             } else { 
0692               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0693             }
0694             break;
0695           case 2: // INFO_MESSAGES
0696             if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
0697               {
0698                 org.apache.thrift.protocol.TList _list134 = iprot.readListBegin();
0699                 struct.infoMessages = new ArrayList<String>(_list134.size);
0700                 String _elem135;
0701                 for (int _i136 = 0; _i136 < _list134.size; ++_i136)
0702                 {
0703                   _elem135 = iprot.readString();
0704                   struct.infoMessages.add(_elem135);
0705                 }
0706                 iprot.readListEnd();
0707               }
0708               struct.setInfoMessagesIsSet(true);
0709             } else { 
0710               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0711             }
0712             break;
0713           case 3: // SQL_STATE
0714             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0715               struct.sqlState = iprot.readString();
0716               struct.setSqlStateIsSet(true);
0717             } else { 
0718               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0719             }
0720             break;
0721           case 4: // ERROR_CODE
0722             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
0723               struct.errorCode = iprot.readI32();
0724               struct.setErrorCodeIsSet(true);
0725             } else { 
0726               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0727             }
0728             break;
0729           case 5: // ERROR_MESSAGE
0730             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0731               struct.errorMessage = iprot.readString();
0732               struct.setErrorMessageIsSet(true);
0733             } else { 
0734               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0735             }
0736             break;
0737           default:
0738             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0739         }
0740         iprot.readFieldEnd();
0741       }
0742       iprot.readStructEnd();
0743       struct.validate();
0744     }
0745 
0746     public void write(org.apache.thrift.protocol.TProtocol oprot, TStatus struct) throws org.apache.thrift.TException {
0747       struct.validate();
0748 
0749       oprot.writeStructBegin(STRUCT_DESC);
0750       if (struct.statusCode != null) {
0751         oprot.writeFieldBegin(STATUS_CODE_FIELD_DESC);
0752         oprot.writeI32(struct.statusCode.getValue());
0753         oprot.writeFieldEnd();
0754       }
0755       if (struct.infoMessages != null) {
0756         if (struct.isSetInfoMessages()) {
0757           oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC);
0758           {
0759             oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size()));
0760             for (String _iter137 : struct.infoMessages)
0761             {
0762               oprot.writeString(_iter137);
0763             }
0764             oprot.writeListEnd();
0765           }
0766           oprot.writeFieldEnd();
0767         }
0768       }
0769       if (struct.sqlState != null) {
0770         if (struct.isSetSqlState()) {
0771           oprot.writeFieldBegin(SQL_STATE_FIELD_DESC);
0772           oprot.writeString(struct.sqlState);
0773           oprot.writeFieldEnd();
0774         }
0775       }
0776       if (struct.isSetErrorCode()) {
0777         oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC);
0778         oprot.writeI32(struct.errorCode);
0779         oprot.writeFieldEnd();
0780       }
0781       if (struct.errorMessage != null) {
0782         if (struct.isSetErrorMessage()) {
0783           oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC);
0784           oprot.writeString(struct.errorMessage);
0785           oprot.writeFieldEnd();
0786         }
0787       }
0788       oprot.writeFieldStop();
0789       oprot.writeStructEnd();
0790     }
0791 
0792   }
0793 
0794   private static class TStatusTupleSchemeFactory implements SchemeFactory {
0795     public TStatusTupleScheme getScheme() {
0796       return new TStatusTupleScheme();
0797     }
0798   }
0799 
0800   private static class TStatusTupleScheme extends TupleScheme<TStatus> {
0801 
0802     @Override
0803     public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException {
0804       TTupleProtocol oprot = (TTupleProtocol) prot;
0805       oprot.writeI32(struct.statusCode.getValue());
0806       BitSet optionals = new BitSet();
0807       if (struct.isSetInfoMessages()) {
0808         optionals.set(0);
0809       }
0810       if (struct.isSetSqlState()) {
0811         optionals.set(1);
0812       }
0813       if (struct.isSetErrorCode()) {
0814         optionals.set(2);
0815       }
0816       if (struct.isSetErrorMessage()) {
0817         optionals.set(3);
0818       }
0819       oprot.writeBitSet(optionals, 4);
0820       if (struct.isSetInfoMessages()) {
0821         {
0822           oprot.writeI32(struct.infoMessages.size());
0823           for (String _iter138 : struct.infoMessages)
0824           {
0825             oprot.writeString(_iter138);
0826           }
0827         }
0828       }
0829       if (struct.isSetSqlState()) {
0830         oprot.writeString(struct.sqlState);
0831       }
0832       if (struct.isSetErrorCode()) {
0833         oprot.writeI32(struct.errorCode);
0834       }
0835       if (struct.isSetErrorMessage()) {
0836         oprot.writeString(struct.errorMessage);
0837       }
0838     }
0839 
0840     @Override
0841     public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException {
0842       TTupleProtocol iprot = (TTupleProtocol) prot;
0843       struct.statusCode = org.apache.hive.service.rpc.thrift.TStatusCode.findByValue(iprot.readI32());
0844       struct.setStatusCodeIsSet(true);
0845       BitSet incoming = iprot.readBitSet(4);
0846       if (incoming.get(0)) {
0847         {
0848           org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
0849           struct.infoMessages = new ArrayList<String>(_list139.size);
0850           String _elem140;
0851           for (int _i141 = 0; _i141 < _list139.size; ++_i141)
0852           {
0853             _elem140 = iprot.readString();
0854             struct.infoMessages.add(_elem140);
0855           }
0856         }
0857         struct.setInfoMessagesIsSet(true);
0858       }
0859       if (incoming.get(1)) {
0860         struct.sqlState = iprot.readString();
0861         struct.setSqlStateIsSet(true);
0862       }
0863       if (incoming.get(2)) {
0864         struct.errorCode = iprot.readI32();
0865         struct.setErrorCodeIsSet(true);
0866       }
0867       if (incoming.get(3)) {
0868         struct.errorMessage = iprot.readString();
0869         struct.setErrorMessageIsSet(true);
0870       }
0871     }
0872   }
0873 
0874 }
0875