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 TOpenSessionResp implements org.apache.thrift.TBase<TOpenSessionResp, TOpenSessionResp._Fields>, java.io.Serializable, Cloneable {
0035   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp");
0036 
0037   private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1);
0038   private static final org.apache.thrift.protocol.TField SERVER_PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("serverProtocolVersion", org.apache.thrift.protocol.TType.I32, (short)2);
0039   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)3);
0040   private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4);
0041 
0042   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0043   static {
0044     schemes.put(StandardScheme.class, new TOpenSessionRespStandardSchemeFactory());
0045     schemes.put(TupleScheme.class, new TOpenSessionRespTupleSchemeFactory());
0046   }
0047 
0048   private TStatus status; // required
0049   private TProtocolVersion serverProtocolVersion; // required
0050   private TSessionHandle sessionHandle; // optional
0051   private Map<String,String> configuration; // optional
0052 
0053   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
0054   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0055     STATUS((short)1, "status"),
0056     /**
0057      * 
0058      * @see TProtocolVersion
0059      */
0060     SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"),
0061     SESSION_HANDLE((short)3, "sessionHandle"),
0062     CONFIGURATION((short)4, "configuration");
0063 
0064     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0065 
0066     static {
0067       for (_Fields field : EnumSet.allOf(_Fields.class)) {
0068         byName.put(field.getFieldName(), field);
0069       }
0070     }
0071 
0072     /**
0073      * Find the _Fields constant that matches fieldId, or null if its not found.
0074      */
0075     public static _Fields findByThriftId(int fieldId) {
0076       switch(fieldId) {
0077         case 1: // STATUS
0078           return STATUS;
0079         case 2: // SERVER_PROTOCOL_VERSION
0080           return SERVER_PROTOCOL_VERSION;
0081         case 3: // SESSION_HANDLE
0082           return SESSION_HANDLE;
0083         case 4: // CONFIGURATION
0084           return CONFIGURATION;
0085         default:
0086           return null;
0087       }
0088     }
0089 
0090     /**
0091      * Find the _Fields constant that matches fieldId, throwing an exception
0092      * if it is not found.
0093      */
0094     public static _Fields findByThriftIdOrThrow(int fieldId) {
0095       _Fields fields = findByThriftId(fieldId);
0096       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0097       return fields;
0098     }
0099 
0100     /**
0101      * Find the _Fields constant that matches name, or null if its not found.
0102      */
0103     public static _Fields findByName(String name) {
0104       return byName.get(name);
0105     }
0106 
0107     private final short _thriftId;
0108     private final String _fieldName;
0109 
0110     _Fields(short thriftId, String fieldName) {
0111       _thriftId = thriftId;
0112       _fieldName = fieldName;
0113     }
0114 
0115     public short getThriftFieldId() {
0116       return _thriftId;
0117     }
0118 
0119     public String getFieldName() {
0120       return _fieldName;
0121     }
0122   }
0123 
0124   // isset id assignments
0125   private _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION};
0126   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0127   static {
0128     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0129     tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0130         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class)));
0131     tmpMap.put(_Fields.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0132         new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class)));
0133     tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0134         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class)));
0135     tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0136         new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, 
0137             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), 
0138             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
0139     metaDataMap = Collections.unmodifiableMap(tmpMap);
0140     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionResp.class, metaDataMap);
0141   }
0142 
0143   public TOpenSessionResp() {
0144     this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8;
0145 
0146   }
0147 
0148   public TOpenSessionResp(
0149     TStatus status,
0150     TProtocolVersion serverProtocolVersion)
0151   {
0152     this();
0153     this.status = status;
0154     this.serverProtocolVersion = serverProtocolVersion;
0155   }
0156 
0157   /**
0158    * Performs a deep copy on <i>other</i>.
0159    */
0160   public TOpenSessionResp(TOpenSessionResp other) {
0161     if (other.isSetStatus()) {
0162       this.status = new TStatus(other.status);
0163     }
0164     if (other.isSetServerProtocolVersion()) {
0165       this.serverProtocolVersion = other.serverProtocolVersion;
0166     }
0167     if (other.isSetSessionHandle()) {
0168       this.sessionHandle = new TSessionHandle(other.sessionHandle);
0169     }
0170     if (other.isSetConfiguration()) {
0171       Map<String,String> __this__configuration = new HashMap<String,String>();
0172       for (Map.Entry<String, String> other_element : other.configuration.entrySet()) {
0173 
0174         String other_element_key = other_element.getKey();
0175         String other_element_value = other_element.getValue();
0176 
0177         String __this__configuration_copy_key = other_element_key;
0178 
0179         String __this__configuration_copy_value = other_element_value;
0180 
0181         __this__configuration.put(__this__configuration_copy_key, __this__configuration_copy_value);
0182       }
0183       this.configuration = __this__configuration;
0184     }
0185   }
0186 
0187   public TOpenSessionResp deepCopy() {
0188     return new TOpenSessionResp(this);
0189   }
0190 
0191   @Override
0192   public void clear() {
0193     this.status = null;
0194     this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8;
0195 
0196     this.sessionHandle = null;
0197     this.configuration = null;
0198   }
0199 
0200   public TStatus getStatus() {
0201     return this.status;
0202   }
0203 
0204   public void setStatus(TStatus status) {
0205     this.status = status;
0206   }
0207 
0208   public void unsetStatus() {
0209     this.status = null;
0210   }
0211 
0212   /** Returns true if field status is set (has been assigned a value) and false otherwise */
0213   public boolean isSetStatus() {
0214     return this.status != null;
0215   }
0216 
0217   public void setStatusIsSet(boolean value) {
0218     if (!value) {
0219       this.status = null;
0220     }
0221   }
0222 
0223   /**
0224    * 
0225    * @see TProtocolVersion
0226    */
0227   public TProtocolVersion getServerProtocolVersion() {
0228     return this.serverProtocolVersion;
0229   }
0230 
0231   /**
0232    * 
0233    * @see TProtocolVersion
0234    */
0235   public void setServerProtocolVersion(TProtocolVersion serverProtocolVersion) {
0236     this.serverProtocolVersion = serverProtocolVersion;
0237   }
0238 
0239   public void unsetServerProtocolVersion() {
0240     this.serverProtocolVersion = null;
0241   }
0242 
0243   /** Returns true if field serverProtocolVersion is set (has been assigned a value) and false otherwise */
0244   public boolean isSetServerProtocolVersion() {
0245     return this.serverProtocolVersion != null;
0246   }
0247 
0248   public void setServerProtocolVersionIsSet(boolean value) {
0249     if (!value) {
0250       this.serverProtocolVersion = null;
0251     }
0252   }
0253 
0254   public TSessionHandle getSessionHandle() {
0255     return this.sessionHandle;
0256   }
0257 
0258   public void setSessionHandle(TSessionHandle sessionHandle) {
0259     this.sessionHandle = sessionHandle;
0260   }
0261 
0262   public void unsetSessionHandle() {
0263     this.sessionHandle = null;
0264   }
0265 
0266   /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */
0267   public boolean isSetSessionHandle() {
0268     return this.sessionHandle != null;
0269   }
0270 
0271   public void setSessionHandleIsSet(boolean value) {
0272     if (!value) {
0273       this.sessionHandle = null;
0274     }
0275   }
0276 
0277   public int getConfigurationSize() {
0278     return (this.configuration == null) ? 0 : this.configuration.size();
0279   }
0280 
0281   public void putToConfiguration(String key, String val) {
0282     if (this.configuration == null) {
0283       this.configuration = new HashMap<String,String>();
0284     }
0285     this.configuration.put(key, val);
0286   }
0287 
0288   public Map<String,String> getConfiguration() {
0289     return this.configuration;
0290   }
0291 
0292   public void setConfiguration(Map<String,String> configuration) {
0293     this.configuration = configuration;
0294   }
0295 
0296   public void unsetConfiguration() {
0297     this.configuration = null;
0298   }
0299 
0300   /** Returns true if field configuration is set (has been assigned a value) and false otherwise */
0301   public boolean isSetConfiguration() {
0302     return this.configuration != null;
0303   }
0304 
0305   public void setConfigurationIsSet(boolean value) {
0306     if (!value) {
0307       this.configuration = null;
0308     }
0309   }
0310 
0311   public void setFieldValue(_Fields field, Object value) {
0312     switch (field) {
0313     case STATUS:
0314       if (value == null) {
0315         unsetStatus();
0316       } else {
0317         setStatus((TStatus)value);
0318       }
0319       break;
0320 
0321     case SERVER_PROTOCOL_VERSION:
0322       if (value == null) {
0323         unsetServerProtocolVersion();
0324       } else {
0325         setServerProtocolVersion((TProtocolVersion)value);
0326       }
0327       break;
0328 
0329     case SESSION_HANDLE:
0330       if (value == null) {
0331         unsetSessionHandle();
0332       } else {
0333         setSessionHandle((TSessionHandle)value);
0334       }
0335       break;
0336 
0337     case CONFIGURATION:
0338       if (value == null) {
0339         unsetConfiguration();
0340       } else {
0341         setConfiguration((Map<String,String>)value);
0342       }
0343       break;
0344 
0345     }
0346   }
0347 
0348   public Object getFieldValue(_Fields field) {
0349     switch (field) {
0350     case STATUS:
0351       return getStatus();
0352 
0353     case SERVER_PROTOCOL_VERSION:
0354       return getServerProtocolVersion();
0355 
0356     case SESSION_HANDLE:
0357       return getSessionHandle();
0358 
0359     case CONFIGURATION:
0360       return getConfiguration();
0361 
0362     }
0363     throw new IllegalStateException();
0364   }
0365 
0366   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0367   public boolean isSet(_Fields field) {
0368     if (field == null) {
0369       throw new IllegalArgumentException();
0370     }
0371 
0372     switch (field) {
0373     case STATUS:
0374       return isSetStatus();
0375     case SERVER_PROTOCOL_VERSION:
0376       return isSetServerProtocolVersion();
0377     case SESSION_HANDLE:
0378       return isSetSessionHandle();
0379     case CONFIGURATION:
0380       return isSetConfiguration();
0381     }
0382     throw new IllegalStateException();
0383   }
0384 
0385   @Override
0386   public boolean equals(Object that) {
0387     if (that == null)
0388       return false;
0389     if (that instanceof TOpenSessionResp)
0390       return this.equals((TOpenSessionResp)that);
0391     return false;
0392   }
0393 
0394   public boolean equals(TOpenSessionResp that) {
0395     if (that == null)
0396       return false;
0397 
0398     boolean this_present_status = true && this.isSetStatus();
0399     boolean that_present_status = true && that.isSetStatus();
0400     if (this_present_status || that_present_status) {
0401       if (!(this_present_status && that_present_status))
0402         return false;
0403       if (!this.status.equals(that.status))
0404         return false;
0405     }
0406 
0407     boolean this_present_serverProtocolVersion = true && this.isSetServerProtocolVersion();
0408     boolean that_present_serverProtocolVersion = true && that.isSetServerProtocolVersion();
0409     if (this_present_serverProtocolVersion || that_present_serverProtocolVersion) {
0410       if (!(this_present_serverProtocolVersion && that_present_serverProtocolVersion))
0411         return false;
0412       if (!this.serverProtocolVersion.equals(that.serverProtocolVersion))
0413         return false;
0414     }
0415 
0416     boolean this_present_sessionHandle = true && this.isSetSessionHandle();
0417     boolean that_present_sessionHandle = true && that.isSetSessionHandle();
0418     if (this_present_sessionHandle || that_present_sessionHandle) {
0419       if (!(this_present_sessionHandle && that_present_sessionHandle))
0420         return false;
0421       if (!this.sessionHandle.equals(that.sessionHandle))
0422         return false;
0423     }
0424 
0425     boolean this_present_configuration = true && this.isSetConfiguration();
0426     boolean that_present_configuration = true && that.isSetConfiguration();
0427     if (this_present_configuration || that_present_configuration) {
0428       if (!(this_present_configuration && that_present_configuration))
0429         return false;
0430       if (!this.configuration.equals(that.configuration))
0431         return false;
0432     }
0433 
0434     return true;
0435   }
0436 
0437   @Override
0438   public int hashCode() {
0439     HashCodeBuilder builder = new HashCodeBuilder();
0440 
0441     boolean present_status = true && (isSetStatus());
0442     builder.append(present_status);
0443     if (present_status)
0444       builder.append(status);
0445 
0446     boolean present_serverProtocolVersion = true && (isSetServerProtocolVersion());
0447     builder.append(present_serverProtocolVersion);
0448     if (present_serverProtocolVersion)
0449       builder.append(serverProtocolVersion.getValue());
0450 
0451     boolean present_sessionHandle = true && (isSetSessionHandle());
0452     builder.append(present_sessionHandle);
0453     if (present_sessionHandle)
0454       builder.append(sessionHandle);
0455 
0456     boolean present_configuration = true && (isSetConfiguration());
0457     builder.append(present_configuration);
0458     if (present_configuration)
0459       builder.append(configuration);
0460 
0461     return builder.toHashCode();
0462   }
0463 
0464   public int compareTo(TOpenSessionResp other) {
0465     if (!getClass().equals(other.getClass())) {
0466       return getClass().getName().compareTo(other.getClass().getName());
0467     }
0468 
0469     int lastComparison = 0;
0470     TOpenSessionResp typedOther = (TOpenSessionResp)other;
0471 
0472     lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
0473     if (lastComparison != 0) {
0474       return lastComparison;
0475     }
0476     if (isSetStatus()) {
0477       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
0478       if (lastComparison != 0) {
0479         return lastComparison;
0480       }
0481     }
0482     lastComparison = Boolean.valueOf(isSetServerProtocolVersion()).compareTo(typedOther.isSetServerProtocolVersion());
0483     if (lastComparison != 0) {
0484       return lastComparison;
0485     }
0486     if (isSetServerProtocolVersion()) {
0487       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverProtocolVersion, typedOther.serverProtocolVersion);
0488       if (lastComparison != 0) {
0489         return lastComparison;
0490       }
0491     }
0492     lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle());
0493     if (lastComparison != 0) {
0494       return lastComparison;
0495     }
0496     if (isSetSessionHandle()) {
0497       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle);
0498       if (lastComparison != 0) {
0499         return lastComparison;
0500       }
0501     }
0502     lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(typedOther.isSetConfiguration());
0503     if (lastComparison != 0) {
0504       return lastComparison;
0505     }
0506     if (isSetConfiguration()) {
0507       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, typedOther.configuration);
0508       if (lastComparison != 0) {
0509         return lastComparison;
0510       }
0511     }
0512     return 0;
0513   }
0514 
0515   public _Fields fieldForId(int fieldId) {
0516     return _Fields.findByThriftId(fieldId);
0517   }
0518 
0519   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0520     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0521   }
0522 
0523   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0524     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0525   }
0526 
0527   @Override
0528   public String toString() {
0529     StringBuilder sb = new StringBuilder("TOpenSessionResp(");
0530     boolean first = true;
0531 
0532     sb.append("status:");
0533     if (this.status == null) {
0534       sb.append("null");
0535     } else {
0536       sb.append(this.status);
0537     }
0538     first = false;
0539     if (!first) sb.append(", ");
0540     sb.append("serverProtocolVersion:");
0541     if (this.serverProtocolVersion == null) {
0542       sb.append("null");
0543     } else {
0544       sb.append(this.serverProtocolVersion);
0545     }
0546     first = false;
0547     if (isSetSessionHandle()) {
0548       if (!first) sb.append(", ");
0549       sb.append("sessionHandle:");
0550       if (this.sessionHandle == null) {
0551         sb.append("null");
0552       } else {
0553         sb.append(this.sessionHandle);
0554       }
0555       first = false;
0556     }
0557     if (isSetConfiguration()) {
0558       if (!first) sb.append(", ");
0559       sb.append("configuration:");
0560       if (this.configuration == null) {
0561         sb.append("null");
0562       } else {
0563         sb.append(this.configuration);
0564       }
0565       first = false;
0566     }
0567     sb.append(")");
0568     return sb.toString();
0569   }
0570 
0571   public void validate() throws org.apache.thrift.TException {
0572     // check for required fields
0573     if (!isSetStatus()) {
0574       throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
0575     }
0576 
0577     if (!isSetServerProtocolVersion()) {
0578       throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' is unset! Struct:" + toString());
0579     }
0580 
0581     // check for sub-struct validity
0582     if (status != null) {
0583       status.validate();
0584     }
0585     if (sessionHandle != null) {
0586       sessionHandle.validate();
0587     }
0588   }
0589 
0590   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0591     try {
0592       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0593     } catch (org.apache.thrift.TException te) {
0594       throw new java.io.IOException(te);
0595     }
0596   }
0597 
0598   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0599     try {
0600       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0601     } catch (org.apache.thrift.TException te) {
0602       throw new java.io.IOException(te);
0603     }
0604   }
0605 
0606   private static class TOpenSessionRespStandardSchemeFactory implements SchemeFactory {
0607     public TOpenSessionRespStandardScheme getScheme() {
0608       return new TOpenSessionRespStandardScheme();
0609     }
0610   }
0611 
0612   private static class TOpenSessionRespStandardScheme extends StandardScheme<TOpenSessionResp> {
0613 
0614     public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp struct) throws org.apache.thrift.TException {
0615       org.apache.thrift.protocol.TField schemeField;
0616       iprot.readStructBegin();
0617       while (true)
0618       {
0619         schemeField = iprot.readFieldBegin();
0620         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0621           break;
0622         }
0623         switch (schemeField.id) {
0624           case 1: // STATUS
0625             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0626               struct.status = new TStatus();
0627               struct.status.read(iprot);
0628               struct.setStatusIsSet(true);
0629             } else { 
0630               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0631             }
0632             break;
0633           case 2: // SERVER_PROTOCOL_VERSION
0634             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
0635               struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32());
0636               struct.setServerProtocolVersionIsSet(true);
0637             } else { 
0638               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0639             }
0640             break;
0641           case 3: // SESSION_HANDLE
0642             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0643               struct.sessionHandle = new TSessionHandle();
0644               struct.sessionHandle.read(iprot);
0645               struct.setSessionHandleIsSet(true);
0646             } else { 
0647               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0648             }
0649             break;
0650           case 4: // CONFIGURATION
0651             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
0652               {
0653                 org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin();
0654                 struct.configuration = new HashMap<String,String>(2*_map152.size);
0655                 for (int _i153 = 0; _i153 < _map152.size; ++_i153)
0656                 {
0657                   String _key154; // required
0658                   String _val155; // required
0659                   _key154 = iprot.readString();
0660                   _val155 = iprot.readString();
0661                   struct.configuration.put(_key154, _val155);
0662                 }
0663                 iprot.readMapEnd();
0664               }
0665               struct.setConfigurationIsSet(true);
0666             } else { 
0667               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0668             }
0669             break;
0670           default:
0671             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0672         }
0673         iprot.readFieldEnd();
0674       }
0675       iprot.readStructEnd();
0676       struct.validate();
0677     }
0678 
0679     public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionResp struct) throws org.apache.thrift.TException {
0680       struct.validate();
0681 
0682       oprot.writeStructBegin(STRUCT_DESC);
0683       if (struct.status != null) {
0684         oprot.writeFieldBegin(STATUS_FIELD_DESC);
0685         struct.status.write(oprot);
0686         oprot.writeFieldEnd();
0687       }
0688       if (struct.serverProtocolVersion != null) {
0689         oprot.writeFieldBegin(SERVER_PROTOCOL_VERSION_FIELD_DESC);
0690         oprot.writeI32(struct.serverProtocolVersion.getValue());
0691         oprot.writeFieldEnd();
0692       }
0693       if (struct.sessionHandle != null) {
0694         if (struct.isSetSessionHandle()) {
0695           oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC);
0696           struct.sessionHandle.write(oprot);
0697           oprot.writeFieldEnd();
0698         }
0699       }
0700       if (struct.configuration != null) {
0701         if (struct.isSetConfiguration()) {
0702           oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC);
0703           {
0704             oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size()));
0705             for (Map.Entry<String, String> _iter156 : struct.configuration.entrySet())
0706             {
0707               oprot.writeString(_iter156.getKey());
0708               oprot.writeString(_iter156.getValue());
0709             }
0710             oprot.writeMapEnd();
0711           }
0712           oprot.writeFieldEnd();
0713         }
0714       }
0715       oprot.writeFieldStop();
0716       oprot.writeStructEnd();
0717     }
0718 
0719   }
0720 
0721   private static class TOpenSessionRespTupleSchemeFactory implements SchemeFactory {
0722     public TOpenSessionRespTupleScheme getScheme() {
0723       return new TOpenSessionRespTupleScheme();
0724     }
0725   }
0726 
0727   private static class TOpenSessionRespTupleScheme extends TupleScheme<TOpenSessionResp> {
0728 
0729     @Override
0730     public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException {
0731       TTupleProtocol oprot = (TTupleProtocol) prot;
0732       struct.status.write(oprot);
0733       oprot.writeI32(struct.serverProtocolVersion.getValue());
0734       BitSet optionals = new BitSet();
0735       if (struct.isSetSessionHandle()) {
0736         optionals.set(0);
0737       }
0738       if (struct.isSetConfiguration()) {
0739         optionals.set(1);
0740       }
0741       oprot.writeBitSet(optionals, 2);
0742       if (struct.isSetSessionHandle()) {
0743         struct.sessionHandle.write(oprot);
0744       }
0745       if (struct.isSetConfiguration()) {
0746         {
0747           oprot.writeI32(struct.configuration.size());
0748           for (Map.Entry<String, String> _iter157 : struct.configuration.entrySet())
0749           {
0750             oprot.writeString(_iter157.getKey());
0751             oprot.writeString(_iter157.getValue());
0752           }
0753         }
0754       }
0755     }
0756 
0757     @Override
0758     public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException {
0759       TTupleProtocol iprot = (TTupleProtocol) prot;
0760       struct.status = new TStatus();
0761       struct.status.read(iprot);
0762       struct.setStatusIsSet(true);
0763       struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32());
0764       struct.setServerProtocolVersionIsSet(true);
0765       BitSet incoming = iprot.readBitSet(2);
0766       if (incoming.get(0)) {
0767         struct.sessionHandle = new TSessionHandle();
0768         struct.sessionHandle.read(iprot);
0769         struct.setSessionHandleIsSet(true);
0770       }
0771       if (incoming.get(1)) {
0772         {
0773           org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
0774           struct.configuration = new HashMap<String,String>(2*_map158.size);
0775           for (int _i159 = 0; _i159 < _map158.size; ++_i159)
0776           {
0777             String _key160; // required
0778             String _val161; // required
0779             _key160 = iprot.readString();
0780             _val161 = iprot.readString();
0781             struct.configuration.put(_key160, _val161);
0782           }
0783         }
0784         struct.setConfigurationIsSet(true);
0785       }
0786     }
0787   }
0788 
0789 }
0790