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 TGetDelegationTokenReq implements org.apache.thrift.TBase<TGetDelegationTokenReq, TGetDelegationTokenReq._Fields>, java.io.Serializable, Cloneable, Comparable<TGetDelegationTokenReq> {
0039 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenReq");
0040
0041 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);
0042 private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)2);
0043 private static final org.apache.thrift.protocol.TField RENEWER_FIELD_DESC = new org.apache.thrift.protocol.TField("renewer", org.apache.thrift.protocol.TType.STRING, (short)3);
0044
0045 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0046 static {
0047 schemes.put(StandardScheme.class, new TGetDelegationTokenReqStandardSchemeFactory());
0048 schemes.put(TupleScheme.class, new TGetDelegationTokenReqTupleSchemeFactory());
0049 }
0050
0051 private TSessionHandle sessionHandle;
0052 private String owner;
0053 private String renewer;
0054
0055
0056 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0057 SESSION_HANDLE((short)1, "sessionHandle"),
0058 OWNER((short)2, "owner"),
0059 RENEWER((short)3, "renewer");
0060
0061 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0062
0063 static {
0064 for (_Fields field : EnumSet.allOf(_Fields.class)) {
0065 byName.put(field.getFieldName(), field);
0066 }
0067 }
0068
0069
0070
0071
0072 public static _Fields findByThriftId(int fieldId) {
0073 switch(fieldId) {
0074 case 1:
0075 return SESSION_HANDLE;
0076 case 2:
0077 return OWNER;
0078 case 3:
0079 return RENEWER;
0080 default:
0081 return null;
0082 }
0083 }
0084
0085
0086
0087
0088
0089 public static _Fields findByThriftIdOrThrow(int fieldId) {
0090 _Fields fields = findByThriftId(fieldId);
0091 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0092 return fields;
0093 }
0094
0095
0096
0097
0098 public static _Fields findByName(String name) {
0099 return byName.get(name);
0100 }
0101
0102 private final short _thriftId;
0103 private final String _fieldName;
0104
0105 _Fields(short thriftId, String fieldName) {
0106 _thriftId = thriftId;
0107 _fieldName = fieldName;
0108 }
0109
0110 public short getThriftFieldId() {
0111 return _thriftId;
0112 }
0113
0114 public String getFieldName() {
0115 return _fieldName;
0116 }
0117 }
0118
0119
0120 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0121 static {
0122 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0123 tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED,
0124 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class)));
0125 tmpMap.put(_Fields.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED,
0126 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
0127 tmpMap.put(_Fields.RENEWER, new org.apache.thrift.meta_data.FieldMetaData("renewer", org.apache.thrift.TFieldRequirementType.REQUIRED,
0128 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
0129 metaDataMap = Collections.unmodifiableMap(tmpMap);
0130 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenReq.class, metaDataMap);
0131 }
0132
0133 public TGetDelegationTokenReq() {
0134 }
0135
0136 public TGetDelegationTokenReq(
0137 TSessionHandle sessionHandle,
0138 String owner,
0139 String renewer)
0140 {
0141 this();
0142 this.sessionHandle = sessionHandle;
0143 this.owner = owner;
0144 this.renewer = renewer;
0145 }
0146
0147
0148
0149
0150 public TGetDelegationTokenReq(TGetDelegationTokenReq other) {
0151 if (other.isSetSessionHandle()) {
0152 this.sessionHandle = new TSessionHandle(other.sessionHandle);
0153 }
0154 if (other.isSetOwner()) {
0155 this.owner = other.owner;
0156 }
0157 if (other.isSetRenewer()) {
0158 this.renewer = other.renewer;
0159 }
0160 }
0161
0162 public TGetDelegationTokenReq deepCopy() {
0163 return new TGetDelegationTokenReq(this);
0164 }
0165
0166 @Override
0167 public void clear() {
0168 this.sessionHandle = null;
0169 this.owner = null;
0170 this.renewer = null;
0171 }
0172
0173 public TSessionHandle getSessionHandle() {
0174 return this.sessionHandle;
0175 }
0176
0177 public void setSessionHandle(TSessionHandle sessionHandle) {
0178 this.sessionHandle = sessionHandle;
0179 }
0180
0181 public void unsetSessionHandle() {
0182 this.sessionHandle = null;
0183 }
0184
0185
0186 public boolean isSetSessionHandle() {
0187 return this.sessionHandle != null;
0188 }
0189
0190 public void setSessionHandleIsSet(boolean value) {
0191 if (!value) {
0192 this.sessionHandle = null;
0193 }
0194 }
0195
0196 public String getOwner() {
0197 return this.owner;
0198 }
0199
0200 public void setOwner(String owner) {
0201 this.owner = owner;
0202 }
0203
0204 public void unsetOwner() {
0205 this.owner = null;
0206 }
0207
0208
0209 public boolean isSetOwner() {
0210 return this.owner != null;
0211 }
0212
0213 public void setOwnerIsSet(boolean value) {
0214 if (!value) {
0215 this.owner = null;
0216 }
0217 }
0218
0219 public String getRenewer() {
0220 return this.renewer;
0221 }
0222
0223 public void setRenewer(String renewer) {
0224 this.renewer = renewer;
0225 }
0226
0227 public void unsetRenewer() {
0228 this.renewer = null;
0229 }
0230
0231
0232 public boolean isSetRenewer() {
0233 return this.renewer != null;
0234 }
0235
0236 public void setRenewerIsSet(boolean value) {
0237 if (!value) {
0238 this.renewer = null;
0239 }
0240 }
0241
0242 public void setFieldValue(_Fields field, Object value) {
0243 switch (field) {
0244 case SESSION_HANDLE:
0245 if (value == null) {
0246 unsetSessionHandle();
0247 } else {
0248 setSessionHandle((TSessionHandle)value);
0249 }
0250 break;
0251
0252 case OWNER:
0253 if (value == null) {
0254 unsetOwner();
0255 } else {
0256 setOwner((String)value);
0257 }
0258 break;
0259
0260 case RENEWER:
0261 if (value == null) {
0262 unsetRenewer();
0263 } else {
0264 setRenewer((String)value);
0265 }
0266 break;
0267
0268 }
0269 }
0270
0271 public Object getFieldValue(_Fields field) {
0272 switch (field) {
0273 case SESSION_HANDLE:
0274 return getSessionHandle();
0275
0276 case OWNER:
0277 return getOwner();
0278
0279 case RENEWER:
0280 return getRenewer();
0281
0282 }
0283 throw new IllegalStateException();
0284 }
0285
0286
0287 public boolean isSet(_Fields field) {
0288 if (field == null) {
0289 throw new IllegalArgumentException();
0290 }
0291
0292 switch (field) {
0293 case SESSION_HANDLE:
0294 return isSetSessionHandle();
0295 case OWNER:
0296 return isSetOwner();
0297 case RENEWER:
0298 return isSetRenewer();
0299 }
0300 throw new IllegalStateException();
0301 }
0302
0303 @Override
0304 public boolean equals(Object that) {
0305 if (that == null)
0306 return false;
0307 if (that instanceof TGetDelegationTokenReq)
0308 return this.equals((TGetDelegationTokenReq)that);
0309 return false;
0310 }
0311
0312 public boolean equals(TGetDelegationTokenReq that) {
0313 if (that == null)
0314 return false;
0315
0316 boolean this_present_sessionHandle = true && this.isSetSessionHandle();
0317 boolean that_present_sessionHandle = true && that.isSetSessionHandle();
0318 if (this_present_sessionHandle || that_present_sessionHandle) {
0319 if (!(this_present_sessionHandle && that_present_sessionHandle))
0320 return false;
0321 if (!this.sessionHandle.equals(that.sessionHandle))
0322 return false;
0323 }
0324
0325 boolean this_present_owner = true && this.isSetOwner();
0326 boolean that_present_owner = true && that.isSetOwner();
0327 if (this_present_owner || that_present_owner) {
0328 if (!(this_present_owner && that_present_owner))
0329 return false;
0330 if (!this.owner.equals(that.owner))
0331 return false;
0332 }
0333
0334 boolean this_present_renewer = true && this.isSetRenewer();
0335 boolean that_present_renewer = true && that.isSetRenewer();
0336 if (this_present_renewer || that_present_renewer) {
0337 if (!(this_present_renewer && that_present_renewer))
0338 return false;
0339 if (!this.renewer.equals(that.renewer))
0340 return false;
0341 }
0342
0343 return true;
0344 }
0345
0346 @Override
0347 public int hashCode() {
0348 List<Object> list = new ArrayList<Object>();
0349
0350 boolean present_sessionHandle = true && (isSetSessionHandle());
0351 list.add(present_sessionHandle);
0352 if (present_sessionHandle)
0353 list.add(sessionHandle);
0354
0355 boolean present_owner = true && (isSetOwner());
0356 list.add(present_owner);
0357 if (present_owner)
0358 list.add(owner);
0359
0360 boolean present_renewer = true && (isSetRenewer());
0361 list.add(present_renewer);
0362 if (present_renewer)
0363 list.add(renewer);
0364
0365 return list.hashCode();
0366 }
0367
0368 @Override
0369 public int compareTo(TGetDelegationTokenReq other) {
0370 if (!getClass().equals(other.getClass())) {
0371 return getClass().getName().compareTo(other.getClass().getName());
0372 }
0373
0374 int lastComparison = 0;
0375
0376 lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle());
0377 if (lastComparison != 0) {
0378 return lastComparison;
0379 }
0380 if (isSetSessionHandle()) {
0381 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle);
0382 if (lastComparison != 0) {
0383 return lastComparison;
0384 }
0385 }
0386 lastComparison = Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner());
0387 if (lastComparison != 0) {
0388 return lastComparison;
0389 }
0390 if (isSetOwner()) {
0391 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner);
0392 if (lastComparison != 0) {
0393 return lastComparison;
0394 }
0395 }
0396 lastComparison = Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer());
0397 if (lastComparison != 0) {
0398 return lastComparison;
0399 }
0400 if (isSetRenewer()) {
0401 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.renewer, other.renewer);
0402 if (lastComparison != 0) {
0403 return lastComparison;
0404 }
0405 }
0406 return 0;
0407 }
0408
0409 public _Fields fieldForId(int fieldId) {
0410 return _Fields.findByThriftId(fieldId);
0411 }
0412
0413 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0414 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0415 }
0416
0417 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0418 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0419 }
0420
0421 @Override
0422 public String toString() {
0423 StringBuilder sb = new StringBuilder("TGetDelegationTokenReq(");
0424 boolean first = true;
0425
0426 sb.append("sessionHandle:");
0427 if (this.sessionHandle == null) {
0428 sb.append("null");
0429 } else {
0430 sb.append(this.sessionHandle);
0431 }
0432 first = false;
0433 if (!first) sb.append(", ");
0434 sb.append("owner:");
0435 if (this.owner == null) {
0436 sb.append("null");
0437 } else {
0438 sb.append(this.owner);
0439 }
0440 first = false;
0441 if (!first) sb.append(", ");
0442 sb.append("renewer:");
0443 if (this.renewer == null) {
0444 sb.append("null");
0445 } else {
0446 sb.append(this.renewer);
0447 }
0448 first = false;
0449 sb.append(")");
0450 return sb.toString();
0451 }
0452
0453 public void validate() throws org.apache.thrift.TException {
0454
0455 if (!isSetSessionHandle()) {
0456 throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString());
0457 }
0458
0459 if (!isSetOwner()) {
0460 throw new org.apache.thrift.protocol.TProtocolException("Required field 'owner' is unset! Struct:" + toString());
0461 }
0462
0463 if (!isSetRenewer()) {
0464 throw new org.apache.thrift.protocol.TProtocolException("Required field 'renewer' is unset! Struct:" + toString());
0465 }
0466
0467
0468 if (sessionHandle != null) {
0469 sessionHandle.validate();
0470 }
0471 }
0472
0473 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0474 try {
0475 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0476 } catch (org.apache.thrift.TException te) {
0477 throw new java.io.IOException(te);
0478 }
0479 }
0480
0481 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0482 try {
0483 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0484 } catch (org.apache.thrift.TException te) {
0485 throw new java.io.IOException(te);
0486 }
0487 }
0488
0489 private static class TGetDelegationTokenReqStandardSchemeFactory implements SchemeFactory {
0490 public TGetDelegationTokenReqStandardScheme getScheme() {
0491 return new TGetDelegationTokenReqStandardScheme();
0492 }
0493 }
0494
0495 private static class TGetDelegationTokenReqStandardScheme extends StandardScheme<TGetDelegationTokenReq> {
0496
0497 public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException {
0498 org.apache.thrift.protocol.TField schemeField;
0499 iprot.readStructBegin();
0500 while (true)
0501 {
0502 schemeField = iprot.readFieldBegin();
0503 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
0504 break;
0505 }
0506 switch (schemeField.id) {
0507 case 1:
0508 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0509 struct.sessionHandle = new TSessionHandle();
0510 struct.sessionHandle.read(iprot);
0511 struct.setSessionHandleIsSet(true);
0512 } else {
0513 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0514 }
0515 break;
0516 case 2:
0517 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0518 struct.owner = iprot.readString();
0519 struct.setOwnerIsSet(true);
0520 } else {
0521 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0522 }
0523 break;
0524 case 3:
0525 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0526 struct.renewer = iprot.readString();
0527 struct.setRenewerIsSet(true);
0528 } else {
0529 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0530 }
0531 break;
0532 default:
0533 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0534 }
0535 iprot.readFieldEnd();
0536 }
0537 iprot.readStructEnd();
0538 struct.validate();
0539 }
0540
0541 public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException {
0542 struct.validate();
0543
0544 oprot.writeStructBegin(STRUCT_DESC);
0545 if (struct.sessionHandle != null) {
0546 oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC);
0547 struct.sessionHandle.write(oprot);
0548 oprot.writeFieldEnd();
0549 }
0550 if (struct.owner != null) {
0551 oprot.writeFieldBegin(OWNER_FIELD_DESC);
0552 oprot.writeString(struct.owner);
0553 oprot.writeFieldEnd();
0554 }
0555 if (struct.renewer != null) {
0556 oprot.writeFieldBegin(RENEWER_FIELD_DESC);
0557 oprot.writeString(struct.renewer);
0558 oprot.writeFieldEnd();
0559 }
0560 oprot.writeFieldStop();
0561 oprot.writeStructEnd();
0562 }
0563
0564 }
0565
0566 private static class TGetDelegationTokenReqTupleSchemeFactory implements SchemeFactory {
0567 public TGetDelegationTokenReqTupleScheme getScheme() {
0568 return new TGetDelegationTokenReqTupleScheme();
0569 }
0570 }
0571
0572 private static class TGetDelegationTokenReqTupleScheme extends TupleScheme<TGetDelegationTokenReq> {
0573
0574 @Override
0575 public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException {
0576 TTupleProtocol oprot = (TTupleProtocol) prot;
0577 struct.sessionHandle.write(oprot);
0578 oprot.writeString(struct.owner);
0579 oprot.writeString(struct.renewer);
0580 }
0581
0582 @Override
0583 public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException {
0584 TTupleProtocol iprot = (TTupleProtocol) prot;
0585 struct.sessionHandle = new TSessionHandle();
0586 struct.sessionHandle.read(iprot);
0587 struct.setSessionHandleIsSet(true);
0588 struct.owner = iprot.readString();
0589 struct.setOwnerIsSet(true);
0590 struct.renewer = iprot.readString();
0591 struct.setRenewerIsSet(true);
0592 }
0593 }
0594
0595 }
0596