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