PageRenderTime 94ms CodeModel.GetById 13ms app.highlight 73ms 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/Query.java

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