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 TOperationHandle implements org.apache.thrift.TBase<TOperationHandle, TOperationHandle._Fields>, java.io.Serializable, Cloneable {
0035 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle");
0036
0037 private static final org.apache.thrift.protocol.TField OPERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operationId", org.apache.thrift.protocol.TType.STRUCT, (short)1);
0038 private static final org.apache.thrift.protocol.TField OPERATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationType", org.apache.thrift.protocol.TType.I32, (short)2);
0039 private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)3);
0040 private static final org.apache.thrift.protocol.TField MODIFIED_ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("modifiedRowCount", org.apache.thrift.protocol.TType.DOUBLE, (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 TOperationHandleStandardSchemeFactory());
0045 schemes.put(TupleScheme.class, new TOperationHandleTupleSchemeFactory());
0046 }
0047
0048 private THandleIdentifier operationId;
0049 private TOperationType operationType;
0050 private boolean hasResultSet;
0051 private double modifiedRowCount;
0052
0053
0054 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0055 OPERATION_ID((short)1, "operationId"),
0056
0057
0058
0059
0060 OPERATION_TYPE((short)2, "operationType"),
0061 HAS_RESULT_SET((short)3, "hasResultSet"),
0062 MODIFIED_ROW_COUNT((short)4, "modifiedRowCount");
0063
0064 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0065
0066 static {
0067 for (_Fields field : EnumSet.allOf(_Fields.class)) {
0068 byName.put(field.getFieldName(), field);
0069 }
0070 }
0071
0072
0073
0074
0075 public static _Fields findByThriftId(int fieldId) {
0076 switch(fieldId) {
0077 case 1:
0078 return OPERATION_ID;
0079 case 2:
0080 return OPERATION_TYPE;
0081 case 3:
0082 return HAS_RESULT_SET;
0083 case 4:
0084 return MODIFIED_ROW_COUNT;
0085 default:
0086 return null;
0087 }
0088 }
0089
0090
0091
0092
0093
0094 public static _Fields findByThriftIdOrThrow(int fieldId) {
0095 _Fields fields = findByThriftId(fieldId);
0096 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0097 return fields;
0098 }
0099
0100
0101
0102
0103 public static _Fields findByName(String name) {
0104 return byName.get(name);
0105 }
0106
0107 private final short _thriftId;
0108 private final String _fieldName;
0109
0110 _Fields(short thriftId, String fieldName) {
0111 _thriftId = thriftId;
0112 _fieldName = fieldName;
0113 }
0114
0115 public short getThriftFieldId() {
0116 return _thriftId;
0117 }
0118
0119 public String getFieldName() {
0120 return _fieldName;
0121 }
0122 }
0123
0124
0125 private static final int __HASRESULTSET_ISSET_ID = 0;
0126 private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1;
0127 private byte __isset_bitfield = 0;
0128 private _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT};
0129 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0130 static {
0131 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0132 tmpMap.put(_Fields.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED,
0133 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class)));
0134 tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED,
0135 new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationType.class)));
0136 tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.REQUIRED,
0137 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
0138 tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL,
0139 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
0140 metaDataMap = Collections.unmodifiableMap(tmpMap);
0141 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap);
0142 }
0143
0144 public TOperationHandle() {
0145 }
0146
0147 public TOperationHandle(
0148 THandleIdentifier operationId,
0149 TOperationType operationType,
0150 boolean hasResultSet)
0151 {
0152 this();
0153 this.operationId = operationId;
0154 this.operationType = operationType;
0155 this.hasResultSet = hasResultSet;
0156 setHasResultSetIsSet(true);
0157 }
0158
0159
0160
0161
0162 public TOperationHandle(TOperationHandle other) {
0163 __isset_bitfield = other.__isset_bitfield;
0164 if (other.isSetOperationId()) {
0165 this.operationId = new THandleIdentifier(other.operationId);
0166 }
0167 if (other.isSetOperationType()) {
0168 this.operationType = other.operationType;
0169 }
0170 this.hasResultSet = other.hasResultSet;
0171 this.modifiedRowCount = other.modifiedRowCount;
0172 }
0173
0174 public TOperationHandle deepCopy() {
0175 return new TOperationHandle(this);
0176 }
0177
0178 @Override
0179 public void clear() {
0180 this.operationId = null;
0181 this.operationType = null;
0182 setHasResultSetIsSet(false);
0183 this.hasResultSet = false;
0184 setModifiedRowCountIsSet(false);
0185 this.modifiedRowCount = 0.0;
0186 }
0187
0188 public THandleIdentifier getOperationId() {
0189 return this.operationId;
0190 }
0191
0192 public void setOperationId(THandleIdentifier operationId) {
0193 this.operationId = operationId;
0194 }
0195
0196 public void unsetOperationId() {
0197 this.operationId = null;
0198 }
0199
0200
0201 public boolean isSetOperationId() {
0202 return this.operationId != null;
0203 }
0204
0205 public void setOperationIdIsSet(boolean value) {
0206 if (!value) {
0207 this.operationId = null;
0208 }
0209 }
0210
0211
0212
0213
0214
0215 public TOperationType getOperationType() {
0216 return this.operationType;
0217 }
0218
0219
0220
0221
0222
0223 public void setOperationType(TOperationType operationType) {
0224 this.operationType = operationType;
0225 }
0226
0227 public void unsetOperationType() {
0228 this.operationType = null;
0229 }
0230
0231
0232 public boolean isSetOperationType() {
0233 return this.operationType != null;
0234 }
0235
0236 public void setOperationTypeIsSet(boolean value) {
0237 if (!value) {
0238 this.operationType = null;
0239 }
0240 }
0241
0242 public boolean isHasResultSet() {
0243 return this.hasResultSet;
0244 }
0245
0246 public void setHasResultSet(boolean hasResultSet) {
0247 this.hasResultSet = hasResultSet;
0248 setHasResultSetIsSet(true);
0249 }
0250
0251 public void unsetHasResultSet() {
0252 __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID);
0253 }
0254
0255
0256 public boolean isSetHasResultSet() {
0257 return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID);
0258 }
0259
0260 public void setHasResultSetIsSet(boolean value) {
0261 __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value);
0262 }
0263
0264 public double getModifiedRowCount() {
0265 return this.modifiedRowCount;
0266 }
0267
0268 public void setModifiedRowCount(double modifiedRowCount) {
0269 this.modifiedRowCount = modifiedRowCount;
0270 setModifiedRowCountIsSet(true);
0271 }
0272
0273 public void unsetModifiedRowCount() {
0274 __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID);
0275 }
0276
0277
0278 public boolean isSetModifiedRowCount() {
0279 return EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID);
0280 }
0281
0282 public void setModifiedRowCountIsSet(boolean value) {
0283 __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value);
0284 }
0285
0286 public void setFieldValue(_Fields field, Object value) {
0287 switch (field) {
0288 case OPERATION_ID:
0289 if (value == null) {
0290 unsetOperationId();
0291 } else {
0292 setOperationId((THandleIdentifier)value);
0293 }
0294 break;
0295
0296 case OPERATION_TYPE:
0297 if (value == null) {
0298 unsetOperationType();
0299 } else {
0300 setOperationType((TOperationType)value);
0301 }
0302 break;
0303
0304 case HAS_RESULT_SET:
0305 if (value == null) {
0306 unsetHasResultSet();
0307 } else {
0308 setHasResultSet((Boolean)value);
0309 }
0310 break;
0311
0312 case MODIFIED_ROW_COUNT:
0313 if (value == null) {
0314 unsetModifiedRowCount();
0315 } else {
0316 setModifiedRowCount((Double)value);
0317 }
0318 break;
0319
0320 }
0321 }
0322
0323 public Object getFieldValue(_Fields field) {
0324 switch (field) {
0325 case OPERATION_ID:
0326 return getOperationId();
0327
0328 case OPERATION_TYPE:
0329 return getOperationType();
0330
0331 case HAS_RESULT_SET:
0332 return Boolean.valueOf(isHasResultSet());
0333
0334 case MODIFIED_ROW_COUNT:
0335 return Double.valueOf(getModifiedRowCount());
0336
0337 }
0338 throw new IllegalStateException();
0339 }
0340
0341
0342 public boolean isSet(_Fields field) {
0343 if (field == null) {
0344 throw new IllegalArgumentException();
0345 }
0346
0347 switch (field) {
0348 case OPERATION_ID:
0349 return isSetOperationId();
0350 case OPERATION_TYPE:
0351 return isSetOperationType();
0352 case HAS_RESULT_SET:
0353 return isSetHasResultSet();
0354 case MODIFIED_ROW_COUNT:
0355 return isSetModifiedRowCount();
0356 }
0357 throw new IllegalStateException();
0358 }
0359
0360 @Override
0361 public boolean equals(Object that) {
0362 if (that == null)
0363 return false;
0364 if (that instanceof TOperationHandle)
0365 return this.equals((TOperationHandle)that);
0366 return false;
0367 }
0368
0369 public boolean equals(TOperationHandle that) {
0370 if (that == null)
0371 return false;
0372
0373 boolean this_present_operationId = true && this.isSetOperationId();
0374 boolean that_present_operationId = true && that.isSetOperationId();
0375 if (this_present_operationId || that_present_operationId) {
0376 if (!(this_present_operationId && that_present_operationId))
0377 return false;
0378 if (!this.operationId.equals(that.operationId))
0379 return false;
0380 }
0381
0382 boolean this_present_operationType = true && this.isSetOperationType();
0383 boolean that_present_operationType = true && that.isSetOperationType();
0384 if (this_present_operationType || that_present_operationType) {
0385 if (!(this_present_operationType && that_present_operationType))
0386 return false;
0387 if (!this.operationType.equals(that.operationType))
0388 return false;
0389 }
0390
0391 boolean this_present_hasResultSet = true;
0392 boolean that_present_hasResultSet = true;
0393 if (this_present_hasResultSet || that_present_hasResultSet) {
0394 if (!(this_present_hasResultSet && that_present_hasResultSet))
0395 return false;
0396 if (this.hasResultSet != that.hasResultSet)
0397 return false;
0398 }
0399
0400 boolean this_present_modifiedRowCount = true && this.isSetModifiedRowCount();
0401 boolean that_present_modifiedRowCount = true && that.isSetModifiedRowCount();
0402 if (this_present_modifiedRowCount || that_present_modifiedRowCount) {
0403 if (!(this_present_modifiedRowCount && that_present_modifiedRowCount))
0404 return false;
0405 if (this.modifiedRowCount != that.modifiedRowCount)
0406 return false;
0407 }
0408
0409 return true;
0410 }
0411
0412 @Override
0413 public int hashCode() {
0414 HashCodeBuilder builder = new HashCodeBuilder();
0415
0416 boolean present_operationId = true && (isSetOperationId());
0417 builder.append(present_operationId);
0418 if (present_operationId)
0419 builder.append(operationId);
0420
0421 boolean present_operationType = true && (isSetOperationType());
0422 builder.append(present_operationType);
0423 if (present_operationType)
0424 builder.append(operationType.getValue());
0425
0426 boolean present_hasResultSet = true;
0427 builder.append(present_hasResultSet);
0428 if (present_hasResultSet)
0429 builder.append(hasResultSet);
0430
0431 boolean present_modifiedRowCount = true && (isSetModifiedRowCount());
0432 builder.append(present_modifiedRowCount);
0433 if (present_modifiedRowCount)
0434 builder.append(modifiedRowCount);
0435
0436 return builder.toHashCode();
0437 }
0438
0439 public int compareTo(TOperationHandle other) {
0440 if (!getClass().equals(other.getClass())) {
0441 return getClass().getName().compareTo(other.getClass().getName());
0442 }
0443
0444 int lastComparison = 0;
0445 TOperationHandle typedOther = (TOperationHandle)other;
0446
0447 lastComparison = Boolean.valueOf(isSetOperationId()).compareTo(typedOther.isSetOperationId());
0448 if (lastComparison != 0) {
0449 return lastComparison;
0450 }
0451 if (isSetOperationId()) {
0452 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationId, typedOther.operationId);
0453 if (lastComparison != 0) {
0454 return lastComparison;
0455 }
0456 }
0457 lastComparison = Boolean.valueOf(isSetOperationType()).compareTo(typedOther.isSetOperationType());
0458 if (lastComparison != 0) {
0459 return lastComparison;
0460 }
0461 if (isSetOperationType()) {
0462 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationType, typedOther.operationType);
0463 if (lastComparison != 0) {
0464 return lastComparison;
0465 }
0466 }
0467 lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(typedOther.isSetHasResultSet());
0468 if (lastComparison != 0) {
0469 return lastComparison;
0470 }
0471 if (isSetHasResultSet()) {
0472 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, typedOther.hasResultSet);
0473 if (lastComparison != 0) {
0474 return lastComparison;
0475 }
0476 }
0477 lastComparison = Boolean.valueOf(isSetModifiedRowCount()).compareTo(typedOther.isSetModifiedRowCount());
0478 if (lastComparison != 0) {
0479 return lastComparison;
0480 }
0481 if (isSetModifiedRowCount()) {
0482 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modifiedRowCount, typedOther.modifiedRowCount);
0483 if (lastComparison != 0) {
0484 return lastComparison;
0485 }
0486 }
0487 return 0;
0488 }
0489
0490 public _Fields fieldForId(int fieldId) {
0491 return _Fields.findByThriftId(fieldId);
0492 }
0493
0494 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0495 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0496 }
0497
0498 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0499 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0500 }
0501
0502 @Override
0503 public String toString() {
0504 StringBuilder sb = new StringBuilder("TOperationHandle(");
0505 boolean first = true;
0506
0507 sb.append("operationId:");
0508 if (this.operationId == null) {
0509 sb.append("null");
0510 } else {
0511 sb.append(this.operationId);
0512 }
0513 first = false;
0514 if (!first) sb.append(", ");
0515 sb.append("operationType:");
0516 if (this.operationType == null) {
0517 sb.append("null");
0518 } else {
0519 sb.append(this.operationType);
0520 }
0521 first = false;
0522 if (!first) sb.append(", ");
0523 sb.append("hasResultSet:");
0524 sb.append(this.hasResultSet);
0525 first = false;
0526 if (isSetModifiedRowCount()) {
0527 if (!first) sb.append(", ");
0528 sb.append("modifiedRowCount:");
0529 sb.append(this.modifiedRowCount);
0530 first = false;
0531 }
0532 sb.append(")");
0533 return sb.toString();
0534 }
0535
0536 public void validate() throws org.apache.thrift.TException {
0537
0538 if (!isSetOperationId()) {
0539 throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationId' is unset! Struct:" + toString());
0540 }
0541
0542 if (!isSetOperationType()) {
0543 throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationType' is unset! Struct:" + toString());
0544 }
0545
0546 if (!isSetHasResultSet()) {
0547 throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' is unset! Struct:" + toString());
0548 }
0549
0550
0551 if (operationId != null) {
0552 operationId.validate();
0553 }
0554 }
0555
0556 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0557 try {
0558 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0559 } catch (org.apache.thrift.TException te) {
0560 throw new java.io.IOException(te);
0561 }
0562 }
0563
0564 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0565 try {
0566
0567 __isset_bitfield = 0;
0568 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0569 } catch (org.apache.thrift.TException te) {
0570 throw new java.io.IOException(te);
0571 }
0572 }
0573
0574 private static class TOperationHandleStandardSchemeFactory implements SchemeFactory {
0575 public TOperationHandleStandardScheme getScheme() {
0576 return new TOperationHandleStandardScheme();
0577 }
0578 }
0579
0580 private static class TOperationHandleStandardScheme extends StandardScheme<TOperationHandle> {
0581
0582 public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle struct) throws org.apache.thrift.TException {
0583 org.apache.thrift.protocol.TField schemeField;
0584 iprot.readStructBegin();
0585 while (true)
0586 {
0587 schemeField = iprot.readFieldBegin();
0588 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
0589 break;
0590 }
0591 switch (schemeField.id) {
0592 case 1:
0593 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0594 struct.operationId = new THandleIdentifier();
0595 struct.operationId.read(iprot);
0596 struct.setOperationIdIsSet(true);
0597 } else {
0598 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0599 }
0600 break;
0601 case 2:
0602 if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
0603 struct.operationType = TOperationType.findByValue(iprot.readI32());
0604 struct.setOperationTypeIsSet(true);
0605 } else {
0606 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0607 }
0608 break;
0609 case 3:
0610 if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
0611 struct.hasResultSet = iprot.readBool();
0612 struct.setHasResultSetIsSet(true);
0613 } else {
0614 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0615 }
0616 break;
0617 case 4:
0618 if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
0619 struct.modifiedRowCount = iprot.readDouble();
0620 struct.setModifiedRowCountIsSet(true);
0621 } else {
0622 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0623 }
0624 break;
0625 default:
0626 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0627 }
0628 iprot.readFieldEnd();
0629 }
0630 iprot.readStructEnd();
0631 struct.validate();
0632 }
0633
0634 public void write(org.apache.thrift.protocol.TProtocol oprot, TOperationHandle struct) throws org.apache.thrift.TException {
0635 struct.validate();
0636
0637 oprot.writeStructBegin(STRUCT_DESC);
0638 if (struct.operationId != null) {
0639 oprot.writeFieldBegin(OPERATION_ID_FIELD_DESC);
0640 struct.operationId.write(oprot);
0641 oprot.writeFieldEnd();
0642 }
0643 if (struct.operationType != null) {
0644 oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC);
0645 oprot.writeI32(struct.operationType.getValue());
0646 oprot.writeFieldEnd();
0647 }
0648 oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC);
0649 oprot.writeBool(struct.hasResultSet);
0650 oprot.writeFieldEnd();
0651 if (struct.isSetModifiedRowCount()) {
0652 oprot.writeFieldBegin(MODIFIED_ROW_COUNT_FIELD_DESC);
0653 oprot.writeDouble(struct.modifiedRowCount);
0654 oprot.writeFieldEnd();
0655 }
0656 oprot.writeFieldStop();
0657 oprot.writeStructEnd();
0658 }
0659
0660 }
0661
0662 private static class TOperationHandleTupleSchemeFactory implements SchemeFactory {
0663 public TOperationHandleTupleScheme getScheme() {
0664 return new TOperationHandleTupleScheme();
0665 }
0666 }
0667
0668 private static class TOperationHandleTupleScheme extends TupleScheme<TOperationHandle> {
0669
0670 @Override
0671 public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException {
0672 TTupleProtocol oprot = (TTupleProtocol) prot;
0673 struct.operationId.write(oprot);
0674 oprot.writeI32(struct.operationType.getValue());
0675 oprot.writeBool(struct.hasResultSet);
0676 BitSet optionals = new BitSet();
0677 if (struct.isSetModifiedRowCount()) {
0678 optionals.set(0);
0679 }
0680 oprot.writeBitSet(optionals, 1);
0681 if (struct.isSetModifiedRowCount()) {
0682 oprot.writeDouble(struct.modifiedRowCount);
0683 }
0684 }
0685
0686 @Override
0687 public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException {
0688 TTupleProtocol iprot = (TTupleProtocol) prot;
0689 struct.operationId = new THandleIdentifier();
0690 struct.operationId.read(iprot);
0691 struct.setOperationIdIsSet(true);
0692 struct.operationType = TOperationType.findByValue(iprot.readI32());
0693 struct.setOperationTypeIsSet(true);
0694 struct.hasResultSet = iprot.readBool();
0695 struct.setHasResultSetIsSet(true);
0696 BitSet incoming = iprot.readBitSet(1);
0697 if (incoming.get(0)) {
0698 struct.modifiedRowCount = iprot.readDouble();
0699 struct.setModifiedRowCountIsSet(true);
0700 }
0701 }
0702 }
0703
0704 }
0705