http://git-wip-us.apache.org/repos/asf/hive/blob/ba8a99e1/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java index 922094b..0e70758 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ColumnStatisticsDesc.java @@ -43,6 +43,7 @@ import org.slf4j.LoggerFactory; private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField PART_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("partName", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField LAST_ANALYZED_FIELD_DESC = new org.apache.thrift.protocol.TField("lastAnalyzed", org.apache.thrift.protocol.TType.I64, (short)5); + private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)6); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -55,6 +56,7 @@ import org.slf4j.LoggerFactory; private String tableName; // required private String partName; // optional private long lastAnalyzed; // optional + private String catName; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -62,7 +64,8 @@ import org.slf4j.LoggerFactory; DB_NAME((short)2, "dbName"), TABLE_NAME((short)3, "tableName"), PART_NAME((short)4, "partName"), - LAST_ANALYZED((short)5, "lastAnalyzed"); + LAST_ANALYZED((short)5, "lastAnalyzed"), + CAT_NAME((short)6, "catName"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -87,6 +90,8 @@ import org.slf4j.LoggerFactory; return PART_NAME; case 5: // LAST_ANALYZED return LAST_ANALYZED; + case 6: // CAT_NAME + return CAT_NAME; default: return null; } @@ -130,7 +135,7 @@ import org.slf4j.LoggerFactory; private static final int __ISTBLLEVEL_ISSET_ID = 0; private static final int __LASTANALYZED_ISSET_ID = 1; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.PART_NAME,_Fields.LAST_ANALYZED}; + private static final _Fields optionals[] = {_Fields.PART_NAME,_Fields.LAST_ANALYZED,_Fields.CAT_NAME}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -144,6 +149,8 @@ import org.slf4j.LoggerFactory; new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.LAST_ANALYZED, new org.apache.thrift.meta_data.FieldMetaData("lastAnalyzed", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.CAT_NAME, new org.apache.thrift.meta_data.FieldMetaData("catName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ColumnStatisticsDesc.class, metaDataMap); } @@ -179,6 +186,9 @@ import org.slf4j.LoggerFactory; this.partName = other.partName; } this.lastAnalyzed = other.lastAnalyzed; + if (other.isSetCatName()) { + this.catName = other.catName; + } } public ColumnStatisticsDesc deepCopy() { @@ -194,6 +204,7 @@ import org.slf4j.LoggerFactory; this.partName = null; setLastAnalyzedIsSet(false); this.lastAnalyzed = 0; + this.catName = null; } public boolean isIsTblLevel() { @@ -309,6 +320,29 @@ import org.slf4j.LoggerFactory; __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTANALYZED_ISSET_ID, value); } + public String getCatName() { + return this.catName; + } + + public void setCatName(String catName) { + this.catName = catName; + } + + public void unsetCatName() { + this.catName = null; + } + + /** Returns true if field catName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatName() { + return this.catName != null; + } + + public void setCatNameIsSet(boolean value) { + if (!value) { + this.catName = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case IS_TBL_LEVEL: @@ -351,6 +385,14 @@ import org.slf4j.LoggerFactory; } break; + case CAT_NAME: + if (value == null) { + unsetCatName(); + } else { + setCatName((String)value); + } + break; + } } @@ -371,6 +413,9 @@ import org.slf4j.LoggerFactory; case LAST_ANALYZED: return getLastAnalyzed(); + case CAT_NAME: + return getCatName(); + } throw new IllegalStateException(); } @@ -392,6 +437,8 @@ import org.slf4j.LoggerFactory; return isSetPartName(); case LAST_ANALYZED: return isSetLastAnalyzed(); + case CAT_NAME: + return isSetCatName(); } throw new IllegalStateException(); } @@ -454,6 +501,15 @@ import org.slf4j.LoggerFactory; return false; } + boolean this_present_catName = true && this.isSetCatName(); + boolean that_present_catName = true && that.isSetCatName(); + if (this_present_catName || that_present_catName) { + if (!(this_present_catName && that_present_catName)) + return false; + if (!this.catName.equals(that.catName)) + return false; + } + return true; } @@ -486,6 +542,11 @@ import org.slf4j.LoggerFactory; if (present_lastAnalyzed) list.add(lastAnalyzed); + boolean present_catName = true && (isSetCatName()); + list.add(present_catName); + if (present_catName) + list.add(catName); + return list.hashCode(); } @@ -547,6 +608,16 @@ import org.slf4j.LoggerFactory; return lastComparison; } } + lastComparison = Boolean.valueOf(isSetCatName()).compareTo(other.isSetCatName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catName, other.catName); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -602,6 +673,16 @@ import org.slf4j.LoggerFactory; sb.append(this.lastAnalyzed); first = false; } + if (isSetCatName()) { + if (!first) sb.append(", "); + sb.append("catName:"); + if (this.catName == null) { + sb.append("null"); + } else { + sb.append(this.catName); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -699,6 +780,14 @@ import org.slf4j.LoggerFactory; org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 6: // CAT_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catName = iprot.readString(); + struct.setCatNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -737,6 +826,13 @@ import org.slf4j.LoggerFactory; oprot.writeI64(struct.lastAnalyzed); oprot.writeFieldEnd(); } + if (struct.catName != null) { + if (struct.isSetCatName()) { + oprot.writeFieldBegin(CAT_NAME_FIELD_DESC); + oprot.writeString(struct.catName); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -764,13 +860,19 @@ import org.slf4j.LoggerFactory; if (struct.isSetLastAnalyzed()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetCatName()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetPartName()) { oprot.writeString(struct.partName); } if (struct.isSetLastAnalyzed()) { oprot.writeI64(struct.lastAnalyzed); } + if (struct.isSetCatName()) { + oprot.writeString(struct.catName); + } } @Override @@ -782,7 +884,7 @@ import org.slf4j.LoggerFactory; struct.setDbNameIsSet(true); struct.tableName = iprot.readString(); struct.setTableNameIsSet(true); - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.partName = iprot.readString(); struct.setPartNameIsSet(true); @@ -791,6 +893,10 @@ import org.slf4j.LoggerFactory; struct.lastAnalyzed = iprot.readI64(); struct.setLastAnalyzedIsSet(true); } + if (incoming.get(2)) { + struct.catName = iprot.readString(); + struct.setCatNameIsSet(true); + } } }
http://git-wip-us.apache.org/repos/asf/hive/blob/ba8a99e1/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CompactionRequest.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CompactionRequest.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CompactionRequest.java index 1a27ff5..a106cd4 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CompactionRequest.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CompactionRequest.java @@ -814,15 +814,15 @@ import org.slf4j.LoggerFactory; case 6: // PROPERTIES if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map650 = iprot.readMapBegin(); - struct.properties = new HashMap<String,String>(2*_map650.size); - String _key651; - String _val652; - for (int _i653 = 0; _i653 < _map650.size; ++_i653) + org.apache.thrift.protocol.TMap _map658 = iprot.readMapBegin(); + struct.properties = new HashMap<String,String>(2*_map658.size); + String _key659; + String _val660; + for (int _i661 = 0; _i661 < _map658.size; ++_i661) { - _key651 = iprot.readString(); - _val652 = iprot.readString(); - struct.properties.put(_key651, _val652); + _key659 = iprot.readString(); + _val660 = iprot.readString(); + struct.properties.put(_key659, _val660); } iprot.readMapEnd(); } @@ -878,10 +878,10 @@ import org.slf4j.LoggerFactory; oprot.writeFieldBegin(PROPERTIES_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.properties.size())); - for (Map.Entry<String, String> _iter654 : struct.properties.entrySet()) + for (Map.Entry<String, String> _iter662 : struct.properties.entrySet()) { - oprot.writeString(_iter654.getKey()); - oprot.writeString(_iter654.getValue()); + oprot.writeString(_iter662.getKey()); + oprot.writeString(_iter662.getValue()); } oprot.writeMapEnd(); } @@ -928,10 +928,10 @@ import org.slf4j.LoggerFactory; if (struct.isSetProperties()) { { oprot.writeI32(struct.properties.size()); - for (Map.Entry<String, String> _iter655 : struct.properties.entrySet()) + for (Map.Entry<String, String> _iter663 : struct.properties.entrySet()) { - oprot.writeString(_iter655.getKey()); - oprot.writeString(_iter655.getValue()); + oprot.writeString(_iter663.getKey()); + oprot.writeString(_iter663.getValue()); } } } @@ -957,15 +957,15 @@ import org.slf4j.LoggerFactory; } if (incoming.get(2)) { { - org.apache.thrift.protocol.TMap _map656 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.properties = new HashMap<String,String>(2*_map656.size); - String _key657; - String _val658; - for (int _i659 = 0; _i659 < _map656.size; ++_i659) + org.apache.thrift.protocol.TMap _map664 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.properties = new HashMap<String,String>(2*_map664.size); + String _key665; + String _val666; + for (int _i667 = 0; _i667 < _map664.size; ++_i667) { - _key657 = iprot.readString(); - _val658 = iprot.readString(); - struct.properties.put(_key657, _val658); + _key665 = iprot.readString(); + _val666 = iprot.readString(); + struct.properties.put(_key665, _val666); } } struct.setPropertiesIsSet(true); http://git-wip-us.apache.org/repos/asf/hive/blob/ba8a99e1/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreateCatalogRequest.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreateCatalogRequest.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreateCatalogRequest.java new file mode 100644 index 0000000..c260b3d --- /dev/null +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreateCatalogRequest.java @@ -0,0 +1,400 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.metastore.api; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") [email protected] @org.apache.hadoop.classification.InterfaceStability.Stable public class CreateCatalogRequest implements org.apache.thrift.TBase<CreateCatalogRequest, CreateCatalogRequest._Fields>, java.io.Serializable, Cloneable, Comparable<CreateCatalogRequest> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CreateCatalogRequest"); + + private static final org.apache.thrift.protocol.TField CATALOG_FIELD_DESC = new org.apache.thrift.protocol.TField("catalog", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CreateCatalogRequestStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CreateCatalogRequestTupleSchemeFactory()); + } + + private Catalog catalog; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + CATALOG((short)1, "catalog"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + 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: // CATALOG + return CATALOG; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.CATALOG, new org.apache.thrift.meta_data.FieldMetaData("catalog", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Catalog.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CreateCatalogRequest.class, metaDataMap); + } + + public CreateCatalogRequest() { + } + + public CreateCatalogRequest( + Catalog catalog) + { + this(); + this.catalog = catalog; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public CreateCatalogRequest(CreateCatalogRequest other) { + if (other.isSetCatalog()) { + this.catalog = new Catalog(other.catalog); + } + } + + public CreateCatalogRequest deepCopy() { + return new CreateCatalogRequest(this); + } + + @Override + public void clear() { + this.catalog = null; + } + + public Catalog getCatalog() { + return this.catalog; + } + + public void setCatalog(Catalog catalog) { + this.catalog = catalog; + } + + public void unsetCatalog() { + this.catalog = null; + } + + /** Returns true if field catalog is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalog() { + return this.catalog != null; + } + + public void setCatalogIsSet(boolean value) { + if (!value) { + this.catalog = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case CATALOG: + if (value == null) { + unsetCatalog(); + } else { + setCatalog((Catalog)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case CATALOG: + return getCatalog(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case CATALOG: + return isSetCatalog(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof CreateCatalogRequest) + return this.equals((CreateCatalogRequest)that); + return false; + } + + public boolean equals(CreateCatalogRequest that) { + if (that == null) + return false; + + boolean this_present_catalog = true && this.isSetCatalog(); + boolean that_present_catalog = true && that.isSetCatalog(); + if (this_present_catalog || that_present_catalog) { + if (!(this_present_catalog && that_present_catalog)) + return false; + if (!this.catalog.equals(that.catalog)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_catalog = true && (isSetCatalog()); + list.add(present_catalog); + if (present_catalog) + list.add(catalog); + + return list.hashCode(); + } + + @Override + public int compareTo(CreateCatalogRequest other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetCatalog()).compareTo(other.isSetCatalog()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalog()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalog, other.catalog); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("CreateCatalogRequest("); + boolean first = true; + + sb.append("catalog:"); + if (this.catalog == null) { + sb.append("null"); + } else { + sb.append(this.catalog); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (catalog != null) { + catalog.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class CreateCatalogRequestStandardSchemeFactory implements SchemeFactory { + public CreateCatalogRequestStandardScheme getScheme() { + return new CreateCatalogRequestStandardScheme(); + } + } + + private static class CreateCatalogRequestStandardScheme extends StandardScheme<CreateCatalogRequest> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CreateCatalogRequest struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // CATALOG + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.catalog = new Catalog(); + struct.catalog.read(iprot); + struct.setCatalogIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, CreateCatalogRequest struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.catalog != null) { + oprot.writeFieldBegin(CATALOG_FIELD_DESC); + struct.catalog.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CreateCatalogRequestTupleSchemeFactory implements SchemeFactory { + public CreateCatalogRequestTupleScheme getScheme() { + return new CreateCatalogRequestTupleScheme(); + } + } + + private static class CreateCatalogRequestTupleScheme extends TupleScheme<CreateCatalogRequest> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CreateCatalogRequest struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetCatalog()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetCatalog()) { + struct.catalog.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, CreateCatalogRequest struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.catalog = new Catalog(); + struct.catalog.read(iprot); + struct.setCatalogIsSet(true); + } + } + } + +} + http://git-wip-us.apache.org/repos/asf/hive/blob/ba8a99e1/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreationMetadata.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreationMetadata.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreationMetadata.java index b744177..d28972c 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreationMetadata.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/CreationMetadata.java @@ -38,10 +38,11 @@ import org.slf4j.LoggerFactory; @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class CreationMetadata implements org.apache.thrift.TBase<CreationMetadata, CreationMetadata._Fields>, java.io.Serializable, Cloneable, Comparable<CreationMetadata> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CreationMetadata"); - private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("dbName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tblName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField TABLES_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("tablesUsed", org.apache.thrift.protocol.TType.SET, (short)3); - private static final org.apache.thrift.protocol.TField VALID_TXN_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validTxnList", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("dbName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tblName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField TABLES_USED_FIELD_DESC = new org.apache.thrift.protocol.TField("tablesUsed", org.apache.thrift.protocol.TType.SET, (short)4); + private static final org.apache.thrift.protocol.TField VALID_TXN_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("validTxnList", org.apache.thrift.protocol.TType.STRING, (short)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -49,6 +50,7 @@ import org.slf4j.LoggerFactory; schemes.put(TupleScheme.class, new CreationMetadataTupleSchemeFactory()); } + private String catName; // required private String dbName; // required private String tblName; // required private Set<String> tablesUsed; // required @@ -56,10 +58,11 @@ import org.slf4j.LoggerFactory; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - DB_NAME((short)1, "dbName"), - TBL_NAME((short)2, "tblName"), - TABLES_USED((short)3, "tablesUsed"), - VALID_TXN_LIST((short)4, "validTxnList"); + CAT_NAME((short)1, "catName"), + DB_NAME((short)2, "dbName"), + TBL_NAME((short)3, "tblName"), + TABLES_USED((short)4, "tablesUsed"), + VALID_TXN_LIST((short)5, "validTxnList"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -74,13 +77,15 @@ import org.slf4j.LoggerFactory; */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // DB_NAME + case 1: // CAT_NAME + return CAT_NAME; + case 2: // DB_NAME return DB_NAME; - case 2: // TBL_NAME + case 3: // TBL_NAME return TBL_NAME; - case 3: // TABLES_USED + case 4: // TABLES_USED return TABLES_USED; - case 4: // VALID_TXN_LIST + case 5: // VALID_TXN_LIST return VALID_TXN_LIST; default: return null; @@ -126,6 +131,8 @@ import org.slf4j.LoggerFactory; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.CAT_NAME, new org.apache.thrift.meta_data.FieldMetaData("catName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DB_NAME, new org.apache.thrift.meta_data.FieldMetaData("dbName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tblName", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -143,11 +150,13 @@ import org.slf4j.LoggerFactory; } public CreationMetadata( + String catName, String dbName, String tblName, Set<String> tablesUsed) { this(); + this.catName = catName; this.dbName = dbName; this.tblName = tblName; this.tablesUsed = tablesUsed; @@ -157,6 +166,9 @@ import org.slf4j.LoggerFactory; * Performs a deep copy on <i>other</i>. */ public CreationMetadata(CreationMetadata other) { + if (other.isSetCatName()) { + this.catName = other.catName; + } if (other.isSetDbName()) { this.dbName = other.dbName; } @@ -178,12 +190,36 @@ import org.slf4j.LoggerFactory; @Override public void clear() { + this.catName = null; this.dbName = null; this.tblName = null; this.tablesUsed = null; this.validTxnList = null; } + public String getCatName() { + return this.catName; + } + + public void setCatName(String catName) { + this.catName = catName; + } + + public void unsetCatName() { + this.catName = null; + } + + /** Returns true if field catName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatName() { + return this.catName != null; + } + + public void setCatNameIsSet(boolean value) { + if (!value) { + this.catName = null; + } + } + public String getDbName() { return this.dbName; } @@ -293,6 +329,14 @@ import org.slf4j.LoggerFactory; public void setFieldValue(_Fields field, Object value) { switch (field) { + case CAT_NAME: + if (value == null) { + unsetCatName(); + } else { + setCatName((String)value); + } + break; + case DB_NAME: if (value == null) { unsetDbName(); @@ -330,6 +374,9 @@ import org.slf4j.LoggerFactory; public Object getFieldValue(_Fields field) { switch (field) { + case CAT_NAME: + return getCatName(); + case DB_NAME: return getDbName(); @@ -353,6 +400,8 @@ import org.slf4j.LoggerFactory; } switch (field) { + case CAT_NAME: + return isSetCatName(); case DB_NAME: return isSetDbName(); case TBL_NAME: @@ -378,6 +427,15 @@ import org.slf4j.LoggerFactory; if (that == null) return false; + boolean this_present_catName = true && this.isSetCatName(); + boolean that_present_catName = true && that.isSetCatName(); + if (this_present_catName || that_present_catName) { + if (!(this_present_catName && that_present_catName)) + return false; + if (!this.catName.equals(that.catName)) + return false; + } + boolean this_present_dbName = true && this.isSetDbName(); boolean that_present_dbName = true && that.isSetDbName(); if (this_present_dbName || that_present_dbName) { @@ -421,6 +479,11 @@ import org.slf4j.LoggerFactory; public int hashCode() { List<Object> list = new ArrayList<Object>(); + boolean present_catName = true && (isSetCatName()); + list.add(present_catName); + if (present_catName) + list.add(catName); + boolean present_dbName = true && (isSetDbName()); list.add(present_dbName); if (present_dbName) @@ -452,6 +515,16 @@ import org.slf4j.LoggerFactory; int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetCatName()).compareTo(other.isSetCatName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catName, other.catName); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetDbName()).compareTo(other.isSetDbName()); if (lastComparison != 0) { return lastComparison; @@ -512,6 +585,14 @@ import org.slf4j.LoggerFactory; StringBuilder sb = new StringBuilder("CreationMetadata("); boolean first = true; + sb.append("catName:"); + if (this.catName == null) { + sb.append("null"); + } else { + sb.append(this.catName); + } + first = false; + if (!first) sb.append(", "); sb.append("dbName:"); if (this.dbName == null) { sb.append("null"); @@ -551,6 +632,10 @@ import org.slf4j.LoggerFactory; public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetCatName()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'catName' is unset! Struct:" + toString()); + } + if (!isSetDbName()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'dbName' is unset! Struct:" + toString()); } @@ -600,7 +685,15 @@ import org.slf4j.LoggerFactory; break; } switch (schemeField.id) { - case 1: // DB_NAME + case 1: // CAT_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catName = iprot.readString(); + struct.setCatNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // DB_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.dbName = iprot.readString(); struct.setDbNameIsSet(true); @@ -608,7 +701,7 @@ import org.slf4j.LoggerFactory; org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // TBL_NAME + case 3: // TBL_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.tblName = iprot.readString(); struct.setTblNameIsSet(true); @@ -616,16 +709,16 @@ import org.slf4j.LoggerFactory; org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 3: // TABLES_USED + case 4: // TABLES_USED if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { - org.apache.thrift.protocol.TSet _set676 = iprot.readSetBegin(); - struct.tablesUsed = new HashSet<String>(2*_set676.size); - String _elem677; - for (int _i678 = 0; _i678 < _set676.size; ++_i678) + org.apache.thrift.protocol.TSet _set684 = iprot.readSetBegin(); + struct.tablesUsed = new HashSet<String>(2*_set684.size); + String _elem685; + for (int _i686 = 0; _i686 < _set684.size; ++_i686) { - _elem677 = iprot.readString(); - struct.tablesUsed.add(_elem677); + _elem685 = iprot.readString(); + struct.tablesUsed.add(_elem685); } iprot.readSetEnd(); } @@ -634,7 +727,7 @@ import org.slf4j.LoggerFactory; org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 4: // VALID_TXN_LIST + case 5: // VALID_TXN_LIST if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.validTxnList = iprot.readString(); struct.setValidTxnListIsSet(true); @@ -655,6 +748,11 @@ import org.slf4j.LoggerFactory; struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.catName != null) { + oprot.writeFieldBegin(CAT_NAME_FIELD_DESC); + oprot.writeString(struct.catName); + oprot.writeFieldEnd(); + } if (struct.dbName != null) { oprot.writeFieldBegin(DB_NAME_FIELD_DESC); oprot.writeString(struct.dbName); @@ -669,9 +767,9 @@ import org.slf4j.LoggerFactory; oprot.writeFieldBegin(TABLES_USED_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, struct.tablesUsed.size())); - for (String _iter679 : struct.tablesUsed) + for (String _iter687 : struct.tablesUsed) { - oprot.writeString(_iter679); + oprot.writeString(_iter687); } oprot.writeSetEnd(); } @@ -701,13 +799,14 @@ import org.slf4j.LoggerFactory; @Override public void write(org.apache.thrift.protocol.TProtocol prot, CreationMetadata struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.catName); oprot.writeString(struct.dbName); oprot.writeString(struct.tblName); { oprot.writeI32(struct.tablesUsed.size()); - for (String _iter680 : struct.tablesUsed) + for (String _iter688 : struct.tablesUsed) { - oprot.writeString(_iter680); + oprot.writeString(_iter688); } } BitSet optionals = new BitSet(); @@ -723,18 +822,20 @@ import org.slf4j.LoggerFactory; @Override public void read(org.apache.thrift.protocol.TProtocol prot, CreationMetadata struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; + struct.catName = iprot.readString(); + struct.setCatNameIsSet(true); struct.dbName = iprot.readString(); struct.setDbNameIsSet(true); struct.tblName = iprot.readString(); struct.setTblNameIsSet(true); { - org.apache.thrift.protocol.TSet _set681 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tablesUsed = new HashSet<String>(2*_set681.size); - String _elem682; - for (int _i683 = 0; _i683 < _set681.size; ++_i683) + org.apache.thrift.protocol.TSet _set689 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.tablesUsed = new HashSet<String>(2*_set689.size); + String _elem690; + for (int _i691 = 0; _i691 < _set689.size; ++_i691) { - _elem682 = iprot.readString(); - struct.tablesUsed.add(_elem682); + _elem690 = iprot.readString(); + struct.tablesUsed.add(_elem690); } } struct.setTablesUsedIsSet(true); http://git-wip-us.apache.org/repos/asf/hive/blob/ba8a99e1/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java index 1a8c7b5..9cde9b8 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Database.java @@ -45,6 +45,7 @@ import org.slf4j.LoggerFactory; private static final org.apache.thrift.protocol.TField PRIVILEGES_FIELD_DESC = new org.apache.thrift.protocol.TField("privileges", org.apache.thrift.protocol.TType.STRUCT, (short)5); private static final org.apache.thrift.protocol.TField OWNER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerName", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField OWNER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("ownerType", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)8); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -59,6 +60,7 @@ import org.slf4j.LoggerFactory; private PrincipalPrivilegeSet privileges; // optional private String ownerName; // optional private PrincipalType ownerType; // optional + private String catalogName; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -72,7 +74,8 @@ import org.slf4j.LoggerFactory; * * @see PrincipalType */ - OWNER_TYPE((short)7, "ownerType"); + OWNER_TYPE((short)7, "ownerType"), + CATALOG_NAME((short)8, "catalogName"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -101,6 +104,8 @@ import org.slf4j.LoggerFactory; return OWNER_NAME; case 7: // OWNER_TYPE return OWNER_TYPE; + case 8: // CATALOG_NAME + return CATALOG_NAME; default: return null; } @@ -141,7 +146,7 @@ import org.slf4j.LoggerFactory; } // isset id assignments - private static final _Fields optionals[] = {_Fields.PRIVILEGES,_Fields.OWNER_NAME,_Fields.OWNER_TYPE}; + private static final _Fields optionals[] = {_Fields.PRIVILEGES,_Fields.OWNER_NAME,_Fields.OWNER_TYPE,_Fields.CATALOG_NAME}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -161,6 +166,8 @@ import org.slf4j.LoggerFactory; new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.OWNER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("ownerType", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, PrincipalType.class))); + tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Database.class, metaDataMap); } @@ -207,6 +214,9 @@ import org.slf4j.LoggerFactory; if (other.isSetOwnerType()) { this.ownerType = other.ownerType; } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } } public Database deepCopy() { @@ -222,6 +232,7 @@ import org.slf4j.LoggerFactory; this.privileges = null; this.ownerName = null; this.ownerType = null; + this.catalogName = null; } public String getName() { @@ -404,6 +415,29 @@ import org.slf4j.LoggerFactory; } } + public String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case NAME: @@ -462,6 +496,14 @@ import org.slf4j.LoggerFactory; } break; + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((String)value); + } + break; + } } @@ -488,6 +530,9 @@ import org.slf4j.LoggerFactory; case OWNER_TYPE: return getOwnerType(); + case CATALOG_NAME: + return getCatalogName(); + } throw new IllegalStateException(); } @@ -513,6 +558,8 @@ import org.slf4j.LoggerFactory; return isSetOwnerName(); case OWNER_TYPE: return isSetOwnerType(); + case CATALOG_NAME: + return isSetCatalogName(); } throw new IllegalStateException(); } @@ -593,6 +640,15 @@ import org.slf4j.LoggerFactory; return false; } + boolean this_present_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + return true; } @@ -635,6 +691,11 @@ import org.slf4j.LoggerFactory; if (present_ownerType) list.add(ownerType.getValue()); + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); + return list.hashCode(); } @@ -716,6 +777,16 @@ import org.slf4j.LoggerFactory; return lastComparison; } } + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -797,6 +868,16 @@ import org.slf4j.LoggerFactory; } first = false; } + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -870,15 +951,15 @@ import org.slf4j.LoggerFactory; case 4: // PARAMETERS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map94 = iprot.readMapBegin(); - struct.parameters = new HashMap<String,String>(2*_map94.size); - String _key95; - String _val96; - for (int _i97 = 0; _i97 < _map94.size; ++_i97) + org.apache.thrift.protocol.TMap _map102 = iprot.readMapBegin(); + struct.parameters = new HashMap<String,String>(2*_map102.size); + String _key103; + String _val104; + for (int _i105 = 0; _i105 < _map102.size; ++_i105) { - _key95 = iprot.readString(); - _val96 = iprot.readString(); - struct.parameters.put(_key95, _val96); + _key103 = iprot.readString(); + _val104 = iprot.readString(); + struct.parameters.put(_key103, _val104); } iprot.readMapEnd(); } @@ -912,6 +993,14 @@ import org.slf4j.LoggerFactory; org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 8: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -944,10 +1033,10 @@ import org.slf4j.LoggerFactory; oprot.writeFieldBegin(PARAMETERS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.parameters.size())); - for (Map.Entry<String, String> _iter98 : struct.parameters.entrySet()) + for (Map.Entry<String, String> _iter106 : struct.parameters.entrySet()) { - oprot.writeString(_iter98.getKey()); - oprot.writeString(_iter98.getValue()); + oprot.writeString(_iter106.getKey()); + oprot.writeString(_iter106.getValue()); } oprot.writeMapEnd(); } @@ -974,6 +1063,13 @@ import org.slf4j.LoggerFactory; oprot.writeFieldEnd(); } } + if (struct.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1013,7 +1109,10 @@ import org.slf4j.LoggerFactory; if (struct.isSetOwnerType()) { optionals.set(6); } - oprot.writeBitSet(optionals, 7); + if (struct.isSetCatalogName()) { + optionals.set(7); + } + oprot.writeBitSet(optionals, 8); if (struct.isSetName()) { oprot.writeString(struct.name); } @@ -1026,10 +1125,10 @@ import org.slf4j.LoggerFactory; if (struct.isSetParameters()) { { oprot.writeI32(struct.parameters.size()); - for (Map.Entry<String, String> _iter99 : struct.parameters.entrySet()) + for (Map.Entry<String, String> _iter107 : struct.parameters.entrySet()) { - oprot.writeString(_iter99.getKey()); - oprot.writeString(_iter99.getValue()); + oprot.writeString(_iter107.getKey()); + oprot.writeString(_iter107.getValue()); } } } @@ -1042,12 +1141,15 @@ import org.slf4j.LoggerFactory; if (struct.isSetOwnerType()) { oprot.writeI32(struct.ownerType.getValue()); } + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, Database struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(7); + BitSet incoming = iprot.readBitSet(8); if (incoming.get(0)) { struct.name = iprot.readString(); struct.setNameIsSet(true); @@ -1062,15 +1164,15 @@ import org.slf4j.LoggerFactory; } if (incoming.get(3)) { { - org.apache.thrift.protocol.TMap _map100 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.parameters = new HashMap<String,String>(2*_map100.size); - String _key101; - String _val102; - for (int _i103 = 0; _i103 < _map100.size; ++_i103) + org.apache.thrift.protocol.TMap _map108 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.parameters = new HashMap<String,String>(2*_map108.size); + String _key109; + String _val110; + for (int _i111 = 0; _i111 < _map108.size; ++_i111) { - _key101 = iprot.readString(); - _val102 = iprot.readString(); - struct.parameters.put(_key101, _val102); + _key109 = iprot.readString(); + _val110 = iprot.readString(); + struct.parameters.put(_key109, _val110); } } struct.setParametersIsSet(true); @@ -1088,6 +1190,10 @@ import org.slf4j.LoggerFactory; struct.ownerType = org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32()); struct.setOwnerTypeIsSet(true); } + if (incoming.get(7)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } } } http://git-wip-us.apache.org/repos/asf/hive/blob/ba8a99e1/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsRequest.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsRequest.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsRequest.java index 5f4954d..69378c9 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsRequest.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsRequest.java @@ -38,8 +38,9 @@ import org.slf4j.LoggerFactory; @org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class DefaultConstraintsRequest implements org.apache.thrift.TBase<DefaultConstraintsRequest, DefaultConstraintsRequest._Fields>, java.io.Serializable, Cloneable, Comparable<DefaultConstraintsRequest> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DefaultConstraintsRequest"); - private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl_name", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField CAT_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField DB_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("db_name", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField TBL_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tbl_name", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -47,13 +48,15 @@ import org.slf4j.LoggerFactory; schemes.put(TupleScheme.class, new DefaultConstraintsRequestTupleSchemeFactory()); } + private String catName; // required private String db_name; // required private String tbl_name; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - DB_NAME((short)1, "db_name"), - TBL_NAME((short)2, "tbl_name"); + CAT_NAME((short)1, "catName"), + DB_NAME((short)2, "db_name"), + TBL_NAME((short)3, "tbl_name"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -68,9 +71,11 @@ import org.slf4j.LoggerFactory; */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // DB_NAME + case 1: // CAT_NAME + return CAT_NAME; + case 2: // DB_NAME return DB_NAME; - case 2: // TBL_NAME + case 3: // TBL_NAME return TBL_NAME; default: return null; @@ -115,6 +120,8 @@ import org.slf4j.LoggerFactory; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.CAT_NAME, new org.apache.thrift.meta_data.FieldMetaData("catName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.DB_NAME, new org.apache.thrift.meta_data.FieldMetaData("db_name", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TBL_NAME, new org.apache.thrift.meta_data.FieldMetaData("tbl_name", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -127,10 +134,12 @@ import org.slf4j.LoggerFactory; } public DefaultConstraintsRequest( + String catName, String db_name, String tbl_name) { this(); + this.catName = catName; this.db_name = db_name; this.tbl_name = tbl_name; } @@ -139,6 +148,9 @@ import org.slf4j.LoggerFactory; * Performs a deep copy on <i>other</i>. */ public DefaultConstraintsRequest(DefaultConstraintsRequest other) { + if (other.isSetCatName()) { + this.catName = other.catName; + } if (other.isSetDb_name()) { this.db_name = other.db_name; } @@ -153,10 +165,34 @@ import org.slf4j.LoggerFactory; @Override public void clear() { + this.catName = null; this.db_name = null; this.tbl_name = null; } + public String getCatName() { + return this.catName; + } + + public void setCatName(String catName) { + this.catName = catName; + } + + public void unsetCatName() { + this.catName = null; + } + + /** Returns true if field catName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatName() { + return this.catName != null; + } + + public void setCatNameIsSet(boolean value) { + if (!value) { + this.catName = null; + } + } + public String getDb_name() { return this.db_name; } @@ -205,6 +241,14 @@ import org.slf4j.LoggerFactory; public void setFieldValue(_Fields field, Object value) { switch (field) { + case CAT_NAME: + if (value == null) { + unsetCatName(); + } else { + setCatName((String)value); + } + break; + case DB_NAME: if (value == null) { unsetDb_name(); @@ -226,6 +270,9 @@ import org.slf4j.LoggerFactory; public Object getFieldValue(_Fields field) { switch (field) { + case CAT_NAME: + return getCatName(); + case DB_NAME: return getDb_name(); @@ -243,6 +290,8 @@ import org.slf4j.LoggerFactory; } switch (field) { + case CAT_NAME: + return isSetCatName(); case DB_NAME: return isSetDb_name(); case TBL_NAME: @@ -264,6 +313,15 @@ import org.slf4j.LoggerFactory; if (that == null) return false; + boolean this_present_catName = true && this.isSetCatName(); + boolean that_present_catName = true && that.isSetCatName(); + if (this_present_catName || that_present_catName) { + if (!(this_present_catName && that_present_catName)) + return false; + if (!this.catName.equals(that.catName)) + return false; + } + boolean this_present_db_name = true && this.isSetDb_name(); boolean that_present_db_name = true && that.isSetDb_name(); if (this_present_db_name || that_present_db_name) { @@ -289,6 +347,11 @@ import org.slf4j.LoggerFactory; public int hashCode() { List<Object> list = new ArrayList<Object>(); + boolean present_catName = true && (isSetCatName()); + list.add(present_catName); + if (present_catName) + list.add(catName); + boolean present_db_name = true && (isSetDb_name()); list.add(present_db_name); if (present_db_name) @@ -310,6 +373,16 @@ import org.slf4j.LoggerFactory; int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetCatName()).compareTo(other.isSetCatName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catName, other.catName); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = Boolean.valueOf(isSetDb_name()).compareTo(other.isSetDb_name()); if (lastComparison != 0) { return lastComparison; @@ -350,6 +423,14 @@ import org.slf4j.LoggerFactory; StringBuilder sb = new StringBuilder("DefaultConstraintsRequest("); boolean first = true; + sb.append("catName:"); + if (this.catName == null) { + sb.append("null"); + } else { + sb.append(this.catName); + } + first = false; + if (!first) sb.append(", "); sb.append("db_name:"); if (this.db_name == null) { sb.append("null"); @@ -371,6 +452,10 @@ import org.slf4j.LoggerFactory; public void validate() throws org.apache.thrift.TException { // check for required fields + if (!isSetCatName()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'catName' is unset! Struct:" + toString()); + } + if (!isSetDb_name()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'db_name' is unset! Struct:" + toString()); } @@ -416,7 +501,15 @@ import org.slf4j.LoggerFactory; break; } switch (schemeField.id) { - case 1: // DB_NAME + case 1: // CAT_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catName = iprot.readString(); + struct.setCatNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // DB_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.db_name = iprot.readString(); struct.setDb_nameIsSet(true); @@ -424,7 +517,7 @@ import org.slf4j.LoggerFactory; org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 2: // TBL_NAME + case 3: // TBL_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.tbl_name = iprot.readString(); struct.setTbl_nameIsSet(true); @@ -445,6 +538,11 @@ import org.slf4j.LoggerFactory; struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.catName != null) { + oprot.writeFieldBegin(CAT_NAME_FIELD_DESC); + oprot.writeString(struct.catName); + oprot.writeFieldEnd(); + } if (struct.db_name != null) { oprot.writeFieldBegin(DB_NAME_FIELD_DESC); oprot.writeString(struct.db_name); @@ -472,6 +570,7 @@ import org.slf4j.LoggerFactory; @Override public void write(org.apache.thrift.protocol.TProtocol prot, DefaultConstraintsRequest struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.catName); oprot.writeString(struct.db_name); oprot.writeString(struct.tbl_name); } @@ -479,6 +578,8 @@ import org.slf4j.LoggerFactory; @Override public void read(org.apache.thrift.protocol.TProtocol prot, DefaultConstraintsRequest struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; + struct.catName = iprot.readString(); + struct.setCatNameIsSet(true); struct.db_name = iprot.readString(); struct.setDb_nameIsSet(true); struct.tbl_name = iprot.readString(); http://git-wip-us.apache.org/repos/asf/hive/blob/ba8a99e1/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsResponse.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsResponse.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsResponse.java index f7ee187..47b8d1c 100644 --- a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsResponse.java +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DefaultConstraintsResponse.java @@ -354,14 +354,14 @@ import org.slf4j.LoggerFactory; case 1: // DEFAULT_CONSTRAINTS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list344 = iprot.readListBegin(); - struct.defaultConstraints = new ArrayList<SQLDefaultConstraint>(_list344.size); - SQLDefaultConstraint _elem345; - for (int _i346 = 0; _i346 < _list344.size; ++_i346) + org.apache.thrift.protocol.TList _list352 = iprot.readListBegin(); + struct.defaultConstraints = new ArrayList<SQLDefaultConstraint>(_list352.size); + SQLDefaultConstraint _elem353; + for (int _i354 = 0; _i354 < _list352.size; ++_i354) { - _elem345 = new SQLDefaultConstraint(); - _elem345.read(iprot); - struct.defaultConstraints.add(_elem345); + _elem353 = new SQLDefaultConstraint(); + _elem353.read(iprot); + struct.defaultConstraints.add(_elem353); } iprot.readListEnd(); } @@ -387,9 +387,9 @@ import org.slf4j.LoggerFactory; oprot.writeFieldBegin(DEFAULT_CONSTRAINTS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.defaultConstraints.size())); - for (SQLDefaultConstraint _iter347 : struct.defaultConstraints) + for (SQLDefaultConstraint _iter355 : struct.defaultConstraints) { - _iter347.write(oprot); + _iter355.write(oprot); } oprot.writeListEnd(); } @@ -414,9 +414,9 @@ import org.slf4j.LoggerFactory; TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.defaultConstraints.size()); - for (SQLDefaultConstraint _iter348 : struct.defaultConstraints) + for (SQLDefaultConstraint _iter356 : struct.defaultConstraints) { - _iter348.write(oprot); + _iter356.write(oprot); } } } @@ -425,14 +425,14 @@ import org.slf4j.LoggerFactory; public void read(org.apache.thrift.protocol.TProtocol prot, DefaultConstraintsResponse struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; { - org.apache.thrift.protocol.TList _list349 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.defaultConstraints = new ArrayList<SQLDefaultConstraint>(_list349.size); - SQLDefaultConstraint _elem350; - for (int _i351 = 0; _i351 < _list349.size; ++_i351) + org.apache.thrift.protocol.TList _list357 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.defaultConstraints = new ArrayList<SQLDefaultConstraint>(_list357.size); + SQLDefaultConstraint _elem358; + for (int _i359 = 0; _i359 < _list357.size; ++_i359) { - _elem350 = new SQLDefaultConstraint(); - _elem350.read(iprot); - struct.defaultConstraints.add(_elem350); + _elem358 = new SQLDefaultConstraint(); + _elem358.read(iprot); + struct.defaultConstraints.add(_elem358); } } struct.setDefaultConstraintsIsSet(true); http://git-wip-us.apache.org/repos/asf/hive/blob/ba8a99e1/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DropCatalogRequest.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DropCatalogRequest.java b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DropCatalogRequest.java new file mode 100644 index 0000000..a11fe47 --- /dev/null +++ b/standalone-metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/DropCatalogRequest.java @@ -0,0 +1,395 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.metastore.api; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") [email protected] @org.apache.hadoop.classification.InterfaceStability.Stable public class DropCatalogRequest implements org.apache.thrift.TBase<DropCatalogRequest, DropCatalogRequest._Fields>, java.io.Serializable, Cloneable, Comparable<DropCatalogRequest> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DropCatalogRequest"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new DropCatalogRequestStandardSchemeFactory()); + schemes.put(TupleScheme.class, new DropCatalogRequestTupleSchemeFactory()); + } + + private String name; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + NAME((short)1, "name"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + 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: // NAME + return NAME; + 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, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DropCatalogRequest.class, metaDataMap); + } + + public DropCatalogRequest() { + } + + public DropCatalogRequest( + String name) + { + this(); + this.name = name; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public DropCatalogRequest(DropCatalogRequest other) { + if (other.isSetName()) { + this.name = other.name; + } + } + + public DropCatalogRequest deepCopy() { + return new DropCatalogRequest(this); + } + + @Override + public void clear() { + this.name = null; + } + + public String getName() { + return this.name; + } + + public void setName(String name) { + this.name = name; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case NAME: + return isSetName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof DropCatalogRequest) + return this.equals((DropCatalogRequest)that); + return false; + } + + public boolean equals(DropCatalogRequest that) { + if (that == null) + return false; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_name = true && (isSetName()); + list.add(present_name); + if (present_name) + list.add(name); + + return list.hashCode(); + } + + @Override + public int compareTo(DropCatalogRequest other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DropCatalogRequest("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class DropCatalogRequestStandardSchemeFactory implements SchemeFactory { + public DropCatalogRequestStandardScheme getScheme() { + return new DropCatalogRequestStandardScheme(); + } + } + + private static class DropCatalogRequestStandardScheme extends StandardScheme<DropCatalogRequest> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, DropCatalogRequest struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, DropCatalogRequest struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class DropCatalogRequestTupleSchemeFactory implements SchemeFactory { + public DropCatalogRequestTupleScheme getScheme() { + return new DropCatalogRequestTupleScheme(); + } + } + + private static class DropCatalogRequestTupleScheme extends TupleScheme<DropCatalogRequest> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, DropCatalogRequest struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetName()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, DropCatalogRequest struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + } + } + +} +
