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