Return-Path: Delivered-To: apmail-hive-commits-archive@www.apache.org Received: (qmail 56247 invoked from network); 9 Dec 2010 18:32:24 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Dec 2010 18:32:24 -0000 Received: (qmail 47408 invoked by uid 500); 9 Dec 2010 18:32:23 -0000 Delivered-To: apmail-hive-commits-archive@hive.apache.org Received: (qmail 47370 invoked by uid 500); 9 Dec 2010 18:32:23 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 47281 invoked by uid 99); 9 Dec 2010 18:32:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 18:32:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Dec 2010 18:32:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E0C322388C3E; Thu, 9 Dec 2010 18:31:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1044070 [18/29] - in /hive/trunk: ./ eclipse-templates/ ivy/ lib/ metastore/ metastore/if/ metastore/src/gen-cpp/ metastore/src/gen-javabean/org/apache/hadoop/hive/metastore/api/ metastore/src/gen-php/ metastore/src/gen-py/hive_metastore/ ... Date: Thu, 09 Dec 2010 18:31:09 -0000 To: commits@hive.apache.org From: nzhang@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101209183113.E0C322388C3E@eris.apache.org> Added: hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Graph.java URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Graph.java?rev=1044070&view=auto ============================================================================== --- hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Graph.java (added) +++ hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Graph.java Thu Dec 9 18:30:58 2010 @@ -0,0 +1,569 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.ql.plan.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.thrift.*; +import org.apache.thrift.async.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.transport.*; +import org.apache.thrift.protocol.*; + +public class Graph implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("Graph"); + + private static final TField NODE_TYPE_FIELD_DESC = new TField("nodeType", TType.I32, (short)1); + private static final TField ROOTS_FIELD_DESC = new TField("roots", TType.LIST, (short)2); + private static final TField ADJACENCY_LIST_FIELD_DESC = new TField("adjacencyList", TType.LIST, (short)3); + + private NodeType nodeType; + private List roots; + private List adjacencyList; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + /** + * + * @see NodeType + */ + NODE_TYPE((short)1, "nodeType"), + ROOTS((short)2, "roots"), + ADJACENCY_LIST((short)3, "adjacencyList"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NODE_TYPE + return NODE_TYPE; + case 2: // ROOTS + return ROOTS; + case 3: // ADJACENCY_LIST + return ADJACENCY_LIST; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NODE_TYPE, new FieldMetaData("nodeType", TFieldRequirementType.DEFAULT, + new EnumMetaData(TType.ENUM, NodeType.class))); + tmpMap.put(_Fields.ROOTS, new FieldMetaData("roots", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new FieldValueMetaData(TType.STRING)))); + tmpMap.put(_Fields.ADJACENCY_LIST, new FieldMetaData("adjacencyList", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Adjacency.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(Graph.class, metaDataMap); + } + + public Graph() { + } + + public Graph( + NodeType nodeType, + List roots, + List adjacencyList) + { + this(); + this.nodeType = nodeType; + this.roots = roots; + this.adjacencyList = adjacencyList; + } + + /** + * Performs a deep copy on other. + */ + public Graph(Graph other) { + if (other.isSetNodeType()) { + this.nodeType = other.nodeType; + } + if (other.isSetRoots()) { + List __this__roots = new ArrayList(); + for (String other_element : other.roots) { + __this__roots.add(other_element); + } + this.roots = __this__roots; + } + if (other.isSetAdjacencyList()) { + List __this__adjacencyList = new ArrayList(); + for (Adjacency other_element : other.adjacencyList) { + __this__adjacencyList.add(new Adjacency(other_element)); + } + this.adjacencyList = __this__adjacencyList; + } + } + + public Graph deepCopy() { + return new Graph(this); + } + + @Override + public void clear() { + this.nodeType = null; + this.roots = null; + this.adjacencyList = null; + } + + /** + * + * @see NodeType + */ + public NodeType getNodeType() { + return this.nodeType; + } + + /** + * + * @see NodeType + */ + public void setNodeType(NodeType nodeType) { + this.nodeType = nodeType; + } + + public void unsetNodeType() { + this.nodeType = null; + } + + /** Returns true if field nodeType is set (has been asigned a value) and false otherwise */ + public boolean isSetNodeType() { + return this.nodeType != null; + } + + public void setNodeTypeIsSet(boolean value) { + if (!value) { + this.nodeType = null; + } + } + + public int getRootsSize() { + return (this.roots == null) ? 0 : this.roots.size(); + } + + public java.util.Iterator getRootsIterator() { + return (this.roots == null) ? null : this.roots.iterator(); + } + + public void addToRoots(String elem) { + if (this.roots == null) { + this.roots = new ArrayList(); + } + this.roots.add(elem); + } + + public List getRoots() { + return this.roots; + } + + public void setRoots(List roots) { + this.roots = roots; + } + + public void unsetRoots() { + this.roots = null; + } + + /** Returns true if field roots is set (has been asigned a value) and false otherwise */ + public boolean isSetRoots() { + return this.roots != null; + } + + public void setRootsIsSet(boolean value) { + if (!value) { + this.roots = null; + } + } + + public int getAdjacencyListSize() { + return (this.adjacencyList == null) ? 0 : this.adjacencyList.size(); + } + + public java.util.Iterator getAdjacencyListIterator() { + return (this.adjacencyList == null) ? null : this.adjacencyList.iterator(); + } + + public void addToAdjacencyList(Adjacency elem) { + if (this.adjacencyList == null) { + this.adjacencyList = new ArrayList(); + } + this.adjacencyList.add(elem); + } + + public List getAdjacencyList() { + return this.adjacencyList; + } + + public void setAdjacencyList(List adjacencyList) { + this.adjacencyList = adjacencyList; + } + + public void unsetAdjacencyList() { + this.adjacencyList = null; + } + + /** Returns true if field adjacencyList is set (has been asigned a value) and false otherwise */ + public boolean isSetAdjacencyList() { + return this.adjacencyList != null; + } + + public void setAdjacencyListIsSet(boolean value) { + if (!value) { + this.adjacencyList = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NODE_TYPE: + if (value == null) { + unsetNodeType(); + } else { + setNodeType((NodeType)value); + } + break; + + case ROOTS: + if (value == null) { + unsetRoots(); + } else { + setRoots((List)value); + } + break; + + case ADJACENCY_LIST: + if (value == null) { + unsetAdjacencyList(); + } else { + setAdjacencyList((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NODE_TYPE: + return getNodeType(); + + case ROOTS: + return getRoots(); + + case ADJACENCY_LIST: + return getAdjacencyList(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NODE_TYPE: + return isSetNodeType(); + case ROOTS: + return isSetRoots(); + case ADJACENCY_LIST: + return isSetAdjacencyList(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Graph) + return this.equals((Graph)that); + return false; + } + + public boolean equals(Graph that) { + if (that == null) + return false; + + boolean this_present_nodeType = true && this.isSetNodeType(); + boolean that_present_nodeType = true && that.isSetNodeType(); + if (this_present_nodeType || that_present_nodeType) { + if (!(this_present_nodeType && that_present_nodeType)) + return false; + if (!this.nodeType.equals(that.nodeType)) + return false; + } + + boolean this_present_roots = true && this.isSetRoots(); + boolean that_present_roots = true && that.isSetRoots(); + if (this_present_roots || that_present_roots) { + if (!(this_present_roots && that_present_roots)) + return false; + if (!this.roots.equals(that.roots)) + return false; + } + + boolean this_present_adjacencyList = true && this.isSetAdjacencyList(); + boolean that_present_adjacencyList = true && that.isSetAdjacencyList(); + if (this_present_adjacencyList || that_present_adjacencyList) { + if (!(this_present_adjacencyList && that_present_adjacencyList)) + return false; + if (!this.adjacencyList.equals(that.adjacencyList)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(Graph other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Graph typedOther = (Graph)other; + + lastComparison = Boolean.valueOf(isSetNodeType()).compareTo(typedOther.isSetNodeType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNodeType()) { + lastComparison = TBaseHelper.compareTo(this.nodeType, typedOther.nodeType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRoots()).compareTo(typedOther.isSetRoots()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRoots()) { + lastComparison = TBaseHelper.compareTo(this.roots, typedOther.roots); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAdjacencyList()).compareTo(typedOther.isSetAdjacencyList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAdjacencyList()) { + lastComparison = TBaseHelper.compareTo(this.adjacencyList, typedOther.adjacencyList); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // NODE_TYPE + if (field.type == TType.I32) { + this.nodeType = NodeType.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // ROOTS + if (field.type == TType.LIST) { + { + TList _list4 = iprot.readListBegin(); + this.roots = new ArrayList(_list4.size); + for (int _i5 = 0; _i5 < _list4.size; ++_i5) + { + String _elem6; + _elem6 = iprot.readString(); + this.roots.add(_elem6); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // ADJACENCY_LIST + if (field.type == TType.LIST) { + { + TList _list7 = iprot.readListBegin(); + this.adjacencyList = new ArrayList(_list7.size); + for (int _i8 = 0; _i8 < _list7.size; ++_i8) + { + Adjacency _elem9; + _elem9 = new Adjacency(); + _elem9.read(iprot); + this.adjacencyList.add(_elem9); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.nodeType != null) { + oprot.writeFieldBegin(NODE_TYPE_FIELD_DESC); + oprot.writeI32(this.nodeType.getValue()); + oprot.writeFieldEnd(); + } + if (this.roots != null) { + oprot.writeFieldBegin(ROOTS_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRING, this.roots.size())); + for (String _iter10 : this.roots) + { + oprot.writeString(_iter10); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (this.adjacencyList != null) { + oprot.writeFieldBegin(ADJACENCY_LIST_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.adjacencyList.size())); + for (Adjacency _iter11 : this.adjacencyList) + { + _iter11.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Graph("); + boolean first = true; + + sb.append("nodeType:"); + if (this.nodeType == null) { + sb.append("null"); + } else { + sb.append(this.nodeType); + } + first = false; + if (!first) sb.append(", "); + sb.append("roots:"); + if (this.roots == null) { + sb.append("null"); + } else { + sb.append(this.roots); + } + first = false; + if (!first) sb.append(", "); + sb.append("adjacencyList:"); + if (this.adjacencyList == null) { + sb.append("null"); + } else { + sb.append(this.adjacencyList); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + Added: hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/NodeType.java URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/NodeType.java?rev=1044070&view=auto ============================================================================== --- hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/NodeType.java (added) +++ hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/NodeType.java Thu Dec 9 18:30:58 2010 @@ -0,0 +1,44 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.ql.plan.api; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum NodeType implements TEnum { + OPERATOR(0), + STAGE(1); + + private final int value; + + private NodeType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static NodeType findByValue(int value) { + switch (value) { + case 0: + return OPERATOR; + case 1: + return STAGE; + default: + return null; + } + } +} Added: hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java?rev=1044070&view=auto ============================================================================== --- hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java (added) +++ hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Operator.java Thu Dec 9 18:30:58 2010 @@ -0,0 +1,841 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.ql.plan.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.thrift.*; +import org.apache.thrift.async.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.transport.*; +import org.apache.thrift.protocol.*; + +public class Operator implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("Operator"); + + private static final TField OPERATOR_ID_FIELD_DESC = new TField("operatorId", TType.STRING, (short)1); + private static final TField OPERATOR_TYPE_FIELD_DESC = new TField("operatorType", TType.I32, (short)2); + private static final TField OPERATOR_ATTRIBUTES_FIELD_DESC = new TField("operatorAttributes", TType.MAP, (short)3); + private static final TField OPERATOR_COUNTERS_FIELD_DESC = new TField("operatorCounters", TType.MAP, (short)4); + private static final TField DONE_FIELD_DESC = new TField("done", TType.BOOL, (short)5); + private static final TField STARTED_FIELD_DESC = new TField("started", TType.BOOL, (short)6); + + private String operatorId; + private OperatorType operatorType; + private Map operatorAttributes; + private Map operatorCounters; + private boolean done; + private boolean started; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + OPERATOR_ID((short)1, "operatorId"), + /** + * + * @see OperatorType + */ + OPERATOR_TYPE((short)2, "operatorType"), + OPERATOR_ATTRIBUTES((short)3, "operatorAttributes"), + OPERATOR_COUNTERS((short)4, "operatorCounters"), + DONE((short)5, "done"), + STARTED((short)6, "started"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // OPERATOR_ID + return OPERATOR_ID; + case 2: // OPERATOR_TYPE + return OPERATOR_TYPE; + case 3: // OPERATOR_ATTRIBUTES + return OPERATOR_ATTRIBUTES; + case 4: // OPERATOR_COUNTERS + return OPERATOR_COUNTERS; + case 5: // DONE + return DONE; + case 6: // STARTED + return STARTED; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __DONE_ISSET_ID = 0; + private static final int __STARTED_ISSET_ID = 1; + private BitSet __isset_bit_vector = new BitSet(2); + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.OPERATOR_ID, new FieldMetaData("operatorId", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.OPERATOR_TYPE, new FieldMetaData("operatorType", TFieldRequirementType.DEFAULT, + new EnumMetaData(TType.ENUM, OperatorType.class))); + tmpMap.put(_Fields.OPERATOR_ATTRIBUTES, new FieldMetaData("operatorAttributes", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + tmpMap.put(_Fields.OPERATOR_COUNTERS, new FieldMetaData("operatorCounters", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.I64)))); + tmpMap.put(_Fields.DONE, new FieldMetaData("done", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.STARTED, new FieldMetaData("started", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(Operator.class, metaDataMap); + } + + public Operator() { + } + + public Operator( + String operatorId, + OperatorType operatorType, + Map operatorAttributes, + Map operatorCounters, + boolean done, + boolean started) + { + this(); + this.operatorId = operatorId; + this.operatorType = operatorType; + this.operatorAttributes = operatorAttributes; + this.operatorCounters = operatorCounters; + this.done = done; + setDoneIsSet(true); + this.started = started; + setStartedIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public Operator(Operator other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetOperatorId()) { + this.operatorId = other.operatorId; + } + if (other.isSetOperatorType()) { + this.operatorType = other.operatorType; + } + if (other.isSetOperatorAttributes()) { + Map __this__operatorAttributes = new HashMap(); + for (Map.Entry other_element : other.operatorAttributes.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__operatorAttributes_copy_key = other_element_key; + + String __this__operatorAttributes_copy_value = other_element_value; + + __this__operatorAttributes.put(__this__operatorAttributes_copy_key, __this__operatorAttributes_copy_value); + } + this.operatorAttributes = __this__operatorAttributes; + } + if (other.isSetOperatorCounters()) { + Map __this__operatorCounters = new HashMap(); + for (Map.Entry other_element : other.operatorCounters.entrySet()) { + + String other_element_key = other_element.getKey(); + Long other_element_value = other_element.getValue(); + + String __this__operatorCounters_copy_key = other_element_key; + + Long __this__operatorCounters_copy_value = other_element_value; + + __this__operatorCounters.put(__this__operatorCounters_copy_key, __this__operatorCounters_copy_value); + } + this.operatorCounters = __this__operatorCounters; + } + this.done = other.done; + this.started = other.started; + } + + public Operator deepCopy() { + return new Operator(this); + } + + @Override + public void clear() { + this.operatorId = null; + this.operatorType = null; + this.operatorAttributes = null; + this.operatorCounters = null; + setDoneIsSet(false); + this.done = false; + setStartedIsSet(false); + this.started = false; + } + + public String getOperatorId() { + return this.operatorId; + } + + public void setOperatorId(String operatorId) { + this.operatorId = operatorId; + } + + public void unsetOperatorId() { + this.operatorId = null; + } + + /** Returns true if field operatorId is set (has been asigned a value) and false otherwise */ + public boolean isSetOperatorId() { + return this.operatorId != null; + } + + public void setOperatorIdIsSet(boolean value) { + if (!value) { + this.operatorId = null; + } + } + + /** + * + * @see OperatorType + */ + public OperatorType getOperatorType() { + return this.operatorType; + } + + /** + * + * @see OperatorType + */ + public void setOperatorType(OperatorType operatorType) { + this.operatorType = operatorType; + } + + public void unsetOperatorType() { + this.operatorType = null; + } + + /** Returns true if field operatorType is set (has been asigned a value) and false otherwise */ + public boolean isSetOperatorType() { + return this.operatorType != null; + } + + public void setOperatorTypeIsSet(boolean value) { + if (!value) { + this.operatorType = null; + } + } + + public int getOperatorAttributesSize() { + return (this.operatorAttributes == null) ? 0 : this.operatorAttributes.size(); + } + + public void putToOperatorAttributes(String key, String val) { + if (this.operatorAttributes == null) { + this.operatorAttributes = new HashMap(); + } + this.operatorAttributes.put(key, val); + } + + public Map getOperatorAttributes() { + return this.operatorAttributes; + } + + public void setOperatorAttributes(Map operatorAttributes) { + this.operatorAttributes = operatorAttributes; + } + + public void unsetOperatorAttributes() { + this.operatorAttributes = null; + } + + /** Returns true if field operatorAttributes is set (has been asigned a value) and false otherwise */ + public boolean isSetOperatorAttributes() { + return this.operatorAttributes != null; + } + + public void setOperatorAttributesIsSet(boolean value) { + if (!value) { + this.operatorAttributes = null; + } + } + + public int getOperatorCountersSize() { + return (this.operatorCounters == null) ? 0 : this.operatorCounters.size(); + } + + public void putToOperatorCounters(String key, long val) { + if (this.operatorCounters == null) { + this.operatorCounters = new HashMap(); + } + this.operatorCounters.put(key, val); + } + + public Map getOperatorCounters() { + return this.operatorCounters; + } + + public void setOperatorCounters(Map operatorCounters) { + this.operatorCounters = operatorCounters; + } + + public void unsetOperatorCounters() { + this.operatorCounters = null; + } + + /** Returns true if field operatorCounters is set (has been asigned a value) and false otherwise */ + public boolean isSetOperatorCounters() { + return this.operatorCounters != null; + } + + public void setOperatorCountersIsSet(boolean value) { + if (!value) { + this.operatorCounters = null; + } + } + + public boolean isDone() { + return this.done; + } + + public void setDone(boolean done) { + this.done = done; + setDoneIsSet(true); + } + + public void unsetDone() { + __isset_bit_vector.clear(__DONE_ISSET_ID); + } + + /** Returns true if field done is set (has been asigned a value) and false otherwise */ + public boolean isSetDone() { + return __isset_bit_vector.get(__DONE_ISSET_ID); + } + + public void setDoneIsSet(boolean value) { + __isset_bit_vector.set(__DONE_ISSET_ID, value); + } + + public boolean isStarted() { + return this.started; + } + + public void setStarted(boolean started) { + this.started = started; + setStartedIsSet(true); + } + + public void unsetStarted() { + __isset_bit_vector.clear(__STARTED_ISSET_ID); + } + + /** Returns true if field started is set (has been asigned a value) and false otherwise */ + public boolean isSetStarted() { + return __isset_bit_vector.get(__STARTED_ISSET_ID); + } + + public void setStartedIsSet(boolean value) { + __isset_bit_vector.set(__STARTED_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case OPERATOR_ID: + if (value == null) { + unsetOperatorId(); + } else { + setOperatorId((String)value); + } + break; + + case OPERATOR_TYPE: + if (value == null) { + unsetOperatorType(); + } else { + setOperatorType((OperatorType)value); + } + break; + + case OPERATOR_ATTRIBUTES: + if (value == null) { + unsetOperatorAttributes(); + } else { + setOperatorAttributes((Map)value); + } + break; + + case OPERATOR_COUNTERS: + if (value == null) { + unsetOperatorCounters(); + } else { + setOperatorCounters((Map)value); + } + break; + + case DONE: + if (value == null) { + unsetDone(); + } else { + setDone((Boolean)value); + } + break; + + case STARTED: + if (value == null) { + unsetStarted(); + } else { + setStarted((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case OPERATOR_ID: + return getOperatorId(); + + case OPERATOR_TYPE: + return getOperatorType(); + + case OPERATOR_ATTRIBUTES: + return getOperatorAttributes(); + + case OPERATOR_COUNTERS: + return getOperatorCounters(); + + case DONE: + return new Boolean(isDone()); + + case STARTED: + return new Boolean(isStarted()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case OPERATOR_ID: + return isSetOperatorId(); + case OPERATOR_TYPE: + return isSetOperatorType(); + case OPERATOR_ATTRIBUTES: + return isSetOperatorAttributes(); + case OPERATOR_COUNTERS: + return isSetOperatorCounters(); + case DONE: + return isSetDone(); + case STARTED: + return isSetStarted(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Operator) + return this.equals((Operator)that); + return false; + } + + public boolean equals(Operator that) { + if (that == null) + return false; + + boolean this_present_operatorId = true && this.isSetOperatorId(); + boolean that_present_operatorId = true && that.isSetOperatorId(); + if (this_present_operatorId || that_present_operatorId) { + if (!(this_present_operatorId && that_present_operatorId)) + return false; + if (!this.operatorId.equals(that.operatorId)) + return false; + } + + boolean this_present_operatorType = true && this.isSetOperatorType(); + boolean that_present_operatorType = true && that.isSetOperatorType(); + if (this_present_operatorType || that_present_operatorType) { + if (!(this_present_operatorType && that_present_operatorType)) + return false; + if (!this.operatorType.equals(that.operatorType)) + return false; + } + + boolean this_present_operatorAttributes = true && this.isSetOperatorAttributes(); + boolean that_present_operatorAttributes = true && that.isSetOperatorAttributes(); + if (this_present_operatorAttributes || that_present_operatorAttributes) { + if (!(this_present_operatorAttributes && that_present_operatorAttributes)) + return false; + if (!this.operatorAttributes.equals(that.operatorAttributes)) + return false; + } + + boolean this_present_operatorCounters = true && this.isSetOperatorCounters(); + boolean that_present_operatorCounters = true && that.isSetOperatorCounters(); + if (this_present_operatorCounters || that_present_operatorCounters) { + if (!(this_present_operatorCounters && that_present_operatorCounters)) + return false; + if (!this.operatorCounters.equals(that.operatorCounters)) + return false; + } + + boolean this_present_done = true; + boolean that_present_done = true; + if (this_present_done || that_present_done) { + if (!(this_present_done && that_present_done)) + return false; + if (this.done != that.done) + return false; + } + + boolean this_present_started = true; + boolean that_present_started = true; + if (this_present_started || that_present_started) { + if (!(this_present_started && that_present_started)) + return false; + if (this.started != that.started) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(Operator other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Operator typedOther = (Operator)other; + + lastComparison = Boolean.valueOf(isSetOperatorId()).compareTo(typedOther.isSetOperatorId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperatorId()) { + lastComparison = TBaseHelper.compareTo(this.operatorId, typedOther.operatorId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperatorType()).compareTo(typedOther.isSetOperatorType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperatorType()) { + lastComparison = TBaseHelper.compareTo(this.operatorType, typedOther.operatorType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperatorAttributes()).compareTo(typedOther.isSetOperatorAttributes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperatorAttributes()) { + lastComparison = TBaseHelper.compareTo(this.operatorAttributes, typedOther.operatorAttributes); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperatorCounters()).compareTo(typedOther.isSetOperatorCounters()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperatorCounters()) { + lastComparison = TBaseHelper.compareTo(this.operatorCounters, typedOther.operatorCounters); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDone()).compareTo(typedOther.isSetDone()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDone()) { + lastComparison = TBaseHelper.compareTo(this.done, typedOther.done); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStarted()).compareTo(typedOther.isSetStarted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStarted()) { + lastComparison = TBaseHelper.compareTo(this.started, typedOther.started); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // OPERATOR_ID + if (field.type == TType.STRING) { + this.operatorId = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // OPERATOR_TYPE + if (field.type == TType.I32) { + this.operatorType = OperatorType.findByValue(iprot.readI32()); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // OPERATOR_ATTRIBUTES + if (field.type == TType.MAP) { + { + TMap _map12 = iprot.readMapBegin(); + this.operatorAttributes = new HashMap(2*_map12.size); + for (int _i13 = 0; _i13 < _map12.size; ++_i13) + { + String _key14; + String _val15; + _key14 = iprot.readString(); + _val15 = iprot.readString(); + this.operatorAttributes.put(_key14, _val15); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // OPERATOR_COUNTERS + if (field.type == TType.MAP) { + { + TMap _map16 = iprot.readMapBegin(); + this.operatorCounters = new HashMap(2*_map16.size); + for (int _i17 = 0; _i17 < _map16.size; ++_i17) + { + String _key18; + long _val19; + _key18 = iprot.readString(); + _val19 = iprot.readI64(); + this.operatorCounters.put(_key18, _val19); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // DONE + if (field.type == TType.BOOL) { + this.done = iprot.readBool(); + setDoneIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 6: // STARTED + if (field.type == TType.BOOL) { + this.started = iprot.readBool(); + setStartedIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.operatorId != null) { + oprot.writeFieldBegin(OPERATOR_ID_FIELD_DESC); + oprot.writeString(this.operatorId); + oprot.writeFieldEnd(); + } + if (this.operatorType != null) { + oprot.writeFieldBegin(OPERATOR_TYPE_FIELD_DESC); + oprot.writeI32(this.operatorType.getValue()); + oprot.writeFieldEnd(); + } + if (this.operatorAttributes != null) { + oprot.writeFieldBegin(OPERATOR_ATTRIBUTES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.operatorAttributes.size())); + for (Map.Entry _iter20 : this.operatorAttributes.entrySet()) + { + oprot.writeString(_iter20.getKey()); + oprot.writeString(_iter20.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.operatorCounters != null) { + oprot.writeFieldBegin(OPERATOR_COUNTERS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.I64, this.operatorCounters.size())); + for (Map.Entry _iter21 : this.operatorCounters.entrySet()) + { + oprot.writeString(_iter21.getKey()); + oprot.writeI64(_iter21.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DONE_FIELD_DESC); + oprot.writeBool(this.done); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(STARTED_FIELD_DESC); + oprot.writeBool(this.started); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Operator("); + boolean first = true; + + sb.append("operatorId:"); + if (this.operatorId == null) { + sb.append("null"); + } else { + sb.append(this.operatorId); + } + first = false; + if (!first) sb.append(", "); + sb.append("operatorType:"); + if (this.operatorType == null) { + sb.append("null"); + } else { + sb.append(this.operatorType); + } + first = false; + if (!first) sb.append(", "); + sb.append("operatorAttributes:"); + if (this.operatorAttributes == null) { + sb.append("null"); + } else { + sb.append(this.operatorAttributes); + } + first = false; + if (!first) sb.append(", "); + sb.append("operatorCounters:"); + if (this.operatorCounters == null) { + sb.append("null"); + } else { + sb.append(this.operatorCounters); + } + first = false; + if (!first) sb.append(", "); + sb.append("done:"); + sb.append(this.done); + first = false; + if (!first) sb.append(", "); + sb.append("started:"); + sb.append(this.started); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} + Added: hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java?rev=1044070&view=auto ============================================================================== --- hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java (added) +++ hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/OperatorType.java Thu Dec 9 18:30:58 2010 @@ -0,0 +1,92 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.ql.plan.api; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum OperatorType implements TEnum { + JOIN(0), + MAPJOIN(1), + EXTRACT(2), + FILTER(3), + FORWARD(4), + GROUPBY(5), + LIMIT(6), + SCRIPT(7), + SELECT(8), + TABLESCAN(9), + FILESINK(10), + REDUCESINK(11), + UNION(12), + UDTF(13), + LATERALVIEWJOIN(14), + LATERALVIEWFORWARD(15), + HASHTABLESINK(16), + HASHTABLEDUMMY(17); + + private final int value; + + private OperatorType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static OperatorType findByValue(int value) { + switch (value) { + case 0: + return JOIN; + case 1: + return MAPJOIN; + case 2: + return EXTRACT; + case 3: + return FILTER; + case 4: + return FORWARD; + case 5: + return GROUPBY; + case 6: + return LIMIT; + case 7: + return SCRIPT; + case 8: + return SELECT; + case 9: + return TABLESCAN; + case 10: + return FILESINK; + case 11: + return REDUCESINK; + case 12: + return UNION; + case 13: + return UDTF; + case 14: + return LATERALVIEWJOIN; + case 15: + return LATERALVIEWFORWARD; + case 16: + return HASHTABLESINK; + case 17: + return HASHTABLEDUMMY; + default: + return null; + } + } +} Added: hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java?rev=1044070&view=auto ============================================================================== --- hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java (added) +++ hive/trunk/ql/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/ql/plan/api/Query.java Thu Dec 9 18:30:58 2010 @@ -0,0 +1,1044 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ +package org.apache.hadoop.hive.ql.plan.api; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.apache.thrift.*; +import org.apache.thrift.async.*; +import org.apache.thrift.meta_data.*; +import org.apache.thrift.transport.*; +import org.apache.thrift.protocol.*; + +public class Query implements TBase, java.io.Serializable, Cloneable { + private static final TStruct STRUCT_DESC = new TStruct("Query"); + + private static final TField QUERY_ID_FIELD_DESC = new TField("queryId", TType.STRING, (short)1); + private static final TField QUERY_TYPE_FIELD_DESC = new TField("queryType", TType.STRING, (short)2); + private static final TField QUERY_ATTRIBUTES_FIELD_DESC = new TField("queryAttributes", TType.MAP, (short)3); + private static final TField QUERY_COUNTERS_FIELD_DESC = new TField("queryCounters", TType.MAP, (short)4); + private static final TField STAGE_GRAPH_FIELD_DESC = new TField("stageGraph", TType.STRUCT, (short)5); + private static final TField STAGE_LIST_FIELD_DESC = new TField("stageList", TType.LIST, (short)6); + private static final TField DONE_FIELD_DESC = new TField("done", TType.BOOL, (short)7); + private static final TField STARTED_FIELD_DESC = new TField("started", TType.BOOL, (short)8); + + private String queryId; + private String queryType; + private Map queryAttributes; + private Map queryCounters; + private Graph stageGraph; + private List stageList; + private boolean done; + private boolean started; + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements TFieldIdEnum { + QUERY_ID((short)1, "queryId"), + QUERY_TYPE((short)2, "queryType"), + QUERY_ATTRIBUTES((short)3, "queryAttributes"), + QUERY_COUNTERS((short)4, "queryCounters"), + STAGE_GRAPH((short)5, "stageGraph"), + STAGE_LIST((short)6, "stageList"), + DONE((short)7, "done"), + STARTED((short)8, "started"); + + private static final Map byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // QUERY_ID + return QUERY_ID; + case 2: // QUERY_TYPE + return QUERY_TYPE; + case 3: // QUERY_ATTRIBUTES + return QUERY_ATTRIBUTES; + case 4: // QUERY_COUNTERS + return QUERY_COUNTERS; + case 5: // STAGE_GRAPH + return STAGE_GRAPH; + case 6: // STAGE_LIST + return STAGE_LIST; + case 7: // DONE + return DONE; + case 8: // STARTED + return STARTED; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __DONE_ISSET_ID = 0; + private static final int __STARTED_ISSET_ID = 1; + private BitSet __isset_bit_vector = new BitSet(2); + + public static final Map<_Fields, FieldMetaData> metaDataMap; + static { + Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.QUERY_ID, new FieldMetaData("queryId", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.QUERY_TYPE, new FieldMetaData("queryType", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.STRING))); + tmpMap.put(_Fields.QUERY_ATTRIBUTES, new FieldMetaData("queryAttributes", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.STRING)))); + tmpMap.put(_Fields.QUERY_COUNTERS, new FieldMetaData("queryCounters", TFieldRequirementType.DEFAULT, + new MapMetaData(TType.MAP, + new FieldValueMetaData(TType.STRING), + new FieldValueMetaData(TType.I64)))); + tmpMap.put(_Fields.STAGE_GRAPH, new FieldMetaData("stageGraph", TFieldRequirementType.DEFAULT, + new StructMetaData(TType.STRUCT, Graph.class))); + tmpMap.put(_Fields.STAGE_LIST, new FieldMetaData("stageList", TFieldRequirementType.DEFAULT, + new ListMetaData(TType.LIST, + new StructMetaData(TType.STRUCT, Stage.class)))); + tmpMap.put(_Fields.DONE, new FieldMetaData("done", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + tmpMap.put(_Fields.STARTED, new FieldMetaData("started", TFieldRequirementType.DEFAULT, + new FieldValueMetaData(TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + FieldMetaData.addStructMetaDataMap(Query.class, metaDataMap); + } + + public Query() { + } + + public Query( + String queryId, + String queryType, + Map queryAttributes, + Map queryCounters, + Graph stageGraph, + List stageList, + boolean done, + boolean started) + { + this(); + this.queryId = queryId; + this.queryType = queryType; + this.queryAttributes = queryAttributes; + this.queryCounters = queryCounters; + this.stageGraph = stageGraph; + this.stageList = stageList; + this.done = done; + setDoneIsSet(true); + this.started = started; + setStartedIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public Query(Query other) { + __isset_bit_vector.clear(); + __isset_bit_vector.or(other.__isset_bit_vector); + if (other.isSetQueryId()) { + this.queryId = other.queryId; + } + if (other.isSetQueryType()) { + this.queryType = other.queryType; + } + if (other.isSetQueryAttributes()) { + Map __this__queryAttributes = new HashMap(); + for (Map.Entry other_element : other.queryAttributes.entrySet()) { + + String other_element_key = other_element.getKey(); + String other_element_value = other_element.getValue(); + + String __this__queryAttributes_copy_key = other_element_key; + + String __this__queryAttributes_copy_value = other_element_value; + + __this__queryAttributes.put(__this__queryAttributes_copy_key, __this__queryAttributes_copy_value); + } + this.queryAttributes = __this__queryAttributes; + } + if (other.isSetQueryCounters()) { + Map __this__queryCounters = new HashMap(); + for (Map.Entry other_element : other.queryCounters.entrySet()) { + + String other_element_key = other_element.getKey(); + Long other_element_value = other_element.getValue(); + + String __this__queryCounters_copy_key = other_element_key; + + Long __this__queryCounters_copy_value = other_element_value; + + __this__queryCounters.put(__this__queryCounters_copy_key, __this__queryCounters_copy_value); + } + this.queryCounters = __this__queryCounters; + } + if (other.isSetStageGraph()) { + this.stageGraph = new Graph(other.stageGraph); + } + if (other.isSetStageList()) { + List __this__stageList = new ArrayList(); + for (Stage other_element : other.stageList) { + __this__stageList.add(new Stage(other_element)); + } + this.stageList = __this__stageList; + } + this.done = other.done; + this.started = other.started; + } + + public Query deepCopy() { + return new Query(this); + } + + @Override + public void clear() { + this.queryId = null; + this.queryType = null; + this.queryAttributes = null; + this.queryCounters = null; + this.stageGraph = null; + this.stageList = null; + setDoneIsSet(false); + this.done = false; + setStartedIsSet(false); + this.started = false; + } + + public String getQueryId() { + return this.queryId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + public void unsetQueryId() { + this.queryId = null; + } + + /** Returns true if field queryId is set (has been asigned a value) and false otherwise */ + public boolean isSetQueryId() { + return this.queryId != null; + } + + public void setQueryIdIsSet(boolean value) { + if (!value) { + this.queryId = null; + } + } + + public String getQueryType() { + return this.queryType; + } + + public void setQueryType(String queryType) { + this.queryType = queryType; + } + + public void unsetQueryType() { + this.queryType = null; + } + + /** Returns true if field queryType is set (has been asigned a value) and false otherwise */ + public boolean isSetQueryType() { + return this.queryType != null; + } + + public void setQueryTypeIsSet(boolean value) { + if (!value) { + this.queryType = null; + } + } + + public int getQueryAttributesSize() { + return (this.queryAttributes == null) ? 0 : this.queryAttributes.size(); + } + + public void putToQueryAttributes(String key, String val) { + if (this.queryAttributes == null) { + this.queryAttributes = new HashMap(); + } + this.queryAttributes.put(key, val); + } + + public Map getQueryAttributes() { + return this.queryAttributes; + } + + public void setQueryAttributes(Map queryAttributes) { + this.queryAttributes = queryAttributes; + } + + public void unsetQueryAttributes() { + this.queryAttributes = null; + } + + /** Returns true if field queryAttributes is set (has been asigned a value) and false otherwise */ + public boolean isSetQueryAttributes() { + return this.queryAttributes != null; + } + + public void setQueryAttributesIsSet(boolean value) { + if (!value) { + this.queryAttributes = null; + } + } + + public int getQueryCountersSize() { + return (this.queryCounters == null) ? 0 : this.queryCounters.size(); + } + + public void putToQueryCounters(String key, long val) { + if (this.queryCounters == null) { + this.queryCounters = new HashMap(); + } + this.queryCounters.put(key, val); + } + + public Map getQueryCounters() { + return this.queryCounters; + } + + public void setQueryCounters(Map queryCounters) { + this.queryCounters = queryCounters; + } + + public void unsetQueryCounters() { + this.queryCounters = null; + } + + /** Returns true if field queryCounters is set (has been asigned a value) and false otherwise */ + public boolean isSetQueryCounters() { + return this.queryCounters != null; + } + + public void setQueryCountersIsSet(boolean value) { + if (!value) { + this.queryCounters = null; + } + } + + public Graph getStageGraph() { + return this.stageGraph; + } + + public void setStageGraph(Graph stageGraph) { + this.stageGraph = stageGraph; + } + + public void unsetStageGraph() { + this.stageGraph = null; + } + + /** Returns true if field stageGraph is set (has been asigned a value) and false otherwise */ + public boolean isSetStageGraph() { + return this.stageGraph != null; + } + + public void setStageGraphIsSet(boolean value) { + if (!value) { + this.stageGraph = null; + } + } + + public int getStageListSize() { + return (this.stageList == null) ? 0 : this.stageList.size(); + } + + public java.util.Iterator getStageListIterator() { + return (this.stageList == null) ? null : this.stageList.iterator(); + } + + public void addToStageList(Stage elem) { + if (this.stageList == null) { + this.stageList = new ArrayList(); + } + this.stageList.add(elem); + } + + public List getStageList() { + return this.stageList; + } + + public void setStageList(List stageList) { + this.stageList = stageList; + } + + public void unsetStageList() { + this.stageList = null; + } + + /** Returns true if field stageList is set (has been asigned a value) and false otherwise */ + public boolean isSetStageList() { + return this.stageList != null; + } + + public void setStageListIsSet(boolean value) { + if (!value) { + this.stageList = null; + } + } + + public boolean isDone() { + return this.done; + } + + public void setDone(boolean done) { + this.done = done; + setDoneIsSet(true); + } + + public void unsetDone() { + __isset_bit_vector.clear(__DONE_ISSET_ID); + } + + /** Returns true if field done is set (has been asigned a value) and false otherwise */ + public boolean isSetDone() { + return __isset_bit_vector.get(__DONE_ISSET_ID); + } + + public void setDoneIsSet(boolean value) { + __isset_bit_vector.set(__DONE_ISSET_ID, value); + } + + public boolean isStarted() { + return this.started; + } + + public void setStarted(boolean started) { + this.started = started; + setStartedIsSet(true); + } + + public void unsetStarted() { + __isset_bit_vector.clear(__STARTED_ISSET_ID); + } + + /** Returns true if field started is set (has been asigned a value) and false otherwise */ + public boolean isSetStarted() { + return __isset_bit_vector.get(__STARTED_ISSET_ID); + } + + public void setStartedIsSet(boolean value) { + __isset_bit_vector.set(__STARTED_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case QUERY_ID: + if (value == null) { + unsetQueryId(); + } else { + setQueryId((String)value); + } + break; + + case QUERY_TYPE: + if (value == null) { + unsetQueryType(); + } else { + setQueryType((String)value); + } + break; + + case QUERY_ATTRIBUTES: + if (value == null) { + unsetQueryAttributes(); + } else { + setQueryAttributes((Map)value); + } + break; + + case QUERY_COUNTERS: + if (value == null) { + unsetQueryCounters(); + } else { + setQueryCounters((Map)value); + } + break; + + case STAGE_GRAPH: + if (value == null) { + unsetStageGraph(); + } else { + setStageGraph((Graph)value); + } + break; + + case STAGE_LIST: + if (value == null) { + unsetStageList(); + } else { + setStageList((List)value); + } + break; + + case DONE: + if (value == null) { + unsetDone(); + } else { + setDone((Boolean)value); + } + break; + + case STARTED: + if (value == null) { + unsetStarted(); + } else { + setStarted((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case QUERY_ID: + return getQueryId(); + + case QUERY_TYPE: + return getQueryType(); + + case QUERY_ATTRIBUTES: + return getQueryAttributes(); + + case QUERY_COUNTERS: + return getQueryCounters(); + + case STAGE_GRAPH: + return getStageGraph(); + + case STAGE_LIST: + return getStageList(); + + case DONE: + return new Boolean(isDone()); + + case STARTED: + return new Boolean(isStarted()); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case QUERY_ID: + return isSetQueryId(); + case QUERY_TYPE: + return isSetQueryType(); + case QUERY_ATTRIBUTES: + return isSetQueryAttributes(); + case QUERY_COUNTERS: + return isSetQueryCounters(); + case STAGE_GRAPH: + return isSetStageGraph(); + case STAGE_LIST: + return isSetStageList(); + case DONE: + return isSetDone(); + case STARTED: + return isSetStarted(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Query) + return this.equals((Query)that); + return false; + } + + public boolean equals(Query that) { + if (that == null) + return false; + + boolean this_present_queryId = true && this.isSetQueryId(); + boolean that_present_queryId = true && that.isSetQueryId(); + if (this_present_queryId || that_present_queryId) { + if (!(this_present_queryId && that_present_queryId)) + return false; + if (!this.queryId.equals(that.queryId)) + return false; + } + + boolean this_present_queryType = true && this.isSetQueryType(); + boolean that_present_queryType = true && that.isSetQueryType(); + if (this_present_queryType || that_present_queryType) { + if (!(this_present_queryType && that_present_queryType)) + return false; + if (!this.queryType.equals(that.queryType)) + return false; + } + + boolean this_present_queryAttributes = true && this.isSetQueryAttributes(); + boolean that_present_queryAttributes = true && that.isSetQueryAttributes(); + if (this_present_queryAttributes || that_present_queryAttributes) { + if (!(this_present_queryAttributes && that_present_queryAttributes)) + return false; + if (!this.queryAttributes.equals(that.queryAttributes)) + return false; + } + + boolean this_present_queryCounters = true && this.isSetQueryCounters(); + boolean that_present_queryCounters = true && that.isSetQueryCounters(); + if (this_present_queryCounters || that_present_queryCounters) { + if (!(this_present_queryCounters && that_present_queryCounters)) + return false; + if (!this.queryCounters.equals(that.queryCounters)) + return false; + } + + boolean this_present_stageGraph = true && this.isSetStageGraph(); + boolean that_present_stageGraph = true && that.isSetStageGraph(); + if (this_present_stageGraph || that_present_stageGraph) { + if (!(this_present_stageGraph && that_present_stageGraph)) + return false; + if (!this.stageGraph.equals(that.stageGraph)) + return false; + } + + boolean this_present_stageList = true && this.isSetStageList(); + boolean that_present_stageList = true && that.isSetStageList(); + if (this_present_stageList || that_present_stageList) { + if (!(this_present_stageList && that_present_stageList)) + return false; + if (!this.stageList.equals(that.stageList)) + return false; + } + + boolean this_present_done = true; + boolean that_present_done = true; + if (this_present_done || that_present_done) { + if (!(this_present_done && that_present_done)) + return false; + if (this.done != that.done) + return false; + } + + boolean this_present_started = true; + boolean that_present_started = true; + if (this_present_started || that_present_started) { + if (!(this_present_started && that_present_started)) + return false; + if (this.started != that.started) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(Query other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + Query typedOther = (Query)other; + + lastComparison = Boolean.valueOf(isSetQueryId()).compareTo(typedOther.isSetQueryId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryId()) { + lastComparison = TBaseHelper.compareTo(this.queryId, typedOther.queryId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetQueryType()).compareTo(typedOther.isSetQueryType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryType()) { + lastComparison = TBaseHelper.compareTo(this.queryType, typedOther.queryType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetQueryAttributes()).compareTo(typedOther.isSetQueryAttributes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryAttributes()) { + lastComparison = TBaseHelper.compareTo(this.queryAttributes, typedOther.queryAttributes); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetQueryCounters()).compareTo(typedOther.isSetQueryCounters()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryCounters()) { + lastComparison = TBaseHelper.compareTo(this.queryCounters, typedOther.queryCounters); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStageGraph()).compareTo(typedOther.isSetStageGraph()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStageGraph()) { + lastComparison = TBaseHelper.compareTo(this.stageGraph, typedOther.stageGraph); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStageList()).compareTo(typedOther.isSetStageList()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStageList()) { + lastComparison = TBaseHelper.compareTo(this.stageList, typedOther.stageList); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDone()).compareTo(typedOther.isSetDone()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDone()) { + lastComparison = TBaseHelper.compareTo(this.done, typedOther.done); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStarted()).compareTo(typedOther.isSetStarted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStarted()) { + lastComparison = TBaseHelper.compareTo(this.started, typedOther.started); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(TProtocol iprot) throws TException { + TField field; + iprot.readStructBegin(); + while (true) + { + field = iprot.readFieldBegin(); + if (field.type == TType.STOP) { + break; + } + switch (field.id) { + case 1: // QUERY_ID + if (field.type == TType.STRING) { + this.queryId = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 2: // QUERY_TYPE + if (field.type == TType.STRING) { + this.queryType = iprot.readString(); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 3: // QUERY_ATTRIBUTES + if (field.type == TType.MAP) { + { + TMap _map50 = iprot.readMapBegin(); + this.queryAttributes = new HashMap(2*_map50.size); + for (int _i51 = 0; _i51 < _map50.size; ++_i51) + { + String _key52; + String _val53; + _key52 = iprot.readString(); + _val53 = iprot.readString(); + this.queryAttributes.put(_key52, _val53); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 4: // QUERY_COUNTERS + if (field.type == TType.MAP) { + { + TMap _map54 = iprot.readMapBegin(); + this.queryCounters = new HashMap(2*_map54.size); + for (int _i55 = 0; _i55 < _map54.size; ++_i55) + { + String _key56; + long _val57; + _key56 = iprot.readString(); + _val57 = iprot.readI64(); + this.queryCounters.put(_key56, _val57); + } + iprot.readMapEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 5: // STAGE_GRAPH + if (field.type == TType.STRUCT) { + this.stageGraph = new Graph(); + this.stageGraph.read(iprot); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 6: // STAGE_LIST + if (field.type == TType.LIST) { + { + TList _list58 = iprot.readListBegin(); + this.stageList = new ArrayList(_list58.size); + for (int _i59 = 0; _i59 < _list58.size; ++_i59) + { + Stage _elem60; + _elem60 = new Stage(); + _elem60.read(iprot); + this.stageList.add(_elem60); + } + iprot.readListEnd(); + } + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 7: // DONE + if (field.type == TType.BOOL) { + this.done = iprot.readBool(); + setDoneIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + case 8: // STARTED + if (field.type == TType.BOOL) { + this.started = iprot.readBool(); + setStartedIsSet(true); + } else { + TProtocolUtil.skip(iprot, field.type); + } + break; + default: + TProtocolUtil.skip(iprot, field.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + validate(); + } + + public void write(TProtocol oprot) throws TException { + validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (this.queryId != null) { + oprot.writeFieldBegin(QUERY_ID_FIELD_DESC); + oprot.writeString(this.queryId); + oprot.writeFieldEnd(); + } + if (this.queryType != null) { + oprot.writeFieldBegin(QUERY_TYPE_FIELD_DESC); + oprot.writeString(this.queryType); + oprot.writeFieldEnd(); + } + if (this.queryAttributes != null) { + oprot.writeFieldBegin(QUERY_ATTRIBUTES_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.queryAttributes.size())); + for (Map.Entry _iter61 : this.queryAttributes.entrySet()) + { + oprot.writeString(_iter61.getKey()); + oprot.writeString(_iter61.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.queryCounters != null) { + oprot.writeFieldBegin(QUERY_COUNTERS_FIELD_DESC); + { + oprot.writeMapBegin(new TMap(TType.STRING, TType.I64, this.queryCounters.size())); + for (Map.Entry _iter62 : this.queryCounters.entrySet()) + { + oprot.writeString(_iter62.getKey()); + oprot.writeI64(_iter62.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (this.stageGraph != null) { + oprot.writeFieldBegin(STAGE_GRAPH_FIELD_DESC); + this.stageGraph.write(oprot); + oprot.writeFieldEnd(); + } + if (this.stageList != null) { + oprot.writeFieldBegin(STAGE_LIST_FIELD_DESC); + { + oprot.writeListBegin(new TList(TType.STRUCT, this.stageList.size())); + for (Stage _iter63 : this.stageList) + { + _iter63.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DONE_FIELD_DESC); + oprot.writeBool(this.done); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(STARTED_FIELD_DESC); + oprot.writeBool(this.started); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Query("); + boolean first = true; + + sb.append("queryId:"); + if (this.queryId == null) { + sb.append("null"); + } else { + sb.append(this.queryId); + } + first = false; + if (!first) sb.append(", "); + sb.append("queryType:"); + if (this.queryType == null) { + sb.append("null"); + } else { + sb.append(this.queryType); + } + first = false; + if (!first) sb.append(", "); + sb.append("queryAttributes:"); + if (this.queryAttributes == null) { + sb.append("null"); + } else { + sb.append(this.queryAttributes); + } + first = false; + if (!first) sb.append(", "); + sb.append("queryCounters:"); + if (this.queryCounters == null) { + sb.append("null"); + } else { + sb.append(this.queryCounters); + } + first = false; + if (!first) sb.append(", "); + sb.append("stageGraph:"); + if (this.stageGraph == null) { + sb.append("null"); + } else { + sb.append(this.stageGraph); + } + first = false; + if (!first) sb.append(", "); + sb.append("stageList:"); + if (this.stageList == null) { + sb.append("null"); + } else { + sb.append(this.stageList); + } + first = false; + if (!first) sb.append(", "); + sb.append("done:"); + sb.append(this.done); + first = false; + if (!first) sb.append(", "); + sb.append("started:"); + sb.append(this.started); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws TException { + // check for required fields + } + +} +