| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508 |
- /**
- * Autogenerated by Thrift
- *
- * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
- */
- package com.cloudera.beeswax.api;
- import org.apache.commons.lang.builder.HashCodeBuilder;
- import java.util.List;
- import java.util.ArrayList;
- import java.util.Map;
- import java.util.HashMap;
- import java.util.Set;
- import java.util.HashSet;
- import java.util.Collections;
- import org.apache.log4j.Logger;
- import org.apache.thrift.*;
- import org.apache.thrift.meta_data.*;
- import org.apache.thrift.protocol.*;
- /**
- * Metadata information about the results.
- * Applicable only for SELECT.
- */
- public class ResultsMetadata implements TBase, java.io.Serializable, Cloneable {
- private static final TStruct STRUCT_DESC = new TStruct("ResultsMetadata");
- private static final TField SCHEMA_FIELD_DESC = new TField("schema", TType.STRUCT, (short)1);
- private static final TField TABLE_DIR_FIELD_DESC = new TField("table_dir", TType.STRING, (short)2);
- private static final TField IN_TABLENAME_FIELD_DESC = new TField("in_tablename", TType.STRING, (short)3);
- private static final TField DELIM_FIELD_DESC = new TField("delim", TType.STRING, (short)4);
- /**
- * The schema of the results
- */
- public org.apache.hadoop.hive.metastore.api.Schema schema;
- public static final int SCHEMA = 1;
- /**
- * The directory containing the results. Not applicable for partition table.
- */
- public String table_dir;
- public static final int TABLE_DIR = 2;
- /**
- * If the results are straight from an existing table, the table name.
- */
- public String in_tablename;
- public static final int IN_TABLENAME = 3;
- /**
- * Field delimiter
- */
- public String delim;
- public static final int DELIM = 4;
- private final Isset __isset = new Isset();
- private static final class Isset implements java.io.Serializable {
- }
- public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
- put(SCHEMA, new FieldMetaData("schema", TFieldRequirementType.DEFAULT,
- new StructMetaData(TType.STRUCT, org.apache.hadoop.hive.metastore.api.Schema.class)));
- put(TABLE_DIR, new FieldMetaData("table_dir", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- put(IN_TABLENAME, new FieldMetaData("in_tablename", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- put(DELIM, new FieldMetaData("delim", TFieldRequirementType.DEFAULT,
- new FieldValueMetaData(TType.STRING)));
- }});
- static {
- FieldMetaData.addStructMetaDataMap(ResultsMetadata.class, metaDataMap);
- }
- public ResultsMetadata() {
- }
- public ResultsMetadata(
- org.apache.hadoop.hive.metastore.api.Schema schema,
- String table_dir,
- String in_tablename,
- String delim)
- {
- this();
- this.schema = schema;
- this.table_dir = table_dir;
- this.in_tablename = in_tablename;
- this.delim = delim;
- }
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public ResultsMetadata(ResultsMetadata other) {
- if (other.isSetSchema()) {
- this.schema = new org.apache.hadoop.hive.metastore.api.Schema(other.schema);
- }
- if (other.isSetTable_dir()) {
- this.table_dir = other.table_dir;
- }
- if (other.isSetIn_tablename()) {
- this.in_tablename = other.in_tablename;
- }
- if (other.isSetDelim()) {
- this.delim = other.delim;
- }
- }
- @Override
- public ResultsMetadata clone() {
- return new ResultsMetadata(this);
- }
- /**
- * The schema of the results
- */
- public org.apache.hadoop.hive.metastore.api.Schema getSchema() {
- return this.schema;
- }
- /**
- * The schema of the results
- */
- public void setSchema(org.apache.hadoop.hive.metastore.api.Schema schema) {
- this.schema = schema;
- }
- public void unsetSchema() {
- this.schema = null;
- }
- // Returns true if field schema is set (has been asigned a value) and false otherwise
- public boolean isSetSchema() {
- return this.schema != null;
- }
- public void setSchemaIsSet(boolean value) {
- if (!value) {
- this.schema = null;
- }
- }
- /**
- * The directory containing the results. Not applicable for partition table.
- */
- public String getTable_dir() {
- return this.table_dir;
- }
- /**
- * The directory containing the results. Not applicable for partition table.
- */
- public void setTable_dir(String table_dir) {
- this.table_dir = table_dir;
- }
- public void unsetTable_dir() {
- this.table_dir = null;
- }
- // Returns true if field table_dir is set (has been asigned a value) and false otherwise
- public boolean isSetTable_dir() {
- return this.table_dir != null;
- }
- public void setTable_dirIsSet(boolean value) {
- if (!value) {
- this.table_dir = null;
- }
- }
- /**
- * If the results are straight from an existing table, the table name.
- */
- public String getIn_tablename() {
- return this.in_tablename;
- }
- /**
- * If the results are straight from an existing table, the table name.
- */
- public void setIn_tablename(String in_tablename) {
- this.in_tablename = in_tablename;
- }
- public void unsetIn_tablename() {
- this.in_tablename = null;
- }
- // Returns true if field in_tablename is set (has been asigned a value) and false otherwise
- public boolean isSetIn_tablename() {
- return this.in_tablename != null;
- }
- public void setIn_tablenameIsSet(boolean value) {
- if (!value) {
- this.in_tablename = null;
- }
- }
- /**
- * Field delimiter
- */
- public String getDelim() {
- return this.delim;
- }
- /**
- * Field delimiter
- */
- public void setDelim(String delim) {
- this.delim = delim;
- }
- public void unsetDelim() {
- this.delim = null;
- }
- // Returns true if field delim is set (has been asigned a value) and false otherwise
- public boolean isSetDelim() {
- return this.delim != null;
- }
- public void setDelimIsSet(boolean value) {
- if (!value) {
- this.delim = null;
- }
- }
- public void setFieldValue(int fieldID, Object value) {
- switch (fieldID) {
- case SCHEMA:
- if (value == null) {
- unsetSchema();
- } else {
- setSchema((org.apache.hadoop.hive.metastore.api.Schema)value);
- }
- break;
- case TABLE_DIR:
- if (value == null) {
- unsetTable_dir();
- } else {
- setTable_dir((String)value);
- }
- break;
- case IN_TABLENAME:
- if (value == null) {
- unsetIn_tablename();
- } else {
- setIn_tablename((String)value);
- }
- break;
- case DELIM:
- if (value == null) {
- unsetDelim();
- } else {
- setDelim((String)value);
- }
- break;
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
- }
- }
- public Object getFieldValue(int fieldID) {
- switch (fieldID) {
- case SCHEMA:
- return getSchema();
- case TABLE_DIR:
- return getTable_dir();
- case IN_TABLENAME:
- return getIn_tablename();
- case DELIM:
- return getDelim();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
- }
- }
- // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
- public boolean isSet(int fieldID) {
- switch (fieldID) {
- case SCHEMA:
- return isSetSchema();
- case TABLE_DIR:
- return isSetTable_dir();
- case IN_TABLENAME:
- return isSetIn_tablename();
- case DELIM:
- return isSetDelim();
- default:
- throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
- }
- }
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof ResultsMetadata)
- return this.equals((ResultsMetadata)that);
- return false;
- }
- public boolean equals(ResultsMetadata that) {
- if (that == null)
- return false;
- boolean this_present_schema = true && this.isSetSchema();
- boolean that_present_schema = true && that.isSetSchema();
- if (this_present_schema || that_present_schema) {
- if (!(this_present_schema && that_present_schema))
- return false;
- if (!this.schema.equals(that.schema))
- return false;
- }
- boolean this_present_table_dir = true && this.isSetTable_dir();
- boolean that_present_table_dir = true && that.isSetTable_dir();
- if (this_present_table_dir || that_present_table_dir) {
- if (!(this_present_table_dir && that_present_table_dir))
- return false;
- if (!this.table_dir.equals(that.table_dir))
- return false;
- }
- boolean this_present_in_tablename = true && this.isSetIn_tablename();
- boolean that_present_in_tablename = true && that.isSetIn_tablename();
- if (this_present_in_tablename || that_present_in_tablename) {
- if (!(this_present_in_tablename && that_present_in_tablename))
- return false;
- if (!this.in_tablename.equals(that.in_tablename))
- return false;
- }
- boolean this_present_delim = true && this.isSetDelim();
- boolean that_present_delim = true && that.isSetDelim();
- if (this_present_delim || that_present_delim) {
- if (!(this_present_delim && that_present_delim))
- return false;
- if (!this.delim.equals(that.delim))
- return false;
- }
- return true;
- }
- @Override
- public int hashCode() {
- HashCodeBuilder builder = new HashCodeBuilder();
- boolean present_schema = true && (isSetSchema());
- builder.append(present_schema);
- if (present_schema)
- builder.append(schema);
- boolean present_table_dir = true && (isSetTable_dir());
- builder.append(present_table_dir);
- if (present_table_dir)
- builder.append(table_dir);
- boolean present_in_tablename = true && (isSetIn_tablename());
- builder.append(present_in_tablename);
- if (present_in_tablename)
- builder.append(in_tablename);
- boolean present_delim = true && (isSetDelim());
- builder.append(present_delim);
- if (present_delim)
- builder.append(delim);
- return builder.toHashCode();
- }
- 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 SCHEMA:
- if (field.type == TType.STRUCT) {
- this.schema = new org.apache.hadoop.hive.metastore.api.Schema();
- this.schema.read(iprot);
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case TABLE_DIR:
- if (field.type == TType.STRING) {
- this.table_dir = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case IN_TABLENAME:
- if (field.type == TType.STRING) {
- this.in_tablename = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- case DELIM:
- if (field.type == TType.STRING) {
- this.delim = iprot.readString();
- } else {
- TProtocolUtil.skip(iprot, field.type);
- }
- break;
- default:
- TProtocolUtil.skip(iprot, field.type);
- break;
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
- // check for required fields of primitive type, which can't be checked in the validate method
- validate();
- }
- public void write(TProtocol oprot) throws TException {
- validate();
- oprot.writeStructBegin(STRUCT_DESC);
- if (this.schema != null) {
- oprot.writeFieldBegin(SCHEMA_FIELD_DESC);
- this.schema.write(oprot);
- oprot.writeFieldEnd();
- }
- if (this.table_dir != null) {
- oprot.writeFieldBegin(TABLE_DIR_FIELD_DESC);
- oprot.writeString(this.table_dir);
- oprot.writeFieldEnd();
- }
- if (this.in_tablename != null) {
- oprot.writeFieldBegin(IN_TABLENAME_FIELD_DESC);
- oprot.writeString(this.in_tablename);
- oprot.writeFieldEnd();
- }
- if (this.delim != null) {
- oprot.writeFieldBegin(DELIM_FIELD_DESC);
- oprot.writeString(this.delim);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("ResultsMetadata(");
- boolean first = true;
- sb.append("schema:");
- if (this.schema == null) {
- sb.append("null");
- } else {
- sb.append(this.schema);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("table_dir:");
- if (this.table_dir == null) {
- sb.append("null");
- } else {
- sb.append(this.table_dir);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("in_tablename:");
- if (this.in_tablename == null) {
- sb.append("null");
- } else {
- sb.append(this.in_tablename);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("delim:");
- if (this.delim == null) {
- sb.append("null");
- } else {
- sb.append(this.delim);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
- public void validate() throws TException {
- // check for required fields
- // check that fields of type enum have valid values
- }
- }
|