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