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 TOpenSessionReq implements org.apache.thrift.TBase<TOpenSessionReq, TOpenSessionReq._Fields>, java.io.Serializable, Cloneable {
0035   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionReq");
0036 
0037   private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1);
0038   private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2);
0039   private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (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 TOpenSessionReqStandardSchemeFactory());
0045     schemes.put(TupleScheme.class, new TOpenSessionReqTupleSchemeFactory());
0046   }
0047 
0048   private TProtocolVersion client_protocol; // required
0049   private String username; // optional
0050   private String password; // 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     /**
0056      * 
0057      * @see TProtocolVersion
0058      */
0059     CLIENT_PROTOCOL((short)1, "client_protocol"),
0060     USERNAME((short)2, "username"),
0061     PASSWORD((short)3, "password"),
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: // CLIENT_PROTOCOL
0078           return CLIENT_PROTOCOL;
0079         case 2: // USERNAME
0080           return USERNAME;
0081         case 3: // PASSWORD
0082           return PASSWORD;
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.USERNAME,_Fields.PASSWORD,_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.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0130         new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class)));
0131     tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0132         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
0133     tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
0134         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
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(TOpenSessionReq.class, metaDataMap);
0141   }
0142 
0143   public TOpenSessionReq() {
0144     this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8;
0145 
0146   }
0147 
0148   public TOpenSessionReq(
0149     TProtocolVersion client_protocol)
0150   {
0151     this();
0152     this.client_protocol = client_protocol;
0153   }
0154 
0155   /**
0156    * Performs a deep copy on <i>other</i>.
0157    */
0158   public TOpenSessionReq(TOpenSessionReq other) {
0159     if (other.isSetClient_protocol()) {
0160       this.client_protocol = other.client_protocol;
0161     }
0162     if (other.isSetUsername()) {
0163       this.username = other.username;
0164     }
0165     if (other.isSetPassword()) {
0166       this.password = other.password;
0167     }
0168     if (other.isSetConfiguration()) {
0169       Map<String,String> __this__configuration = new HashMap<String,String>();
0170       for (Map.Entry<String, String> other_element : other.configuration.entrySet()) {
0171 
0172         String other_element_key = other_element.getKey();
0173         String other_element_value = other_element.getValue();
0174 
0175         String __this__configuration_copy_key = other_element_key;
0176 
0177         String __this__configuration_copy_value = other_element_value;
0178 
0179         __this__configuration.put(__this__configuration_copy_key, __this__configuration_copy_value);
0180       }
0181       this.configuration = __this__configuration;
0182     }
0183   }
0184 
0185   public TOpenSessionReq deepCopy() {
0186     return new TOpenSessionReq(this);
0187   }
0188 
0189   @Override
0190   public void clear() {
0191     this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8;
0192 
0193     this.username = null;
0194     this.password = null;
0195     this.configuration = null;
0196   }
0197 
0198   /**
0199    * 
0200    * @see TProtocolVersion
0201    */
0202   public TProtocolVersion getClient_protocol() {
0203     return this.client_protocol;
0204   }
0205 
0206   /**
0207    * 
0208    * @see TProtocolVersion
0209    */
0210   public void setClient_protocol(TProtocolVersion client_protocol) {
0211     this.client_protocol = client_protocol;
0212   }
0213 
0214   public void unsetClient_protocol() {
0215     this.client_protocol = null;
0216   }
0217 
0218   /** Returns true if field client_protocol is set (has been assigned a value) and false otherwise */
0219   public boolean isSetClient_protocol() {
0220     return this.client_protocol != null;
0221   }
0222 
0223   public void setClient_protocolIsSet(boolean value) {
0224     if (!value) {
0225       this.client_protocol = null;
0226     }
0227   }
0228 
0229   public String getUsername() {
0230     return this.username;
0231   }
0232 
0233   public void setUsername(String username) {
0234     this.username = username;
0235   }
0236 
0237   public void unsetUsername() {
0238     this.username = null;
0239   }
0240 
0241   /** Returns true if field username is set (has been assigned a value) and false otherwise */
0242   public boolean isSetUsername() {
0243     return this.username != null;
0244   }
0245 
0246   public void setUsernameIsSet(boolean value) {
0247     if (!value) {
0248       this.username = null;
0249     }
0250   }
0251 
0252   public String getPassword() {
0253     return this.password;
0254   }
0255 
0256   public void setPassword(String password) {
0257     this.password = password;
0258   }
0259 
0260   public void unsetPassword() {
0261     this.password = null;
0262   }
0263 
0264   /** Returns true if field password is set (has been assigned a value) and false otherwise */
0265   public boolean isSetPassword() {
0266     return this.password != null;
0267   }
0268 
0269   public void setPasswordIsSet(boolean value) {
0270     if (!value) {
0271       this.password = null;
0272     }
0273   }
0274 
0275   public int getConfigurationSize() {
0276     return (this.configuration == null) ? 0 : this.configuration.size();
0277   }
0278 
0279   public void putToConfiguration(String key, String val) {
0280     if (this.configuration == null) {
0281       this.configuration = new HashMap<String,String>();
0282     }
0283     this.configuration.put(key, val);
0284   }
0285 
0286   public Map<String,String> getConfiguration() {
0287     return this.configuration;
0288   }
0289 
0290   public void setConfiguration(Map<String,String> configuration) {
0291     this.configuration = configuration;
0292   }
0293 
0294   public void unsetConfiguration() {
0295     this.configuration = null;
0296   }
0297 
0298   /** Returns true if field configuration is set (has been assigned a value) and false otherwise */
0299   public boolean isSetConfiguration() {
0300     return this.configuration != null;
0301   }
0302 
0303   public void setConfigurationIsSet(boolean value) {
0304     if (!value) {
0305       this.configuration = null;
0306     }
0307   }
0308 
0309   public void setFieldValue(_Fields field, Object value) {
0310     switch (field) {
0311     case CLIENT_PROTOCOL:
0312       if (value == null) {
0313         unsetClient_protocol();
0314       } else {
0315         setClient_protocol((TProtocolVersion)value);
0316       }
0317       break;
0318 
0319     case USERNAME:
0320       if (value == null) {
0321         unsetUsername();
0322       } else {
0323         setUsername((String)value);
0324       }
0325       break;
0326 
0327     case PASSWORD:
0328       if (value == null) {
0329         unsetPassword();
0330       } else {
0331         setPassword((String)value);
0332       }
0333       break;
0334 
0335     case CONFIGURATION:
0336       if (value == null) {
0337         unsetConfiguration();
0338       } else {
0339         setConfiguration((Map<String,String>)value);
0340       }
0341       break;
0342 
0343     }
0344   }
0345 
0346   public Object getFieldValue(_Fields field) {
0347     switch (field) {
0348     case CLIENT_PROTOCOL:
0349       return getClient_protocol();
0350 
0351     case USERNAME:
0352       return getUsername();
0353 
0354     case PASSWORD:
0355       return getPassword();
0356 
0357     case CONFIGURATION:
0358       return getConfiguration();
0359 
0360     }
0361     throw new IllegalStateException();
0362   }
0363 
0364   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0365   public boolean isSet(_Fields field) {
0366     if (field == null) {
0367       throw new IllegalArgumentException();
0368     }
0369 
0370     switch (field) {
0371     case CLIENT_PROTOCOL:
0372       return isSetClient_protocol();
0373     case USERNAME:
0374       return isSetUsername();
0375     case PASSWORD:
0376       return isSetPassword();
0377     case CONFIGURATION:
0378       return isSetConfiguration();
0379     }
0380     throw new IllegalStateException();
0381   }
0382 
0383   @Override
0384   public boolean equals(Object that) {
0385     if (that == null)
0386       return false;
0387     if (that instanceof TOpenSessionReq)
0388       return this.equals((TOpenSessionReq)that);
0389     return false;
0390   }
0391 
0392   public boolean equals(TOpenSessionReq that) {
0393     if (that == null)
0394       return false;
0395 
0396     boolean this_present_client_protocol = true && this.isSetClient_protocol();
0397     boolean that_present_client_protocol = true && that.isSetClient_protocol();
0398     if (this_present_client_protocol || that_present_client_protocol) {
0399       if (!(this_present_client_protocol && that_present_client_protocol))
0400         return false;
0401       if (!this.client_protocol.equals(that.client_protocol))
0402         return false;
0403     }
0404 
0405     boolean this_present_username = true && this.isSetUsername();
0406     boolean that_present_username = true && that.isSetUsername();
0407     if (this_present_username || that_present_username) {
0408       if (!(this_present_username && that_present_username))
0409         return false;
0410       if (!this.username.equals(that.username))
0411         return false;
0412     }
0413 
0414     boolean this_present_password = true && this.isSetPassword();
0415     boolean that_present_password = true && that.isSetPassword();
0416     if (this_present_password || that_present_password) {
0417       if (!(this_present_password && that_present_password))
0418         return false;
0419       if (!this.password.equals(that.password))
0420         return false;
0421     }
0422 
0423     boolean this_present_configuration = true && this.isSetConfiguration();
0424     boolean that_present_configuration = true && that.isSetConfiguration();
0425     if (this_present_configuration || that_present_configuration) {
0426       if (!(this_present_configuration && that_present_configuration))
0427         return false;
0428       if (!this.configuration.equals(that.configuration))
0429         return false;
0430     }
0431 
0432     return true;
0433   }
0434 
0435   @Override
0436   public int hashCode() {
0437     HashCodeBuilder builder = new HashCodeBuilder();
0438 
0439     boolean present_client_protocol = true && (isSetClient_protocol());
0440     builder.append(present_client_protocol);
0441     if (present_client_protocol)
0442       builder.append(client_protocol.getValue());
0443 
0444     boolean present_username = true && (isSetUsername());
0445     builder.append(present_username);
0446     if (present_username)
0447       builder.append(username);
0448 
0449     boolean present_password = true && (isSetPassword());
0450     builder.append(present_password);
0451     if (present_password)
0452       builder.append(password);
0453 
0454     boolean present_configuration = true && (isSetConfiguration());
0455     builder.append(present_configuration);
0456     if (present_configuration)
0457       builder.append(configuration);
0458 
0459     return builder.toHashCode();
0460   }
0461 
0462   public int compareTo(TOpenSessionReq other) {
0463     if (!getClass().equals(other.getClass())) {
0464       return getClass().getName().compareTo(other.getClass().getName());
0465     }
0466 
0467     int lastComparison = 0;
0468     TOpenSessionReq typedOther = (TOpenSessionReq)other;
0469 
0470     lastComparison = Boolean.valueOf(isSetClient_protocol()).compareTo(typedOther.isSetClient_protocol());
0471     if (lastComparison != 0) {
0472       return lastComparison;
0473     }
0474     if (isSetClient_protocol()) {
0475       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_protocol, typedOther.client_protocol);
0476       if (lastComparison != 0) {
0477         return lastComparison;
0478       }
0479     }
0480     lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername());
0481     if (lastComparison != 0) {
0482       return lastComparison;
0483     }
0484     if (isSetUsername()) {
0485       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username);
0486       if (lastComparison != 0) {
0487         return lastComparison;
0488       }
0489     }
0490     lastComparison = Boolean.valueOf(isSetPassword()).compareTo(typedOther.isSetPassword());
0491     if (lastComparison != 0) {
0492       return lastComparison;
0493     }
0494     if (isSetPassword()) {
0495       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password);
0496       if (lastComparison != 0) {
0497         return lastComparison;
0498       }
0499     }
0500     lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(typedOther.isSetConfiguration());
0501     if (lastComparison != 0) {
0502       return lastComparison;
0503     }
0504     if (isSetConfiguration()) {
0505       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, typedOther.configuration);
0506       if (lastComparison != 0) {
0507         return lastComparison;
0508       }
0509     }
0510     return 0;
0511   }
0512 
0513   public _Fields fieldForId(int fieldId) {
0514     return _Fields.findByThriftId(fieldId);
0515   }
0516 
0517   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0518     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0519   }
0520 
0521   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0522     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0523   }
0524 
0525   @Override
0526   public String toString() {
0527     StringBuilder sb = new StringBuilder("TOpenSessionReq(");
0528     boolean first = true;
0529 
0530     sb.append("client_protocol:");
0531     if (this.client_protocol == null) {
0532       sb.append("null");
0533     } else {
0534       sb.append(this.client_protocol);
0535     }
0536     first = false;
0537     if (isSetUsername()) {
0538       if (!first) sb.append(", ");
0539       sb.append("username:");
0540       if (this.username == null) {
0541         sb.append("null");
0542       } else {
0543         sb.append(this.username);
0544       }
0545       first = false;
0546     }
0547     if (isSetPassword()) {
0548       if (!first) sb.append(", ");
0549       sb.append("password:");
0550       if (this.password == null) {
0551         sb.append("null");
0552       } else {
0553         sb.append(this.password);
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 (!isSetClient_protocol()) {
0574       throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' is unset! Struct:" + toString());
0575     }
0576 
0577     // check for sub-struct validity
0578   }
0579 
0580   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0581     try {
0582       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0583     } catch (org.apache.thrift.TException te) {
0584       throw new java.io.IOException(te);
0585     }
0586   }
0587 
0588   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0589     try {
0590       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0591     } catch (org.apache.thrift.TException te) {
0592       throw new java.io.IOException(te);
0593     }
0594   }
0595 
0596   private static class TOpenSessionReqStandardSchemeFactory implements SchemeFactory {
0597     public TOpenSessionReqStandardScheme getScheme() {
0598       return new TOpenSessionReqStandardScheme();
0599     }
0600   }
0601 
0602   private static class TOpenSessionReqStandardScheme extends StandardScheme<TOpenSessionReq> {
0603 
0604     public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq struct) throws org.apache.thrift.TException {
0605       org.apache.thrift.protocol.TField schemeField;
0606       iprot.readStructBegin();
0607       while (true)
0608       {
0609         schemeField = iprot.readFieldBegin();
0610         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0611           break;
0612         }
0613         switch (schemeField.id) {
0614           case 1: // CLIENT_PROTOCOL
0615             if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
0616               struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32());
0617               struct.setClient_protocolIsSet(true);
0618             } else { 
0619               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0620             }
0621             break;
0622           case 2: // USERNAME
0623             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0624               struct.username = iprot.readString();
0625               struct.setUsernameIsSet(true);
0626             } else { 
0627               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0628             }
0629             break;
0630           case 3: // PASSWORD
0631             if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0632               struct.password = iprot.readString();
0633               struct.setPasswordIsSet(true);
0634             } else { 
0635               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0636             }
0637             break;
0638           case 4: // CONFIGURATION
0639             if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
0640               {
0641                 org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin();
0642                 struct.configuration = new HashMap<String,String>(2*_map142.size);
0643                 for (int _i143 = 0; _i143 < _map142.size; ++_i143)
0644                 {
0645                   String _key144; // required
0646                   String _val145; // required
0647                   _key144 = iprot.readString();
0648                   _val145 = iprot.readString();
0649                   struct.configuration.put(_key144, _val145);
0650                 }
0651                 iprot.readMapEnd();
0652               }
0653               struct.setConfigurationIsSet(true);
0654             } else { 
0655               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0656             }
0657             break;
0658           default:
0659             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0660         }
0661         iprot.readFieldEnd();
0662       }
0663       iprot.readStructEnd();
0664       struct.validate();
0665     }
0666 
0667     public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionReq struct) throws org.apache.thrift.TException {
0668       struct.validate();
0669 
0670       oprot.writeStructBegin(STRUCT_DESC);
0671       if (struct.client_protocol != null) {
0672         oprot.writeFieldBegin(CLIENT_PROTOCOL_FIELD_DESC);
0673         oprot.writeI32(struct.client_protocol.getValue());
0674         oprot.writeFieldEnd();
0675       }
0676       if (struct.username != null) {
0677         if (struct.isSetUsername()) {
0678           oprot.writeFieldBegin(USERNAME_FIELD_DESC);
0679           oprot.writeString(struct.username);
0680           oprot.writeFieldEnd();
0681         }
0682       }
0683       if (struct.password != null) {
0684         if (struct.isSetPassword()) {
0685           oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
0686           oprot.writeString(struct.password);
0687           oprot.writeFieldEnd();
0688         }
0689       }
0690       if (struct.configuration != null) {
0691         if (struct.isSetConfiguration()) {
0692           oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC);
0693           {
0694             oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size()));
0695             for (Map.Entry<String, String> _iter146 : struct.configuration.entrySet())
0696             {
0697               oprot.writeString(_iter146.getKey());
0698               oprot.writeString(_iter146.getValue());
0699             }
0700             oprot.writeMapEnd();
0701           }
0702           oprot.writeFieldEnd();
0703         }
0704       }
0705       oprot.writeFieldStop();
0706       oprot.writeStructEnd();
0707     }
0708 
0709   }
0710 
0711   private static class TOpenSessionReqTupleSchemeFactory implements SchemeFactory {
0712     public TOpenSessionReqTupleScheme getScheme() {
0713       return new TOpenSessionReqTupleScheme();
0714     }
0715   }
0716 
0717   private static class TOpenSessionReqTupleScheme extends TupleScheme<TOpenSessionReq> {
0718 
0719     @Override
0720     public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException {
0721       TTupleProtocol oprot = (TTupleProtocol) prot;
0722       oprot.writeI32(struct.client_protocol.getValue());
0723       BitSet optionals = new BitSet();
0724       if (struct.isSetUsername()) {
0725         optionals.set(0);
0726       }
0727       if (struct.isSetPassword()) {
0728         optionals.set(1);
0729       }
0730       if (struct.isSetConfiguration()) {
0731         optionals.set(2);
0732       }
0733       oprot.writeBitSet(optionals, 3);
0734       if (struct.isSetUsername()) {
0735         oprot.writeString(struct.username);
0736       }
0737       if (struct.isSetPassword()) {
0738         oprot.writeString(struct.password);
0739       }
0740       if (struct.isSetConfiguration()) {
0741         {
0742           oprot.writeI32(struct.configuration.size());
0743           for (Map.Entry<String, String> _iter147 : struct.configuration.entrySet())
0744           {
0745             oprot.writeString(_iter147.getKey());
0746             oprot.writeString(_iter147.getValue());
0747           }
0748         }
0749       }
0750     }
0751 
0752     @Override
0753     public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException {
0754       TTupleProtocol iprot = (TTupleProtocol) prot;
0755       struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32());
0756       struct.setClient_protocolIsSet(true);
0757       BitSet incoming = iprot.readBitSet(3);
0758       if (incoming.get(0)) {
0759         struct.username = iprot.readString();
0760         struct.setUsernameIsSet(true);
0761       }
0762       if (incoming.get(1)) {
0763         struct.password = iprot.readString();
0764         struct.setPasswordIsSet(true);
0765       }
0766       if (incoming.get(2)) {
0767         {
0768           org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
0769           struct.configuration = new HashMap<String,String>(2*_map148.size);
0770           for (int _i149 = 0; _i149 < _map148.size; ++_i149)
0771           {
0772             String _key150; // required
0773             String _val151; // required
0774             _key150 = iprot.readString();
0775             _val151 = iprot.readString();
0776             struct.configuration.put(_key150, _val151);
0777           }
0778         }
0779         struct.setConfigurationIsSet(true);
0780       }
0781     }
0782   }
0783 
0784 }
0785