PageRenderTime 56ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 1ms

/tags/release-0.1-rc2/hive/external/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java

#
Java | 1044 lines | 893 code | 121 blank | 30 comment | 234 complexity | a58de2ac197403402e105ef19b7a7b5a MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. /**
  2. * Autogenerated by Thrift
  3. *
  4. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  5. */
  6. package org.apache.hadoop.hive.ql.plan.api;
  7. import java.util.List;
  8. import java.util.ArrayList;
  9. import java.util.Map;
  10. import java.util.HashMap;
  11. import java.util.EnumMap;
  12. import java.util.Set;
  13. import java.util.HashSet;
  14. import java.util.EnumSet;
  15. import java.util.Collections;
  16. import java.util.BitSet;
  17. import java.nio.ByteBuffer;
  18. import java.util.Arrays;
  19. import org.slf4j.Logger;
  20. import org.slf4j.LoggerFactory;
  21. import org.apache.thrift.*;
  22. import org.apache.thrift.async.*;
  23. import org.apache.thrift.meta_data.*;
  24. import org.apache.thrift.transport.*;
  25. import org.apache.thrift.protocol.*;
  26. public class Query implements TBase<Query, Query._Fields>, java.io.Serializable, Cloneable {
  27. private static final TStruct STRUCT_DESC = new TStruct("Query");
  28. private static final TField QUERY_ID_FIELD_DESC = new TField("queryId", TType.STRING, (short)1);
  29. private static final TField QUERY_TYPE_FIELD_DESC = new TField("queryType", TType.STRING, (short)2);
  30. private static final TField QUERY_ATTRIBUTES_FIELD_DESC = new TField("queryAttributes", TType.MAP, (short)3);
  31. private static final TField QUERY_COUNTERS_FIELD_DESC = new TField("queryCounters", TType.MAP, (short)4);
  32. private static final TField STAGE_GRAPH_FIELD_DESC = new TField("stageGraph", TType.STRUCT, (short)5);
  33. private static final TField STAGE_LIST_FIELD_DESC = new TField("stageList", TType.LIST, (short)6);
  34. private static final TField DONE_FIELD_DESC = new TField("done", TType.BOOL, (short)7);
  35. private static final TField STARTED_FIELD_DESC = new TField("started", TType.BOOL, (short)8);
  36. private String queryId;
  37. private String queryType;
  38. private Map<String,String> queryAttributes;
  39. private Map<String,Long> queryCounters;
  40. private Graph stageGraph;
  41. private List<Stage> stageList;
  42. private boolean done;
  43. private boolean started;
  44. /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  45. public enum _Fields implements TFieldIdEnum {
  46. QUERY_ID((short)1, "queryId"),
  47. QUERY_TYPE((short)2, "queryType"),
  48. QUERY_ATTRIBUTES((short)3, "queryAttributes"),
  49. QUERY_COUNTERS((short)4, "queryCounters"),
  50. STAGE_GRAPH((short)5, "stageGraph"),
  51. STAGE_LIST((short)6, "stageList"),
  52. DONE((short)7, "done"),
  53. STARTED((short)8, "started");
  54. private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
  55. static {
  56. for (_Fields field : EnumSet.allOf(_Fields.class)) {
  57. byName.put(field.getFieldName(), field);
  58. }
  59. }
  60. /**
  61. * Find the _Fields constant that matches fieldId, or null if its not found.
  62. */
  63. public static _Fields findByThriftId(int fieldId) {
  64. switch(fieldId) {
  65. case 1: // QUERY_ID
  66. return QUERY_ID;
  67. case 2: // QUERY_TYPE
  68. return QUERY_TYPE;
  69. case 3: // QUERY_ATTRIBUTES
  70. return QUERY_ATTRIBUTES;
  71. case 4: // QUERY_COUNTERS
  72. return QUERY_COUNTERS;
  73. case 5: // STAGE_GRAPH
  74. return STAGE_GRAPH;
  75. case 6: // STAGE_LIST
  76. return STAGE_LIST;
  77. case 7: // DONE
  78. return DONE;
  79. case 8: // STARTED
  80. return STARTED;
  81. default:
  82. return null;
  83. }
  84. }
  85. /**
  86. * Find the _Fields constant that matches fieldId, throwing an exception
  87. * if it is not found.
  88. */
  89. public static _Fields findByThriftIdOrThrow(int fieldId) {
  90. _Fields fields = findByThriftId(fieldId);
  91. if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
  92. return fields;
  93. }
  94. /**
  95. * Find the _Fields constant that matches name, or null if its not found.
  96. */
  97. public static _Fields findByName(String name) {
  98. return byName.get(name);
  99. }
  100. private final short _thriftId;
  101. private final String _fieldName;
  102. _Fields(short thriftId, String fieldName) {
  103. _thriftId = thriftId;
  104. _fieldName = fieldName;
  105. }
  106. public short getThriftFieldId() {
  107. return _thriftId;
  108. }
  109. public String getFieldName() {
  110. return _fieldName;
  111. }
  112. }
  113. // isset id assignments
  114. private static final int __DONE_ISSET_ID = 0;
  115. private static final int __STARTED_ISSET_ID = 1;
  116. private BitSet __isset_bit_vector = new BitSet(2);
  117. public static final Map<_Fields, FieldMetaData> metaDataMap;
  118. static {
  119. Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
  120. tmpMap.put(_Fields.QUERY_ID, new FieldMetaData("queryId", TFieldRequirementType.DEFAULT,
  121. new FieldValueMetaData(TType.STRING)));
  122. tmpMap.put(_Fields.QUERY_TYPE, new FieldMetaData("queryType", TFieldRequirementType.DEFAULT,
  123. new FieldValueMetaData(TType.STRING)));
  124. tmpMap.put(_Fields.QUERY_ATTRIBUTES, new FieldMetaData("queryAttributes", TFieldRequirementType.DEFAULT,
  125. new MapMetaData(TType.MAP,
  126. new FieldValueMetaData(TType.STRING),
  127. new FieldValueMetaData(TType.STRING))));
  128. tmpMap.put(_Fields.QUERY_COUNTERS, new FieldMetaData("queryCounters", TFieldRequirementType.DEFAULT,
  129. new MapMetaData(TType.MAP,
  130. new FieldValueMetaData(TType.STRING),
  131. new FieldValueMetaData(TType.I64))));
  132. tmpMap.put(_Fields.STAGE_GRAPH, new FieldMetaData("stageGraph", TFieldRequirementType.DEFAULT,
  133. new StructMetaData(TType.STRUCT, Graph.class)));
  134. tmpMap.put(_Fields.STAGE_LIST, new FieldMetaData("stageList", TFieldRequirementType.DEFAULT,
  135. new ListMetaData(TType.LIST,
  136. new StructMetaData(TType.STRUCT, Stage.class))));
  137. tmpMap.put(_Fields.DONE, new FieldMetaData("done", TFieldRequirementType.DEFAULT,
  138. new FieldValueMetaData(TType.BOOL)));
  139. tmpMap.put(_Fields.STARTED, new FieldMetaData("started", TFieldRequirementType.DEFAULT,
  140. new FieldValueMetaData(TType.BOOL)));
  141. metaDataMap = Collections.unmodifiableMap(tmpMap);
  142. FieldMetaData.addStructMetaDataMap(Query.class, metaDataMap);
  143. }
  144. public Query() {
  145. }
  146. public Query(
  147. String queryId,
  148. String queryType,
  149. Map<String,String> queryAttributes,
  150. Map<String,Long> queryCounters,
  151. Graph stageGraph,
  152. List<Stage> stageList,
  153. boolean done,
  154. boolean started)
  155. {
  156. this();
  157. this.queryId = queryId;
  158. this.queryType = queryType;
  159. this.queryAttributes = queryAttributes;
  160. this.queryCounters = queryCounters;
  161. this.stageGraph = stageGraph;
  162. this.stageList = stageList;
  163. this.done = done;
  164. setDoneIsSet(true);
  165. this.started = started;
  166. setStartedIsSet(true);
  167. }
  168. /**
  169. * Performs a deep copy on <i>other</i>.
  170. */
  171. public Query(Query other) {
  172. __isset_bit_vector.clear();
  173. __isset_bit_vector.or(other.__isset_bit_vector);
  174. if (other.isSetQueryId()) {
  175. this.queryId = other.queryId;
  176. }
  177. if (other.isSetQueryType()) {
  178. this.queryType = other.queryType;
  179. }
  180. if (other.isSetQueryAttributes()) {
  181. Map<String,String> __this__queryAttributes = new HashMap<String,String>();
  182. for (Map.Entry<String, String> other_element : other.queryAttributes.entrySet()) {
  183. String other_element_key = other_element.getKey();
  184. String other_element_value = other_element.getValue();
  185. String __this__queryAttributes_copy_key = other_element_key;
  186. String __this__queryAttributes_copy_value = other_element_value;
  187. __this__queryAttributes.put(__this__queryAttributes_copy_key, __this__queryAttributes_copy_value);
  188. }
  189. this.queryAttributes = __this__queryAttributes;
  190. }
  191. if (other.isSetQueryCounters()) {
  192. Map<String,Long> __this__queryCounters = new HashMap<String,Long>();
  193. for (Map.Entry<String, Long> other_element : other.queryCounters.entrySet()) {
  194. String other_element_key = other_element.getKey();
  195. Long other_element_value = other_element.getValue();
  196. String __this__queryCounters_copy_key = other_element_key;
  197. Long __this__queryCounters_copy_value = other_element_value;
  198. __this__queryCounters.put(__this__queryCounters_copy_key, __this__queryCounters_copy_value);
  199. }
  200. this.queryCounters = __this__queryCounters;
  201. }
  202. if (other.isSetStageGraph()) {
  203. this.stageGraph = new Graph(other.stageGraph);
  204. }
  205. if (other.isSetStageList()) {
  206. List<Stage> __this__stageList = new ArrayList<Stage>();
  207. for (Stage other_element : other.stageList) {
  208. __this__stageList.add(new Stage(other_element));
  209. }
  210. this.stageList = __this__stageList;
  211. }
  212. this.done = other.done;
  213. this.started = other.started;
  214. }
  215. public Query deepCopy() {
  216. return new Query(this);
  217. }
  218. @Override
  219. public void clear() {
  220. this.queryId = null;
  221. this.queryType = null;
  222. this.queryAttributes = null;
  223. this.queryCounters = null;
  224. this.stageGraph = null;
  225. this.stageList = null;
  226. setDoneIsSet(false);
  227. this.done = false;
  228. setStartedIsSet(false);
  229. this.started = false;
  230. }
  231. public String getQueryId() {
  232. return this.queryId;
  233. }
  234. public void setQueryId(String queryId) {
  235. this.queryId = queryId;
  236. }
  237. public void unsetQueryId() {
  238. this.queryId = null;
  239. }
  240. /** Returns true if field queryId is set (has been asigned a value) and false otherwise */
  241. public boolean isSetQueryId() {
  242. return this.queryId != null;
  243. }
  244. public void setQueryIdIsSet(boolean value) {
  245. if (!value) {
  246. this.queryId = null;
  247. }
  248. }
  249. public String getQueryType() {
  250. return this.queryType;
  251. }
  252. public void setQueryType(String queryType) {
  253. this.queryType = queryType;
  254. }
  255. public void unsetQueryType() {
  256. this.queryType = null;
  257. }
  258. /** Returns true if field queryType is set (has been asigned a value) and false otherwise */
  259. public boolean isSetQueryType() {
  260. return this.queryType != null;
  261. }
  262. public void setQueryTypeIsSet(boolean value) {
  263. if (!value) {
  264. this.queryType = null;
  265. }
  266. }
  267. public int getQueryAttributesSize() {
  268. return (this.queryAttributes == null) ? 0 : this.queryAttributes.size();
  269. }
  270. public void putToQueryAttributes(String key, String val) {
  271. if (this.queryAttributes == null) {
  272. this.queryAttributes = new HashMap<String,String>();
  273. }
  274. this.queryAttributes.put(key, val);
  275. }
  276. public Map<String,String> getQueryAttributes() {
  277. return this.queryAttributes;
  278. }
  279. public void setQueryAttributes(Map<String,String> queryAttributes) {
  280. this.queryAttributes = queryAttributes;
  281. }
  282. public void unsetQueryAttributes() {
  283. this.queryAttributes = null;
  284. }
  285. /** Returns true if field queryAttributes is set (has been asigned a value) and false otherwise */
  286. public boolean isSetQueryAttributes() {
  287. return this.queryAttributes != null;
  288. }
  289. public void setQueryAttributesIsSet(boolean value) {
  290. if (!value) {
  291. this.queryAttributes = null;
  292. }
  293. }
  294. public int getQueryCountersSize() {
  295. return (this.queryCounters == null) ? 0 : this.queryCounters.size();
  296. }
  297. public void putToQueryCounters(String key, long val) {
  298. if (this.queryCounters == null) {
  299. this.queryCounters = new HashMap<String,Long>();
  300. }
  301. this.queryCounters.put(key, val);
  302. }
  303. public Map<String,Long> getQueryCounters() {
  304. return this.queryCounters;
  305. }
  306. public void setQueryCounters(Map<String,Long> queryCounters) {
  307. this.queryCounters = queryCounters;
  308. }
  309. public void unsetQueryCounters() {
  310. this.queryCounters = null;
  311. }
  312. /** Returns true if field queryCounters is set (has been asigned a value) and false otherwise */
  313. public boolean isSetQueryCounters() {
  314. return this.queryCounters != null;
  315. }
  316. public void setQueryCountersIsSet(boolean value) {
  317. if (!value) {
  318. this.queryCounters = null;
  319. }
  320. }
  321. public Graph getStageGraph() {
  322. return this.stageGraph;
  323. }
  324. public void setStageGraph(Graph stageGraph) {
  325. this.stageGraph = stageGraph;
  326. }
  327. public void unsetStageGraph() {
  328. this.stageGraph = null;
  329. }
  330. /** Returns true if field stageGraph is set (has been asigned a value) and false otherwise */
  331. public boolean isSetStageGraph() {
  332. return this.stageGraph != null;
  333. }
  334. public void setStageGraphIsSet(boolean value) {
  335. if (!value) {
  336. this.stageGraph = null;
  337. }
  338. }
  339. public int getStageListSize() {
  340. return (this.stageList == null) ? 0 : this.stageList.size();
  341. }
  342. public java.util.Iterator<Stage> getStageListIterator() {
  343. return (this.stageList == null) ? null : this.stageList.iterator();
  344. }
  345. public void addToStageList(Stage elem) {
  346. if (this.stageList == null) {
  347. this.stageList = new ArrayList<Stage>();
  348. }
  349. this.stageList.add(elem);
  350. }
  351. public List<Stage> getStageList() {
  352. return this.stageList;
  353. }
  354. public void setStageList(List<Stage> stageList) {
  355. this.stageList = stageList;
  356. }
  357. public void unsetStageList() {
  358. this.stageList = null;
  359. }
  360. /** Returns true if field stageList is set (has been asigned a value) and false otherwise */
  361. public boolean isSetStageList() {
  362. return this.stageList != null;
  363. }
  364. public void setStageListIsSet(boolean value) {
  365. if (!value) {
  366. this.stageList = null;
  367. }
  368. }
  369. public boolean isDone() {
  370. return this.done;
  371. }
  372. public void setDone(boolean done) {
  373. this.done = done;
  374. setDoneIsSet(true);
  375. }
  376. public void unsetDone() {
  377. __isset_bit_vector.clear(__DONE_ISSET_ID);
  378. }
  379. /** Returns true if field done is set (has been asigned a value) and false otherwise */
  380. public boolean isSetDone() {
  381. return __isset_bit_vector.get(__DONE_ISSET_ID);
  382. }
  383. public void setDoneIsSet(boolean value) {
  384. __isset_bit_vector.set(__DONE_ISSET_ID, value);
  385. }
  386. public boolean isStarted() {
  387. return this.started;
  388. }
  389. public void setStarted(boolean started) {
  390. this.started = started;
  391. setStartedIsSet(true);
  392. }
  393. public void unsetStarted() {
  394. __isset_bit_vector.clear(__STARTED_ISSET_ID);
  395. }
  396. /** Returns true if field started is set (has been asigned a value) and false otherwise */
  397. public boolean isSetStarted() {
  398. return __isset_bit_vector.get(__STARTED_ISSET_ID);
  399. }
  400. public void setStartedIsSet(boolean value) {
  401. __isset_bit_vector.set(__STARTED_ISSET_ID, value);
  402. }
  403. public void setFieldValue(_Fields field, Object value) {
  404. switch (field) {
  405. case QUERY_ID:
  406. if (value == null) {
  407. unsetQueryId();
  408. } else {
  409. setQueryId((String)value);
  410. }
  411. break;
  412. case QUERY_TYPE:
  413. if (value == null) {
  414. unsetQueryType();
  415. } else {
  416. setQueryType((String)value);
  417. }
  418. break;
  419. case QUERY_ATTRIBUTES:
  420. if (value == null) {
  421. unsetQueryAttributes();
  422. } else {
  423. setQueryAttributes((Map<String,String>)value);
  424. }
  425. break;
  426. case QUERY_COUNTERS:
  427. if (value == null) {
  428. unsetQueryCounters();
  429. } else {
  430. setQueryCounters((Map<String,Long>)value);
  431. }
  432. break;
  433. case STAGE_GRAPH:
  434. if (value == null) {
  435. unsetStageGraph();
  436. } else {
  437. setStageGraph((Graph)value);
  438. }
  439. break;
  440. case STAGE_LIST:
  441. if (value == null) {
  442. unsetStageList();
  443. } else {
  444. setStageList((List<Stage>)value);
  445. }
  446. break;
  447. case DONE:
  448. if (value == null) {
  449. unsetDone();
  450. } else {
  451. setDone((Boolean)value);
  452. }
  453. break;
  454. case STARTED:
  455. if (value == null) {
  456. unsetStarted();
  457. } else {
  458. setStarted((Boolean)value);
  459. }
  460. break;
  461. }
  462. }
  463. public Object getFieldValue(_Fields field) {
  464. switch (field) {
  465. case QUERY_ID:
  466. return getQueryId();
  467. case QUERY_TYPE:
  468. return getQueryType();
  469. case QUERY_ATTRIBUTES:
  470. return getQueryAttributes();
  471. case QUERY_COUNTERS:
  472. return getQueryCounters();
  473. case STAGE_GRAPH:
  474. return getStageGraph();
  475. case STAGE_LIST:
  476. return getStageList();
  477. case DONE:
  478. return new Boolean(isDone());
  479. case STARTED:
  480. return new Boolean(isStarted());
  481. }
  482. throw new IllegalStateException();
  483. }
  484. /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
  485. public boolean isSet(_Fields field) {
  486. if (field == null) {
  487. throw new IllegalArgumentException();
  488. }
  489. switch (field) {
  490. case QUERY_ID:
  491. return isSetQueryId();
  492. case QUERY_TYPE:
  493. return isSetQueryType();
  494. case QUERY_ATTRIBUTES:
  495. return isSetQueryAttributes();
  496. case QUERY_COUNTERS:
  497. return isSetQueryCounters();
  498. case STAGE_GRAPH:
  499. return isSetStageGraph();
  500. case STAGE_LIST:
  501. return isSetStageList();
  502. case DONE:
  503. return isSetDone();
  504. case STARTED:
  505. return isSetStarted();
  506. }
  507. throw new IllegalStateException();
  508. }
  509. @Override
  510. public boolean equals(Object that) {
  511. if (that == null)
  512. return false;
  513. if (that instanceof Query)
  514. return this.equals((Query)that);
  515. return false;
  516. }
  517. public boolean equals(Query that) {
  518. if (that == null)
  519. return false;
  520. boolean this_present_queryId = true && this.isSetQueryId();
  521. boolean that_present_queryId = true && that.isSetQueryId();
  522. if (this_present_queryId || that_present_queryId) {
  523. if (!(this_present_queryId && that_present_queryId))
  524. return false;
  525. if (!this.queryId.equals(that.queryId))
  526. return false;
  527. }
  528. boolean this_present_queryType = true && this.isSetQueryType();
  529. boolean that_present_queryType = true && that.isSetQueryType();
  530. if (this_present_queryType || that_present_queryType) {
  531. if (!(this_present_queryType && that_present_queryType))
  532. return false;
  533. if (!this.queryType.equals(that.queryType))
  534. return false;
  535. }
  536. boolean this_present_queryAttributes = true && this.isSetQueryAttributes();
  537. boolean that_present_queryAttributes = true && that.isSetQueryAttributes();
  538. if (this_present_queryAttributes || that_present_queryAttributes) {
  539. if (!(this_present_queryAttributes && that_present_queryAttributes))
  540. return false;
  541. if (!this.queryAttributes.equals(that.queryAttributes))
  542. return false;
  543. }
  544. boolean this_present_queryCounters = true && this.isSetQueryCounters();
  545. boolean that_present_queryCounters = true && that.isSetQueryCounters();
  546. if (this_present_queryCounters || that_present_queryCounters) {
  547. if (!(this_present_queryCounters && that_present_queryCounters))
  548. return false;
  549. if (!this.queryCounters.equals(that.queryCounters))
  550. return false;
  551. }
  552. boolean this_present_stageGraph = true && this.isSetStageGraph();
  553. boolean that_present_stageGraph = true && that.isSetStageGraph();
  554. if (this_present_stageGraph || that_present_stageGraph) {
  555. if (!(this_present_stageGraph && that_present_stageGraph))
  556. return false;
  557. if (!this.stageGraph.equals(that.stageGraph))
  558. return false;
  559. }
  560. boolean this_present_stageList = true && this.isSetStageList();
  561. boolean that_present_stageList = true && that.isSetStageList();
  562. if (this_present_stageList || that_present_stageList) {
  563. if (!(this_present_stageList && that_present_stageList))
  564. return false;
  565. if (!this.stageList.equals(that.stageList))
  566. return false;
  567. }
  568. boolean this_present_done = true;
  569. boolean that_present_done = true;
  570. if (this_present_done || that_present_done) {
  571. if (!(this_present_done && that_present_done))
  572. return false;
  573. if (this.done != that.done)
  574. return false;
  575. }
  576. boolean this_present_started = true;
  577. boolean that_present_started = true;
  578. if (this_present_started || that_present_started) {
  579. if (!(this_present_started && that_present_started))
  580. return false;
  581. if (this.started != that.started)
  582. return false;
  583. }
  584. return true;
  585. }
  586. @Override
  587. public int hashCode() {
  588. return 0;
  589. }
  590. public int compareTo(Query other) {
  591. if (!getClass().equals(other.getClass())) {
  592. return getClass().getName().compareTo(other.getClass().getName());
  593. }
  594. int lastComparison = 0;
  595. Query typedOther = (Query)other;
  596. lastComparison = Boolean.valueOf(isSetQueryId()).compareTo(typedOther.isSetQueryId());
  597. if (lastComparison != 0) {
  598. return lastComparison;
  599. }
  600. if (isSetQueryId()) {
  601. lastComparison = TBaseHelper.compareTo(this.queryId, typedOther.queryId);
  602. if (lastComparison != 0) {
  603. return lastComparison;
  604. }
  605. }
  606. lastComparison = Boolean.valueOf(isSetQueryType()).compareTo(typedOther.isSetQueryType());
  607. if (lastComparison != 0) {
  608. return lastComparison;
  609. }
  610. if (isSetQueryType()) {
  611. lastComparison = TBaseHelper.compareTo(this.queryType, typedOther.queryType);
  612. if (lastComparison != 0) {
  613. return lastComparison;
  614. }
  615. }
  616. lastComparison = Boolean.valueOf(isSetQueryAttributes()).compareTo(typedOther.isSetQueryAttributes());
  617. if (lastComparison != 0) {
  618. return lastComparison;
  619. }
  620. if (isSetQueryAttributes()) {
  621. lastComparison = TBaseHelper.compareTo(this.queryAttributes, typedOther.queryAttributes);
  622. if (lastComparison != 0) {
  623. return lastComparison;
  624. }
  625. }
  626. lastComparison = Boolean.valueOf(isSetQueryCounters()).compareTo(typedOther.isSetQueryCounters());
  627. if (lastComparison != 0) {
  628. return lastComparison;
  629. }
  630. if (isSetQueryCounters()) {
  631. lastComparison = TBaseHelper.compareTo(this.queryCounters, typedOther.queryCounters);
  632. if (lastComparison != 0) {
  633. return lastComparison;
  634. }
  635. }
  636. lastComparison = Boolean.valueOf(isSetStageGraph()).compareTo(typedOther.isSetStageGraph());
  637. if (lastComparison != 0) {
  638. return lastComparison;
  639. }
  640. if (isSetStageGraph()) {
  641. lastComparison = TBaseHelper.compareTo(this.stageGraph, typedOther.stageGraph);
  642. if (lastComparison != 0) {
  643. return lastComparison;
  644. }
  645. }
  646. lastComparison = Boolean.valueOf(isSetStageList()).compareTo(typedOther.isSetStageList());
  647. if (lastComparison != 0) {
  648. return lastComparison;
  649. }
  650. if (isSetStageList()) {
  651. lastComparison = TBaseHelper.compareTo(this.stageList, typedOther.stageList);
  652. if (lastComparison != 0) {
  653. return lastComparison;
  654. }
  655. }
  656. lastComparison = Boolean.valueOf(isSetDone()).compareTo(typedOther.isSetDone());
  657. if (lastComparison != 0) {
  658. return lastComparison;
  659. }
  660. if (isSetDone()) {
  661. lastComparison = TBaseHelper.compareTo(this.done, typedOther.done);
  662. if (lastComparison != 0) {
  663. return lastComparison;
  664. }
  665. }
  666. lastComparison = Boolean.valueOf(isSetStarted()).compareTo(typedOther.isSetStarted());
  667. if (lastComparison != 0) {
  668. return lastComparison;
  669. }
  670. if (isSetStarted()) {
  671. lastComparison = TBaseHelper.compareTo(this.started, typedOther.started);
  672. if (lastComparison != 0) {
  673. return lastComparison;
  674. }
  675. }
  676. return 0;
  677. }
  678. public _Fields fieldForId(int fieldId) {
  679. return _Fields.findByThriftId(fieldId);
  680. }
  681. public void read(TProtocol iprot) throws TException {
  682. TField field;
  683. iprot.readStructBegin();
  684. while (true)
  685. {
  686. field = iprot.readFieldBegin();
  687. if (field.type == TType.STOP) {
  688. break;
  689. }
  690. switch (field.id) {
  691. case 1: // QUERY_ID
  692. if (field.type == TType.STRING) {
  693. this.queryId = iprot.readString();
  694. } else {
  695. TProtocolUtil.skip(iprot, field.type);
  696. }
  697. break;
  698. case 2: // QUERY_TYPE
  699. if (field.type == TType.STRING) {
  700. this.queryType = iprot.readString();
  701. } else {
  702. TProtocolUtil.skip(iprot, field.type);
  703. }
  704. break;
  705. case 3: // QUERY_ATTRIBUTES
  706. if (field.type == TType.MAP) {
  707. {
  708. TMap _map50 = iprot.readMapBegin();
  709. this.queryAttributes = new HashMap<String,String>(2*_map50.size);
  710. for (int _i51 = 0; _i51 < _map50.size; ++_i51)
  711. {
  712. String _key52;
  713. String _val53;
  714. _key52 = iprot.readString();
  715. _val53 = iprot.readString();
  716. this.queryAttributes.put(_key52, _val53);
  717. }
  718. iprot.readMapEnd();
  719. }
  720. } else {
  721. TProtocolUtil.skip(iprot, field.type);
  722. }
  723. break;
  724. case 4: // QUERY_COUNTERS
  725. if (field.type == TType.MAP) {
  726. {
  727. TMap _map54 = iprot.readMapBegin();
  728. this.queryCounters = new HashMap<String,Long>(2*_map54.size);
  729. for (int _i55 = 0; _i55 < _map54.size; ++_i55)
  730. {
  731. String _key56;
  732. long _val57;
  733. _key56 = iprot.readString();
  734. _val57 = iprot.readI64();
  735. this.queryCounters.put(_key56, _val57);
  736. }
  737. iprot.readMapEnd();
  738. }
  739. } else {
  740. TProtocolUtil.skip(iprot, field.type);
  741. }
  742. break;
  743. case 5: // STAGE_GRAPH
  744. if (field.type == TType.STRUCT) {
  745. this.stageGraph = new Graph();
  746. this.stageGraph.read(iprot);
  747. } else {
  748. TProtocolUtil.skip(iprot, field.type);
  749. }
  750. break;
  751. case 6: // STAGE_LIST
  752. if (field.type == TType.LIST) {
  753. {
  754. TList _list58 = iprot.readListBegin();
  755. this.stageList = new ArrayList<Stage>(_list58.size);
  756. for (int _i59 = 0; _i59 < _list58.size; ++_i59)
  757. {
  758. Stage _elem60;
  759. _elem60 = new Stage();
  760. _elem60.read(iprot);
  761. this.stageList.add(_elem60);
  762. }
  763. iprot.readListEnd();
  764. }
  765. } else {
  766. TProtocolUtil.skip(iprot, field.type);
  767. }
  768. break;
  769. case 7: // DONE
  770. if (field.type == TType.BOOL) {
  771. this.done = iprot.readBool();
  772. setDoneIsSet(true);
  773. } else {
  774. TProtocolUtil.skip(iprot, field.type);
  775. }
  776. break;
  777. case 8: // STARTED
  778. if (field.type == TType.BOOL) {
  779. this.started = iprot.readBool();
  780. setStartedIsSet(true);
  781. } else {
  782. TProtocolUtil.skip(iprot, field.type);
  783. }
  784. break;
  785. default:
  786. TProtocolUtil.skip(iprot, field.type);
  787. }
  788. iprot.readFieldEnd();
  789. }
  790. iprot.readStructEnd();
  791. validate();
  792. }
  793. public void write(TProtocol oprot) throws TException {
  794. validate();
  795. oprot.writeStructBegin(STRUCT_DESC);
  796. if (this.queryId != null) {
  797. oprot.writeFieldBegin(QUERY_ID_FIELD_DESC);
  798. oprot.writeString(this.queryId);
  799. oprot.writeFieldEnd();
  800. }
  801. if (this.queryType != null) {
  802. oprot.writeFieldBegin(QUERY_TYPE_FIELD_DESC);
  803. oprot.writeString(this.queryType);
  804. oprot.writeFieldEnd();
  805. }
  806. if (this.queryAttributes != null) {
  807. oprot.writeFieldBegin(QUERY_ATTRIBUTES_FIELD_DESC);
  808. {
  809. oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.queryAttributes.size()));
  810. for (Map.Entry<String, String> _iter61 : this.queryAttributes.entrySet())
  811. {
  812. oprot.writeString(_iter61.getKey());
  813. oprot.writeString(_iter61.getValue());
  814. }
  815. oprot.writeMapEnd();
  816. }
  817. oprot.writeFieldEnd();
  818. }
  819. if (this.queryCounters != null) {
  820. oprot.writeFieldBegin(QUERY_COUNTERS_FIELD_DESC);
  821. {
  822. oprot.writeMapBegin(new TMap(TType.STRING, TType.I64, this.queryCounters.size()));
  823. for (Map.Entry<String, Long> _iter62 : this.queryCounters.entrySet())
  824. {
  825. oprot.writeString(_iter62.getKey());
  826. oprot.writeI64(_iter62.getValue());
  827. }
  828. oprot.writeMapEnd();
  829. }
  830. oprot.writeFieldEnd();
  831. }
  832. if (this.stageGraph != null) {
  833. oprot.writeFieldBegin(STAGE_GRAPH_FIELD_DESC);
  834. this.stageGraph.write(oprot);
  835. oprot.writeFieldEnd();
  836. }
  837. if (this.stageList != null) {
  838. oprot.writeFieldBegin(STAGE_LIST_FIELD_DESC);
  839. {
  840. oprot.writeListBegin(new TList(TType.STRUCT, this.stageList.size()));
  841. for (Stage _iter63 : this.stageList)
  842. {
  843. _iter63.write(oprot);
  844. }
  845. oprot.writeListEnd();
  846. }
  847. oprot.writeFieldEnd();
  848. }
  849. oprot.writeFieldBegin(DONE_FIELD_DESC);
  850. oprot.writeBool(this.done);
  851. oprot.writeFieldEnd();
  852. oprot.writeFieldBegin(STARTED_FIELD_DESC);
  853. oprot.writeBool(this.started);
  854. oprot.writeFieldEnd();
  855. oprot.writeFieldStop();
  856. oprot.writeStructEnd();
  857. }
  858. @Override
  859. public String toString() {
  860. StringBuilder sb = new StringBuilder("Query(");
  861. boolean first = true;
  862. sb.append("queryId:");
  863. if (this.queryId == null) {
  864. sb.append("null");
  865. } else {
  866. sb.append(this.queryId);
  867. }
  868. first = false;
  869. if (!first) sb.append(", ");
  870. sb.append("queryType:");
  871. if (this.queryType == null) {
  872. sb.append("null");
  873. } else {
  874. sb.append(this.queryType);
  875. }
  876. first = false;
  877. if (!first) sb.append(", ");
  878. sb.append("queryAttributes:");
  879. if (this.queryAttributes == null) {
  880. sb.append("null");
  881. } else {
  882. sb.append(this.queryAttributes);
  883. }
  884. first = false;
  885. if (!first) sb.append(", ");
  886. sb.append("queryCounters:");
  887. if (this.queryCounters == null) {
  888. sb.append("null");
  889. } else {
  890. sb.append(this.queryCounters);
  891. }
  892. first = false;
  893. if (!first) sb.append(", ");
  894. sb.append("stageGraph:");
  895. if (this.stageGraph == null) {
  896. sb.append("null");
  897. } else {
  898. sb.append(this.stageGraph);
  899. }
  900. first = false;
  901. if (!first) sb.append(", ");
  902. sb.append("stageList:");
  903. if (this.stageList == null) {
  904. sb.append("null");
  905. } else {
  906. sb.append(this.stageList);
  907. }
  908. first = false;
  909. if (!first) sb.append(", ");
  910. sb.append("done:");
  911. sb.append(this.done);
  912. first = false;
  913. if (!first) sb.append(", ");
  914. sb.append("started:");
  915. sb.append(this.started);
  916. first = false;
  917. sb.append(")");
  918. return sb.toString();
  919. }
  920. public void validate() throws TException {
  921. // check for required fields
  922. }
  923. }