Modified: hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp?rev=1570760&r1=1570759&r2=1570760&view=diff ============================================================================== --- hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp (original) +++ hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.cpp Sat Feb 22 00:20:49 2014 @@ -54,6 +54,18 @@ const char* _kFunctionTypeNames[] = { }; const std::map<int, const char*> _FunctionType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(1, _kFunctionTypeValues, _kFunctionTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); +int _kResourceTypeValues[] = { + ResourceType::JAR, + ResourceType::FILE, + ResourceType::ARCHIVE +}; +const char* _kResourceTypeNames[] = { + "JAR", + "FILE", + "ARCHIVE" +}; +const std::map<int, const char*> _ResourceType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kResourceTypeValues, _kResourceTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + const char* Version::ascii_fingerprint = "07A9615F837F7D0A952B595DD3020972"; const uint8_t Version::binary_fingerprint[16] = {0x07,0xA9,0x61,0x5F,0x83,0x7F,0x7D,0x0A,0x95,0x2B,0x59,0x5D,0xD3,0x02,0x09,0x72}; @@ -5186,8 +5198,85 @@ void swap(DropPartitionsRequest &a, Drop swap(a.__isset, b.__isset); } -const char* Function::ascii_fingerprint = "86DDA615E907A95BA1CF7EDB4925A7F5"; -const uint8_t Function::binary_fingerprint[16] = {0x86,0xDD,0xA6,0x15,0xE9,0x07,0xA9,0x5B,0xA1,0xCF,0x7E,0xDB,0x49,0x25,0xA7,0xF5}; +const char* ResourceUri::ascii_fingerprint = "19B5240589E680301A7E32DF3971EFBE"; +const uint8_t ResourceUri::binary_fingerprint[16] = {0x19,0xB5,0x24,0x05,0x89,0xE6,0x80,0x30,0x1A,0x7E,0x32,0xDF,0x39,0x71,0xEF,0xBE}; + +uint32_t ResourceUri::read(::apache::thrift::protocol::TProtocol* iprot) { + + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast276; + xfer += iprot->readI32(ecast276); + this->resourceType = (ResourceType::type)ecast276; + this->__isset.resourceType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->uri); + this->__isset.uri = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t ResourceUri::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + xfer += oprot->writeStructBegin("ResourceUri"); + + xfer += oprot->writeFieldBegin("resourceType", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((int32_t)this->resourceType); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("uri", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->uri); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(ResourceUri &a, ResourceUri &b) { + using ::std::swap; + swap(a.resourceType, b.resourceType); + swap(a.uri, b.uri); + swap(a.__isset, b.__isset); +} + +const char* Function::ascii_fingerprint = "72279C515E70F888568542F97616ADB8"; +const uint8_t Function::binary_fingerprint[16] = {0x72,0x27,0x9C,0x51,0x5E,0x70,0xF8,0x88,0x56,0x85,0x42,0xF9,0x76,0x16,0xAD,0xB8}; uint32_t Function::read(::apache::thrift::protocol::TProtocol* iprot) { @@ -5243,9 +5332,9 @@ uint32_t Function::read(::apache::thrift break; case 5: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast276; - xfer += iprot->readI32(ecast276); - this->ownerType = (PrincipalType::type)ecast276; + int32_t ecast277; + xfer += iprot->readI32(ecast277); + this->ownerType = (PrincipalType::type)ecast277; this->__isset.ownerType = true; } else { xfer += iprot->skip(ftype); @@ -5261,14 +5350,34 @@ uint32_t Function::read(::apache::thrift break; case 7: if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast277; - xfer += iprot->readI32(ecast277); - this->functionType = (FunctionType::type)ecast277; + int32_t ecast278; + xfer += iprot->readI32(ecast278); + this->functionType = (FunctionType::type)ecast278; this->__isset.functionType = true; } else { xfer += iprot->skip(ftype); } break; + case 8: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->resourceUris.clear(); + uint32_t _size279; + ::apache::thrift::protocol::TType _etype282; + xfer += iprot->readListBegin(_etype282, _size279); + this->resourceUris.resize(_size279); + uint32_t _i283; + for (_i283 = 0; _i283 < _size279; ++_i283) + { + xfer += this->resourceUris[_i283].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.resourceUris = true; + } else { + xfer += iprot->skip(ftype); + } + break; default: xfer += iprot->skip(ftype); break; @@ -5313,6 +5422,18 @@ uint32_t Function::write(::apache::thrif xfer += oprot->writeI32((int32_t)this->functionType); xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldBegin("resourceUris", ::apache::thrift::protocol::T_LIST, 8); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->resourceUris.size())); + std::vector<ResourceUri> ::const_iterator _iter284; + for (_iter284 = this->resourceUris.begin(); _iter284 != this->resourceUris.end(); ++_iter284) + { + xfer += (*_iter284).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + xfer += oprot->writeFieldStop(); xfer += oprot->writeStructEnd(); return xfer; @@ -5327,6 +5448,7 @@ void swap(Function &a, Function &b) { swap(a.ownerType, b.ownerType); swap(a.createTime, b.createTime); swap(a.functionType, b.functionType); + swap(a.resourceUris, b.resourceUris); swap(a.__isset, b.__isset); }
Modified: hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h?rev=1570760&r1=1570759&r2=1570760&view=diff ============================================================================== --- hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h (original) +++ hive/trunk/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h Sat Feb 22 00:20:49 2014 @@ -55,6 +55,16 @@ struct FunctionType { extern const std::map<int, const char*> _FunctionType_VALUES_TO_NAMES; +struct ResourceType { + enum type { + JAR = 1, + FILE = 2, + ARCHIVE = 3 + }; +}; + +extern const std::map<int, const char*> _ResourceType_VALUES_TO_NAMES; + typedef struct _Version__isset { _Version__isset() : version(false), comments(false) {} bool version; @@ -2743,8 +2753,59 @@ class DropPartitionsRequest { void swap(DropPartitionsRequest &a, DropPartitionsRequest &b); +typedef struct _ResourceUri__isset { + _ResourceUri__isset() : resourceType(false), uri(false) {} + bool resourceType; + bool uri; +} _ResourceUri__isset; + +class ResourceUri { + public: + + static const char* ascii_fingerprint; // = "19B5240589E680301A7E32DF3971EFBE"; + static const uint8_t binary_fingerprint[16]; // = {0x19,0xB5,0x24,0x05,0x89,0xE6,0x80,0x30,0x1A,0x7E,0x32,0xDF,0x39,0x71,0xEF,0xBE}; + + ResourceUri() : resourceType((ResourceType::type)0), uri() { + } + + virtual ~ResourceUri() throw() {} + + ResourceType::type resourceType; + std::string uri; + + _ResourceUri__isset __isset; + + void __set_resourceType(const ResourceType::type val) { + resourceType = val; + } + + void __set_uri(const std::string& val) { + uri = val; + } + + bool operator == (const ResourceUri & rhs) const + { + if (!(resourceType == rhs.resourceType)) + return false; + if (!(uri == rhs.uri)) + return false; + return true; + } + bool operator != (const ResourceUri &rhs) const { + return !(*this == rhs); + } + + bool operator < (const ResourceUri & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +void swap(ResourceUri &a, ResourceUri &b); + typedef struct _Function__isset { - _Function__isset() : functionName(false), dbName(false), className(false), ownerName(false), ownerType(false), createTime(false), functionType(false) {} + _Function__isset() : functionName(false), dbName(false), className(false), ownerName(false), ownerType(false), createTime(false), functionType(false), resourceUris(false) {} bool functionName; bool dbName; bool className; @@ -2752,13 +2813,14 @@ typedef struct _Function__isset { bool ownerType; bool createTime; bool functionType; + bool resourceUris; } _Function__isset; class Function { public: - static const char* ascii_fingerprint; // = "86DDA615E907A95BA1CF7EDB4925A7F5"; - static const uint8_t binary_fingerprint[16]; // = {0x86,0xDD,0xA6,0x15,0xE9,0x07,0xA9,0x5B,0xA1,0xCF,0x7E,0xDB,0x49,0x25,0xA7,0xF5}; + static const char* ascii_fingerprint; // = "72279C515E70F888568542F97616ADB8"; + static const uint8_t binary_fingerprint[16]; // = {0x72,0x27,0x9C,0x51,0x5E,0x70,0xF8,0x88,0x56,0x85,0x42,0xF9,0x76,0x16,0xAD,0xB8}; Function() : functionName(), dbName(), className(), ownerName(), ownerType((PrincipalType::type)0), createTime(0), functionType((FunctionType::type)0) { } @@ -2772,6 +2834,7 @@ class Function { PrincipalType::type ownerType; int32_t createTime; FunctionType::type functionType; + std::vector<ResourceUri> resourceUris; _Function__isset __isset; @@ -2803,6 +2866,10 @@ class Function { functionType = val; } + void __set_resourceUris(const std::vector<ResourceUri> & val) { + resourceUris = val; + } + bool operator == (const Function & rhs) const { if (!(functionName == rhs.functionName)) @@ -2819,6 +2886,8 @@ class Function { return false; if (!(functionType == rhs.functionType)) return false; + if (!(resourceUris == rhs.resourceUris)) + return false; return true; } bool operator != (const Function &rhs) const { Modified: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Function.java URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Function.java?rev=1570760&r1=1570759&r2=1570760&view=diff ============================================================================== --- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Function.java (original) +++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/Function.java Sat Feb 22 00:20:49 2014 @@ -41,6 +41,7 @@ public class Function implements org.apa 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)5); private static final org.apache.thrift.protocol.TField CREATE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("createTime", org.apache.thrift.protocol.TType.I32, (short)6); private static final org.apache.thrift.protocol.TField FUNCTION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("functionType", org.apache.thrift.protocol.TType.I32, (short)7); + private static final org.apache.thrift.protocol.TField RESOURCE_URIS_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceUris", org.apache.thrift.protocol.TType.LIST, (short)8); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -55,6 +56,7 @@ public class Function implements org.apa private PrincipalType ownerType; // required private int createTime; // required private FunctionType functionType; // required + private List<ResourceUri> resourceUris; // 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 { @@ -72,7 +74,8 @@ public class Function implements org.apa * * @see FunctionType */ - FUNCTION_TYPE((short)7, "functionType"); + FUNCTION_TYPE((short)7, "functionType"), + RESOURCE_URIS((short)8, "resourceUris"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -101,6 +104,8 @@ public class Function implements org.apa return CREATE_TIME; case 7: // FUNCTION_TYPE return FUNCTION_TYPE; + case 8: // RESOURCE_URIS + return RESOURCE_URIS; default: return null; } @@ -160,6 +165,9 @@ public class Function implements org.apa new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.FUNCTION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("functionType", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, FunctionType.class))); + tmpMap.put(_Fields.RESOURCE_URIS, new org.apache.thrift.meta_data.FieldMetaData("resourceUris", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ResourceUri.class)))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Function.class, metaDataMap); } @@ -174,7 +182,8 @@ public class Function implements org.apa String ownerName, PrincipalType ownerType, int createTime, - FunctionType functionType) + FunctionType functionType, + List<ResourceUri> resourceUris) { this(); this.functionName = functionName; @@ -185,6 +194,7 @@ public class Function implements org.apa this.createTime = createTime; setCreateTimeIsSet(true); this.functionType = functionType; + this.resourceUris = resourceUris; } /** @@ -211,6 +221,13 @@ public class Function implements org.apa if (other.isSetFunctionType()) { this.functionType = other.functionType; } + if (other.isSetResourceUris()) { + List<ResourceUri> __this__resourceUris = new ArrayList<ResourceUri>(); + for (ResourceUri other_element : other.resourceUris) { + __this__resourceUris.add(new ResourceUri(other_element)); + } + this.resourceUris = __this__resourceUris; + } } public Function deepCopy() { @@ -227,6 +244,7 @@ public class Function implements org.apa setCreateTimeIsSet(false); this.createTime = 0; this.functionType = null; + this.resourceUris = null; } public String getFunctionName() { @@ -405,6 +423,44 @@ public class Function implements org.apa } } + public int getResourceUrisSize() { + return (this.resourceUris == null) ? 0 : this.resourceUris.size(); + } + + public java.util.Iterator<ResourceUri> getResourceUrisIterator() { + return (this.resourceUris == null) ? null : this.resourceUris.iterator(); + } + + public void addToResourceUris(ResourceUri elem) { + if (this.resourceUris == null) { + this.resourceUris = new ArrayList<ResourceUri>(); + } + this.resourceUris.add(elem); + } + + public List<ResourceUri> getResourceUris() { + return this.resourceUris; + } + + public void setResourceUris(List<ResourceUri> resourceUris) { + this.resourceUris = resourceUris; + } + + public void unsetResourceUris() { + this.resourceUris = null; + } + + /** Returns true if field resourceUris is set (has been assigned a value) and false otherwise */ + public boolean isSetResourceUris() { + return this.resourceUris != null; + } + + public void setResourceUrisIsSet(boolean value) { + if (!value) { + this.resourceUris = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case FUNCTION_NAME: @@ -463,6 +519,14 @@ public class Function implements org.apa } break; + case RESOURCE_URIS: + if (value == null) { + unsetResourceUris(); + } else { + setResourceUris((List<ResourceUri>)value); + } + break; + } } @@ -489,6 +553,9 @@ public class Function implements org.apa case FUNCTION_TYPE: return getFunctionType(); + case RESOURCE_URIS: + return getResourceUris(); + } throw new IllegalStateException(); } @@ -514,6 +581,8 @@ public class Function implements org.apa return isSetCreateTime(); case FUNCTION_TYPE: return isSetFunctionType(); + case RESOURCE_URIS: + return isSetResourceUris(); } throw new IllegalStateException(); } @@ -594,6 +663,15 @@ public class Function implements org.apa return false; } + boolean this_present_resourceUris = true && this.isSetResourceUris(); + boolean that_present_resourceUris = true && that.isSetResourceUris(); + if (this_present_resourceUris || that_present_resourceUris) { + if (!(this_present_resourceUris && that_present_resourceUris)) + return false; + if (!this.resourceUris.equals(that.resourceUris)) + return false; + } + return true; } @@ -636,6 +714,11 @@ public class Function implements org.apa if (present_functionType) builder.append(functionType.getValue()); + boolean present_resourceUris = true && (isSetResourceUris()); + builder.append(present_resourceUris); + if (present_resourceUris) + builder.append(resourceUris); + return builder.toHashCode(); } @@ -717,6 +800,16 @@ public class Function implements org.apa return lastComparison; } } + lastComparison = Boolean.valueOf(isSetResourceUris()).compareTo(typedOther.isSetResourceUris()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetResourceUris()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceUris, typedOther.resourceUris); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -788,6 +881,14 @@ public class Function implements org.apa sb.append(this.functionType); } first = false; + if (!first) sb.append(", "); + sb.append("resourceUris:"); + if (this.resourceUris == null) { + sb.append("null"); + } else { + sb.append(this.resourceUris); + } + first = false; sb.append(")"); return sb.toString(); } @@ -889,6 +990,25 @@ public class Function implements org.apa org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 8: // RESOURCE_URIS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list354 = iprot.readListBegin(); + struct.resourceUris = new ArrayList<ResourceUri>(_list354.size); + for (int _i355 = 0; _i355 < _list354.size; ++_i355) + { + ResourceUri _elem356; // optional + _elem356 = new ResourceUri(); + _elem356.read(iprot); + struct.resourceUris.add(_elem356); + } + iprot.readListEnd(); + } + struct.setResourceUrisIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -935,6 +1055,18 @@ public class Function implements org.apa oprot.writeI32(struct.functionType.getValue()); oprot.writeFieldEnd(); } + if (struct.resourceUris != null) { + oprot.writeFieldBegin(RESOURCE_URIS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.resourceUris.size())); + for (ResourceUri _iter357 : struct.resourceUris) + { + _iter357.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -974,7 +1106,10 @@ public class Function implements org.apa if (struct.isSetFunctionType()) { optionals.set(6); } - oprot.writeBitSet(optionals, 7); + if (struct.isSetResourceUris()) { + optionals.set(7); + } + oprot.writeBitSet(optionals, 8); if (struct.isSetFunctionName()) { oprot.writeString(struct.functionName); } @@ -996,12 +1131,21 @@ public class Function implements org.apa if (struct.isSetFunctionType()) { oprot.writeI32(struct.functionType.getValue()); } + if (struct.isSetResourceUris()) { + { + oprot.writeI32(struct.resourceUris.size()); + for (ResourceUri _iter358 : struct.resourceUris) + { + _iter358.write(oprot); + } + } + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, Function 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.functionName = iprot.readString(); struct.setFunctionNameIsSet(true); @@ -1030,6 +1174,20 @@ public class Function implements org.apa struct.functionType = FunctionType.findByValue(iprot.readI32()); struct.setFunctionTypeIsSet(true); } + if (incoming.get(7)) { + { + org.apache.thrift.protocol.TList _list359 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.resourceUris = new ArrayList<ResourceUri>(_list359.size); + for (int _i360 = 0; _i360 < _list359.size; ++_i360) + { + ResourceUri _elem361; // optional + _elem361 = new ResourceUri(); + _elem361.read(iprot); + struct.resourceUris.add(_elem361); + } + } + struct.setResourceUrisIsSet(true); + } } } Added: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ResourceType.java URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ResourceType.java?rev=1570760&view=auto ============================================================================== --- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ResourceType.java (added) +++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ResourceType.java Sat Feb 22 00:20:49 2014 @@ -0,0 +1,48 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.hadoop.hive.metastore.api; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum ResourceType implements org.apache.thrift.TEnum { + JAR(1), + FILE(2), + ARCHIVE(3); + + private final int value; + + private ResourceType(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 ResourceType findByValue(int value) { + switch (value) { + case 1: + return JAR; + case 2: + return FILE; + case 3: + return ARCHIVE; + default: + return null; + } + } +} Added: hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ResourceUri.java URL: http://svn.apache.org/viewvc/hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ResourceUri.java?rev=1570760&view=auto ============================================================================== --- hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ResourceUri.java (added) +++ hive/trunk/metastore/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/ResourceUri.java Sat Feb 22 00:20:49 2014 @@ -0,0 +1,507 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * 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.commons.lang.builder.HashCodeBuilder; +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 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; + +public class ResourceUri implements org.apache.thrift.TBase<ResourceUri, ResourceUri._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ResourceUri"); + + private static final org.apache.thrift.protocol.TField RESOURCE_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("resourceType", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField URI_FIELD_DESC = new org.apache.thrift.protocol.TField("uri", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ResourceUriStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ResourceUriTupleSchemeFactory()); + } + + private ResourceType resourceType; // required + private String uri; // 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 { + /** + * + * @see ResourceType + */ + RESOURCE_TYPE((short)1, "resourceType"), + URI((short)2, "uri"); + + 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: // RESOURCE_TYPE + return RESOURCE_TYPE; + case 2: // URI + return URI; + 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.RESOURCE_TYPE, new org.apache.thrift.meta_data.FieldMetaData("resourceType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, ResourceType.class))); + tmpMap.put(_Fields.URI, new org.apache.thrift.meta_data.FieldMetaData("uri", 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(ResourceUri.class, metaDataMap); + } + + public ResourceUri() { + } + + public ResourceUri( + ResourceType resourceType, + String uri) + { + this(); + this.resourceType = resourceType; + this.uri = uri; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public ResourceUri(ResourceUri other) { + if (other.isSetResourceType()) { + this.resourceType = other.resourceType; + } + if (other.isSetUri()) { + this.uri = other.uri; + } + } + + public ResourceUri deepCopy() { + return new ResourceUri(this); + } + + @Override + public void clear() { + this.resourceType = null; + this.uri = null; + } + + /** + * + * @see ResourceType + */ + public ResourceType getResourceType() { + return this.resourceType; + } + + /** + * + * @see ResourceType + */ + public void setResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + } + + public void unsetResourceType() { + this.resourceType = null; + } + + /** Returns true if field resourceType is set (has been assigned a value) and false otherwise */ + public boolean isSetResourceType() { + return this.resourceType != null; + } + + public void setResourceTypeIsSet(boolean value) { + if (!value) { + this.resourceType = null; + } + } + + public String getUri() { + return this.uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + public void unsetUri() { + this.uri = null; + } + + /** Returns true if field uri is set (has been assigned a value) and false otherwise */ + public boolean isSetUri() { + return this.uri != null; + } + + public void setUriIsSet(boolean value) { + if (!value) { + this.uri = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case RESOURCE_TYPE: + if (value == null) { + unsetResourceType(); + } else { + setResourceType((ResourceType)value); + } + break; + + case URI: + if (value == null) { + unsetUri(); + } else { + setUri((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case RESOURCE_TYPE: + return getResourceType(); + + case URI: + return getUri(); + + } + 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 RESOURCE_TYPE: + return isSetResourceType(); + case URI: + return isSetUri(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ResourceUri) + return this.equals((ResourceUri)that); + return false; + } + + public boolean equals(ResourceUri that) { + if (that == null) + return false; + + boolean this_present_resourceType = true && this.isSetResourceType(); + boolean that_present_resourceType = true && that.isSetResourceType(); + if (this_present_resourceType || that_present_resourceType) { + if (!(this_present_resourceType && that_present_resourceType)) + return false; + if (!this.resourceType.equals(that.resourceType)) + return false; + } + + boolean this_present_uri = true && this.isSetUri(); + boolean that_present_uri = true && that.isSetUri(); + if (this_present_uri || that_present_uri) { + if (!(this_present_uri && that_present_uri)) + return false; + if (!this.uri.equals(that.uri)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_resourceType = true && (isSetResourceType()); + builder.append(present_resourceType); + if (present_resourceType) + builder.append(resourceType.getValue()); + + boolean present_uri = true && (isSetUri()); + builder.append(present_uri); + if (present_uri) + builder.append(uri); + + return builder.toHashCode(); + } + + public int compareTo(ResourceUri other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ResourceUri typedOther = (ResourceUri)other; + + lastComparison = Boolean.valueOf(isSetResourceType()).compareTo(typedOther.isSetResourceType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetResourceType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.resourceType, typedOther.resourceType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUri()).compareTo(typedOther.isSetUri()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUri()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uri, typedOther.uri); + 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("ResourceUri("); + boolean first = true; + + sb.append("resourceType:"); + if (this.resourceType == null) { + sb.append("null"); + } else { + sb.append(this.resourceType); + } + first = false; + if (!first) sb.append(", "); + sb.append("uri:"); + if (this.uri == null) { + sb.append("null"); + } else { + sb.append(this.uri); + } + 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 ResourceUriStandardSchemeFactory implements SchemeFactory { + public ResourceUriStandardScheme getScheme() { + return new ResourceUriStandardScheme(); + } + } + + private static class ResourceUriStandardScheme extends StandardScheme<ResourceUri> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ResourceUri 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: // RESOURCE_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.resourceType = ResourceType.findByValue(iprot.readI32()); + struct.setResourceTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // URI + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.uri = iprot.readString(); + struct.setUriIsSet(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, ResourceUri struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.resourceType != null) { + oprot.writeFieldBegin(RESOURCE_TYPE_FIELD_DESC); + oprot.writeI32(struct.resourceType.getValue()); + oprot.writeFieldEnd(); + } + if (struct.uri != null) { + oprot.writeFieldBegin(URI_FIELD_DESC); + oprot.writeString(struct.uri); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ResourceUriTupleSchemeFactory implements SchemeFactory { + public ResourceUriTupleScheme getScheme() { + return new ResourceUriTupleScheme(); + } + } + + private static class ResourceUriTupleScheme extends TupleScheme<ResourceUri> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ResourceUri struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetResourceType()) { + optionals.set(0); + } + if (struct.isSetUri()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetResourceType()) { + oprot.writeI32(struct.resourceType.getValue()); + } + if (struct.isSetUri()) { + oprot.writeString(struct.uri); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ResourceUri struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.resourceType = ResourceType.findByValue(iprot.readI32()); + struct.setResourceTypeIsSet(true); + } + if (incoming.get(1)) { + struct.uri = iprot.readString(); + struct.setUriIsSet(true); + } + } + } + +} +
