PageRenderTime 29ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/IndexAlreadyExistsException.java

http://github.com/apache/hive
Java | 395 lines | 307 code | 63 blank | 25 comment | 49 complexity | 9bcac429fb5eec36847d406f70d1e015 MD5 | raw file
Possible License(s): Apache-2.0
  1. /**
  2. * Autogenerated by Thrift Compiler (0.9.3)
  3. *
  4. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5. * @generated
  6. */
  7. package org.apache.hadoop.hive.metastore.api;
  8. import org.apache.thrift.scheme.IScheme;
  9. import org.apache.thrift.scheme.SchemeFactory;
  10. import org.apache.thrift.scheme.StandardScheme;
  11. import org.apache.thrift.scheme.TupleScheme;
  12. import org.apache.thrift.protocol.TTupleProtocol;
  13. import org.apache.thrift.protocol.TProtocolException;
  14. import org.apache.thrift.EncodingUtils;
  15. import org.apache.thrift.TException;
  16. import org.apache.thrift.async.AsyncMethodCallback;
  17. import org.apache.thrift.server.AbstractNonblockingServer.*;
  18. import java.util.List;
  19. import java.util.ArrayList;
  20. import java.util.Map;
  21. import java.util.HashMap;
  22. import java.util.EnumMap;
  23. import java.util.Set;
  24. import java.util.HashSet;
  25. import java.util.EnumSet;
  26. import java.util.Collections;
  27. import java.util.BitSet;
  28. import java.nio.ByteBuffer;
  29. import java.util.Arrays;
  30. import javax.annotation.Generated;
  31. import org.slf4j.Logger;
  32. import org.slf4j.LoggerFactory;
  33. @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
  34. @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
  35. public class IndexAlreadyExistsException extends TException implements org.apache.thrift.TBase<IndexAlreadyExistsException, IndexAlreadyExistsException._Fields>, java.io.Serializable, Cloneable, Comparable<IndexAlreadyExistsException> {
  36. private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IndexAlreadyExistsException");
  37. private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1);
  38. private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  39. static {
  40. schemes.put(StandardScheme.class, new IndexAlreadyExistsExceptionStandardSchemeFactory());
  41. schemes.put(TupleScheme.class, new IndexAlreadyExistsExceptionTupleSchemeFactory());
  42. }
  43. private String message; // required
  44. /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  45. public enum _Fields implements org.apache.thrift.TFieldIdEnum {
  46. MESSAGE((short)1, "message");
  47. private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
  48. static {
  49. for (_Fields field : EnumSet.allOf(_Fields.class)) {
  50. byName.put(field.getFieldName(), field);
  51. }
  52. }
  53. /**
  54. * Find the _Fields constant that matches fieldId, or null if its not found.
  55. */
  56. public static _Fields findByThriftId(int fieldId) {
  57. switch(fieldId) {
  58. case 1: // MESSAGE
  59. return MESSAGE;
  60. default:
  61. return null;
  62. }
  63. }
  64. /**
  65. * Find the _Fields constant that matches fieldId, throwing an exception
  66. * if it is not found.
  67. */
  68. public static _Fields findByThriftIdOrThrow(int fieldId) {
  69. _Fields fields = findByThriftId(fieldId);
  70. if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
  71. return fields;
  72. }
  73. /**
  74. * Find the _Fields constant that matches name, or null if its not found.
  75. */
  76. public static _Fields findByName(String name) {
  77. return byName.get(name);
  78. }
  79. private final short _thriftId;
  80. private final String _fieldName;
  81. _Fields(short thriftId, String fieldName) {
  82. _thriftId = thriftId;
  83. _fieldName = fieldName;
  84. }
  85. public short getThriftFieldId() {
  86. return _thriftId;
  87. }
  88. public String getFieldName() {
  89. return _fieldName;
  90. }
  91. }
  92. // isset id assignments
  93. public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  94. static {
  95. Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
  96. tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT,
  97. new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
  98. metaDataMap = Collections.unmodifiableMap(tmpMap);
  99. org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IndexAlreadyExistsException.class, metaDataMap);
  100. }
  101. public IndexAlreadyExistsException() {
  102. }
  103. public IndexAlreadyExistsException(
  104. String message)
  105. {
  106. this();
  107. this.message = message;
  108. }
  109. /**
  110. * Performs a deep copy on <i>other</i>.
  111. */
  112. public IndexAlreadyExistsException(IndexAlreadyExistsException other) {
  113. if (other.isSetMessage()) {
  114. this.message = other.message;
  115. }
  116. }
  117. public IndexAlreadyExistsException deepCopy() {
  118. return new IndexAlreadyExistsException(this);
  119. }
  120. @Override
  121. public void clear() {
  122. this.message = null;
  123. }
  124. public String getMessage() {
  125. return this.message;
  126. }
  127. public void setMessage(String message) {
  128. this.message = message;
  129. }
  130. public void unsetMessage() {
  131. this.message = null;
  132. }
  133. /** Returns true if field message is set (has been assigned a value) and false otherwise */
  134. public boolean isSetMessage() {
  135. return this.message != null;
  136. }
  137. public void setMessageIsSet(boolean value) {
  138. if (!value) {
  139. this.message = null;
  140. }
  141. }
  142. public void setFieldValue(_Fields field, Object value) {
  143. switch (field) {
  144. case MESSAGE:
  145. if (value == null) {
  146. unsetMessage();
  147. } else {
  148. setMessage((String)value);
  149. }
  150. break;
  151. }
  152. }
  153. public Object getFieldValue(_Fields field) {
  154. switch (field) {
  155. case MESSAGE:
  156. return getMessage();
  157. }
  158. throw new IllegalStateException();
  159. }
  160. /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  161. public boolean isSet(_Fields field) {
  162. if (field == null) {
  163. throw new IllegalArgumentException();
  164. }
  165. switch (field) {
  166. case MESSAGE:
  167. return isSetMessage();
  168. }
  169. throw new IllegalStateException();
  170. }
  171. @Override
  172. public boolean equals(Object that) {
  173. if (that == null)
  174. return false;
  175. if (that instanceof IndexAlreadyExistsException)
  176. return this.equals((IndexAlreadyExistsException)that);
  177. return false;
  178. }
  179. public boolean equals(IndexAlreadyExistsException that) {
  180. if (that == null)
  181. return false;
  182. boolean this_present_message = true && this.isSetMessage();
  183. boolean that_present_message = true && that.isSetMessage();
  184. if (this_present_message || that_present_message) {
  185. if (!(this_present_message && that_present_message))
  186. return false;
  187. if (!this.message.equals(that.message))
  188. return false;
  189. }
  190. return true;
  191. }
  192. @Override
  193. public int hashCode() {
  194. List<Object> list = new ArrayList<Object>();
  195. boolean present_message = true && (isSetMessage());
  196. list.add(present_message);
  197. if (present_message)
  198. list.add(message);
  199. return list.hashCode();
  200. }
  201. @Override
  202. public int compareTo(IndexAlreadyExistsException other) {
  203. if (!getClass().equals(other.getClass())) {
  204. return getClass().getName().compareTo(other.getClass().getName());
  205. }
  206. int lastComparison = 0;
  207. lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage());
  208. if (lastComparison != 0) {
  209. return lastComparison;
  210. }
  211. if (isSetMessage()) {
  212. lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message);
  213. if (lastComparison != 0) {
  214. return lastComparison;
  215. }
  216. }
  217. return 0;
  218. }
  219. public _Fields fieldForId(int fieldId) {
  220. return _Fields.findByThriftId(fieldId);
  221. }
  222. public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
  223. schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  224. }
  225. public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
  226. schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  227. }
  228. @Override
  229. public String toString() {
  230. StringBuilder sb = new StringBuilder("IndexAlreadyExistsException(");
  231. boolean first = true;
  232. sb.append("message:");
  233. if (this.message == null) {
  234. sb.append("null");
  235. } else {
  236. sb.append(this.message);
  237. }
  238. first = false;
  239. sb.append(")");
  240. return sb.toString();
  241. }
  242. public void validate() throws org.apache.thrift.TException {
  243. // check for required fields
  244. // check for sub-struct validity
  245. }
  246. private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
  247. try {
  248. write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
  249. } catch (org.apache.thrift.TException te) {
  250. throw new java.io.IOException(te);
  251. }
  252. }
  253. private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
  254. try {
  255. read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
  256. } catch (org.apache.thrift.TException te) {
  257. throw new java.io.IOException(te);
  258. }
  259. }
  260. private static class IndexAlreadyExistsExceptionStandardSchemeFactory implements SchemeFactory {
  261. public IndexAlreadyExistsExceptionStandardScheme getScheme() {
  262. return new IndexAlreadyExistsExceptionStandardScheme();
  263. }
  264. }
  265. private static class IndexAlreadyExistsExceptionStandardScheme extends StandardScheme<IndexAlreadyExistsException> {
  266. public void read(org.apache.thrift.protocol.TProtocol iprot, IndexAlreadyExistsException struct) throws org.apache.thrift.TException {
  267. org.apache.thrift.protocol.TField schemeField;
  268. iprot.readStructBegin();
  269. while (true)
  270. {
  271. schemeField = iprot.readFieldBegin();
  272. if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
  273. break;
  274. }
  275. switch (schemeField.id) {
  276. case 1: // MESSAGE
  277. if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
  278. struct.message = iprot.readString();
  279. struct.setMessageIsSet(true);
  280. } else {
  281. org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
  282. }
  283. break;
  284. default:
  285. org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
  286. }
  287. iprot.readFieldEnd();
  288. }
  289. iprot.readStructEnd();
  290. struct.validate();
  291. }
  292. public void write(org.apache.thrift.protocol.TProtocol oprot, IndexAlreadyExistsException struct) throws org.apache.thrift.TException {
  293. struct.validate();
  294. oprot.writeStructBegin(STRUCT_DESC);
  295. if (struct.message != null) {
  296. oprot.writeFieldBegin(MESSAGE_FIELD_DESC);
  297. oprot.writeString(struct.message);
  298. oprot.writeFieldEnd();
  299. }
  300. oprot.writeFieldStop();
  301. oprot.writeStructEnd();
  302. }
  303. }
  304. private static class IndexAlreadyExistsExceptionTupleSchemeFactory implements SchemeFactory {
  305. public IndexAlreadyExistsExceptionTupleScheme getScheme() {
  306. return new IndexAlreadyExistsExceptionTupleScheme();
  307. }
  308. }
  309. private static class IndexAlreadyExistsExceptionTupleScheme extends TupleScheme<IndexAlreadyExistsException> {
  310. @Override
  311. public void write(org.apache.thrift.protocol.TProtocol prot, IndexAlreadyExistsException struct) throws org.apache.thrift.TException {
  312. TTupleProtocol oprot = (TTupleProtocol) prot;
  313. BitSet optionals = new BitSet();
  314. if (struct.isSetMessage()) {
  315. optionals.set(0);
  316. }
  317. oprot.writeBitSet(optionals, 1);
  318. if (struct.isSetMessage()) {
  319. oprot.writeString(struct.message);
  320. }
  321. }
  322. @Override
  323. public void read(org.apache.thrift.protocol.TProtocol prot, IndexAlreadyExistsException struct) throws org.apache.thrift.TException {
  324. TTupleProtocol iprot = (TTupleProtocol) prot;
  325. BitSet incoming = iprot.readBitSet(1);
  326. if (incoming.get(0)) {
  327. struct.message = iprot.readString();
  328. struct.setMessageIsSet(true);
  329. }
  330. }
  331. }
  332. }