Back to home page

OSCL-LXR

 
 

    


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