PageRenderTime 87ms CodeModel.GetById 11ms app.highlight 69ms RepoModel.GetById 1ms app.codeStats 1ms

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