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 TGetInfoResp implements org.apache.thrift.TBase<TGetInfoResp, TGetInfoResp._Fields>, java.io.Serializable, Cloneable, Comparable<TGetInfoResp> {
0039 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoResp");
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 INFO_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoValue", org.apache.thrift.protocol.TType.STRUCT, (short)2);
0043
0044 private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0045 static {
0046 schemes.put(StandardScheme.class, new TGetInfoRespStandardSchemeFactory());
0047 schemes.put(TupleScheme.class, new TGetInfoRespTupleSchemeFactory());
0048 }
0049
0050 private TStatus status;
0051 private TGetInfoValue infoValue;
0052
0053
0054 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0055 STATUS((short)1, "status"),
0056 INFO_VALUE((short)2, "infoValue");
0057
0058 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0059
0060 static {
0061 for (_Fields field : EnumSet.allOf(_Fields.class)) {
0062 byName.put(field.getFieldName(), field);
0063 }
0064 }
0065
0066
0067
0068
0069 public static _Fields findByThriftId(int fieldId) {
0070 switch(fieldId) {
0071 case 1:
0072 return STATUS;
0073 case 2:
0074 return INFO_VALUE;
0075 default:
0076 return null;
0077 }
0078 }
0079
0080
0081
0082
0083
0084 public static _Fields findByThriftIdOrThrow(int fieldId) {
0085 _Fields fields = findByThriftId(fieldId);
0086 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0087 return fields;
0088 }
0089
0090
0091
0092
0093 public static _Fields findByName(String name) {
0094 return byName.get(name);
0095 }
0096
0097 private final short _thriftId;
0098 private final String _fieldName;
0099
0100 _Fields(short thriftId, String fieldName) {
0101 _thriftId = thriftId;
0102 _fieldName = fieldName;
0103 }
0104
0105 public short getThriftFieldId() {
0106 return _thriftId;
0107 }
0108
0109 public String getFieldName() {
0110 return _fieldName;
0111 }
0112 }
0113
0114
0115 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0116 static {
0117 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0118 tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
0119 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class)));
0120 tmpMap.put(_Fields.INFO_VALUE, new org.apache.thrift.meta_data.FieldMetaData("infoValue", org.apache.thrift.TFieldRequirementType.REQUIRED,
0121 new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoValue.class)));
0122 metaDataMap = Collections.unmodifiableMap(tmpMap);
0123 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoResp.class, metaDataMap);
0124 }
0125
0126 public TGetInfoResp() {
0127 }
0128
0129 public TGetInfoResp(
0130 TStatus status,
0131 TGetInfoValue infoValue)
0132 {
0133 this();
0134 this.status = status;
0135 this.infoValue = infoValue;
0136 }
0137
0138
0139
0140
0141 public TGetInfoResp(TGetInfoResp other) {
0142 if (other.isSetStatus()) {
0143 this.status = new TStatus(other.status);
0144 }
0145 if (other.isSetInfoValue()) {
0146 this.infoValue = new TGetInfoValue(other.infoValue);
0147 }
0148 }
0149
0150 public TGetInfoResp deepCopy() {
0151 return new TGetInfoResp(this);
0152 }
0153
0154 @Override
0155 public void clear() {
0156 this.status = null;
0157 this.infoValue = null;
0158 }
0159
0160 public TStatus getStatus() {
0161 return this.status;
0162 }
0163
0164 public void setStatus(TStatus status) {
0165 this.status = status;
0166 }
0167
0168 public void unsetStatus() {
0169 this.status = null;
0170 }
0171
0172
0173 public boolean isSetStatus() {
0174 return this.status != null;
0175 }
0176
0177 public void setStatusIsSet(boolean value) {
0178 if (!value) {
0179 this.status = null;
0180 }
0181 }
0182
0183 public TGetInfoValue getInfoValue() {
0184 return this.infoValue;
0185 }
0186
0187 public void setInfoValue(TGetInfoValue infoValue) {
0188 this.infoValue = infoValue;
0189 }
0190
0191 public void unsetInfoValue() {
0192 this.infoValue = null;
0193 }
0194
0195
0196 public boolean isSetInfoValue() {
0197 return this.infoValue != null;
0198 }
0199
0200 public void setInfoValueIsSet(boolean value) {
0201 if (!value) {
0202 this.infoValue = null;
0203 }
0204 }
0205
0206 public void setFieldValue(_Fields field, Object value) {
0207 switch (field) {
0208 case STATUS:
0209 if (value == null) {
0210 unsetStatus();
0211 } else {
0212 setStatus((TStatus)value);
0213 }
0214 break;
0215
0216 case INFO_VALUE:
0217 if (value == null) {
0218 unsetInfoValue();
0219 } else {
0220 setInfoValue((TGetInfoValue)value);
0221 }
0222 break;
0223
0224 }
0225 }
0226
0227 public Object getFieldValue(_Fields field) {
0228 switch (field) {
0229 case STATUS:
0230 return getStatus();
0231
0232 case INFO_VALUE:
0233 return getInfoValue();
0234
0235 }
0236 throw new IllegalStateException();
0237 }
0238
0239
0240 public boolean isSet(_Fields field) {
0241 if (field == null) {
0242 throw new IllegalArgumentException();
0243 }
0244
0245 switch (field) {
0246 case STATUS:
0247 return isSetStatus();
0248 case INFO_VALUE:
0249 return isSetInfoValue();
0250 }
0251 throw new IllegalStateException();
0252 }
0253
0254 @Override
0255 public boolean equals(Object that) {
0256 if (that == null)
0257 return false;
0258 if (that instanceof TGetInfoResp)
0259 return this.equals((TGetInfoResp)that);
0260 return false;
0261 }
0262
0263 public boolean equals(TGetInfoResp that) {
0264 if (that == null)
0265 return false;
0266
0267 boolean this_present_status = true && this.isSetStatus();
0268 boolean that_present_status = true && that.isSetStatus();
0269 if (this_present_status || that_present_status) {
0270 if (!(this_present_status && that_present_status))
0271 return false;
0272 if (!this.status.equals(that.status))
0273 return false;
0274 }
0275
0276 boolean this_present_infoValue = true && this.isSetInfoValue();
0277 boolean that_present_infoValue = true && that.isSetInfoValue();
0278 if (this_present_infoValue || that_present_infoValue) {
0279 if (!(this_present_infoValue && that_present_infoValue))
0280 return false;
0281 if (!this.infoValue.equals(that.infoValue))
0282 return false;
0283 }
0284
0285 return true;
0286 }
0287
0288 @Override
0289 public int hashCode() {
0290 List<Object> list = new ArrayList<Object>();
0291
0292 boolean present_status = true && (isSetStatus());
0293 list.add(present_status);
0294 if (present_status)
0295 list.add(status);
0296
0297 boolean present_infoValue = true && (isSetInfoValue());
0298 list.add(present_infoValue);
0299 if (present_infoValue)
0300 list.add(infoValue);
0301
0302 return list.hashCode();
0303 }
0304
0305 @Override
0306 public int compareTo(TGetInfoResp other) {
0307 if (!getClass().equals(other.getClass())) {
0308 return getClass().getName().compareTo(other.getClass().getName());
0309 }
0310
0311 int lastComparison = 0;
0312
0313 lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
0314 if (lastComparison != 0) {
0315 return lastComparison;
0316 }
0317 if (isSetStatus()) {
0318 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
0319 if (lastComparison != 0) {
0320 return lastComparison;
0321 }
0322 }
0323 lastComparison = Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue());
0324 if (lastComparison != 0) {
0325 return lastComparison;
0326 }
0327 if (isSetInfoValue()) {
0328 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoValue, other.infoValue);
0329 if (lastComparison != 0) {
0330 return lastComparison;
0331 }
0332 }
0333 return 0;
0334 }
0335
0336 public _Fields fieldForId(int fieldId) {
0337 return _Fields.findByThriftId(fieldId);
0338 }
0339
0340 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0341 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0342 }
0343
0344 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0345 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0346 }
0347
0348 @Override
0349 public String toString() {
0350 StringBuilder sb = new StringBuilder("TGetInfoResp(");
0351 boolean first = true;
0352
0353 sb.append("status:");
0354 if (this.status == null) {
0355 sb.append("null");
0356 } else {
0357 sb.append(this.status);
0358 }
0359 first = false;
0360 if (!first) sb.append(", ");
0361 sb.append("infoValue:");
0362 if (this.infoValue == null) {
0363 sb.append("null");
0364 } else {
0365 sb.append(this.infoValue);
0366 }
0367 first = false;
0368 sb.append(")");
0369 return sb.toString();
0370 }
0371
0372 public void validate() throws org.apache.thrift.TException {
0373
0374 if (!isSetStatus()) {
0375 throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
0376 }
0377
0378 if (!isSetInfoValue()) {
0379 throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoValue' is unset! Struct:" + toString());
0380 }
0381
0382
0383 if (status != null) {
0384 status.validate();
0385 }
0386 }
0387
0388 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0389 try {
0390 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0391 } catch (org.apache.thrift.TException te) {
0392 throw new java.io.IOException(te);
0393 }
0394 }
0395
0396 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0397 try {
0398 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0399 } catch (org.apache.thrift.TException te) {
0400 throw new java.io.IOException(te);
0401 }
0402 }
0403
0404 private static class TGetInfoRespStandardSchemeFactory implements SchemeFactory {
0405 public TGetInfoRespStandardScheme getScheme() {
0406 return new TGetInfoRespStandardScheme();
0407 }
0408 }
0409
0410 private static class TGetInfoRespStandardScheme extends StandardScheme<TGetInfoResp> {
0411
0412 public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoResp struct) throws org.apache.thrift.TException {
0413 org.apache.thrift.protocol.TField schemeField;
0414 iprot.readStructBegin();
0415 while (true)
0416 {
0417 schemeField = iprot.readFieldBegin();
0418 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
0419 break;
0420 }
0421 switch (schemeField.id) {
0422 case 1:
0423 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0424 struct.status = new TStatus();
0425 struct.status.read(iprot);
0426 struct.setStatusIsSet(true);
0427 } else {
0428 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0429 }
0430 break;
0431 case 2:
0432 if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0433 struct.infoValue = new TGetInfoValue();
0434 struct.infoValue.read(iprot);
0435 struct.setInfoValueIsSet(true);
0436 } else {
0437 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0438 }
0439 break;
0440 default:
0441 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0442 }
0443 iprot.readFieldEnd();
0444 }
0445 iprot.readStructEnd();
0446 struct.validate();
0447 }
0448
0449 public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoResp struct) throws org.apache.thrift.TException {
0450 struct.validate();
0451
0452 oprot.writeStructBegin(STRUCT_DESC);
0453 if (struct.status != null) {
0454 oprot.writeFieldBegin(STATUS_FIELD_DESC);
0455 struct.status.write(oprot);
0456 oprot.writeFieldEnd();
0457 }
0458 if (struct.infoValue != null) {
0459 oprot.writeFieldBegin(INFO_VALUE_FIELD_DESC);
0460 struct.infoValue.write(oprot);
0461 oprot.writeFieldEnd();
0462 }
0463 oprot.writeFieldStop();
0464 oprot.writeStructEnd();
0465 }
0466
0467 }
0468
0469 private static class TGetInfoRespTupleSchemeFactory implements SchemeFactory {
0470 public TGetInfoRespTupleScheme getScheme() {
0471 return new TGetInfoRespTupleScheme();
0472 }
0473 }
0474
0475 private static class TGetInfoRespTupleScheme extends TupleScheme<TGetInfoResp> {
0476
0477 @Override
0478 public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException {
0479 TTupleProtocol oprot = (TTupleProtocol) prot;
0480 struct.status.write(oprot);
0481 struct.infoValue.write(oprot);
0482 }
0483
0484 @Override
0485 public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException {
0486 TTupleProtocol iprot = (TTupleProtocol) prot;
0487 struct.status = new TStatus();
0488 struct.status.read(iprot);
0489 struct.setStatusIsSet(true);
0490 struct.infoValue = new TGetInfoValue();
0491 struct.infoValue.read(iprot);
0492 struct.setInfoValueIsSet(true);
0493 }
0494 }
0495
0496 }
0497