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 TUserDefinedTypeEntry implements org.apache.thrift.TBase<TUserDefinedTypeEntry, TUserDefinedTypeEntry._Fields>, java.io.Serializable, Cloneable, Comparable<TUserDefinedTypeEntry> {
0039 private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUserDefinedTypeEntry");
0040
0041 private static final org.apache.thrift.protocol.TField TYPE_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeClassName", org.apache.thrift.protocol.TType.STRING, (short)1);
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 TUserDefinedTypeEntryStandardSchemeFactory());
0046 schemes.put(TupleScheme.class, new TUserDefinedTypeEntryTupleSchemeFactory());
0047 }
0048
0049 private String typeClassName;
0050
0051
0052 public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0053 TYPE_CLASS_NAME((short)1, "typeClassName");
0054
0055 private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0056
0057 static {
0058 for (_Fields field : EnumSet.allOf(_Fields.class)) {
0059 byName.put(field.getFieldName(), field);
0060 }
0061 }
0062
0063
0064
0065
0066 public static _Fields findByThriftId(int fieldId) {
0067 switch(fieldId) {
0068 case 1:
0069 return TYPE_CLASS_NAME;
0070 default:
0071 return null;
0072 }
0073 }
0074
0075
0076
0077
0078
0079 public static _Fields findByThriftIdOrThrow(int fieldId) {
0080 _Fields fields = findByThriftId(fieldId);
0081 if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0082 return fields;
0083 }
0084
0085
0086
0087
0088 public static _Fields findByName(String name) {
0089 return byName.get(name);
0090 }
0091
0092 private final short _thriftId;
0093 private final String _fieldName;
0094
0095 _Fields(short thriftId, String fieldName) {
0096 _thriftId = thriftId;
0097 _fieldName = fieldName;
0098 }
0099
0100 public short getThriftFieldId() {
0101 return _thriftId;
0102 }
0103
0104 public String getFieldName() {
0105 return _fieldName;
0106 }
0107 }
0108
0109
0110 public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0111 static {
0112 Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0113 tmpMap.put(_Fields.TYPE_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeClassName", org.apache.thrift.TFieldRequirementType.REQUIRED,
0114 new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
0115 metaDataMap = Collections.unmodifiableMap(tmpMap);
0116 org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUserDefinedTypeEntry.class, metaDataMap);
0117 }
0118
0119 public TUserDefinedTypeEntry() {
0120 }
0121
0122 public TUserDefinedTypeEntry(
0123 String typeClassName)
0124 {
0125 this();
0126 this.typeClassName = typeClassName;
0127 }
0128
0129
0130
0131
0132 public TUserDefinedTypeEntry(TUserDefinedTypeEntry other) {
0133 if (other.isSetTypeClassName()) {
0134 this.typeClassName = other.typeClassName;
0135 }
0136 }
0137
0138 public TUserDefinedTypeEntry deepCopy() {
0139 return new TUserDefinedTypeEntry(this);
0140 }
0141
0142 @Override
0143 public void clear() {
0144 this.typeClassName = null;
0145 }
0146
0147 public String getTypeClassName() {
0148 return this.typeClassName;
0149 }
0150
0151 public void setTypeClassName(String typeClassName) {
0152 this.typeClassName = typeClassName;
0153 }
0154
0155 public void unsetTypeClassName() {
0156 this.typeClassName = null;
0157 }
0158
0159
0160 public boolean isSetTypeClassName() {
0161 return this.typeClassName != null;
0162 }
0163
0164 public void setTypeClassNameIsSet(boolean value) {
0165 if (!value) {
0166 this.typeClassName = null;
0167 }
0168 }
0169
0170 public void setFieldValue(_Fields field, Object value) {
0171 switch (field) {
0172 case TYPE_CLASS_NAME:
0173 if (value == null) {
0174 unsetTypeClassName();
0175 } else {
0176 setTypeClassName((String)value);
0177 }
0178 break;
0179
0180 }
0181 }
0182
0183 public Object getFieldValue(_Fields field) {
0184 switch (field) {
0185 case TYPE_CLASS_NAME:
0186 return getTypeClassName();
0187
0188 }
0189 throw new IllegalStateException();
0190 }
0191
0192
0193 public boolean isSet(_Fields field) {
0194 if (field == null) {
0195 throw new IllegalArgumentException();
0196 }
0197
0198 switch (field) {
0199 case TYPE_CLASS_NAME:
0200 return isSetTypeClassName();
0201 }
0202 throw new IllegalStateException();
0203 }
0204
0205 @Override
0206 public boolean equals(Object that) {
0207 if (that == null)
0208 return false;
0209 if (that instanceof TUserDefinedTypeEntry)
0210 return this.equals((TUserDefinedTypeEntry)that);
0211 return false;
0212 }
0213
0214 public boolean equals(TUserDefinedTypeEntry that) {
0215 if (that == null)
0216 return false;
0217
0218 boolean this_present_typeClassName = true && this.isSetTypeClassName();
0219 boolean that_present_typeClassName = true && that.isSetTypeClassName();
0220 if (this_present_typeClassName || that_present_typeClassName) {
0221 if (!(this_present_typeClassName && that_present_typeClassName))
0222 return false;
0223 if (!this.typeClassName.equals(that.typeClassName))
0224 return false;
0225 }
0226
0227 return true;
0228 }
0229
0230 @Override
0231 public int hashCode() {
0232 List<Object> list = new ArrayList<Object>();
0233
0234 boolean present_typeClassName = true && (isSetTypeClassName());
0235 list.add(present_typeClassName);
0236 if (present_typeClassName)
0237 list.add(typeClassName);
0238
0239 return list.hashCode();
0240 }
0241
0242 @Override
0243 public int compareTo(TUserDefinedTypeEntry other) {
0244 if (!getClass().equals(other.getClass())) {
0245 return getClass().getName().compareTo(other.getClass().getName());
0246 }
0247
0248 int lastComparison = 0;
0249
0250 lastComparison = Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName());
0251 if (lastComparison != 0) {
0252 return lastComparison;
0253 }
0254 if (isSetTypeClassName()) {
0255 lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeClassName, other.typeClassName);
0256 if (lastComparison != 0) {
0257 return lastComparison;
0258 }
0259 }
0260 return 0;
0261 }
0262
0263 public _Fields fieldForId(int fieldId) {
0264 return _Fields.findByThriftId(fieldId);
0265 }
0266
0267 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0268 schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0269 }
0270
0271 public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0272 schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0273 }
0274
0275 @Override
0276 public String toString() {
0277 StringBuilder sb = new StringBuilder("TUserDefinedTypeEntry(");
0278 boolean first = true;
0279
0280 sb.append("typeClassName:");
0281 if (this.typeClassName == null) {
0282 sb.append("null");
0283 } else {
0284 sb.append(this.typeClassName);
0285 }
0286 first = false;
0287 sb.append(")");
0288 return sb.toString();
0289 }
0290
0291 public void validate() throws org.apache.thrift.TException {
0292
0293 if (!isSetTypeClassName()) {
0294 throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeClassName' is unset! Struct:" + toString());
0295 }
0296
0297
0298 }
0299
0300 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0301 try {
0302 write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0303 } catch (org.apache.thrift.TException te) {
0304 throw new java.io.IOException(te);
0305 }
0306 }
0307
0308 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0309 try {
0310 read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0311 } catch (org.apache.thrift.TException te) {
0312 throw new java.io.IOException(te);
0313 }
0314 }
0315
0316 private static class TUserDefinedTypeEntryStandardSchemeFactory implements SchemeFactory {
0317 public TUserDefinedTypeEntryStandardScheme getScheme() {
0318 return new TUserDefinedTypeEntryStandardScheme();
0319 }
0320 }
0321
0322 private static class TUserDefinedTypeEntryStandardScheme extends StandardScheme<TUserDefinedTypeEntry> {
0323
0324 public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException {
0325 org.apache.thrift.protocol.TField schemeField;
0326 iprot.readStructBegin();
0327 while (true)
0328 {
0329 schemeField = iprot.readFieldBegin();
0330 if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
0331 break;
0332 }
0333 switch (schemeField.id) {
0334 case 1:
0335 if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
0336 struct.typeClassName = iprot.readString();
0337 struct.setTypeClassNameIsSet(true);
0338 } else {
0339 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0340 }
0341 break;
0342 default:
0343 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0344 }
0345 iprot.readFieldEnd();
0346 }
0347 iprot.readStructEnd();
0348 struct.validate();
0349 }
0350
0351 public void write(org.apache.thrift.protocol.TProtocol oprot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException {
0352 struct.validate();
0353
0354 oprot.writeStructBegin(STRUCT_DESC);
0355 if (struct.typeClassName != null) {
0356 oprot.writeFieldBegin(TYPE_CLASS_NAME_FIELD_DESC);
0357 oprot.writeString(struct.typeClassName);
0358 oprot.writeFieldEnd();
0359 }
0360 oprot.writeFieldStop();
0361 oprot.writeStructEnd();
0362 }
0363
0364 }
0365
0366 private static class TUserDefinedTypeEntryTupleSchemeFactory implements SchemeFactory {
0367 public TUserDefinedTypeEntryTupleScheme getScheme() {
0368 return new TUserDefinedTypeEntryTupleScheme();
0369 }
0370 }
0371
0372 private static class TUserDefinedTypeEntryTupleScheme extends TupleScheme<TUserDefinedTypeEntry> {
0373
0374 @Override
0375 public void write(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException {
0376 TTupleProtocol oprot = (TTupleProtocol) prot;
0377 oprot.writeString(struct.typeClassName);
0378 }
0379
0380 @Override
0381 public void read(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException {
0382 TTupleProtocol iprot = (TTupleProtocol) prot;
0383 struct.typeClassName = iprot.readString();
0384 struct.setTypeClassNameIsSet(true);
0385 }
0386 }
0387
0388 }
0389