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