PageRenderTime 44ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 967 lines | 813 code | 113 blank | 41 comment | 207 complexity | 51fd178fe440aa4af643569e18c83322 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 Stage implements TBase<Stage, Stage._Fields>, java.io.Serializable, Cloneable {
  27. private static final TStruct STRUCT_DESC = new TStruct("Stage");
  28. private static final TField STAGE_ID_FIELD_DESC = new TField("stageId", TType.STRING, (short)1);
  29. private static final TField STAGE_TYPE_FIELD_DESC = new TField("stageType", TType.I32, (short)2);
  30. private static final TField STAGE_ATTRIBUTES_FIELD_DESC = new TField("stageAttributes", TType.MAP, (short)3);
  31. private static final TField STAGE_COUNTERS_FIELD_DESC = new TField("stageCounters", TType.MAP, (short)4);
  32. private static final TField TASK_LIST_FIELD_DESC = new TField("taskList", TType.LIST, (short)5);
  33. private static final TField DONE_FIELD_DESC = new TField("done", TType.BOOL, (short)6);
  34. private static final TField STARTED_FIELD_DESC = new TField("started", TType.BOOL, (short)7);
  35. private String stageId;
  36. private StageType stageType;
  37. private Map<String,String> stageAttributes;
  38. private Map<String,Long> stageCounters;
  39. private List<Task> taskList;
  40. private boolean done;
  41. private boolean started;
  42. /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  43. public enum _Fields implements TFieldIdEnum {
  44. STAGE_ID((short)1, "stageId"),
  45. /**
  46. *
  47. * @see StageType
  48. */
  49. STAGE_TYPE((short)2, "stageType"),
  50. STAGE_ATTRIBUTES((short)3, "stageAttributes"),
  51. STAGE_COUNTERS((short)4, "stageCounters"),
  52. TASK_LIST((short)5, "taskList"),
  53. DONE((short)6, "done"),
  54. STARTED((short)7, "started");
  55. private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
  56. static {
  57. for (_Fields field : EnumSet.allOf(_Fields.class)) {
  58. byName.put(field.getFieldName(), field);
  59. }
  60. }
  61. /**
  62. * Find the _Fields constant that matches fieldId, or null if its not found.
  63. */
  64. public static _Fields findByThriftId(int fieldId) {
  65. switch(fieldId) {
  66. case 1: // STAGE_ID
  67. return STAGE_ID;
  68. case 2: // STAGE_TYPE
  69. return STAGE_TYPE;
  70. case 3: // STAGE_ATTRIBUTES
  71. return STAGE_ATTRIBUTES;
  72. case 4: // STAGE_COUNTERS
  73. return STAGE_COUNTERS;
  74. case 5: // TASK_LIST
  75. return TASK_LIST;
  76. case 6: // DONE
  77. return DONE;
  78. case 7: // STARTED
  79. return STARTED;
  80. default:
  81. return null;
  82. }
  83. }
  84. /**
  85. * Find the _Fields constant that matches fieldId, throwing an exception
  86. * if it is not found.
  87. */
  88. public static _Fields findByThriftIdOrThrow(int fieldId) {
  89. _Fields fields = findByThriftId(fieldId);
  90. if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
  91. return fields;
  92. }
  93. /**
  94. * Find the _Fields constant that matches name, or null if its not found.
  95. */
  96. public static _Fields findByName(String name) {
  97. return byName.get(name);
  98. }
  99. private final short _thriftId;
  100. private final String _fieldName;
  101. _Fields(short thriftId, String fieldName) {
  102. _thriftId = thriftId;
  103. _fieldName = fieldName;
  104. }
  105. public short getThriftFieldId() {
  106. return _thriftId;
  107. }
  108. public String getFieldName() {
  109. return _fieldName;
  110. }
  111. }
  112. // isset id assignments
  113. private static final int __DONE_ISSET_ID = 0;
  114. private static final int __STARTED_ISSET_ID = 1;
  115. private BitSet __isset_bit_vector = new BitSet(2);
  116. public static final Map<_Fields, FieldMetaData> metaDataMap;
  117. static {
  118. Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class);
  119. tmpMap.put(_Fields.STAGE_ID, new FieldMetaData("stageId", TFieldRequirementType.DEFAULT,
  120. new FieldValueMetaData(TType.STRING)));
  121. tmpMap.put(_Fields.STAGE_TYPE, new FieldMetaData("stageType", TFieldRequirementType.DEFAULT,
  122. new EnumMetaData(TType.ENUM, StageType.class)));
  123. tmpMap.put(_Fields.STAGE_ATTRIBUTES, new FieldMetaData("stageAttributes", TFieldRequirementType.DEFAULT,
  124. new MapMetaData(TType.MAP,
  125. new FieldValueMetaData(TType.STRING),
  126. new FieldValueMetaData(TType.STRING))));
  127. tmpMap.put(_Fields.STAGE_COUNTERS, new FieldMetaData("stageCounters", TFieldRequirementType.DEFAULT,
  128. new MapMetaData(TType.MAP,
  129. new FieldValueMetaData(TType.STRING),
  130. new FieldValueMetaData(TType.I64))));
  131. tmpMap.put(_Fields.TASK_LIST, new FieldMetaData("taskList", TFieldRequirementType.DEFAULT,
  132. new ListMetaData(TType.LIST,
  133. new StructMetaData(TType.STRUCT, Task.class))));
  134. tmpMap.put(_Fields.DONE, new FieldMetaData("done", TFieldRequirementType.DEFAULT,
  135. new FieldValueMetaData(TType.BOOL)));
  136. tmpMap.put(_Fields.STARTED, new FieldMetaData("started", TFieldRequirementType.DEFAULT,
  137. new FieldValueMetaData(TType.BOOL)));
  138. metaDataMap = Collections.unmodifiableMap(tmpMap);
  139. FieldMetaData.addStructMetaDataMap(Stage.class, metaDataMap);
  140. }
  141. public Stage() {
  142. }
  143. public Stage(
  144. String stageId,
  145. StageType stageType,
  146. Map<String,String> stageAttributes,
  147. Map<String,Long> stageCounters,
  148. List<Task> taskList,
  149. boolean done,
  150. boolean started)
  151. {
  152. this();
  153. this.stageId = stageId;
  154. this.stageType = stageType;
  155. this.stageAttributes = stageAttributes;
  156. this.stageCounters = stageCounters;
  157. this.taskList = taskList;
  158. this.done = done;
  159. setDoneIsSet(true);
  160. this.started = started;
  161. setStartedIsSet(true);
  162. }
  163. /**
  164. * Performs a deep copy on <i>other</i>.
  165. */
  166. public Stage(Stage other) {
  167. __isset_bit_vector.clear();
  168. __isset_bit_vector.or(other.__isset_bit_vector);
  169. if (other.isSetStageId()) {
  170. this.stageId = other.stageId;
  171. }
  172. if (other.isSetStageType()) {
  173. this.stageType = other.stageType;
  174. }
  175. if (other.isSetStageAttributes()) {
  176. Map<String,String> __this__stageAttributes = new HashMap<String,String>();
  177. for (Map.Entry<String, String> other_element : other.stageAttributes.entrySet()) {
  178. String other_element_key = other_element.getKey();
  179. String other_element_value = other_element.getValue();
  180. String __this__stageAttributes_copy_key = other_element_key;
  181. String __this__stageAttributes_copy_value = other_element_value;
  182. __this__stageAttributes.put(__this__stageAttributes_copy_key, __this__stageAttributes_copy_value);
  183. }
  184. this.stageAttributes = __this__stageAttributes;
  185. }
  186. if (other.isSetStageCounters()) {
  187. Map<String,Long> __this__stageCounters = new HashMap<String,Long>();
  188. for (Map.Entry<String, Long> other_element : other.stageCounters.entrySet()) {
  189. String other_element_key = other_element.getKey();
  190. Long other_element_value = other_element.getValue();
  191. String __this__stageCounters_copy_key = other_element_key;
  192. Long __this__stageCounters_copy_value = other_element_value;
  193. __this__stageCounters.put(__this__stageCounters_copy_key, __this__stageCounters_copy_value);
  194. }
  195. this.stageCounters = __this__stageCounters;
  196. }
  197. if (other.isSetTaskList()) {
  198. List<Task> __this__taskList = new ArrayList<Task>();
  199. for (Task other_element : other.taskList) {
  200. __this__taskList.add(new Task(other_element));
  201. }
  202. this.taskList = __this__taskList;
  203. }
  204. this.done = other.done;
  205. this.started = other.started;
  206. }
  207. public Stage deepCopy() {
  208. return new Stage(this);
  209. }
  210. @Override
  211. public void clear() {
  212. this.stageId = null;
  213. this.stageType = null;
  214. this.stageAttributes = null;
  215. this.stageCounters = null;
  216. this.taskList = null;
  217. setDoneIsSet(false);
  218. this.done = false;
  219. setStartedIsSet(false);
  220. this.started = false;
  221. }
  222. public String getStageId() {
  223. return this.stageId;
  224. }
  225. public void setStageId(String stageId) {
  226. this.stageId = stageId;
  227. }
  228. public void unsetStageId() {
  229. this.stageId = null;
  230. }
  231. /** Returns true if field stageId is set (has been asigned a value) and false otherwise */
  232. public boolean isSetStageId() {
  233. return this.stageId != null;
  234. }
  235. public void setStageIdIsSet(boolean value) {
  236. if (!value) {
  237. this.stageId = null;
  238. }
  239. }
  240. /**
  241. *
  242. * @see StageType
  243. */
  244. public StageType getStageType() {
  245. return this.stageType;
  246. }
  247. /**
  248. *
  249. * @see StageType
  250. */
  251. public void setStageType(StageType stageType) {
  252. this.stageType = stageType;
  253. }
  254. public void unsetStageType() {
  255. this.stageType = null;
  256. }
  257. /** Returns true if field stageType is set (has been asigned a value) and false otherwise */
  258. public boolean isSetStageType() {
  259. return this.stageType != null;
  260. }
  261. public void setStageTypeIsSet(boolean value) {
  262. if (!value) {
  263. this.stageType = null;
  264. }
  265. }
  266. public int getStageAttributesSize() {
  267. return (this.stageAttributes == null) ? 0 : this.stageAttributes.size();
  268. }
  269. public void putToStageAttributes(String key, String val) {
  270. if (this.stageAttributes == null) {
  271. this.stageAttributes = new HashMap<String,String>();
  272. }
  273. this.stageAttributes.put(key, val);
  274. }
  275. public Map<String,String> getStageAttributes() {
  276. return this.stageAttributes;
  277. }
  278. public void setStageAttributes(Map<String,String> stageAttributes) {
  279. this.stageAttributes = stageAttributes;
  280. }
  281. public void unsetStageAttributes() {
  282. this.stageAttributes = null;
  283. }
  284. /** Returns true if field stageAttributes is set (has been asigned a value) and false otherwise */
  285. public boolean isSetStageAttributes() {
  286. return this.stageAttributes != null;
  287. }
  288. public void setStageAttributesIsSet(boolean value) {
  289. if (!value) {
  290. this.stageAttributes = null;
  291. }
  292. }
  293. public int getStageCountersSize() {
  294. return (this.stageCounters == null) ? 0 : this.stageCounters.size();
  295. }
  296. public void putToStageCounters(String key, long val) {
  297. if (this.stageCounters == null) {
  298. this.stageCounters = new HashMap<String,Long>();
  299. }
  300. this.stageCounters.put(key, val);
  301. }
  302. public Map<String,Long> getStageCounters() {
  303. return this.stageCounters;
  304. }
  305. public void setStageCounters(Map<String,Long> stageCounters) {
  306. this.stageCounters = stageCounters;
  307. }
  308. public void unsetStageCounters() {
  309. this.stageCounters = null;
  310. }
  311. /** Returns true if field stageCounters is set (has been asigned a value) and false otherwise */
  312. public boolean isSetStageCounters() {
  313. return this.stageCounters != null;
  314. }
  315. public void setStageCountersIsSet(boolean value) {
  316. if (!value) {
  317. this.stageCounters = null;
  318. }
  319. }
  320. public int getTaskListSize() {
  321. return (this.taskList == null) ? 0 : this.taskList.size();
  322. }
  323. public java.util.Iterator<Task> getTaskListIterator() {
  324. return (this.taskList == null) ? null : this.taskList.iterator();
  325. }
  326. public void addToTaskList(Task elem) {
  327. if (this.taskList == null) {
  328. this.taskList = new ArrayList<Task>();
  329. }
  330. this.taskList.add(elem);
  331. }
  332. public List<Task> getTaskList() {
  333. return this.taskList;
  334. }
  335. public void setTaskList(List<Task> taskList) {
  336. this.taskList = taskList;
  337. }
  338. public void unsetTaskList() {
  339. this.taskList = null;
  340. }
  341. /** Returns true if field taskList is set (has been asigned a value) and false otherwise */
  342. public boolean isSetTaskList() {
  343. return this.taskList != null;
  344. }
  345. public void setTaskListIsSet(boolean value) {
  346. if (!value) {
  347. this.taskList = null;
  348. }
  349. }
  350. public boolean isDone() {
  351. return this.done;
  352. }
  353. public void setDone(boolean done) {
  354. this.done = done;
  355. setDoneIsSet(true);
  356. }
  357. public void unsetDone() {
  358. __isset_bit_vector.clear(__DONE_ISSET_ID);
  359. }
  360. /** Returns true if field done is set (has been asigned a value) and false otherwise */
  361. public boolean isSetDone() {
  362. return __isset_bit_vector.get(__DONE_ISSET_ID);
  363. }
  364. public void setDoneIsSet(boolean value) {
  365. __isset_bit_vector.set(__DONE_ISSET_ID, value);
  366. }
  367. public boolean isStarted() {
  368. return this.started;
  369. }
  370. public void setStarted(boolean started) {
  371. this.started = started;
  372. setStartedIsSet(true);
  373. }
  374. public void unsetStarted() {
  375. __isset_bit_vector.clear(__STARTED_ISSET_ID);
  376. }
  377. /** Returns true if field started is set (has been asigned a value) and false otherwise */
  378. public boolean isSetStarted() {
  379. return __isset_bit_vector.get(__STARTED_ISSET_ID);
  380. }
  381. public void setStartedIsSet(boolean value) {
  382. __isset_bit_vector.set(__STARTED_ISSET_ID, value);
  383. }
  384. public void setFieldValue(_Fields field, Object value) {
  385. switch (field) {
  386. case STAGE_ID:
  387. if (value == null) {
  388. unsetStageId();
  389. } else {
  390. setStageId((String)value);
  391. }
  392. break;
  393. case STAGE_TYPE:
  394. if (value == null) {
  395. unsetStageType();
  396. } else {
  397. setStageType((StageType)value);
  398. }
  399. break;
  400. case STAGE_ATTRIBUTES:
  401. if (value == null) {
  402. unsetStageAttributes();
  403. } else {
  404. setStageAttributes((Map<String,String>)value);
  405. }
  406. break;
  407. case STAGE_COUNTERS:
  408. if (value == null) {
  409. unsetStageCounters();
  410. } else {
  411. setStageCounters((Map<String,Long>)value);
  412. }
  413. break;
  414. case TASK_LIST:
  415. if (value == null) {
  416. unsetTaskList();
  417. } else {
  418. setTaskList((List<Task>)value);
  419. }
  420. break;
  421. case DONE:
  422. if (value == null) {
  423. unsetDone();
  424. } else {
  425. setDone((Boolean)value);
  426. }
  427. break;
  428. case STARTED:
  429. if (value == null) {
  430. unsetStarted();
  431. } else {
  432. setStarted((Boolean)value);
  433. }
  434. break;
  435. }
  436. }
  437. public Object getFieldValue(_Fields field) {
  438. switch (field) {
  439. case STAGE_ID:
  440. return getStageId();
  441. case STAGE_TYPE:
  442. return getStageType();
  443. case STAGE_ATTRIBUTES:
  444. return getStageAttributes();
  445. case STAGE_COUNTERS:
  446. return getStageCounters();
  447. case TASK_LIST:
  448. return getTaskList();
  449. case DONE:
  450. return new Boolean(isDone());
  451. case STARTED:
  452. return new Boolean(isStarted());
  453. }
  454. throw new IllegalStateException();
  455. }
  456. /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */
  457. public boolean isSet(_Fields field) {
  458. if (field == null) {
  459. throw new IllegalArgumentException();
  460. }
  461. switch (field) {
  462. case STAGE_ID:
  463. return isSetStageId();
  464. case STAGE_TYPE:
  465. return isSetStageType();
  466. case STAGE_ATTRIBUTES:
  467. return isSetStageAttributes();
  468. case STAGE_COUNTERS:
  469. return isSetStageCounters();
  470. case TASK_LIST:
  471. return isSetTaskList();
  472. case DONE:
  473. return isSetDone();
  474. case STARTED:
  475. return isSetStarted();
  476. }
  477. throw new IllegalStateException();
  478. }
  479. @Override
  480. public boolean equals(Object that) {
  481. if (that == null)
  482. return false;
  483. if (that instanceof Stage)
  484. return this.equals((Stage)that);
  485. return false;
  486. }
  487. public boolean equals(Stage that) {
  488. if (that == null)
  489. return false;
  490. boolean this_present_stageId = true && this.isSetStageId();
  491. boolean that_present_stageId = true && that.isSetStageId();
  492. if (this_present_stageId || that_present_stageId) {
  493. if (!(this_present_stageId && that_present_stageId))
  494. return false;
  495. if (!this.stageId.equals(that.stageId))
  496. return false;
  497. }
  498. boolean this_present_stageType = true && this.isSetStageType();
  499. boolean that_present_stageType = true && that.isSetStageType();
  500. if (this_present_stageType || that_present_stageType) {
  501. if (!(this_present_stageType && that_present_stageType))
  502. return false;
  503. if (!this.stageType.equals(that.stageType))
  504. return false;
  505. }
  506. boolean this_present_stageAttributes = true && this.isSetStageAttributes();
  507. boolean that_present_stageAttributes = true && that.isSetStageAttributes();
  508. if (this_present_stageAttributes || that_present_stageAttributes) {
  509. if (!(this_present_stageAttributes && that_present_stageAttributes))
  510. return false;
  511. if (!this.stageAttributes.equals(that.stageAttributes))
  512. return false;
  513. }
  514. boolean this_present_stageCounters = true && this.isSetStageCounters();
  515. boolean that_present_stageCounters = true && that.isSetStageCounters();
  516. if (this_present_stageCounters || that_present_stageCounters) {
  517. if (!(this_present_stageCounters && that_present_stageCounters))
  518. return false;
  519. if (!this.stageCounters.equals(that.stageCounters))
  520. return false;
  521. }
  522. boolean this_present_taskList = true && this.isSetTaskList();
  523. boolean that_present_taskList = true && that.isSetTaskList();
  524. if (this_present_taskList || that_present_taskList) {
  525. if (!(this_present_taskList && that_present_taskList))
  526. return false;
  527. if (!this.taskList.equals(that.taskList))
  528. return false;
  529. }
  530. boolean this_present_done = true;
  531. boolean that_present_done = true;
  532. if (this_present_done || that_present_done) {
  533. if (!(this_present_done && that_present_done))
  534. return false;
  535. if (this.done != that.done)
  536. return false;
  537. }
  538. boolean this_present_started = true;
  539. boolean that_present_started = true;
  540. if (this_present_started || that_present_started) {
  541. if (!(this_present_started && that_present_started))
  542. return false;
  543. if (this.started != that.started)
  544. return false;
  545. }
  546. return true;
  547. }
  548. @Override
  549. public int hashCode() {
  550. return 0;
  551. }
  552. public int compareTo(Stage other) {
  553. if (!getClass().equals(other.getClass())) {
  554. return getClass().getName().compareTo(other.getClass().getName());
  555. }
  556. int lastComparison = 0;
  557. Stage typedOther = (Stage)other;
  558. lastComparison = Boolean.valueOf(isSetStageId()).compareTo(typedOther.isSetStageId());
  559. if (lastComparison != 0) {
  560. return lastComparison;
  561. }
  562. if (isSetStageId()) {
  563. lastComparison = TBaseHelper.compareTo(this.stageId, typedOther.stageId);
  564. if (lastComparison != 0) {
  565. return lastComparison;
  566. }
  567. }
  568. lastComparison = Boolean.valueOf(isSetStageType()).compareTo(typedOther.isSetStageType());
  569. if (lastComparison != 0) {
  570. return lastComparison;
  571. }
  572. if (isSetStageType()) {
  573. lastComparison = TBaseHelper.compareTo(this.stageType, typedOther.stageType);
  574. if (lastComparison != 0) {
  575. return lastComparison;
  576. }
  577. }
  578. lastComparison = Boolean.valueOf(isSetStageAttributes()).compareTo(typedOther.isSetStageAttributes());
  579. if (lastComparison != 0) {
  580. return lastComparison;
  581. }
  582. if (isSetStageAttributes()) {
  583. lastComparison = TBaseHelper.compareTo(this.stageAttributes, typedOther.stageAttributes);
  584. if (lastComparison != 0) {
  585. return lastComparison;
  586. }
  587. }
  588. lastComparison = Boolean.valueOf(isSetStageCounters()).compareTo(typedOther.isSetStageCounters());
  589. if (lastComparison != 0) {
  590. return lastComparison;
  591. }
  592. if (isSetStageCounters()) {
  593. lastComparison = TBaseHelper.compareTo(this.stageCounters, typedOther.stageCounters);
  594. if (lastComparison != 0) {
  595. return lastComparison;
  596. }
  597. }
  598. lastComparison = Boolean.valueOf(isSetTaskList()).compareTo(typedOther.isSetTaskList());
  599. if (lastComparison != 0) {
  600. return lastComparison;
  601. }
  602. if (isSetTaskList()) {
  603. lastComparison = TBaseHelper.compareTo(this.taskList, typedOther.taskList);
  604. if (lastComparison != 0) {
  605. return lastComparison;
  606. }
  607. }
  608. lastComparison = Boolean.valueOf(isSetDone()).compareTo(typedOther.isSetDone());
  609. if (lastComparison != 0) {
  610. return lastComparison;
  611. }
  612. if (isSetDone()) {
  613. lastComparison = TBaseHelper.compareTo(this.done, typedOther.done);
  614. if (lastComparison != 0) {
  615. return lastComparison;
  616. }
  617. }
  618. lastComparison = Boolean.valueOf(isSetStarted()).compareTo(typedOther.isSetStarted());
  619. if (lastComparison != 0) {
  620. return lastComparison;
  621. }
  622. if (isSetStarted()) {
  623. lastComparison = TBaseHelper.compareTo(this.started, typedOther.started);
  624. if (lastComparison != 0) {
  625. return lastComparison;
  626. }
  627. }
  628. return 0;
  629. }
  630. public _Fields fieldForId(int fieldId) {
  631. return _Fields.findByThriftId(fieldId);
  632. }
  633. public void read(TProtocol iprot) throws TException {
  634. TField field;
  635. iprot.readStructBegin();
  636. while (true)
  637. {
  638. field = iprot.readFieldBegin();
  639. if (field.type == TType.STOP) {
  640. break;
  641. }
  642. switch (field.id) {
  643. case 1: // STAGE_ID
  644. if (field.type == TType.STRING) {
  645. this.stageId = iprot.readString();
  646. } else {
  647. TProtocolUtil.skip(iprot, field.type);
  648. }
  649. break;
  650. case 2: // STAGE_TYPE
  651. if (field.type == TType.I32) {
  652. this.stageType = StageType.findByValue(iprot.readI32());
  653. } else {
  654. TProtocolUtil.skip(iprot, field.type);
  655. }
  656. break;
  657. case 3: // STAGE_ATTRIBUTES
  658. if (field.type == TType.MAP) {
  659. {
  660. TMap _map36 = iprot.readMapBegin();
  661. this.stageAttributes = new HashMap<String,String>(2*_map36.size);
  662. for (int _i37 = 0; _i37 < _map36.size; ++_i37)
  663. {
  664. String _key38;
  665. String _val39;
  666. _key38 = iprot.readString();
  667. _val39 = iprot.readString();
  668. this.stageAttributes.put(_key38, _val39);
  669. }
  670. iprot.readMapEnd();
  671. }
  672. } else {
  673. TProtocolUtil.skip(iprot, field.type);
  674. }
  675. break;
  676. case 4: // STAGE_COUNTERS
  677. if (field.type == TType.MAP) {
  678. {
  679. TMap _map40 = iprot.readMapBegin();
  680. this.stageCounters = new HashMap<String,Long>(2*_map40.size);
  681. for (int _i41 = 0; _i41 < _map40.size; ++_i41)
  682. {
  683. String _key42;
  684. long _val43;
  685. _key42 = iprot.readString();
  686. _val43 = iprot.readI64();
  687. this.stageCounters.put(_key42, _val43);
  688. }
  689. iprot.readMapEnd();
  690. }
  691. } else {
  692. TProtocolUtil.skip(iprot, field.type);
  693. }
  694. break;
  695. case 5: // TASK_LIST
  696. if (field.type == TType.LIST) {
  697. {
  698. TList _list44 = iprot.readListBegin();
  699. this.taskList = new ArrayList<Task>(_list44.size);
  700. for (int _i45 = 0; _i45 < _list44.size; ++_i45)
  701. {
  702. Task _elem46;
  703. _elem46 = new Task();
  704. _elem46.read(iprot);
  705. this.taskList.add(_elem46);
  706. }
  707. iprot.readListEnd();
  708. }
  709. } else {
  710. TProtocolUtil.skip(iprot, field.type);
  711. }
  712. break;
  713. case 6: // DONE
  714. if (field.type == TType.BOOL) {
  715. this.done = iprot.readBool();
  716. setDoneIsSet(true);
  717. } else {
  718. TProtocolUtil.skip(iprot, field.type);
  719. }
  720. break;
  721. case 7: // STARTED
  722. if (field.type == TType.BOOL) {
  723. this.started = iprot.readBool();
  724. setStartedIsSet(true);
  725. } else {
  726. TProtocolUtil.skip(iprot, field.type);
  727. }
  728. break;
  729. default:
  730. TProtocolUtil.skip(iprot, field.type);
  731. }
  732. iprot.readFieldEnd();
  733. }
  734. iprot.readStructEnd();
  735. validate();
  736. }
  737. public void write(TProtocol oprot) throws TException {
  738. validate();
  739. oprot.writeStructBegin(STRUCT_DESC);
  740. if (this.stageId != null) {
  741. oprot.writeFieldBegin(STAGE_ID_FIELD_DESC);
  742. oprot.writeString(this.stageId);
  743. oprot.writeFieldEnd();
  744. }
  745. if (this.stageType != null) {
  746. oprot.writeFieldBegin(STAGE_TYPE_FIELD_DESC);
  747. oprot.writeI32(this.stageType.getValue());
  748. oprot.writeFieldEnd();
  749. }
  750. if (this.stageAttributes != null) {
  751. oprot.writeFieldBegin(STAGE_ATTRIBUTES_FIELD_DESC);
  752. {
  753. oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.stageAttributes.size()));
  754. for (Map.Entry<String, String> _iter47 : this.stageAttributes.entrySet())
  755. {
  756. oprot.writeString(_iter47.getKey());
  757. oprot.writeString(_iter47.getValue());
  758. }
  759. oprot.writeMapEnd();
  760. }
  761. oprot.writeFieldEnd();
  762. }
  763. if (this.stageCounters != null) {
  764. oprot.writeFieldBegin(STAGE_COUNTERS_FIELD_DESC);
  765. {
  766. oprot.writeMapBegin(new TMap(TType.STRING, TType.I64, this.stageCounters.size()));
  767. for (Map.Entry<String, Long> _iter48 : this.stageCounters.entrySet())
  768. {
  769. oprot.writeString(_iter48.getKey());
  770. oprot.writeI64(_iter48.getValue());
  771. }
  772. oprot.writeMapEnd();
  773. }
  774. oprot.writeFieldEnd();
  775. }
  776. if (this.taskList != null) {
  777. oprot.writeFieldBegin(TASK_LIST_FIELD_DESC);
  778. {
  779. oprot.writeListBegin(new TList(TType.STRUCT, this.taskList.size()));
  780. for (Task _iter49 : this.taskList)
  781. {
  782. _iter49.write(oprot);
  783. }
  784. oprot.writeListEnd();
  785. }
  786. oprot.writeFieldEnd();
  787. }
  788. oprot.writeFieldBegin(DONE_FIELD_DESC);
  789. oprot.writeBool(this.done);
  790. oprot.writeFieldEnd();
  791. oprot.writeFieldBegin(STARTED_FIELD_DESC);
  792. oprot.writeBool(this.started);
  793. oprot.writeFieldEnd();
  794. oprot.writeFieldStop();
  795. oprot.writeStructEnd();
  796. }
  797. @Override
  798. public String toString() {
  799. StringBuilder sb = new StringBuilder("Stage(");
  800. boolean first = true;
  801. sb.append("stageId:");
  802. if (this.stageId == null) {
  803. sb.append("null");
  804. } else {
  805. sb.append(this.stageId);
  806. }
  807. first = false;
  808. if (!first) sb.append(", ");
  809. sb.append("stageType:");
  810. if (this.stageType == null) {
  811. sb.append("null");
  812. } else {
  813. sb.append(this.stageType);
  814. }
  815. first = false;
  816. if (!first) sb.append(", ");
  817. sb.append("stageAttributes:");
  818. if (this.stageAttributes == null) {
  819. sb.append("null");
  820. } else {
  821. sb.append(this.stageAttributes);
  822. }
  823. first = false;
  824. if (!first) sb.append(", ");
  825. sb.append("stageCounters:");
  826. if (this.stageCounters == null) {
  827. sb.append("null");
  828. } else {
  829. sb.append(this.stageCounters);
  830. }
  831. first = false;
  832. if (!first) sb.append(", ");
  833. sb.append("taskList:");
  834. if (this.taskList == null) {
  835. sb.append("null");
  836. } else {
  837. sb.append(this.taskList);
  838. }
  839. first = false;
  840. if (!first) sb.append(", ");
  841. sb.append("done:");
  842. sb.append(this.done);
  843. first = false;
  844. if (!first) sb.append(", ");
  845. sb.append("started:");
  846. sb.append(this.started);
  847. first = false;
  848. sb.append(")");
  849. return sb.toString();
  850. }
  851. public void validate() throws TException {
  852. // check for required fields
  853. }
  854. }